jhu-digital-manuscripts / AnIOp

to track the activities of the Mellon funded Annotation Interoperability project
0 stars 0 forks source link

Consume the georeference data and try to use it #72

Closed cyork closed 4 years ago

GroovinChip commented 4 years ago

I have not consumed the georeference data within Mirador yet - it's not really possible yet. The way things work at the moment is:

  1. We get the ID of a given canvas, which is the iiif URL we have it
  2. We reconstruct the iiif URL into a WA url, call that URL, get the annotations for that canvas from the result of calling the URL, and store those annotations in Mirador's state.

I spoke with Jack yesterday about how to build on top of this so we can pull in annotations from another resource. The best way to do this is to write another plugin that acts as a service for checking other resources for annotations related to the current canvas. This service would define a couple of URL formats for the various resources and do some URL reconstructing for each based on the page number of the canvas (1r, for example). Then the URLs would be called so we can get the annotations from them. The service would be called from within the current plugin every time a canvas is viewed and before the annotations are added to Mirador. See:

// Create Annotation Page object
const AnnoPage = {
  id: url,
  type: 'AnnotationPage',
  items: [
    results,
  ],
}
// Provide Annotation Page to Mirador
receiveAnnotation(canvas.id, url, AnnoPage)

The service would be called before the AnnoPage object is created, and all the annotations would be added to the results property of the AnnoPage object. In that way, we can make sure that annotations from different resources get added to Mirador.

I am currently working on this second plugin.