SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
Introduction to SPARQL

Introduction to SPARQL
Overview
•
•
•
•
•
•
•
•

What is SPARQL?
ASK and SELECT query forms
UNION and ORDER BY
Subsets of results
FILTER expressions and functions
OPTIONAL
DESCRIBE and CONSTRUCT query forms
Common problems

Introduction to SPARQL

#2
What is SPARQL?
• SPARQL is a query language for RDF data
– http://www.w3.org/TR/rdf-sparql-query/

• It is also a protocol
• It is designed around graph patterns
– Graph patterns use Turtle syntax

• SPARQL 1.0 is query only
– SPARQL 1.1 (covered next, not yet a recommendation) includes
syntax for updates

Introduction to SPARQL

#3
Ask
• Did 'Steve Hillage' make the album 'Fish Rising'?
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
ASK { dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title "Fish Rising" . }

• Namespaces are added with 'PREFIX' directive
• Statement patterns that make up the graph are
between {} brackets

Introduction to SPARQL

#4
Select
• What albums and tracks did 'Steve Hillage' make?
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

SELECT ?album_name ?track_title
WHERE {
dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title ?album_name.
?album music-ont:track ?track .
?track dc:title ?track_title . }

• All variables in a query can be selected with '*'
– i.e. SELECT * WHERE { … }

Introduction to SPARQL

#5
Union
• 'Steve Hillage' and 'Jimi Hendrix'?
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

SELECT ?album_name ?track_title
WHERE
{
{
dbpedia:Steve_Hillage foaf:made ?album .
}
UNION
{
dbpedia:Jimi_Hendrix foaf:made ?album .
}
?album dc:title ?album_name.
?album music-ont:track ?track .
?track dc:title ?track_title .
}

Introduction to SPARQL

#6
Order By
• In what order did 'Steve Hillage' release his albums?
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

SELECT distinct ?album_name ?date
WHERE
{
dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title ?album_name.
?album music-ont:track ?track .
?album dc:date ?date.
} ORDER BY( ?date)

Introduction to SPARQL

#7
Subsets of results
• What albums and tracks did 'Steve Hillage' make?
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

SELECT ?album_name ?track_title
WHERE {
dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title ?album_name.
?album music-ont:track ?track .
?track dc:title ?track_title . }
OFFSET 10
LIMIT 15

• Start after the 10th solution, provide (up to) 15 more
Introduction to SPARQL

#8
Filtering solutions
• What are 'Steve Hillage' longer tracks?
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

SELECT ?album_name ?track_title ?duration
WHERE {
dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title ?album_name.
?album music-ont:track ?track .
?track dc:title ?track_title .
?track music-ont:duration ?duration .
FILTER( ?duration > 500000 ).
}

• Allow only those solutions where the track length is
more than 500 seconds
Introduction to SPARQL

#9
Functions
• What albums and tracks did 'Steve Hillage' make?
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

SELECT ?album_name ?track_title
WHERE {
dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title ?album_name.
?album music-ont:track ?track .
?track dc:title ?track_title .
FILTER( REGEX( ?track_title, "hurd.*", "i") ) }

• Allow only those solutions where the track title
contains a substring that begins with 'hurd' in any case
Introduction to SPARQL

#10
Filter expressions
• Can be combined with logical, arithmetic, casts and
comparisons, e.g.
FILTER( ?age < 30 && xsd:double(?weight) < (?empty + ?fuel) )

• Also tests, accessors, e.g.
FILTER( isURI( ?id ) && datatype( ?age ) = xsd:double )

Introduction to SPARQL

#11
Optionals
• Parts of the matching graph can be optional
• Use OPTIONAL {} to enclose the optional parts
• Can test in filter expressions if variable are bound
• Using logical NOT '!' it is possible to filter out
solutions for the optional part

Introduction to SPARQL

#12
Optionals
• Albums from artists who are not dead
PREFIX
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>
dbp-ont: <http://dbpedia.org/ontology/>

SELECT distinct ?artist_name ?album_name ?place_of_death
WHERE {
?artist foaf:made ?album .
?artist foaf:name ?artist_name .
?album dc:title ?album_name.
?album music-ont:track ?track .
?track dc:title ?track_title .
OPTIONAL { ?artist dbp-ont:deathPlace ?place_of_death }
FILTER( ! BOUND( ?place_of_death ) ).
}
Introduction to SPARQL

#13
Describe
• Returns RDF statements about any resource
identified by the query
PREFIX dbpedia: <http://dbpedia.org/resource/>
DESCRIBE dbpedia:Steve_Hillage

PREFIX foaf:
<http://xmlns.com/foaf/0.1/>
DESCRIBE ?x ?y <http://example.org/>
WHERE
{?x foaf:knows ?y}

Introduction to SPARQL

