Overview

As described in the following article, I recently developed an application that serves IIIF manifest files and provides the IIIF Content Search API.

However, there were parts that did not conform to the API specifications.

In this article, I share the corrections made and introduce how to use the Presentation API Validator with practical examples.

https://presentation-validator.iiif.io/

Correcting the Manifest File

Access the Presentation API Validator site above, enter the manifest file URL in URL of Manifest to Validate, and select the corresponding API version (in this case 3.0).

As a result, if there are errors, their details are displayed as shown below.

The manifest file served by the application I developed (introduced at the beginning) was large, so entering the URL directly into the validator took a long time to display results.

Therefore, I separately created a manifest file containing only the first canvas data. Running the validator on it produced 59 error messages.

Below, I describe how to address each error.

Error 1 of 59. Message: ['https://ocr.aws.ldas.jp/v1/manifest/3437686.json'] is not of type 'string'

before

{}"]i"dh"t:tp[s://ocr.aws.ldas.jp/v1/manifest/3437686.json"

The manifest file’s id was mistakenly given as an array. It was corrected as follows.

after

{}"id":"https://ocr.aws.ldas.jp/v1/manifest/3437686.json"

Error 2 of 59. Message: 'Persistent ID' is not of type 'object'

before

{}"]m{}e""tlvaaadblaeutlea""":::""[Pienrfsoi:sntdelnjtp/IpDi"d,/3437686"

This type of error was common across errors 2-23 and 26-59 (mainly in the metadata descriptions).

It was necessary to specify a language (here none) and provide values as arrays, as shown below. Languages such as ja or en can be specified as needed.

after

{}"]m{}e"}"}tl"],v"]aan"an"dboPloiaeneunntlereefa""s""o"::i::::sn{[t{[d[elnjtp/IpDi"d/3437686"

Error 24 of 59. Message: {'@context': 'http://iiif.io/api/search/1/context.json', '@id': 'https://search.aws.ldas.jp/search/3437686', 'profile': 'http://iiif.io/api/search/1/search'} is not of type 'array'

before

{}"}s"""e@@prcirvodoin"fct:ieel"x"e:th""t:{:tp""shh:tt/tt/pps::e//a//riiciihii.ffa..wiisoo./laadppaiis/.ssjeepaa/rrsccehha//r11c//hsce3an4rt3ce7hx6"t8.6j"s,on",

This is the part specifying the IIIF Search API. The service value was changed to an array, @id was corrected to id, and the required type field was set to SearchService1.

after

{}"]s{}e""""r@iptvcdryio"opcn:feeti""e"l::xhett""["t:S:pes"a":hrh/tct/thtspSpe:e:a/r/r/v/ciiihici.ieiaf1fw.".sii.ool//daaappsii./jsspee/aasrreccahhr//c11h/sc3eo4an3rt7ce6hx8"t6,."j,son",

Error 25 of 59. Message: 'https://dl.ndl.go.jp/ja/iiif_license.html' does not match 'http://creativecommons.org/licenses/.*'

before

{}"rights":"https://dl.ndl.go.jp/ja/iiif_license.html"

The values that can be given to rights appear to be limited to URLs from https://creativecommons.org or https://rightsstatements.org.

https://iiif.io/api/presentation/3.0/#rights

Therefore, rights was removed and the value was moved to metadata.

(This approach makes the usage conditions harder to find in viewers, so I will continue to consider whether there is a better method.)

after

{}"]m{}e"}"}tl"],v"]aan"an"dborlohaeniunttlegeeta""h""p"::t::s:s:{["{[/[/dl.ndl.go.jp/ja/iiif_license.html"

Error 29 of 59. Message: 'id' is a required property

before

{}"""}"@@l"],iitan"tdyboTe"penam:elebs"""l"":::e:ht"{[o[tsf.pc.s:C.:Ro]/an/ntwgewenw"t.,sd"l.ndl.go.jp/api/iiif/3437686/range/1",

In the structures description for the table of contents, v2 notation remained. @id was corrected to id, @type to type, and sc: was removed from the value.

after

{}"""}"itl"],idyan"t"pboTe:eenam"lebs":""l"h::e:t"tR{[o[paf.sn.:gC./eo]/"nw,twewn.tdsl".ndl.go.jp/api/iiif/3437686/range/1",

Result

As a result of the above corrections, Validated successfully was displayed as shown below.

IIIF Content Search API

Next, I corrected the IIIF Content Search API. Since there is no validator for this API (as far as I know), I fixed the issues by referring to the documentation. There may still be remaining errors or omissions.

https://iiif.io/api/search/1.0/

Correcting @context

before

{}"id":"https://ocr.aws.ldas.jp/v1/manifest/3437686.json"

0

A non-existent URI was specified. It was corrected to the proper URI.

after

{}"id":"https://ocr.aws.ldas.jp/v1/manifest/3437686.json"

1

Correcting @type and Canvas xywh

before

{}"id":"https://ocr.aws.ldas.jp/v1/manifest/3437686.json"

2

The unnecessary string /searchResults at the end of on was removed. Also, the @type value was corrected from cnt:ContextAstext to cnt:ContentAsText. Furthermore, although not a mandatory fix, the @id specification method was revised following the example from the Wellcome Collection.

https://iiif.wellcomecollection.org/search/v0/b18035723?q=ab

after

{}"id":"https://ocr.aws.ldas.jp/v1/manifest/3437686.json"

3

Adding the hits Element

Previously, the API response did not include the hits element shown below.

https://iiif.io/api/search/1.0/#search-api-specific-responses

By adding this hits element as part of this fix, search results are now correctly displayed in Image Annotator as well.

Summary

While there may still be incomplete aspects, the above corrections established the fix policy for each API. After this, the actual services will be updated accordingly.

I hope this article serves as a reference for using IIIF validators and writing IIIF Presentation API v3 descriptions. (Most were simple mistakes on my part, though…)

Thank you to Professor @_masaka for reporting these issues!

(And I apologize for the inconvenience of having you modify your application to accommodate my bugs.)