IIIF Manifests
Table of contents
IIIF manifest links
Images of published objects from the 5 cultural heritage organisations and their corresponding technical metadata are published as IIIF manifests.
abbreviation | publishing organisation | iiif manifest |
---|---|---|
dmg | Design Museum Gent | https://api.collectie.gent/iiif/presentation/v2/manifest/dmg:objectnumber |
hva | Huis van Alijn | https://api.collectie.gent/iiif/presentation/v2/manifest/hva:objectnumber |
industriemuseum | Industriemuseum | https://api.collectie.gent/iiif/presentation/v2/manifest/industriemuseum:objectnumber |
stam | STAM | https://api.collectie.gent/iiif/presentation/v2/manifest/stam:objectnumber |
archiefgent | Archief Gent | https://api.collectie.gent/iiif/presentation/v2/manifest/archiefgent:objectnumber |
The IIIF manifest contains the link to the image as well as additional data such as licence of the image, format of the image, size of the image, source of the image and so on.
Image not publicly available
Not every heritage object published in the event streams have images or images that are publicly available. Certain images are not publicly available due to copyright restrictions. The correspoding technical metadata in the IIIF manifest is however still accessible. Accessing the IIIF manifests of objects without images will result in the following error:
message: "You don't have permission to access this resource"
You can check if there is a IIIF manifest by using the following python code:
try:
# code that may cause errors
except:
# code that handle exceptions
else:
# code that executes when no exception occurs
E.g.:
#cogentid# equals instelling:objectnumber (dmg:objectnumber, hva:objectnumber, industriemuseum:objectnumber, stam:objectnumber, archiefgent:objectnumber)
def image(request):
iiif_manifest = "https://api.collectie.gent/iiif/presentation/v2/manifest/#cogentid#"
try:
response = urlopen(iiif_manifest)
except ValueError:
print('no image found')
except HTTPError:
print('no image found')
else:
data_json = json.loads(response.read())
image_uri = data_json["sequences"][0]['canvases'][0]["images"][0]["resource"]["@id"]
print(image_uri)
Comunica
Comunica’s Link traversal feature can be used to directly fetch links to the IIIF image API when querying the SPARQL endpoint.
PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX sc: <http://iiif.io/api/presentation/2#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX cidoc: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT *
WHERE {
?s a cidoc:E22_Man-Made_Object ;
cidoc:P129i_is_subject_of [
sc:hasSequences/rdf:rest*/rdf:first [
sc:hasCanvases/rdf:rest*/rdf:first [
sc:hasImageAnnotations/rdf:rest*/rdf:first [
oa:hasBody ?body
]
]
]
]
}