Build your own Digital Bodleian with IIIF and SPARQL

This post describes a simple way to create a customised, interactive view of a set of documents. Despite my provocative title, it’s not a rival to Digital Bodleian, having far less content and without the personalisation and commenting features. BUT it is 1) customisable in terms of the items it displays and 2) not limited to Oxford collections. So in the long term this technique could be useful to researchers who want to focus on a set of items, such as the manuscripts, printed works or art works of a particular culture or era.

IIIF is the International Image Interoperability Framework (discussed previously). At the time of writing there are around 32,000 objects with IIIF manifests linked from Wikidata, from over 100 GLAM collections. Just under two thousand of these are from Digital Bodleian. The Bodleian items are usually multi-page documents such as manuscripts, incunabula, or other printed books, many of which are in this digital form thanks to the Polonsky Foundation Digitization Project.

With some code in the SPARQL query language, we can request the IIIF manifest for each document we are interested in, and send it to a reader application that will give us a nice interactive interface.

There are multiple IIIF readers around the web. Some are listed in the Wikidata entry for “IIIF endpoint”. The Wikimedia Foundation have an installation of Mirador and that’s what I’ll be using. The IIIF manifest is a structured description of the document in a particular language, and Mirador is a reader of that language. I don’t have to interpret the IIIF language myself; I just need to connect these two things that speak it.

Giving the manifest to the viewer is just a matter of adding the viewer link and the manifest link together. CONCAT is a function that concatenates strings together, but a couple more steps are necessary. A string and a link are of different types and so cannot be combined. So we need STR(), a function that converts a link to a string. Then we can add the two strings together, which gives:

Now we have the web address that gives the IIIF manifest to the IIIF viewer, but it isn’t a clickable link. The SPARQL query is treating this as a dumb string of text, so we need one more function, URI(), which does the reverse of STR().


This is an example of the interactive interface that Mirador gives for the document (click the Ⓘ icon in the top right to get the item’s metadata).

In summary, the bit of code that makes the needed link is:

(URI(CONCAT(“”,STR(?iiif))) AS ?iiiflink)

Apart from that, we just need to specify what kind of items we want to view. I’m going to ask for incunabula whose language is Latin. This involves some basic SPARQL (that should be familiar if you’ve attended my “SPARQL as a Foreign Language” workshop).

Here’s the end result and here’s the query code. More than four hundred documents, totalling many thousands of pages, as a publicly shareable online application tailored to my specific interest. Note that you can click the arrows next to Inventory [number] or Year to order the table by those fields.

More of these customised views, with more content, will become possible as more institutions join the Bodleian Libraries both in making multi-page documents available as IIIF and sharing the IIIF manifest links on Wikidata.


Post by Martin Poulter, Wikimedian In Residence
This post licensed under a CC-BY-SA 4.0 license

Comments are closed.