Blog single
One stop solution for a stunning website.
Geolocating with IIIF Presentation API 2.1 Annotation
experiments / IIIF / TechnologySeptember 18, 20200 CommentsBryan Haberberger
In the very first phases of imagining what GeoJSON might look like when attached to IIIF resource, Presentation API 3 had not yet been released, though it was in beta stage. We knew Annotation was a perspective appropriate resource type and data structure for intertwining the data syntax required to make the assertion.
Implementation Description
Below you will see an IIIF Presentation API 2.1 Manifest that contains a single Canvas resource with an IIIF Image API 2.1 compliant image painted onto it. There is an Annotation List containing a single Annotation with coordinates to central Paris, France. The body of that Annotation is GeoJSON-LD.
Example JSON
{ "@context":[ "http://iiif.io/api/presentation/2/context.json", "http://geojson.org/geojson-ld/geojson-context.jsonld" ], "@id":"http://www.example.org/manifest/1", "@type":"sc:Manifest", "label":"Manifest - Example 1", "description":"A Manifest containing a single Canvas that is geolocated to Paris, France via a IIIF Presentation API 2.1 Annotation.", "sequences":[ { "@id":"http://www.example.org/example1/sequence/normal", "@type":"sc:Sequence", "label":"Example 1 Page Order", "canvases":[ { "@id":"http://www.example.org/example1/canvas", "@type":"sc:Canvas", "label":"Example 1 Canvas", "images":[ { "@type":"oa:Annotation", "motivation":"sc:painting", "resource":{ "@id":"http://example.org/images/book1-page1/full/max/0/default.jpg", "@type":"dctypes:Image", "format":"image/jpeg", "service":{ "@context":"http://iiif.io/api/image/2/context.json", "@id":"http://example.org/images/book1-page1", "profile":"http://iiif.io/api/image/2/level1.json" } }, "height":2000, "width":1500, "on":"http://www.example.org/example1/canvas" } ], "otherContent":[ { "@id":"http://www.example.org/example1/annolist", "@type":"sc:AnnotationList", "resources":[ { "@id":"http://www.example.org/example1/anno", "@type":"oa:Annotation", "motivation":"supplementing", "resource":{ "type":"Feature", "properties":{ "label":"Paris, France" }, "geometry":{ "type":"Point", "coordinates":[ 2.34, 48.86 ] } }, "on":"http://www.example.org/example1/canvas" } ] } ] } ] } ] }
Important Implementation Notes
- To support interoperability through Linked Data, the IIIF Presentation API 2.1 and GeoJSON-LD 1.0 context are included at the top of the document. Contexts tell Linked Data processors how to interpret the information contained within the data node.
- The field @context can be array to include any Linked Data Context necessary to describe data that appears in the Manifest resource. It is also important to note that the IIIF Presentation API 2.1 and GeoJSON-LD 1.0 context are JSON-LD 1.0.
- IIIF Presentation API 2.1 dictates that resource types be annotated by Annotation Lists as opposed to single Annotations, even in cases where this is only one Annotation.
- A single GeoJSON Feature was used to assert the coordinates. Since an Annotation List can have an array of resources, multiple Features can be supported all at once. GeoJSON also has Feature Collection, which can contain an array of Features. In this way, it is possible to represent multiple Features under a single Feature Collection object. Our experience with user interfaces that consume GeoJSON is that they will draw a single Feature Collection the same way as an array of multiple Feature objects. Since user interfaces support either, without preference, we chose to represent the single Feature as simply as possible without wrapping it inside a Feature Collection object.
Restrictive Outcomes
After creating this example and studying how processors interpret it, and furthering this example through slight variations, we noticed critical points of incompatibility.
- The context of GeoJSON-LD is not compatible with with JSON-LD 1.0. JSON-LD 1.0 processing cannot realize arrays of arrays, meaning geometry for Polygons cannot be supported.
- properties of GeoJSON-LD is not well described and has been left to act as a wild card. It can contain nearly anything and is therefore subject to repeat described terms from other contexts, such as label.
- In IIIF Presentation API 2.1, a Manifest cannot contain Annotations at the Manifest level. That is, only certain resources contained within the Manifest may be further described by Annotation. This means it is not possible to geolocate a Manifest. Instead, one has to geolocate each individual Canvas contained in the Sequence(s) of the Manifest.
Conclusion
The IIIF Cookbook Community Group, in coordination with the IIIF Maps Community Group, deemed that GeoJSON-LD was not compatible with IIIF Presentation API 2.1 and earlier. Linked Data processors will not be able to understand or realize the GeoJSON-LD data syntax in these Annotations and are likely to ignore that which they cannot process. Since Annotation cannot be applied to all IIIF resource types, it is an insufficient means of applying geographic data to IIIF resources.
Next Step
Investigate other means of supplying geographic information under IIIF Presentation API 2.1 and see if the JSON-LD 1.0 restriction can be circumvented.
Leave A Comment