IIIF object¶
This example story is part of the SHMARQL documentation. It demonstrates the IIIF Object Special Node. To open it as an editable project, download iiif.lodeon.zip and import it in the story editor (/lodeon/ → Import).
IIIF is the standard many museums and libraries use to publish high-resolution images. The node shows IIIF Presentation manifests or IIIF Image API info.json resources in a deep-zoom viewer (OpenSeadragon). The images stay on the museum's server; only the URLs are stored in the story.
Manifests from a SPARQL query¶
Many Wikidata items link to a manifest with property P6108 (IIIF manifest URL). The query returns ?manifest, ?label and ?resource; the gallery shows one result at a time, with a strip to choose another:
{
"version": 1,
"renderer": "iiif",
"sourceMode": "sparql",
"url": "",
"query": "SELECT ?resource ?label ?manifest WHERE {\n VALUES ?painter { wd:Q5598 wd:Q167654 wd:Q205863 wd:Q314889 }\n ?resource wdt:P170 ?painter ;\n wdt:P6108 ?manifest .\n FILTER(STRSTARTS(STR(?manifest), \"https://api.smk.dk/\"))\n SERVICE wikibase:label {\n bd:serviceParam wikibase:language \"en\".\n ?resource rdfs:label ?label .\n }\n}\nLIMIT 20",
"knowledgeGraphProfileId": "wikidata",
"resultMapping": {
"manifest": "manifest",
"imageInfo": "imageInfo",
"label": "label",
"resource": "resource"
},
"selectedItem": null,
"label": "",
"caption": "IIIF manifests (Wikidata property P6108) of paintings by Rembrandt, Frans Hals, Jan Steen and Pieter de Hooch held by the SMK – National Gallery of Denmark.",
"height": 520,
"viewMode": "gallery",
"galleryReferenceStrip": "horizontal"
}
A manifest by URL¶
{
"version": 1,
"renderer": "iiif",
"sourceMode": "url",
"url": "https://iiif.kmska.be/iiif/2/968/manifest.json",
"query": "",
"resultMapping": {
"manifest": "manifest",
"imageInfo": "imageInfo",
"label": "label",
"resource": "resource"
},
"selectedItem": null,
"label": "",
"caption": "One IIIF Presentation manifest by URL, from KMSKA (Royal Museum of Fine Arts Antwerp).",
"height": 520,
"viewMode": "single",
"galleryReferenceStrip": "horizontal"
}
The browser loads the manifests and images directly from the museums, so their servers must allow cross-origin requests (CORS). The SMK and KMSKA servers used here do.
Try it in the editor:
- Switch the first node between gallery and single view, or move the strip to the side.
- Paste a second manifest URL on a new line in the second node.