#14
Construct
• Returns RDF statements created from variable
bindings
PREFIX
PREFIX
PREFIX
PREFIX

dc: <http://purl.org/dc/elements/1.1/>
foaf: <http://xmlns.com/foaf/0.1/>
dbpedia: <http://dbpedia.org/resource/>
music-ont: <http://purl.org/ontology/mo/>

CONSTRUCT { ?album dc:creator dbpedia:Steve_Hillage }
WHERE {
dbpedia:Steve_Hillage foaf:made ?album .
?album dc:title ?album_name.
?album music-ont:track ?track . }

Introduction to SPARQL

#15
Common Problems
• Spelling mistakes in identifiers are not noticed
– It is simply a different URI
– URIs are LONG, are case-sensitive, have '#' or '/' for local part

• Easy to use the right local name with the wrong
namespace
• Literals are compared on type, language and value
– "Steve Hillage"@EN is not the same as "Steve Hillage"
– "3" is not the same as "3"^^xsd:integer

Introduction to SPARQL

#16
Summary
• SPARQL is a powerful query language for RDF
• SPARQL 1.0 is read-only
• SPARQL 1.1 will allow updates

Introduction to SPARQL

#17

Más contenido relacionado

La actualidad más candente

AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...
AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...
AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...Amazon Web Services
 
SPARQL in a nutshell
SPARQL in a nutshellSPARQL in a nutshell
SPARQL in a nutshellFabien Gandon
 
Drupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDrupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDavid Peterson
 
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍Covenant Ko
 
Backup recovery with PostgreSQL
Backup recovery with PostgreSQLBackup recovery with PostgreSQL
Backup recovery with PostgreSQLFederico Campoli
 

La actualidad más candente (7)

AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...
AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...
AWS Webcast - Data Modeling and Best Practices for Scaling your Application w...
 
Graph Modelling
Graph ModellingGraph Modelling
Graph Modelling
 
SPARQL in a nutshell
SPARQL in a nutshellSPARQL in a nutshell
SPARQL in a nutshell
 
Primary analysis tutorial depracated
Primary analysis tutorial depracatedPrimary analysis tutorial depracated
Primary analysis tutorial depracated
 
Drupal case study: ABC Dig Music
Drupal case study: ABC Dig MusicDrupal case study: ABC Dig Music
Drupal case study: ABC Dig Music
 
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
떠먹는 '오브젝트' Ch02 객체지향 프로그래밍
 
Backup recovery with PostgreSQL
Backup recovery with PostgreSQLBackup recovery with PostgreSQL
Backup recovery with PostgreSQL
 

Destacado

ESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data Tutorial
ESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data TutorialESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data Tutorial
ESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data Tutorialeswcsummerschool
 
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked dataESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked dataeswcsummerschool
 
Programming with LOD
Programming with LODProgramming with LOD
Programming with LODFumihiro Kato
 
Semantics, Sensors, and the Social Web
Semantics, Sensors, and the Social WebSemantics, Sensors, and the Social Web
Semantics, Sensors, and the Social WebThe Open University
 
DAA Keynote- 99 Amazing Big Data Experiences
DAA Keynote- 99 Amazing Big Data ExperiencesDAA Keynote- 99 Amazing Big Data Experiences
DAA Keynote- 99 Amazing Big Data ExperiencesOxford Tech + UX
 
Mapping Lo Dto Proton Revised [Compatibility Mode]
Mapping Lo Dto Proton Revised [Compatibility Mode]Mapping Lo Dto Proton Revised [Compatibility Mode]
Mapping Lo Dto Proton Revised [Compatibility Mode]Mariana Damova, Ph.D
 

Destacado (7)

ESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data Tutorial
ESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data TutorialESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data Tutorial
ESWC SS 2012 - Friday Keynote Marko Grobelnik: Big Data Tutorial
 
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked dataESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
ESWC SS 2013 - Thursday Keynote Vassilis Christophides: Preserving linked data
 
Programming with LOD
Programming with LODProgramming with LOD
Programming with LOD
 
Semantics, Sensors, and the Social Web
Semantics, Sensors, and the Social WebSemantics, Sensors, and the Social Web
Semantics, Sensors, and the Social Web
 
IndustryInform Service of Mozaika
IndustryInform Service of MozaikaIndustryInform Service of Mozaika
IndustryInform Service of Mozaika
 
DAA Keynote- 99 Amazing Big Data Experiences
DAA Keynote- 99 Amazing Big Data ExperiencesDAA Keynote- 99 Amazing Big Data Experiences
DAA Keynote- 99 Amazing Big Data Experiences
 
Mapping Lo Dto Proton Revised [Compatibility Mode]
Mapping Lo Dto Proton Revised [Compatibility Mode]Mapping Lo Dto Proton Revised [Compatibility Mode]
Mapping Lo Dto Proton Revised [Compatibility Mode]
 

