From 8121aa38ec0f1c9c1190097c732160970c7d4bd5 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Tue, 28 Apr 2020 11:41:03 +0200 Subject: [PATCH] Fixed bug that created invalid annotations for relations --- src/WebAnnotation.js | 3 +++ src/relations/drawing/DrawingTool.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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}` } ] });