SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Querying 
Cultural Heritage Data 
Dr. Barry Norton, 
Development Manager, ResearchSpace* 
* Funded by the Andrew W. Mellon Foundation 
* Hosted by the Curatorial Directorate, British Museum
Statements and Patterns 
• For one edge in a graph: 
crm:P52_has_current_owner 
bm-obj:EOC3130 
bm-id:the-british-museum
Statements and Patterns 
• For one edge in a graph: 
crm:P52_has_current_owner 
bm-obj:EOC3130 
bm-id:the-british-museum 
• We can declare/retrieve one (N)Triple:
Statements and Patterns 
• For one edge in a graph: 
crm:P52_has_current_owner 
bm-obj:EOC3130 
bm-id:the-british-museum 
• We can declare/retrieve one (N)Triple: 
• Or write this in Turtle: 
@prefix crm: <http://erlangen-crm.org/current/> . 
@prefix bm-obj: <http://collection.britishmuseum.org/id/object/> . 
@prefix bm-id: <http://collection.britishmuseum.org/id/> . 
bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum .
Statements and Patterns 
• For one edge in a graph: 
crm:P52_has_current_owner 
bm-obj:EOC3130 
bm-id:the-british-museum 
• We can write this in Turtle: 
• And check for it in SPARQL: 
bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum . 
PREFIX crm: <http://erlangen-crm.org/current/> 
PREFIX bm-obj: <http://collection.britishmuseum.org/id/object/> 
PREFIX bm-id: <http://collection.britishmuseum.org/id/> 
ASK {bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum} 
true
Statements and Patterns 
• For a set of edges: 
bm-obj:EOC3130 
bm-id:the-british-museum 
? 
crm:P51_has_former_or_current_owner 
? 
• We can do the work on the client: 
• Or have the server do it by turning the 
triple into a triple pattern: 
bm-obj:EOC3130 crm:P51_has_former_or_current_owner ?owner
Exercise 
? 
Questions: 
• Why is the answer different? 
• Who are the two (other) one-time owners? 
?
Solutions & Exercises 
• Why is the answer different? 
– Reasoning, part of the work by the server 
(being a triplestore) means that if two things 
are related by crm:P52_has_current_owner 
then they’’re related by 
crm:P51_has_former_or_current_owner 
• This is part of the work that the server 
(triplestore) can do for you 
• Exercise: query for the (strictly) former 
owners… ? 
?
Solution 1/2 
• Using specific server functionality:
Solution 2/2 
• In pure SPARQL:
Solutions & Exercises 
Who are the two (other) one-time owners? 
• Since people and institutions (and places) are 
? 
? 
treated as are concepts, the names of the former 
owners are attached using skos:prefLabel 
• Exercise: if you didn’t already, include the 
names in your query results
Solutions & Exercises 
If you didn’t already, include the names in 
your query results: 
Question: 
Why are we back at two answers?
Answer 
• Answer: 
– Just as we can add triples together to make a 
graph in RDF, so we can add triple patterns 
together in SPARQL to make a graph pattern 
– By default all triple patterns must be matched, 
but we can use the OPTIONAL {} pattern to 
allow variation 
• Exercise: 
– Query for the owners and their names, if they 
exist* 
* N.B. this bug in the BM data will be fixed soon
Solution
Exercise 
• Take a look here: 
• Exercise: copy and run this query
CSV Exercise 
• Type: 
• Observe that one can now paste the query 
including line breaks* 
• Type: 
* N.B. for now you should first replace the "s with 's and 
change the one occurrence of ecrm: with crm: - we’ll fix this 
* N.B. currently the query needs to be simplified as the BBC 
data is not loaded – this will be available soon
Data Analysis 
• One can import this CSV file into many 
tools: 
– A spreadsheet can be a good way to carry out 
basic visualisations 
– A scripting environment like (i)python/scipy or 
R can allow more analysis before 
visualisation, but: 
• both languages also have libraries to encapsulate 
interaction via SPARQL (rdflib/sparqlwrapper and 
SPARQL/RCurl respectively) 
• one should decide whether more analysis should 
first be carried out using SPARQL…
Exercise 
• If you haven’t so far, click on one of the 
(HotW) 100 Objects (such as number 70, 
Hoa Hakananai'a Easter Island Statue) 
having run the main query 
• Choose a material and observe the query 
for other objects in this material 
• Adapt this query to count how many BM 
objects are made from basalt
Solution & Exercise 
• Exercise: Now count the ‘top ten’ materials 
and the number of objects for each
Solution
A Last Word 
• SPARQLing a ‘native RDF’ database 
(often called a ‘triplestore’) is not the only 
option before defaulting to programming 
• A ‘native graph’ database indexes the 
graph in a different way, supporting 
traversal-oriented queries
Exercise 
Double click
Exercise 
Double click

Contenu connexe

Tendances

Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Daniele Dell'Aglio
 
Query Rewriting in RDF Stream Processing
Query Rewriting in RDF Stream ProcessingQuery Rewriting in RDF Stream Processing
Query Rewriting in RDF Stream ProcessingJean-Paul Calbimonte
 
Batch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWikiBatch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWikiSamuel Lampa
 
Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)
Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)
Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)Dan Starr
 
