SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Querying
Cultural Heritage DataCultural 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:
bm-obj:EOC3130
crm:P52_has_current_owner
bm-id:the-british-museumbm-obj:EOC3130
Statements and Patterns
• For one edge in a graph:
bm-obj:EOC3130
crm:P52_has_current_owner
bm-id:the-british-museum
• We can declare/retrieve one (N)Triple:
bm-obj:EOC3130
Statements and Patterns
• For one edge in a graph:
bm-obj:EOC3130
crm:P52_has_current_owner
bm-id:the-british-museum
• We can declare/retrieve one (N)Triple:
• Or write this in Turtle:
bm-obj:EOC3130
@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:
bm-obj:EOC3130
crm:P52_has_current_owner
bm-id:the-british-museum
• We can write this in Turtle:
• And check for it in SPARQL:
bm-obj:EOC3130
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:
crm:P51_has_former_or_current_owner
?
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 bythen 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
?
?
• 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,– 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*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 queryhaving 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• A ‘native graph’ database indexes the
graph in a different way, supporting
traversal-oriented queries
Exercise
Double click
Exercise
Double click

Mais conteúdo relacionado

Semelhante a Querying Cultural Heritage

Mon norton tut_querying cultural heritage data
Mon norton tut_querying cultural heritage dataMon norton tut_querying cultural heritage data
Mon norton tut_querying cultural heritage data
eswcsummerschool
 
Hippo get together presentation solr integration
Hippo get together presentation   solr integrationHippo get together presentation   solr integration
Hippo get together presentation solr integration
Hippo
 
What's New and Cooking in Open Babel 2.3.2
What's New and Cooking in Open Babel 2.3.2What's New and Cooking in Open Babel 2.3.2
What's New and Cooking in Open Babel 2.3.2
baoilleach
 

Semelhante a Querying Cultural Heritage (20)

Mon norton tut_querying cultural heritage data
Mon norton tut_querying cultural heritage dataMon norton tut_querying cultural heritage data
Mon norton tut_querying cultural heritage data
 
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)
 
Hippo get together presentation solr integration
Hippo get together presentation   solr integrationHippo get together presentation   solr integration
Hippo get together presentation solr integration
 
127 Ch 2: Stack overflows on Linux
127 Ch 2: Stack overflows on Linux127 Ch 2: Stack overflows on Linux
127 Ch 2: Stack overflows on Linux
 
EKAW - Triple Pattern Fragments
EKAW - Triple Pattern FragmentsEKAW - Triple Pattern Fragments
EKAW - Triple Pattern Fragments
 
CNIT 127: Ch 2: Stack overflows on Linux
CNIT 127: Ch 2: Stack overflows on LinuxCNIT 127: Ch 2: Stack overflows on Linux
CNIT 127: Ch 2: Stack overflows on Linux
 
Java Memory Analysis: Problems and Solutions
Java Memory Analysis: Problems and SolutionsJava Memory Analysis: Problems and Solutions
Java Memory Analysis: Problems and Solutions
 
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
 
What's New and Cooking in Open Babel 2.3.2
What's New and Cooking in Open Babel 2.3.2What's New and Cooking in Open Babel 2.3.2
What's New and Cooking in Open Babel 2.3.2
 
BioSD Tutorial 2014 Editition
BioSD Tutorial 2014 EdititionBioSD Tutorial 2014 Editition
BioSD Tutorial 2014 Editition
 
(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)
 
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...
 
Automating materials science workflows with pymatgen, FireWorks, and atomate
Automating materials science workflows with pymatgen, FireWorks, and atomateAutomating materials science workflows with pymatgen, FireWorks, and atomate
Automating materials science workflows with pymatgen, FireWorks, and atomate
 
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
 
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
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
 
