arraysize: 0
Embedding annotations in Mirador by having them merged over an API service
Many examples were written to make use of resources from Digital Collections at Trinity College, Dublin. Unfortunately, these resources are no longer available for machine-readable operations.
How this works
- We are using annotations that were first saved to localStorage and subsequently transferred to a wiki page.
- The JSON for these annotations on the wiki page follows IIIF v3 (the standard output of the localStorage adapter) and comprises one or multiple instances of AnnotationPage.
- To create a new manifest with referenced annotations, an API service is used. The URL for this manifest is
https://codecs.vanhamel.nl/api.php?action=iiif-manifest&format=json&manifest=https://digitalcollections.tcd.ie/concern/works/2801pk516/manifest.json&annotid=67202
, which accepts parameters for both manifest and additional JSON:- manifest: URL of the original manifest (here https://digitalcollections.tcd.ie/concern/works/2801pk516/manifest.json)
- annotid: the page id of the wiki page containing the annotations (here 67202).
- The greatest part of the work is in the Annotations API. Each canvas listed in the manifest that has any annotations references the Annotations API.
- Because our manifest is encoded according to IIIF v2 standards, the JSON of the original annotations is converted to v2. Similar work was done by Glen Robson when he created an adapter for the Simple Annotation Server. My equivalent code in PHP largely follows his example.
- Example:
https://codecs.vanhamel.nl/api.php?action=iiif-annotations&format=json&annotid=67202&v=2&canvas=https://digitalcollections.tcd.ie/concern/works/2801pk516/manifest/canvas/v405sd539