Similar a ESWC SS 2012 - Monday Tutorial 2 Barry Norton: Introduction to SPARQL

Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02eswcsummerschool
 
Querying Linked Data on Android
Querying Linked Data on AndroidQuerying Linked Data on Android
Querying Linked Data on AndroidEUCLID project
 
SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)andyseaborne
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLMyungjin Lee
 
ESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query Language
ESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query LanguageESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query Language
ESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query Languageeswcsummerschool
 
NoSQL and Triple Stores
NoSQL and Triple StoresNoSQL and Triple Stores
NoSQL and Triple Storesandyseaborne
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLEmanuele Della Valle
 
Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...
Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...
Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...ALATechSource
 
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...Allison Jai O'Dell
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQLPedro Szekely
 
Mon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked dataMon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked dataeswcsummerschool
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialAdonisDamian
 
Intro to Linked, Dutch Ships and Sailors and SPARQL handson
Intro to Linked, Dutch Ships and Sailors and SPARQL handson Intro to Linked, Dutch Ships and Sailors and SPARQL handson
Intro to Linked, Dutch Ships and Sailors and SPARQL handson Victor de Boer
 

Similar a ESWC SS 2012 - Monday Tutorial 2 Barry Norton: Introduction to SPARQL (20)

Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02Mon norton tut_queryinglinkeddata02
Mon norton tut_queryinglinkeddata02
 
Querying Linked Data
Querying Linked DataQuerying Linked Data
Querying Linked Data
 
Querying Linked Data on Android
Querying Linked Data on AndroidQuerying Linked Data on Android
Querying Linked Data on Android
 
SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
ESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query Language
ESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query LanguageESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query Language
ESWC SS 2012 - Monday Tutorial 2 Barry Norton: SPARQL 1.1 Query Language
 
Introduction to Bio SPARQL
Introduction to Bio SPARQL Introduction to Bio SPARQL
Introduction to Bio SPARQL
 
NoSQL and Triple Stores
NoSQL and Triple StoresNoSQL and Triple Stores
NoSQL and Triple Stores
 
Sparql
SparqlSparql
Sparql
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQL
 
Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...
Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...
Snyder Kishimoto: RDA for Music: Popular Music, Jazz, and World Music Audio R...
 
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Mon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked dataMon fundulaki tut_querying linked data
Mon fundulaki tut_querying linked data
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
Semantic Web
Semantic WebSemantic Web
Semantic Web
 
Semantic Web
Semantic WebSemantic Web
Semantic Web
 
Intro to Linked, Dutch Ships and Sailors and SPARQL handson
Intro to Linked, Dutch Ships and Sailors and SPARQL handson Intro to Linked, Dutch Ships and Sailors and SPARQL handson
Intro to Linked, Dutch Ships and Sailors and SPARQL handson
 

Más 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
 
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 dataeswcsummerschool
 
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 domingue key_introduction to semantic
Mon domingue key_introduction to semanticMon domingue key_introduction to semantic
Mon domingue key_introduction to semanticeswcsummerschool
 
Tue acosta tut_providing_linkeddata
Tue acosta tut_providing_linkeddataTue acosta tut_providing_linkeddata
Tue acosta tut_providing_linkeddataeswcsummerschool
 

Más 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
 
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
 
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 domingue key_introduction to semantic
Mon domingue key_introduction to semanticMon domingue key_introduction to semantic
Mon domingue key_introduction to semantic
 
Tue acosta tut_providing_linkeddata
Tue acosta tut_providing_linkeddataTue acosta tut_providing_linkeddata
Tue acosta tut_providing_linkeddata
 

Último

MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...lizamodels9
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyEthan lee
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfAmzadHosen3
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...amitlee9823
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Roland Driesen
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 

Último (20)

MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
John Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdfJohn Halpern sued for sexual assault.pdf
John Halpern sued for sexual assault.pdf
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 

