Fixed bug that created invalid annotations for relations

This commit is contained in:
Rainer Simon 2020-04-28 11:41:03 +02:00
parent d491c402af
commit 8121aa38ec
2 changed files with 5 additions and 2 deletions

View File

@ -1,3 +1,5 @@
import uuid from 'uuid/v1';
export default class WebAnnotation { export default class WebAnnotation {
constructor(annotation) { constructor(annotation) {
@ -9,6 +11,7 @@ export default class WebAnnotation {
const stub = { const stub = {
'@context': 'http://www.w3.org/ns/anno.jsonld', '@context': 'http://www.w3.org/ns/anno.jsonld',
'type': 'Annotation', 'type': 'Annotation',
'id': uuid(),
'body': [] 'body': []
}; };

View File

@ -142,8 +142,8 @@ export default class DrawingTool extends EventEmitter {
const annotation = WebAnnotation.create({ const annotation = WebAnnotation.create({
target: [ target: [
{ id: from.id }, { id: `#${from.id}` },
{ id: to.id } { id: `#${to.id}` }
] ]
}); });