From SMW to Rules
From SMW to RulesFrom SMW to Rules
From SMW to RulesJie Bao
 
EKAW - Triple Pattern Fragments
EKAW - Triple Pattern FragmentsEKAW - Triple Pattern Fragments
EKAW - Triple Pattern FragmentsRuben Taelman
 

Tendances (7)

Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1Querying the Web of Data with XSPARQL 1.1
Querying the Web of Data with XSPARQL 1.1
 
Query Rewriting in RDF Stream Processing
Query Rewriting in RDF Stream ProcessingQuery Rewriting in RDF Stream Processing
Query Rewriting in RDF Stream Processing
 
Batch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWikiBatch import of large RDF datasets into Semantic MediaWiki
Batch import of large RDF datasets into Semantic MediaWiki
 
Pg big fast ugly acid
Pg big fast ugly acidPg big fast ugly acid
Pg big fast ugly acid
 
Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)
Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)
Starr Bloom T.C.P. using Hadoop on Yahoo's M45 Cluster (20100112)
 
From SMW to Rules
From SMW to RulesFrom SMW to Rules
From SMW to Rules
 
EKAW - Triple Pattern Fragments
EKAW - Triple Pattern FragmentsEKAW - Triple Pattern Fragments
EKAW - Triple Pattern Fragments
 

En vedette

PG-4039, RapidFire API, by Dmitry Kozlov
PG-4039, RapidFire API, by Dmitry KozlovPG-4039, RapidFire API, by Dmitry Kozlov
PG-4039, RapidFire API, by Dmitry KozlovAMD Developer Central
 
Wed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationsWed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationseswcsummerschool
 
The Handwriting on the Wall: The Pros and Cons of Social Media Use Among Teens
The Handwriting on the Wall: The Pros and Cons of Social Media Use Among TeensThe Handwriting on the Wall: The Pros and Cons of Social Media Use Among Teens
The Handwriting on the Wall: The Pros and Cons of Social Media Use Among TeensProphetik Soul Branding + Design
 
Pros and cons of social media
Pros and cons of social mediaPros and cons of social media
Pros and cons of social mediaChanchal Sharma
 

En vedette (8)

Openhouse 2011
Openhouse 2011Openhouse 2011
Openhouse 2011
 
PG-4039, RapidFire API, by Dmitry Kozlov
PG-4039, RapidFire API, by Dmitry KozlovPG-4039, RapidFire API, by Dmitry Kozlov
PG-4039, RapidFire API, by Dmitry Kozlov
 
Hl ipe nov_4_2012
Hl ipe nov_4_2012Hl ipe nov_4_2012
Hl ipe nov_4_2012
 
Wed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservationsWed batsakis tut_challenges of preservations
Wed batsakis tut_challenges of preservations
 
Social media in job search
Social media in job searchSocial media in job search
Social media in job search
 
Link Value of Social Media
Link Value of Social MediaLink Value of Social Media
Link Value of Social Media
 
The Handwriting on the Wall: The Pros and Cons of Social Media Use Among Teens
The Handwriting on the Wall: The Pros and Cons of Social Media Use Among TeensThe Handwriting on the Wall: The Pros and Cons of Social Media Use Among Teens
The Handwriting on the Wall: The Pros and Cons of Social Media Use Among Teens
 
Pros and cons of social media
Pros and cons of social mediaPros and cons of social media
Pros and cons of social media
 

Similaire à Mon norton tut_querying cultural heritage data

