Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 1 (ICWE 2012 Ed.)
Upcoming SlideShare
Loading in...5
×
 

Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 1 (ICWE 2012 Ed.)

on

  • 3,106 views

These are the slides from my ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data"

These are the slides from my ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data"

Statistics

Views

Total Views
3,106
Views on SlideShare
3,089
Embed Views
17

Actions

Likes
5
Downloads
96
Comments
0

2 Embeds 17

http://www.linkedin.com 15
https://si0.twimg.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 1 (ICWE 2012 Ed.) Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 1 (ICWE 2012 Ed.) Presentation Transcript

  • ICWE 2012 TutorialAn Introduction to SPARQL and Queries over Linked Data ●●●Chapter 1: Linked Data and RDF Olaf Hartig http://olafhartig.de/foaf.rdf#olaf @olafhartig Database and Information Systems Research Group Humboldt-Universität zu Berlin
  • Outline Chapter 1: Linked Data and RDF Chapter 2: The SPARQL Query Language Chapter 3: Querying Linked Data on the Web http://olafhartig.de/icwe.htmlOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 2
  • Chapter 1  Motivation  Technical Foundations  The Web of Linked Data http://olafhartig.de/icwe.htmlOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 3
  • The Traditional Web Traditional Web = Internet + Docs + LinksOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 4
  • The Traditional Web So what is the problem?Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 5
  • The Traditional Web So what is the problem? ● Web content is only loosely structured ● Difficult for applications to do smart thingsOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 6
  • The Traditional Web So what is the problem? ● Web content is only loosely structured ● Difficult for applications to do smart things Solution: ● Increase the structure of Web content ● Publish dataOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 7
  • The Traditional Web So what is the problem? ● Web content is only loosely structured ● Difficult for applications to do smart things Solution: ● Increase the structure of Web content ● Publish data But wait… dont we do that already?Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 8
  • The Traditional Web ● Content providers offer access via Web APIs ● Mashups combine this data Web API Web API Web API Web APIOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 9
  • The Traditional Web ● Content providers offer access via Web APIs ● Mashups combine this data Shortcomings: ● APIs are proprietary ● Mashups are based on a fixed set of data sources Web API ● YouWeb API can not set hyperlinks between data object Web API Web APIOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 10
  • Chapter 1  Motivation  Technical Foundations  The Web of Linked Data http://olafhartig.de/icwe.htmlOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 11
  • Technical Foundations There is no magic – Linked Data is based on well-established (Semantic) Web technologies. ● RDF as shared data model ● HTTP to access data on the Web ● URIs ● Globally unique identifiers for entities ● Pointers to data ● HyperlinksOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 12
  • RDF in General ● Resource Description Framework (RDF) ● A resource is basically everything ● E.g. persons, places, Web documents, abstract concepts ● Descriptions of resources ● Attributes ● Relations ● The framework contains: ● A data model, and ● Languages and syntaxesOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 13
  • RDF Data Model ● Data comes as a set of triples (subject, predicate, object) ● Subject: resources ● Predicate: properties ● Object: literals or resources ● Examples: ● ( Mount Baker , last eruption , 1880 ) ● ( Mount Baker , location , Washington )Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 14
  • RDF Data Model ● RDF is also a graph model ● Triples as directed edges ● Subjects and objects as vertices ● Edges labeled by predicate ● Example: ● ( Mount Baker , last eruption , 1880 ) ● ( Mount Baker , location , Washington ) location Mount Baker Washington last eruption 1880Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 15
  • Uniform Resource Identifier (URI) ● URIs extend the concept of URLs ● Globally unique identifier for resources ● URL of a Web document usually used as its URI ● Attention: URIs identify not only Web documents ● Example: ● Me: http://olafhartig.de/~hartig/foaf.rdf#olaf ● RDF document about me: http://olafhartig.de/~hartig/foaf.rdf ● HTML document about me: http://olafhartig.de/~hartig/index.htmlOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 16
  • Example (revisited) ● (http://dbpedia.org/resource/Mount_Baker, http://dbpedia.org/property/lastEruption, 1880) ● (http://dbpedia.org/resource/Mount_Baker, http://dbpedia.org/property/location, http://dbpedia.org/resource/Washington) http://dbpedia.org/resource/Washington http://dbpedia.org/property/location http://dbpedia.org/resource/Mount_Baker http://dbpedia.org/property/lastEruption 1880Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 17
  • Compact URIs (CURIE) ● Abbreviated Notation for URIs ● Syntax: ● Prefix name (references the prefix of the URI) ● Colon character (“:”) ● Reference part ● URI by concatenating the prefix and the reference part ● Examples: ● dbpedia:Mount_Baker for http://dbpedia.org/resource/Mount_Baker ● myfoaf:olaf for http://olafhartig.de/~hartig/foaf.rdf#olafOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 18
  • Example with CURIEs ● Using ● dbpedia for prefix http://dbpedia.org/resource/ ● p for prefix http://dbpedia.org/property/ ● we have ● (dbpedia:Mount_Baker, p:lastEruption, 1880) ● (dbpedia:Mount_Baker, p:location, dbpedia:Washington) p:location dbpedia:Mount_Baker dbpedia:Washington p:lastEruption 1880Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 19
  • Literals ● Literals may occur in the object position of triples ● Represented by strings ● Literal strings interpreted by datatypes ● Datatype identified by a URI ● Common to use the XML Schema datatypes ● No datatype: interpreted as xsd:string ● Untyped literals may have language tags (e.g. @de) p:name dbpedia:Mount_Baker "Mount Baker"@en p:lastEruption "1880"^^xsd:integerOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 20
  • Turtle – A Readable Syntax for RDF ● Simple, human-readable notation to list RDF triples: ● Triples separated by a period (“.”) character ● Example: <http://dbpedia.org/resource/Mount_Baker> <http://dbpedia.org/resource/Mount_Baker> <http://dbpedia.org/property/lastEruption> <http://dbpedia.org/property/lastEruption> "1880"^^xsd:integer . "1880"^^xsd:integer . <http://dbpedia.org/resource/Mount_Baker> <http://dbpedia.org/resource/Mount_Baker> <http://dbpedia.org/property/location> <http://dbpedia.org/property/location> <http://dbpedia.org/resource/Washington> . <http://dbpedia.org/resource/Washington> .Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 21
  • Turtle – A Readable Syntax for RDF ● Turtle supports the use of CURIEs: ● @prefix directive binds a prefix to a namespace URI @prefix @prefix dbpedia : <http://dbpedia.org/resource/> . dbpedia : <http://dbpedia.org/resource/> . @prefix @prefix p : <http://dbpedia.org/property/> . p : <http://dbpedia.org/property/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . dbpedia:Mount_Baker dbpedia:Mount_Baker p:lastEruption p:lastEruption "1880"^^xsd:integer . "1880"^^xsd:integer . dbpedia:Mount_Baker dbpedia:Mount_Baker p:location p:location dbpedia:Washington . dbpedia:Washington . dbpedia:Washington dbpedia:Washington p:borderingstates p:borderingstates dbpedia:Oregon . dbpedia:Oregon . dbpedia:Washington dbpedia:Washington p:borderingstates p:borderingstates dbpedia:Idaho . dbpedia:Idaho .Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 22
  • Turtle – A Readable Syntax for RDF ● Turtle provides some syntactic sugar: ● Property lists separated by a semicolon (“;”) character ● Object lists separated by a comma (“,”) character @prefix @prefix dbpedia : <http://dbpedia.org/resource/> . dbpedia : <http://dbpedia.org/resource/> . @prefix @prefix p : <http://dbpedia.org/property/> . p : <http://dbpedia.org/property/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . dbpedia:Mount_Baker p:lastEruption "1880"^^xsd:integer ; dbpedia:Mount_Baker p:lastEruption "1880"^^xsd:integer ; p:location p:location dbpedia:Washington . dbpedia:Washington . dbpedia:Washington p:borderingstates dbpedia:Oregon , dbpedia:Washington p:borderingstates dbpedia:Oregon , dbpedia:Idaho . dbpedia:Idaho .Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 23
  • Turtle – A Readable Syntax for RDF ● More syntactic sugar: ● Shortcuts for number literals dbpedia:Mount_Baker p:lastEruption "1880"^^xsd:integer ; dbpedia:Mount_Baker p:lastEruption "1880"^^xsd:integer ; geo:lat "48.777222"^^xsd:float ; geo:lat "48.777222"^^xsd:float ; geo:long "-121.813332"^^xsd:float . geo:long "-121.813332"^^xsd:float . Equivalent: dbpedia:Mount_Baker p:lastEruption 1880 ; dbpedia:Mount_Baker p:lastEruption 1880 ; geo:lat 48.777222 ; geo:lat 48.777222 ; geo:long -121.813332 . geo:long -121.813332 .Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 24
  • RDF/XML – An XML syntax for RDF @prefix dbpedia : <http://dbpedia.org/resource/> . @prefix dbpedia : <http://dbpedia.org/resource/> . Turtle @prefix p : <http://dbpedia.org/property/> . @prefix p : <http://dbpedia.org/property/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . dbpedia:Mount_Baker p:lastEruption "1880"^^xsd:integer . dbpedia:Mount_Baker p:lastEruption "1880"^^xsd:integer . dbpedia:Mount_Baker p:location dbpedia:Mount_Baker p:location dbpedia:Washington . dbpedia:Washington . <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:p="http://dbpedia.org/property/"> xmlns:p="http://dbpedia.org/property/"> <rdf:Description rdf:about="http://dbpedia.org/resource/Mount_Baker"> <rdf:Description rdf:about="http://dbpedia.org/resource/Mount_Baker"> <p:lastEruption ‣ <p:lastEruption ‣ rdf:datatype="http://www.w3.org/2001/XMLSchema#integer" ‣ rdf:datatype="http://www.w3.org/2001/XMLSchema#integer" ‣ >1880</p:lastEruption> >1880</p:lastEruption> <p:location rdf:resource="http://dbpedia.org/resource/Washington"/> <p:location rdf:resource="http://dbpedia.org/resource/Washington"/> </rdf:Description> </rdf:Description> </rdf:RDF> </rdf:RDF> RDF/XMLOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 25
  • Blank Nodes myfoaf:olaf ● Blank nodes represent unnamed, anonymous resources wot:hasKey ● Not identified by a URI rdf:type ● Blank node identifiers wot:PubKey ● Identification of blank nodes in triple serializations wot:hex_id ● Form: _:xyz "E27D37D7" ● Scope: a single RDF graph myfoaf:olaf wot:hasKey [ rdf:type myfoaf:olaf wot:hasKey [ rdf:type wot:PubKey wot:PubKey ; ; wot:hex_id wot:hex_id "E27D37D7" "E27D37D7" ] . ] . myfoaf:olaf wot:hasKey _:x . myfoaf:olaf wot:hasKey _:x . _:x rdf:type _:x rdf:type wot:PubKey ; wot:PubKey ; wot:hex_id "E27D37D7" . wot:hex_id "E27D37D7" .Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 26
  • Vocabularies and Ontologies ● Defined using RDFS or OWL ● A plenty of vocabularies exist: ● People ● Social media ● Commerce ● Events ● Radio and TV programmes ● Music etc.Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 27
  • Chapter 1  Motivation  Technical Foundations  The Web of Linked Data http://olafhartig.de/icwe.htmlOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 28
  • ● Use URIs as names for things ● Use HTTP URIs so that people can look up those names. http://m ● When someone looks up a ymovie URI, provide useful information. ? .d b/movie ● Include links to other URIs so that they can discover more 2449 things. Tim Berners-Lee, July 2006 http://mymovie.db/movie1342 http://mymovie.db/movie0362 http://geo.db/country21 http://geo.db/country7 http://mymovie.db/movie5112 My Movie DB http://geo.db/cityCJ http://geo.db/cityXA http://mymovie.db/movie2449Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 29
  • Linked Data – An Example http://data.linkedmdb.org/.../2014Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 30
  • Linked Data – An Example http://data.linkedmdb.org/.../2014 rdf:type http://data.linkedmdb.org/.../film mov ie:re dc fo late dB o af :t ok itle :b as ed http://www4.wi … /0743424425 _n The Shining ea r http://sws.geonames.org/2635167/Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 31
  • Linked Data – An Example http://data.linkedmdb.org/.../2014 rdf:type http://data.linkedmdb.org/.../film mov ie:re dc fo late dB o af :t ok itle :b as ed http://www4.wi … /0743424425 _n The Shining ea r http://sws.geonames.org/2635167/ n atio l be o pu l n:p :la g s rdf 60943000 United KingdomOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 32
  • Linked Data – An Example http://data.linkedmdb.org/.../2014 rdf:type http://data.linkedmdb.org/.../film mov ie:re dc fo late dB o af :t ok itle :b as ed http://www4.wi … /0743424425 dc: title _n The Shining ea r http://sws.geonames.org/2635167/ The Shining sko s:s n atio l be pu l ub o n:p :la g je s ct rdf 60943000 United Kingdom http://www4.wi … /FictionOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 33
  • Linked Data – An Example http://data.linkedmdb.org/.../2014 rdf:type http://data.linkedmdb.org/.../film mov ie:re dc fo late dB o af :t ok itle :b as ed http://www4.wi … /0743424425 dc: title _n The Shining ea r http://sws.geonames.org/2635167/ The Shining sko s:s n atio l be pu l ub o n:p :la g je s ct rdf 60943000 United Kingdom http://www4.wi … /Fiction http://www4.wi … /1571884029 t skos:subjecOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 34
  • Linked Data – An Example http://data.linkedmdb.org/.../2014 rdf:type http://data.linkedmdb.org/.../film mov ie:re dc fo late dB o af :t ok itle :b as ed http://www4.wi … /0743424425 dc: title _n The Shining ea Is this real? r http://sws.geonames.org/2635167/ The Shining sko s:s n atio l be pu l ub o n:p :la g je s ct rdf 60943000 United Kingdom http://www4.wi … /Fiction http://www4.wi … /1571884029 t skos:subjecOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 35
  • W3C Linking Open Data Project ● Grassroots community effort ● Publish existing, open license datasets as Linked Data ● Interlink things between different data sourcesOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 36
  • W3C Linking Open Data Project As of July 2007Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 37
  • W3C Linking Open Data ProjectOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 38
  • Linked Data Publishers ● UK government ● US government ● Thomson Reuters (Open Calais) ● MetaWeb (Freebase) ● BBC ● NY Times ● Best Buy ● CNET etc.Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 39
  • Outline Chapter 1: Linked Data and RDF Chapter 2: The SPARQL Query Language Chapter 3: Querying Linked Data on the Web http://olafhartig.de/icwe.htmlOlaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 40
  • These slides have been created by Olaf Hartig http://olafhartig.de Some of the slides in the motivations section are inspired by similar slides from Chris Bizer and from Juan Sequeda. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/)Olaf Hartig - ICWE 2012 Tutorial "An Introduction to SPARQL and Queries over Linked Data" - Chapter 1: Linked Data and RDF 41