diff --git a/__tests__/src/lib/AnnotationResource.test.js b/__tests__/src/lib/AnnotationResource.test.js index 9fd5cb941e728a65d19e6ffa5d8a79d71da3de7f..b0710eb5f8ca7ddb7d0d4c5911b7bd1c4c1eb8d5 100644 --- a/__tests__/src/lib/AnnotationResource.test.js +++ b/__tests__/src/lib/AnnotationResource.test.js @@ -26,14 +26,14 @@ describe('AnnotationResource', () => { describe('tags', () => { it('when only motivation', () => { expect( - new AnnotationResource({ resource: [{ '@type': 'oa:Tag', value: 'yo' }, { '@type': 'oa:Tag', value: 'lo' }] }).tags, + new AnnotationResource({ resource: [{ '@type': 'oa:Tag', chars: 'yo' }, { '@type': 'oa:Tag', chars: 'lo' }] }).tags, ).toEqual(['yo', 'lo']); }); it('when multiple motivations', () => { expect( new AnnotationResource({ motivation: ['oa:commenting', 'oa:tagging'], - resource: [{ '@type': 'oa:commenting', value: 'yo' }, { '@type': 'oa:Tag', value: 'lo' }], + resource: [{ '@type': 'oa:commenting', chars: 'yo' }, { '@type': 'oa:Tag', chars: 'lo' }], }).tags, ).toEqual(['lo']); }); diff --git a/src/lib/AnnotationResource.js b/src/lib/AnnotationResource.js index 2a9437521895c24fcec1a745adb0308210d794b6..593a2c2dce68c8e7e2d20ee3e7a9825613cec58c 100644 --- a/src/lib/AnnotationResource.js +++ b/src/lib/AnnotationResource.js @@ -53,9 +53,9 @@ export default class AnnotationResource { /** */ get tags() { if (this.isOnlyTag()) { - return this.resources.map(r => r.value); + return this.resources.map(r => r.chars); } - return this.resources.filter(r => r['@type'] === 'oa:Tag').map(r => r.value); + return this.resources.filter(r => r['@type'] === 'oa:Tag').map(r => r.chars); } /** */