Intro to Open Babel
Intro to Open BabelIntro to Open Babel
Intro to Open Babelbaoilleach
 
RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)Daniele Dell'Aglio
 
RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)Daniele Dell'Aglio
 
Computer Science ACW Intro to OOP L7.pptx
Computer Science ACW Intro to OOP L7.pptxComputer Science ACW Intro to OOP L7.pptx
Computer Science ACW Intro to OOP L7.pptxEdmondLabule2
 
Early Experiences with the OpenMP Accelerator Model
Early Experiences with the OpenMP Accelerator ModelEarly Experiences with the OpenMP Accelerator Model
Early Experiences with the OpenMP Accelerator ModelChunhua Liao
 
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Lucidworks
 
(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)
(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)
(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)Olaf Hartig
 
The PubChemQC Project
The PubChemQC ProjectThe PubChemQC Project
The PubChemQC ProjectMaho Nakata
 
Self-Enforcing Access Control for Encrypted RDF
Self-Enforcing Access Control for Encrypted RDFSelf-Enforcing Access Control for Encrypted RDF
Self-Enforcing Access Control for Encrypted RDFSabrina Kirrane
 
Efficient top-k queries processing in column-family distributed databases
Efficient top-k queries processing in column-family distributed databasesEfficient top-k queries processing in column-family distributed databases
Efficient top-k queries processing in column-family distributed databasesRui Vieira
 
Expressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query RewritingExpressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query RewritingAlexandre Riazanov
 
"The BG collaboration, Past, Present, Future. The new available resources". P...
"The BG collaboration, Past, Present, Future. The new available resources". P..."The BG collaboration, Past, Present, Future. The new available resources". P...
"The BG collaboration, Past, Present, Future. The new available resources". P...lccausp
 
Neural Architectures for Named Entity Recognition
Neural Architectures for Named Entity RecognitionNeural Architectures for Named Entity Recognition
Neural Architectures for Named Entity RecognitionRrubaa Panchendrarajan
 
TclOO: Past Present Future
TclOO: Past Present FutureTclOO: Past Present Future
TclOO: Past Present FutureDonal Fellows
 
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkBuild, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkDatabricks
 
OpenDiscovery
OpenDiscoveryOpenDiscovery
OpenDiscoverygwprice
 
On the need for a W3C community group on RDF Stream Processing
On the need for a W3C community group on RDF Stream ProcessingOn the need for a W3C community group on RDF Stream Processing
On the need for a W3C community group on RDF Stream ProcessingPlanetData Network of Excellence
 

Similaire à Mon norton tut_querying cultural heritage data (20)

Intro to Open Babel
Intro to Open BabelIntro to Open Babel
Intro to Open Babel
 
RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)RDF Stream Processing Models (RSP2014)
RDF Stream Processing Models (RSP2014)
 
BioSD Tutorial 2014 Editition
BioSD Tutorial 2014 EdititionBioSD Tutorial 2014 Editition
BioSD Tutorial 2014 Editition
 
RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)RDF Stream Processing Models (SR4LD2013)
RDF Stream Processing Models (SR4LD2013)
 
Computer Science ACW Intro to OOP L7.pptx
Computer Science ACW Intro to OOP L7.pptxComputer Science ACW Intro to OOP L7.pptx
Computer Science ACW Intro to OOP L7.pptx
 
Early Experiences with the OpenMP Accelerator Model
Early Experiences with the OpenMP Accelerator ModelEarly Experiences with the OpenMP Accelerator Model
Early Experiences with the OpenMP Accelerator Model
 
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
 
(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)
(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)
(An Overview on) Linked Data Management and SPARQL Querying (ISSLOD2011)
 
The PubChemQC Project
The PubChemQC ProjectThe PubChemQC Project
The PubChemQC Project
 
Self-Enforcing Access Control for Encrypted RDF
Self-Enforcing Access Control for Encrypted RDFSelf-Enforcing Access Control for Encrypted RDF
Self-Enforcing Access Control for Encrypted RDF
 
Efficient top-k queries processing in column-family distributed databases
Efficient top-k queries processing in column-family distributed databasesEfficient top-k queries processing in column-family distributed databases
Efficient top-k queries processing in column-family distributed databases
 
Expressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query RewritingExpressive Querying of Semantic Databases with Incremental Query Rewriting
Expressive Querying of Semantic Databases with Incremental Query Rewriting
 
