CenterForDigitalHumanities / rerum_server

Java web service for a RERUM compliant digital object repository
http://rerum.io
Other
7 stars 2 forks source link

Handling Smart objects, alternate solution #93

Open cubap opened 4 years ago

cubap commented 4 years ago

Here's something for discussion @CenterForDigitalHumanities/administrators ...

RERUM always checks for IIIF compliance (more or less) even though we know for a fact that most of the requests will be Web Annotations or other simple objects. We also have discussed adding overhead to all v1 calls to handle "Smart Objects" like a Manifest that automatically subdocuments all its Canvases and AnnotationPageCollections. This would even be the case on simple reads, since a Manifest would have to be reassembled. Minimum case, I would see at least one if at the top of every read and more if there are flags added, as we have discussed.

Perhaps the way forward here is to carry the _id into a service specifically for those objects we want to be smart. Create a iiif service that enlightens regular objects when requested, but still allows for simple calls. I'll add examples…

cubap commented 4 years ago

Example Manifest

{
  "@context": "http://iiif.io/api/presentation/3/context.json",
  "id": "http://store.rerum.io/v1/iiif/[_id]/manifest",
  "type": "Manifest",
  "label": { "en": [ "Book 1" ] },
  "metadata": [
    { "label": { "en": [ "Author" ] }, "value": { "none": [ "Anne Author" ] } },
    { "label": { "en": [ "Published" ] }, "value": { 
        "en": [ "Paris, circa 1400" ],
        "fr": [ "Paris, environ 1400" ]
      }
    }, ],
  "summary": { "en": [ "Book 1, written by Anne Author, published in Paris around 1400." ] },
  "thumbnail": [ {
      "id": "https://example.org/iiif/book1/page1/full/80,100/0/default.jpg",
      "type": "Image",
      "format": "image/jpeg",
    } ],
  "viewingDirection": "right-to-left",
  "behavior": [ "paged" ],
  "rights": "https://creativecommons.org/licenses/by/4.0/",
  "seeAlso": [ {
      "id": "https://example.org/library/catalog/book1.xml",
      "type": "Dataset",
      "format": "text/xml",
      "profile": "https://example.org/profiles/bibliographic"
    } ],
  "rendering": [ {
      "id": "https://example.org/iiif/book1.pdf",
      "type": "Text",
      "label": { "en": [ "Download as PDF" ] },
      "format": "application/pdf"
    } ],
  "partOf": [ {
      "id": "https://example.org/collections/books/",
      "type": "Collection"
    } ],
  "start": {
    "id": "http://store.rerum.io/v1/iiif/[_id]/canvas",
    "type": "Canvas"
  },
  "items": [ {
      "id": "http://store.rerum.io/v1/iiif/[_id]/canvas",
      "type": "Canvas",
      "label": { "none": [ "p. 1" ] }
    } ],
  "structures": [ {
      "id": "http://store.rerum.io/v1/iiif/[_id]/range",
      "type": "Range"
      // Ranges members should be included here
    } ],
  "annotations": [ {
      "id": "http://store.rerum.io/v1/iiif/[_id]/annotations",
      "type": "AnnotationCollection",
      "items": [
        // Annotations about the Manifest are included here
      ] }
  ] 
}

This would be returned from its IIIF @id just as it appears. However, if it were requested at http://store.rerum.io/v1/id/[_id], you would see something very different.

{
  "@context": "http://iiif.io/api/presentation/3/context.json",
  "id": "http://store.rerum.io/v1/iiif/[_id]/manifest",
  "type": "Manifest",
  "label": { "en": [ "Book 1" ] },
  "items": [ "http://store.rerum.io/v1/iiif/[_id]/canvas" ],
  "structures": [ "http://store.rerum.io/v1/iiif/[_id]/range" ],
  "annotations": [ "http://store.rerum.io/v1/iiif/[_id]/annotations" ] 
}

The abbreviated object would have been stored by the create endpoint in the iiif service and would have also created all the associated annotations and objects that are within it. This would be based on recognized "accessories" and anything unknown would be left alone and attached to the general object. The iiif service would be capable of reassembling this object with more complex queries that take a little longer but have much more flexibility and the URI would give away the type of thing to any human. Once the Manifest is saved, loading just the Ranges or AnnotationPages into a bespoke viewer or editor is simple. A single Canvas could be inspected in an annotation tool or exposed for an inline image fragment without loading the entire Manifest.

cubap commented 4 years ago

I'm not certain how we would handle updates…

We may need to put a rule together that the iiif service always overwrites the objects so that there is a reliable URI to call or establish some slug-service that uses the name of the object but allows the URI to be flexible.

cubap commented 4 years ago

I'm not certain how we would handle updates…

We may need to put a rule together that the iiif service always overwrites the objects so that there is a reliable URI to call or establish some slug-service that uses the name of the object but allows the URI to be flexible.

Broken out in #99