ESWC SS 2012 - Monday Tutorial 2 Barry Norton: Introduction to SPARQL

  • 2. Overview • • • • • • • • What is SPARQL? ASK and SELECT query forms UNION and ORDER BY Subsets of results FILTER expressions and functions OPTIONAL DESCRIBE and CONSTRUCT query forms Common problems Introduction to SPARQL #2
  • 3. What is SPARQL? • SPARQL is a query language for RDF data – http://www.w3.org/TR/rdf-sparql-query/ • It is also a protocol • It is designed around graph patterns – Graph patterns use Turtle syntax • SPARQL 1.0 is query only – SPARQL 1.1 (covered next, not yet a recommendation) includes syntax for updates Introduction to SPARQL #3
  • 4. Ask • Did 'Steve Hillage' make the album 'Fish Rising'? PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dbpedia: <http://dbpedia.org/resource/> ASK { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title "Fish Rising" . } • Namespaces are added with 'PREFIX' directive • Statement patterns that make up the graph are between {} brackets Introduction to SPARQL #4
  • 5. Select • What albums and tracks did 'Steve Hillage' make? PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title WHERE { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title ?album_name. ?album music-ont:track ?track . ?track dc:title ?track_title . } • All variables in a query can be selected with '*' – i.e. SELECT * WHERE { … } Introduction to SPARQL #5
  • 6. Union • 'Steve Hillage' and 'Jimi Hendrix'? PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title WHERE { { dbpedia:Steve_Hillage foaf:made ?album . } UNION { dbpedia:Jimi_Hendrix foaf:made ?album . } ?album dc:title ?album_name. ?album music-ont:track ?track . ?track dc:title ?track_title . } Introduction to SPARQL #6
  • 7. Order By • In what order did 'Steve Hillage' release his albums? PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> SELECT distinct ?album_name ?date WHERE { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title ?album_name. ?album music-ont:track ?track . ?album dc:date ?date. } ORDER BY( ?date) Introduction to SPARQL #7
  • 8. Subsets of results • What albums and tracks did 'Steve Hillage' make? PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title WHERE { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title ?album_name. ?album music-ont:track ?track . ?track dc:title ?track_title . } OFFSET 10 LIMIT 15 • Start after the 10th solution, provide (up to) 15 more Introduction to SPARQL #8
  • 9. Filtering solutions • What are 'Steve Hillage' longer tracks? PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title ?duration WHERE { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title ?album_name. ?album music-ont:track ?track . ?track dc:title ?track_title . ?track music-ont:duration ?duration . FILTER( ?duration > 500000 ). } • Allow only those solutions where the track length is more than 500 seconds Introduction to SPARQL #9
  • 10. Functions • What albums and tracks did 'Steve Hillage' make? PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> SELECT ?album_name ?track_title WHERE { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title ?album_name. ?album music-ont:track ?track . ?track dc:title ?track_title . FILTER( REGEX( ?track_title, "hurd.*", "i") ) } • Allow only those solutions where the track title contains a substring that begins with 'hurd' in any case Introduction to SPARQL #10
  • 11. Filter expressions • Can be combined with logical, arithmetic, casts and comparisons, e.g. FILTER( ?age < 30 && xsd:double(?weight) < (?empty + ?fuel) ) • Also tests, accessors, e.g. FILTER( isURI( ?id ) && datatype( ?age ) = xsd:double ) Introduction to SPARQL #11
  • 12. Optionals • Parts of the matching graph can be optional • Use OPTIONAL {} to enclose the optional parts • Can test in filter expressions if variable are bound • Using logical NOT '!' it is possible to filter out solutions for the optional part Introduction to SPARQL #12
  • 13. Optionals • Albums from artists who are not dead PREFIX PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> dbp-ont: <http://dbpedia.org/ontology/> SELECT distinct ?artist_name ?album_name ?place_of_death WHERE { ?artist foaf:made ?album . ?artist foaf:name ?artist_name . ?album dc:title ?album_name. ?album music-ont:track ?track . ?track dc:title ?track_title . OPTIONAL { ?artist dbp-ont:deathPlace ?place_of_death } FILTER( ! BOUND( ?place_of_death ) ). } Introduction to SPARQL #13
  • 14. Describe • Returns RDF statements about any resource identified by the query PREFIX dbpedia: <http://dbpedia.org/resource/> DESCRIBE dbpedia:Steve_Hillage PREFIX foaf: <http://xmlns.com/foaf/0.1/> DESCRIBE ?x ?y <http://example.org/> WHERE {?x foaf:knows ?y} Introduction to SPARQL #14
  • 15. Construct • Returns RDF statements created from variable bindings PREFIX PREFIX PREFIX PREFIX dc: <http://purl.org/dc/elements/1.1/> foaf: <http://xmlns.com/foaf/0.1/> dbpedia: <http://dbpedia.org/resource/> music-ont: <http://purl.org/ontology/mo/> CONSTRUCT { ?album dc:creator dbpedia:Steve_Hillage } WHERE { dbpedia:Steve_Hillage foaf:made ?album . ?album dc:title ?album_name. ?album music-ont:track ?track . } Introduction to SPARQL #15
  • 16. Common Problems • Spelling mistakes in identifiers are not noticed – It is simply a different URI – URIs are LONG, are case-sensitive, have '#' or '/' for local part • Easy to use the right local name with the wrong namespace • Literals are compared on type, language and value – "Steve Hillage"@EN is not the same as "Steve Hillage" – "3" is not the same as "3"^^xsd:integer Introduction to SPARQL #16
  • 17. Summary • SPARQL is a powerful query language for RDF • SPARQL 1.0 is read-only • SPARQL 1.1 will allow updates Introduction to SPARQL #17