ACL 2018 Recap
ACL 2018 RecapACL 2018 Recap
ACL 2018 Recap
 
Java Memory Analysis: Problems and Solutions
Java Memory Analysis: Problems and SolutionsJava Memory Analysis: Problems and Solutions
Java Memory Analysis: Problems and Solutions
 
"The BG collaboration, Past, Present, Future. The new available resources". P...
"The BG collaboration, Past, Present, Future. The new available resources". P..."The BG collaboration, Past, Present, Future. The new available resources". P...
"The BG collaboration, Past, Present, Future. The new available resources". P...
 
Neural Architectures for Named Entity Recognition
Neural Architectures for Named Entity RecognitionNeural Architectures for Named Entity Recognition
Neural Architectures for Named Entity Recognition
 
TclOO: Past Present Future
TclOO: Past Present FutureTclOO: Past Present Future
TclOO: Past Present Future
 
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkBuild, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
 
OpenDiscovery
OpenDiscoveryOpenDiscovery
OpenDiscovery
 
On the need for a W3C community group on RDF Stream Processing
On the need for a W3C community group on RDF Stream ProcessingOn the need for a W3C community group on RDF Stream Processing
On the need for a W3C community group on RDF Stream Processing
 

Plus de eswcsummerschool

Semantic Aquarium - ESWC SSchool 14 - Student project
Semantic Aquarium - ESWC SSchool 14 - Student projectSemantic Aquarium - ESWC SSchool 14 - Student project
Semantic Aquarium - ESWC SSchool 14 - Student projecteswcsummerschool
 
Syrtaki - ESWC SSchool 14 - Student project
Syrtaki  - ESWC SSchool 14 - Student projectSyrtaki  - ESWC SSchool 14 - Student project
Syrtaki - ESWC SSchool 14 - Student projecteswcsummerschool
 
Keep fit (a bit) - ESWC SSchool 14 - Student project
Keep fit (a bit)  - ESWC SSchool 14 - Student projectKeep fit (a bit)  - ESWC SSchool 14 - Student project
Keep fit (a bit) - ESWC SSchool 14 - Student projecteswcsummerschool
 
Arabic Sentiment Lexicon - ESWC SSchool 14 - Student project
Arabic Sentiment Lexicon - ESWC SSchool 14 - Student projectArabic Sentiment Lexicon - ESWC SSchool 14 - Student project
Arabic Sentiment Lexicon - ESWC SSchool 14 - Student projecteswcsummerschool
 
FIT-8BIT An activity music assistant - ESWC SSchool 14 - Student project
FIT-8BIT An activity music assistant - ESWC SSchool 14 - Student projectFIT-8BIT An activity music assistant - ESWC SSchool 14 - Student project
FIT-8BIT An activity music assistant - ESWC SSchool 14 - Student projecteswcsummerschool
 
Personal Tours at the British Museum - ESWC SSchool 14 - Student project
Personal Tours at the British Museum  - ESWC SSchool 14 - Student projectPersonal Tours at the British Museum  - ESWC SSchool 14 - Student project
Personal Tours at the British Museum - ESWC SSchool 14 - Student projecteswcsummerschool
 
Exhibition recommendation using British Museum data and Event Registry - ESWC...
Exhibition recommendation using British Museum data and Event Registry - ESWC...Exhibition recommendation using British Museum data and Event Registry - ESWC...
Exhibition recommendation using British Museum data and Event Registry - ESWC...eswcsummerschool
 
Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...
Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...
Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...eswcsummerschool
 
Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014
Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014 Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014
Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014 eswcsummerschool
 
Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014
Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014
Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014eswcsummerschool
 
Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014
Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014 Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014
Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014 eswcsummerschool
 
Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...
Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...
Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...eswcsummerschool
 
Mon norton tut_publishing01
Mon norton tut_publishing01Mon norton tut_publishing01
Mon norton tut_publishing01eswcsummerschool
 
Mon domingue introduction to the school
Mon domingue introduction to the schoolMon domingue introduction to the school
Mon domingue introduction to the schooleswcsummerschool
 
Tue acosta hands_on_providinglinkeddata
Tue acosta hands_on_providinglinkeddataTue acosta hands_on_providinglinkeddata
Tue acosta hands_on_providinglinkeddataeswcsummerschool
 
