DDMAL/diva.js

Include handling of Presentation API 3.0 `structures` and `ranges`?

Opened this issue · 4 comments

Diva currently supports the IIIF Presentation API 3.0. However, when obtaining the canvases in a manifest, Diva looks for either an array in a sequences array in the manifest or an items array in the manifest (see

const sequence = manifest.sequences ? manifest.sequences[0] : null;
). In the Presentation API 3.0, the Ranges attribute is used to provide these ordering structures (https://iiif.io/api/presentation/3.0/#54-range), and there are no sequences. Diva's logic will still work with the 3.0 API because it will use the ordering of canvases found in the manifest's items array, but will not show a different ordering if defined (because this will be defined in a range.

For more information about this change, see https://iiif.io/api/presentation/3.0/change-log/#141-remove-sequence-in-favor-of-ranges-items-and-behavior-value-sequence

Have you actually found a ranges ordering manifest in the wild? It’s a theoretical possibility but I’ve never actually seen one.

Have you actually found a ranges ordering manifest in the wild? It’s a theoretical possibility but I’ve never actually seen one.

I haven't! So yes, maybe not an issue -- if you haven't seen it, then let's not worry.

Have you seen anyone using the Image API 3.0? Because that would also break things...

Here, if your context pointed to .../image/3/..., then the API would be set to 1.0:

if (context === 'http://iiif.io/api/image/2/context.json' || context === "ImageService2")

Which means here you set the quality to "native" which would not be recognized by a server operating API 3.0:

const quality = (page.api > 1.1) ? 'default' : 'native';

Maybe that is also not adopted?

I only found these because yesterday I created an IIIF Manifest using the 3.0 APIs, so maybe no one is doing that!

Lots of people have adopted IIIF v3, but are figuring out how to manage both 2 and 3.

The Bodleian's IIIF server is a good example of IIIF v3 manifests, but you have to specifically request it with an Accept header. Every manifest you find on Digital Bodleian can be requested this way.

https://digital.bodleian.ox.ac.uk/developer/iiif/

$> curl -H "Accept: application/ld+json;profile=http://iiif.io/api/presentation/3/context.json" "https://iiif.bodleian.ox.ac.uk/iiif/manifest/b73ca01f-aac8-4916-a7c6-3c8e67939a66.json"

Their image server also supports Image API v3:

$> curl -H "Accept: application/ld+json;profile=http://iiif.io/api/image/3/context.json" "https://iiif.bodleian.ox.ac.uk/iiif/image/6722822e-43f0-43f4-a395-b5f3980d4c8e/info.json"

https://iiif.bodleian.ox.ac.uk/iiif/image/6722822e-43f0-43f4-a395-b5f3980d4c8e/full/max/0/default.jpg

Good to know! I think this is definitely something that does not need an immediate change.