diff --git a/src/WebAnnotation.js b/src/WebAnnotation.js index fff3099..486d1e7 100644 --- a/src/WebAnnotation.js +++ b/src/WebAnnotation.js @@ -1,3 +1,5 @@ +import uuid from 'uuid/v1'; + export default class WebAnnotation { constructor(annotation) { @@ -9,6 +11,7 @@ export default class WebAnnotation { const stub = { '@context': 'http://www.w3.org/ns/anno.jsonld', 'type': 'Annotation', + 'id': uuid(), 'body': [] }; diff --git a/src/relations/drawing/DrawingTool.js b/src/relations/drawing/DrawingTool.js index bc03f54..092628f 100644 --- a/src/relations/drawing/DrawingTool.js +++ b/src/relations/drawing/DrawingTool.js @@ -142,8 +142,8 @@ export default class DrawingTool extends EventEmitter { const annotation = WebAnnotation.create({ target: [ - { id: from.id }, - { id: to.id } + { id: `#${from.id}` }, + { id: `#${to.id}` } ] });