DBA Basics: Getting Started with Performance Tuning.pdf
SPARQL queries on CIDOC-CRM data of BritishMuseum
1. 1
CIDOC-CRM SPARQL Tutorial on British Museum
data at http://collection.britishmuseum.org
Author : Thomas Francart – thomas.francart@sparna.fr
Date of creation : 04/06/2018
Date of latest modification : 13/09/2018
Version : 2
License : CC-by-nc-sa https://creativecommons.org/licenses/by-nc-sa/4.0/ Attribution-
NonCommercial-ShareAlike 4.0 International
Table of contents
Objectives.....................................................................................................................................2
1. Know where the documentation is ......................................................................................2
CIDOC-CRM documentation........................................................................................................2
British Museum model documentation........................................................................................2
2. Looking for Turner.................................................................................................................2
On the web.................................................................................................................................2
On ResearchSpace.......................................................................................................................3
On the SPARQL service................................................................................................................3
3. Look for the Production Activities of Turner........................................................................5
4. Find the Works/Objects created by Turner..........................................................................6
5. Pictures of the Works............................................................................................................8
6. Dates of the works................................................................................................................9
7. And now… a timeline !..........................................................................................................9
8. Subjects of Turner works ?....................................................................................................9
2. 2
Objectives
This tutorial allows to understand the implementation of the CIDOC-CRM done by the British
Museum on its SPARQL service at https://collection.britishmuseum.org. It also allows to delve
step-by-step in the documentation of the CIDOC-CRM and some of its building blocks.
The objectives of this tutorial are :
o To understand how to interact with the SPARQL service of the British Museum and
the notice pages to retrieve the necessary information;
o To understand how CIDOC-CRM is used for data modelling, on authors, works, work
production, keywords and dates;
o To learn how to write the corresponding SPARQL queries;
At the end of this tutorial you should be capable of reusing the data of the British Musuem to
generate a timeline using a free online service. This demonstrates the potential of open data
reuse in innovative ways.
1. Know where the documentation is
CIDOC-CRM documentation
Go to www.cidoc-crm.org/versions-of-the-cidoc-crm.
Open the PDF version of the latest version of the CIDOC-CRM. This is the reference
specification of the model.
British Museum model documentation
Go to https://confluence.ontotext.com/display/ResearchSpace
Naviguate under “RS Ontology / BM mapping” and have a look at the diagram. In this diagram
we will use the following parts:
“Bibliography” part for Persons, in top left corner ;
The “Production” part;
The central “Object” part, with the « Subject » part just below ;
From the same page click on the link « mapping manual for endpoint site draft 0.98a.pdf ». This
document explains the choices made by the British Museum when mapping its data to the
CIDOC-CRM.
2. Looking for Turner
On the web
Find “Turner” in your rpeferred search engine ;
Look at its Wikipedia page (“Joseph Mallord William Turner”).
3. 3
On ResearchSpace
Go to https://public.researchspace.org and look for an actor named "Turner, Joseph
Mallord William" (with exactly this spelling, case-sensitive, including the comma) ;
Look at the “table” view and click on “Joseph Mallord William Turner”;
Click on tab “All properties” in the bottom right corner of the notice page;
On the SPARQL service
Go to the service endpoint https://collection.britishmuseum.org/resource/sparql.
Look for anything with the rdfs:label "Turner, Joseph Mallord William";
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?anything WHERE {
?anything rdfs:label "Turner, Joseph Mallord William" .
}
Click on the URI to navigate to this object notice
(http://collection.britishmuseum.org/id/person-institution/49003/appellation/1)
4. 4
In the section “Incoming Statements” :
o Hover your mouse on “is identified by” to view its URI ;
o Read the documentation of the property P131 in the CIDOC-CRM specification
to understand its semantic ;
o Try to find this link in the BM mapping diagram, in the upper-left corner ;
o Click on “Joseph Mallord William Turner” and navigate to its notice page at
http://collection.britishmuseum.org/id/person-institution/49003;
Adapt the SPARQL query to select “the URI of the Person named “Turner, Joseph
Mallord William” "
5. 5
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT * WHERE {
?person a crm:E21_Person .
?person crm:P131_is_identified_by ?appellation .
?appellation rdfs:label "Turner, Joseph Mallord William" .
}
3. Look for the Production Activities of Turner
In section “Incoming Statements” of the notice page of Turner, look for links “carried
out by”. You can filter the list by searching for “carried” in the filter box at the op of this
section ;
o Hover your mouse on “carried out by” to view its URI ;
o Look up and read its definition in the CIDOC-CRM specification ;
o Find the corresponding link in the BM mapping diagram; Note that it appears in
multiple places, try to find “the correct one”;
o Note that the Production Activity that links the creator of the work is part of of a
higher-level Production activity that includes this one as well as other
Production activities that hold different pieces of information;
o Try to find the Production Activity that hold the date information ;
6. 6
Enrich the query to select the URI of the Production Activities of Turner. You can use
the (non CIDOC-CRM) rs:displayLabel property to select some labels for these
activities;
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX rs: <http://www.researchspace.org/ontology/>
SELECT ?event ?eventLabel WHERE {
?person a crm:E21_Person .
?person crm:P131_is_identified_by ?appellation .
?appellation rdfs:label "Turner, Joseph Mallord William" .
?event crm:P14_carried_out_by ?person .
?event rs:displayLabel ?eventLabel .
} ORDER BY ?event
4. Find the Works/Objects created by Turner
Can you find, from the mapping diagram and by navigating in the notice pages of the
events, the links that connect the Production activities of Turner to the objects actually
produced ? for this it is necessary to move up on the “main production event”;
Read the documentation of the corresponding properties in the specification document;
Adapt the query to select the URIs of the objects created by Turner;
7. 7
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX rs: <http://www.researchspace.org/ontology/>
SELECT ?thing WHERE {
?person a crm:E21_Person .
?person crm:P131_is_identified_by ?appellation .
?appellation rdfs:label "Turner, Joseph Mallord William" .
?event crm:P14_carried_out_by ?person .
?superEvent crm:P9_consists_of ?event .
?thing crm:P108i_was_produced_by ?superEvent .
}
From the notice page of one of these Work URI, can you find all the ways to select its
title ? what is the « CIDOC-CRM-way » to select the title ?
Read the documentation of the corresponding properties in the specification document;
Adapt the query to select the titles of all the works of Turner;
8. 8
o BONUS 1 : can you rewrite the query using SPARQL « Property Paths » in a single line ?
o BONUS 2 : can you count the number of works produced by Turner ?
5. Pictures of the Works
o Find how to access to the images of a Work (and to their « main representation ») ;
o There are 2 types of links : a CIDOC-CRM one, and a “proprietary” one;
o Read the documentation of the corresponding properties in the specification document;
o Enrich the query to select, in addition to the title, the link to the image of the work ; try with
the CIDOC-CRM property, then with the British Museum specific property; what do you
see ?
o Copy-Paste the URL of an image in your browser and verify that you access to the image ;
9. 9
You have read the first 8 pages of this tutorial.
To read the full 13-pages version, including all
SPARQL queries, reach us at
thomas.francart@sparna.fr.
6. Dates of the works
7. And now… a timeline !
8. Subjects of Turner works ?