Thu bernstein key_warp_speed
Thu bernstein key_warp_speedThu bernstein key_warp_speed
Thu bernstein key_warp_speedeswcsummerschool
 
Fri schreiber key_knowledge engineering
Fri schreiber key_knowledge engineeringFri schreiber key_knowledge engineering
Fri schreiber key_knowledge engineeringeswcsummerschool
 
Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02eswcsummerschool
 
Mon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked dataMon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked dataeswcsummerschool
 
Mon domingue key_introduction to semantic
Mon domingue key_introduction to semanticMon domingue key_introduction to semantic
Mon domingue key_introduction to semanticeswcsummerschool
 

Plus de eswcsummerschool (20)

Semantic Aquarium - ESWC SSchool 14 - Student project
Semantic Aquarium - ESWC SSchool 14 - Student projectSemantic Aquarium - ESWC SSchool 14 - Student project
Semantic Aquarium - ESWC SSchool 14 - Student project
 
Syrtaki - ESWC SSchool 14 - Student project
Syrtaki  - ESWC SSchool 14 - Student projectSyrtaki  - ESWC SSchool 14 - Student project
Syrtaki - ESWC SSchool 14 - Student project
 
Keep fit (a bit) - ESWC SSchool 14 - Student project
Keep fit (a bit)  - ESWC SSchool 14 - Student projectKeep fit (a bit)  - ESWC SSchool 14 - Student project
Keep fit (a bit) - ESWC SSchool 14 - Student project
 
Arabic Sentiment Lexicon - ESWC SSchool 14 - Student project
Arabic Sentiment Lexicon - ESWC SSchool 14 - Student projectArabic Sentiment Lexicon - ESWC SSchool 14 - Student project
Arabic Sentiment Lexicon - ESWC SSchool 14 - Student project
 
FIT-8BIT An activity music assistant - ESWC SSchool 14 - Student project
FIT-8BIT An activity music assistant - ESWC SSchool 14 - Student projectFIT-8BIT An activity music assistant - ESWC SSchool 14 - Student project
FIT-8BIT An activity music assistant - ESWC SSchool 14 - Student project
 
Personal Tours at the British Museum - ESWC SSchool 14 - Student project
Personal Tours at the British Museum  - ESWC SSchool 14 - Student projectPersonal Tours at the British Museum  - ESWC SSchool 14 - Student project
Personal Tours at the British Museum - ESWC SSchool 14 - Student project
 
Exhibition recommendation using British Museum data and Event Registry - ESWC...
Exhibition recommendation using British Museum data and Event Registry - ESWC...Exhibition recommendation using British Museum data and Event Registry - ESWC...
Exhibition recommendation using British Museum data and Event Registry - ESWC...
 
Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...
Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...
Empowering fishing business using Linked Data - ESWC SSchool 14 - Student pro...
 
Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014
Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014 Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014
Tutorial: Social Semantic Web and Crowdsourcing - E. Simperl - ESWC SS 2014
 
Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014
Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014
Keynote: Global Media Monitoring - M. Grobelnik - ESWC SS 2014
 
Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014
Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014 Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014
Hands On: Amazon Mechanical Turk - M. Acosta - ESWC SS 2014
 
Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...
Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...
Tutorial: Querying a Marine Data Warehouse Using SPARQL - I. Fundulaki - ESWC...
 
Mon norton tut_publishing01
Mon norton tut_publishing01Mon norton tut_publishing01
Mon norton tut_publishing01
 
Mon domingue introduction to the school
Mon domingue introduction to the schoolMon domingue introduction to the school
Mon domingue introduction to the school
 
Tue acosta hands_on_providinglinkeddata
Tue acosta hands_on_providinglinkeddataTue acosta hands_on_providinglinkeddata
Tue acosta hands_on_providinglinkeddata
 
Thu bernstein key_warp_speed
Thu bernstein key_warp_speedThu bernstein key_warp_speed
Thu bernstein key_warp_speed
 
Fri schreiber key_knowledge engineering
Fri schreiber key_knowledge engineeringFri schreiber key_knowledge engineering
Fri schreiber key_knowledge engineering
 
Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02
 
Mon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked dataMon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked data
 
Mon domingue key_introduction to semantic
Mon domingue key_introduction to semanticMon domingue key_introduction to semantic
Mon domingue key_introduction to semantic
 