Return Oriented Programming
Return Oriented ProgrammingReturn Oriented Programming
Return Oriented Programming
 
Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)Managing Memory in Swift (Yes, that's a thing)
Managing Memory in Swift (Yes, that's a thing)
 

Mais de Barry Norton

A Data API with Security and Graph-Level Access Control
A Data API with Security and Graph-Level Access ControlA Data API with Security and Graph-Level Access Control
A Data API with Security and Graph-Level Access Control
Barry Norton
 
Geospatial Linked Open Services
Geospatial Linked Open ServicesGeospatial Linked Open Services
Geospatial Linked Open Services
Barry Norton
 

Mais de Barry Norton (16)

Knowledge Graphs and Milestone
Knowledge Graphs and MilestoneKnowledge Graphs and Milestone
Knowledge Graphs and Milestone
 
ResearchSpace Platform in Use
ResearchSpace Platform in UseResearchSpace Platform in Use
ResearchSpace Platform in Use
 
GRAVITATE Search
GRAVITATE SearchGRAVITATE Search
GRAVITATE Search
 
ResearchSpace Collaborative Features
ResearchSpace Collaborative FeaturesResearchSpace Collaborative Features
ResearchSpace Collaborative Features
 
Book of the Dead Project
Book of the Dead ProjectBook of the Dead Project
Book of the Dead Project
 
Data Culture / Culture Data
Data Culture / Culture DataData Culture / Culture Data
Data Culture / Culture Data
 
A Data API with Security and Graph-Level Access Control
A Data API with Security and Graph-Level Access ControlA Data API with Security and Graph-Level Access Control
A Data API with Security and Graph-Level Access Control
 
GLAMorous LOD and ResearchSpace introduction
GLAMorous LOD and ResearchSpace introductionGLAMorous LOD and ResearchSpace introduction
GLAMorous LOD and ResearchSpace introduction
 
GLAMorous LOD
GLAMorous LODGLAMorous LOD
GLAMorous LOD
 
Linked Data, Ontologies and Inference
Linked Data, Ontologies and InferenceLinked Data, Ontologies and Inference
Linked Data, Ontologies and Inference
 
Integrating Drupal with a Triple Store
Integrating Drupal with a Triple StoreIntegrating Drupal with a Triple Store
Integrating Drupal with a Triple Store
 
Crowdsourcing tasks in Linked Data management
Crowdsourcing tasks in Linked Data managementCrowdsourcing tasks in Linked Data management
Crowdsourcing tasks in Linked Data management
 
Linked Data and Services
Linked Data and ServicesLinked Data and Services
Linked Data and Services
 
Towards Linked Open Services and Processes
Towards Linked Open Services and ProcessesTowards Linked Open Services and Processes
Towards Linked Open Services and Processes
 
Geospatial Linked Open Services
Geospatial Linked Open ServicesGeospatial Linked Open Services
Geospatial Linked Open Services
 
Linked Open Services @ SemData2010
Linked Open Services @ SemData2010Linked Open Services @ SemData2010
Linked Open Services @ SemData2010
 

Último

💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
nirzagarg
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 

Último (20)

Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
Wadgaon Sheri $ Call Girls Pune 10k @ I'm VIP Independent Escorts Girls 80057...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 

Querying Cultural Heritage

  • 1. Querying Cultural Heritage DataCultural 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: bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museumbm-obj:EOC3130
  • 3. Statements and Patterns • For one edge in a graph: bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum • We can declare/retrieve one (N)Triple: bm-obj:EOC3130
  • 4. Statements and Patterns • For one edge in a graph: bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum • We can declare/retrieve one (N)Triple: • Or write this in Turtle: bm-obj:EOC3130 @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: bm-obj:EOC3130 crm:P52_has_current_owner bm-id:the-british-museum • We can write this in Turtle: • And check for it in SPARQL: bm-obj:EOC3130 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: crm:P51_has_former_or_current_owner ? 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 bythen 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 ? ? • 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,– 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*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 queryhaving 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• A ‘native graph’ database indexes the graph in a different way, supporting traversal-oriented queries