Closed robcast closed 4 years ago
The last change in Mirador to accept extended target sources
should also be amended to accept target.source
without target.source.id
.
Should we keep target.id
for backward-compatibility?
I'm not following exactly here. What is the change you would propose there? I thought we were targeting something like this: https://github.com/ProjectMirador/mirador-annotations/issues/20#issuecomment-665531532
target.source.id
is fine in case source
is an object with additional information like partOf
:
"target": {
"type": "SpecificResource",
"source": {
"id": "http://example.org/manifest/1/canvas/1",
"type": "Canvas",
"label": { "en": [ "Page 1" ] } },
"partOf": [
{
"id": ""http://example.org/manifest/1.json",
"type": "Manifest",
"label": { "en": [ "Manifest title" ] } }
}
]
},
"selector": [{
"type": "FragmentSelector",
"conformsTo": "http://www.w3.org/TR/media-frags/",
"value": "xywh=10,10,100,100"
},
{
"type": "SvgSelector",
"value": "<svg:svg> ... </svg:svg>"
}]
If we don't need that information target.source
should be the URI that is currently in target.id
:
"target": {
"type": "SpecificResource",
"source": "http://example.org/manifest/1/canvas/1",
"selector": [{
"type": "FragmentSelector",
"conformsTo": "http://www.w3.org/TR/media-frags/",
"value": "xywh=10,10,100,100"
},
{
"type": "SvgSelector",
"value": "<svg:svg> ... </svg:svg>"
}]
}
should become
return (target.source && target.source.id) || target.source || target.id;
The current annotation model uses the target's
id
property for the canvas uri when the target has a selector.According to the WebAnno spec the target is a
SpecificResource
when it has aselector
and the resource uri should go into thesource
property (theid
is of the SpecificResource object itself).This concerns
WebAnnotation.js
and possible some adapters.