Mon norton tut_querying cultural heritage data

  • 1. Querying Cultural Heritage Data Dr. Barry Norton, Development Manager, ResearchSpace* * Funded by the Andrew W. Mellon Foundation * Hosted by the Curatorial Directorate, British Museum
  • 2. Statements and Patterns • For one edge in a graph: crm:P52_has_current_owner bm-obj:EOC3130 bm-id:the-british-museum
  • 3. Statements and Patterns • For one edge in a graph: crm:P52_has_current_owner bm-obj:EOC3130 bm-id:the-british-museum • We can declare/retrieve one (N)Triple:
  • 4. Statements and Patterns • For one edge in a graph: crm:P52_has_current_owner bm-obj:EOC3130 bm-id:the-british-museum • We can declare/retrieve one (N)Triple: • Or write this in Turtle: @prefix crm: <http://erlangen-crm.org/current/> . @prefix bm-obj: <http://collection.britishmuseum.org/id/object/> . @prefix bm-id: <http://collection.britishmuseum.org/id/> . bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum .
  • 5. Statements and Patterns • For one edge in a graph: crm:P52_has_current_owner bm-obj:EOC3130 bm-id:the-british-museum • We can write this in Turtle: • And check for it in SPARQL: bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum . PREFIX crm: <http://erlangen-crm.org/current/> PREFIX bm-obj: <http://collection.britishmuseum.org/id/object/> PREFIX bm-id: <http://collection.britishmuseum.org/id/> ASK {bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum} true
  • 6. Statements and Patterns • For a set of edges: bm-obj:EOC3130 bm-id:the-british-museum ? crm:P51_has_former_or_current_owner ? • We can do the work on the client: • Or have the server do it by turning the triple into a triple pattern: bm-obj:EOC3130 crm:P51_has_former_or_current_owner ?owner
  • 7. Exercise ? Questions: • Why is the answer different? • Who are the two (other) one-time owners? ?
  • 8. Solutions & Exercises • Why is the answer different? – Reasoning, part of the work by the server (being a triplestore) means that if two things are related by crm:P52_has_current_owner then they’’re related by crm:P51_has_former_or_current_owner • This is part of the work that the server (triplestore) can do for you • Exercise: query for the (strictly) former owners… ? ?
  • 9. Solution 1/2 • Using specific server functionality:
  • 10. Solution 2/2 • In pure SPARQL:
  • 11. Solutions & Exercises Who are the two (other) one-time owners? • Since people and institutions (and places) are ? ? treated as are concepts, the names of the former owners are attached using skos:prefLabel • Exercise: if you didn’t already, include the names in your query results
  • 12. Solutions & Exercises If you didn’t already, include the names in your query results: Question: Why are we back at two answers?
  • 13. Answer • Answer: – Just as we can add triples together to make a graph in RDF, so we can add triple patterns together in SPARQL to make a graph pattern – By default all triple patterns must be matched, but we can use the OPTIONAL {} pattern to allow variation • Exercise: – Query for the owners and their names, if they exist* * N.B. this bug in the BM data will be fixed soon
  • 15. Exercise • Take a look here: • Exercise: copy and run this query
  • 16. CSV Exercise • Type: • Observe that one can now paste the query including line breaks* • Type: * N.B. for now you should first replace the "s with 's and change the one occurrence of ecrm: with crm: - we’ll fix this * N.B. currently the query needs to be simplified as the BBC data is not loaded – this will be available soon
  • 17. Data Analysis • One can import this CSV file into many tools: – A spreadsheet can be a good way to carry out basic visualisations – A scripting environment like (i)python/scipy or R can allow more analysis before visualisation, but: • both languages also have libraries to encapsulate interaction via SPARQL (rdflib/sparqlwrapper and SPARQL/RCurl respectively) • one should decide whether more analysis should first be carried out using SPARQL…
  • 18. Exercise • If you haven’t so far, click on one of the (HotW) 100 Objects (such as number 70, Hoa Hakananai'a Easter Island Statue) having run the main query • Choose a material and observe the query for other objects in this material • Adapt this query to count how many BM objects are made from basalt
  • 19. Solution & Exercise • Exercise: Now count the ‘top ten’ materials and the number of objects for each
  • 21. A Last Word • SPARQLing a ‘native RDF’ database (often called a ‘triplestore’) is not the only option before defaulting to programming • A ‘native graph’ database indexes the graph in a different way, supporting traversal-oriented queries