0
Linked Data, RDF &
SPARQL
Rob Styles
Senior Technical Consultant




   http://creativecommons.org/licenses/by/2.0/uk/
Tim Berners Lee on Linked Data at TED, By PhOtOnQuAnTiQuE, CC-BY-NC-SA on Flickr, http://www.flickr.com/photos/photonquant...
Linked Data

1. Use URIs as names for things

2. Use HTTP URIs so that people can look up those
   names.

3. When someone...
What is
Linked Data?
What is
The Web of
Documents?
The Web of Documents
A global network of linked documents
A place where anyone can say anything about
anything
A vast coll...
Linked Data

1. Use URIs as names for things

2. Use HTTP URIs so that people can look up those
   names.

3. When someone...
The Web of Documents
A global network of linked documents
A place where anyone can say anything about
anything
A vast coll...
The Web of Data
A global network of linked statements
A place where anyone can say anything about
anything
A vast collecti...
What is RDF?
RDF is ...
Resource Description Framework
http://www.w3.org/RDF/

A simple, powerful, data model
Used to define relationshi...
Allow anyone
to say anything
about anything
http://nssdc.gsfc.nasa.gov/
                                                                        Apollo 11 Command and
...
Apollo 11 Command and
                                                   launchsite   Cape Canaveral
    Service Module


...
Resources...
Represent things on the web, like web pages
Represent things not on the web, like people
and places
Can repre...
Values...
Values can be ‘literal’ values or other resources
Literal values are to work with and show users
Literal values ...
Properties are...
The relationship between Resources
Named using URIs
Described in Schema
(or vocabularies, or ontologies)
Apollo 11 Command and                                        Cape Canaveral,
                        launchsite   Cape Can...
Apollo 11 Command and                                        Cape Canaveral,
                        launchsite   Cape Can...
Subject                 Property       Value

Apollo 11 Command and                                          Cape Canavera...
Subject                 Property       Value

Apollo 11 Command and                                               Cape Can...
Statement or Triple

Subject                 Property       Value

Apollo 11 Command and                                  ...
Statement or Triple

Subject                 Property       Value

Apollo 11 Command and                                  ...
Simple Rules for Merging
URIs name the resources we are describing
Two people using the same URI are describing
the same t...
http://...
Apollo 11 Command and
                                                   launchsite
                           ...
http://...
Apollo 11 Command and
                                                   launchsite
                           ...
Simple Rules for Merging
Graphs from several different sources can be
merged
Resources with the same URI are considered
id...
Any RDF can be
merged with any other
       RDF
RDF...
is a Graph data model
XML is a tree data model
RDBMS is a table data model

can be easily distributed
can be easily...
What does RDF look
       like?
Writing RDF
Turtle
What I’m about to show you

N-Triples
One statement per line, subset of Turtle, grep compatible

RDF/JS...
Turtle (TTL) stands for
Terse Triple Language
Turtle
Terse Triple Language (TTL)
http://www.w3.org/2007/02/turtle/primer/

A human-readable notation for RDF
Provides us...
http://...   a
                                   http://...
        /1969-059A               /Spacecraft




<http://.../...
http://...
/1969-059A




      name     Apollo 11 Command and Service Module




                                        ...
http://...                                  launchsite
                                                                   ...
http://...                                  launchsite
                                                                   ...
http://...                                  launchsite
                                                                   ...
How do I SPARQL?
SPARQL
Query Language for RDF
http://www.w3.org/TR/rdf-sparql-query

SPARQL Protocol and RDF Query Language
Graph pattern ...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Triple Patterns
Triple Patterns

<http://example.com/spacecraft/1957-001B>
  foaf:name "Sputnik 1" .
Triple Patterns

<http://example.com/spacecraft/1957-001B>
  foaf:name "Sputnik 1" .


?something foaf:name "Sputnik 1" .
Triple Patterns

<http://example.com/spacecraft/1957-001B>
  foaf:name "Sputnik 1" .


?something foaf:name "Sputnik 1" .
...
Triple Patterns

<http://example.com/spacecraft/1957-001B>
  foaf:name "Sputnik 1" .


?something foaf:name "Sputnik 1" .
...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Triple Patterns

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>


SELECT ?label WHERE {
  ?something rdfs:label ?lab...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Triple Patterns

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-sch...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Triple Patterns

PREFIX space: <http://purl.org/net/schemas/space/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>


SELECT ?la...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Example Select

PREFIX space: <http://purl.org/net/schemas/space/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns...
Example Select
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
 <head>
  <variable name="subject"/>
  <variable na...
Example Select

PREFIX space: <http://purl.org/net/schemas/space/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Example Query
PREFIX space: <http://purl.org/net/schemas/space/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <ht...
Tip 1: Find all the Properties

SELECT DISTINCT ?p WHERE {

    ?s ?p ?o .

}
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
Tip 2: Find all the Classes

SELECT DISTINCT ?type WHERE {

    ?s a ?type .

}
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
/discipline/
space:Discipline   a                                                 rdfs:label                 Space Physics...
This work is Copyright © 2010 Talis Systems Limited.
It is licensed under the Creative Commons Attribution 3.0 Unported Li...
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Linked Data, Rdf & Sparql
Upcoming SlideShare
Loading in...5
×

Linked Data, Rdf & Sparql

3,727

Published on

A 50 minute introduction to RDF, Linked Data and SPARQL.

Published in: Technology

Transcript of "Linked Data, Rdf & Sparql"

  1. 1. Linked Data, RDF & SPARQL Rob Styles Senior Technical Consultant http://creativecommons.org/licenses/by/2.0/uk/
  2. 2. Tim Berners Lee on Linked Data at TED, By PhOtOnQuAnTiQuE, CC-BY-NC-SA on Flickr, http://www.flickr.com/photos/photonquantique/3272712288/
  3. 3. Linked Data 1. Use URIs as names for things 2. Use HTTP URIs so that people can look up those names. 3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) 4. Include links to other URIs. so that they can discover more things. Sir Tim Berners-Lee, http://www.w3.org/DesignIssues/LinkedData
  4. 4. What is Linked Data?
  5. 5. What is The Web of Documents?
  6. 6. The Web of Documents A global network of linked documents A place where anyone can say anything about anything A vast collection of human-readable knowledge (and opinion) Documents are linked, but links are not qualified
  7. 7. Linked Data 1. Use URIs as names for things 2. Use HTTP URIs so that people can look up those names. 3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) 4. Include links to other URIs. so that they can discover more things. Sir Tim Berners-Lee, http://www.w3.org/DesignIssues/LinkedData
  8. 8. The Web of Documents A global network of linked documents A place where anyone can say anything about anything A vast collection of human-readable knowledge (and opinion) Documents are linked, but links are not qualified
  9. 9. The Web of Data A global network of linked statements A place where anyone can say anything about anything A vast collection of machine-readable knowledge (and opinion) Statements are linked, and links are qualified
  10. 10. What is RDF?
  11. 11. RDF is ... Resource Description Framework http://www.w3.org/RDF/ A simple, powerful, data model Used to define relationships between things Designed to work with the architecture of the web The data model for the Web of Data
  12. 12. Allow anyone to say anything about anything
  13. 13. http://nssdc.gsfc.nasa.gov/ Apollo 11 Command and nmc/spacecraftDisplay.do? about Service Module id=1969-059A title NASA - NSSDC - Spacecraft - Details name Apollo 11 Command and Service Module published 23 November 2009 launched 16 July 1969 size 15702 mass 28801.0 a Web Page a Spacecraft
  14. 14. Apollo 11 Command and launchsite Cape Canaveral Service Module name Apollo 11 Command and Service Module name Cape Canaveral, United States launched 16 July 1969 mass 28801.0 a Spacecraft
  15. 15. Resources... Represent things on the web, like web pages Represent things not on the web, like people and places Can represent anything at all Named using URIs (usually)
  16. 16. Values... Values can be ‘literal’ values or other resources Literal values are to work with and show users Literal values can have specific types (numbers, dates) and language codes (en-gb, cy-gb) Other resources are URIs to follow and find more data
  17. 17. Properties are... The relationship between Resources Named using URIs Described in Schema (or vocabularies, or ontologies)
  18. 18. Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States
  19. 19. Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States
  20. 20. Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States
  21. 21. Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States Subject Property Value
  22. 22. Statement or Triple Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States Subject Property Value
  23. 23. Statement or Triple Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States Subject Property Value Statement or Triple
  24. 24. Simple Rules for Merging URIs name the resources we are describing Two people using the same URI are describing the same thing The same URI in two datasets becomes one URI with all of the properties from both datasets RDF data can use URIs from many different websites
  25. 25. http://... Apollo 11 Command and launchsite http://... Cape Canaveral Service Module /1969-059A /cape+cana... name Apollo 11 Command and Service Module name Cape Canaveral, United States launched 16 July 1969 http://... /cape+cana... mass 28801.0 a http://... Spacecraft /Spacecraft latitude N 28° 27' 31'' longitude W 80° 31' 59''
  26. 26. http://... Apollo 11 Command and launchsite http://... Cape Canaveral Service Module /1969-059A /cape+cana... name Apollo 11 Command and Service Module name Cape Canaveral, United States launched 16 July 1969 latitude N 28° 27' 31'' mass 28801.0 longitude W 80° 31' 59'' a http://... Spacecraft /Spacecraft
  27. 27. Simple Rules for Merging Graphs from several different sources can be merged Resources with the same URI are considered identical No limitations on which graphs can be merged
  28. 28. Any RDF can be merged with any other RDF
  29. 29. RDF... is a Graph data model XML is a tree data model RDBMS is a table data model can be easily distributed can be easily merged allows anyone say anything about anything is not new the spec is from 1999 the idea stems back to the late 1960s
  30. 30. What does RDF look like?
  31. 31. Writing RDF Turtle What I’m about to show you N-Triples One statement per line, subset of Turtle, grep compatible RDF/JSON Useful for AJAX Applications and anything with else JSON support RDFa Writing RDF within HTML pages RDF/XML Machine to Machine Transfer De-facto Standard
  32. 32. Turtle (TTL) stands for Terse Triple Language
  33. 33. Turtle Terse Triple Language (TTL) http://www.w3.org/2007/02/turtle/primer/ A human-readable notation for RDF Provides useful syntax for quickly hand-writing RDF Forms the basis of patterns in SPARQL
  34. 34. http://... a http://... /1969-059A /Spacecraft <http://.../1969-059A> a <http://.../Spacecraft> .
  35. 35. http://... /1969-059A name Apollo 11 Command and Service Module @prefix space: <http://example.com/space-schema/> . launched 16 July 1969 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://example.com/spacecraft/1969-059A> mass 28801.0 a space:Spacecraft ; space:name "Apollo 11 Command and Service Module" ; space:launched "1969-07-16"^^xsd:date ; space:mass 28801.0 . a http://... /Spacecraft
  36. 36. http://... launchsite http://... /1969-059A /cape+cana... name Apollo 11 Command and Service Module name Cape Canaveral, United States @prefix space: <http://example.com/space-schema/> . launched 16 July 1969 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://example.com/spacecraft/1969-059A> mass 28801.0 a space:Spacecraft ; space:name "Apollo 11 Command and Service Module" ; space:launched "1969-07-16"^^xsd:date ; space:mass 28801.0 . a http://... /Spacecraft
  37. 37. http://... launchsite http://... /1969-059A /cape+cana... name Apollo 11 Command and Service Module name Cape Canaveral, United States @prefix space: <http://example.com/space-schema/> . launched 16 July 1969 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://example.com/spacecraft/1969-059A> mass 28801.0 a space:Spacecraft ; space:name "Apollo 11 Command and Service Module" ; space:launched "1969-07-16"^^xsd:date ; space:mass 28801.0 . ; a http://... space:launchsite <http://.../cape+cana...> . /Spacecraft
  38. 38. http://... launchsite http://... /1969-059A /cape+cana... name Apollo 11 Command and Service Module name Cape Canaveral, United States @prefix space: <http://example.com/space-schema/> . launched 16 July 1969 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <http://example.com/spacecraft/1969-059A> mass 28801.0 a space:Spacecraft ; space:name "Apollo 11 Command and Service Module" ; space:launched "1969-07-16"^^xsd:date ; space:mass 28801.0 . ; a http://... space:launchsite <http://.../cape+cana...> . /Spacecraft <http://.../cape+cana...> space:name "Cape Canaveral, United States"@en-us .
  39. 39. How do I SPARQL?
  40. 40. SPARQL Query Language for RDF http://www.w3.org/TR/rdf-sparql-query SPARQL Protocol and RDF Query Language Graph pattern based language written the same as Turtle Several queries — Ask; Select; Describe; Construct Read Only still vulnerable to injection, though not as bad as SQL
  41. 41. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  42. 42. Triple Patterns
  43. 43. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" .
  44. 44. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" .
  45. 45. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" . ?something foaf:name ?name .
  46. 46. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" . ?something foaf:name ?name . SELECT ?name WHERE { ?something foaf:name ?name . }
  47. 47. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  48. 48. Triple Patterns PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label WHERE { ?something rdfs:label ?label . }
  49. 49. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  50. 50. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  51. 51. Triple Patterns PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label WHERE { ?something rdfs:label ?label ; rdf:type space:Discipline . }
  52. 52. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  53. 53. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  54. 54. Triple Patterns PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?launchdate WHERE { ?spacecraft foaf:name “Sputnik 1” . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . }
  55. 55. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  56. 56. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  57. 57. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  58. 58. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  59. 59. Example Select PREFIX space: <http://purl.org/net/schemas/space/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?subject ?label WHERE { ?subject rdfs:label ?label ; a space:Discipline . }
  60. 60. Example Select <sparql xmlns="http://www.w3.org/2005/sparql-results#"> <head> <variable name="subject"/> <variable name="label"/> </head> <results> <result> <binding name="subject"> <uri>http://nasa.dataincubator.org/discipline/astronomy</uri> </binding> <binding name="label"> <literal>Astronomy</literal> </binding> </result> <result> <binding name="subject"> <uri>http://nasa.dataincubator.org/discipline/communications</ uri> </binding> <binding name="label"> <literal>Communications</literal>
  61. 61. Example Select PREFIX space: <http://purl.org/net/schemas/space/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT * WHERE { ?subject rdfs:label ?label ; a space:Discipline . }
  62. 62. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  63. 63. Example Query PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?name ?mass WHERE { ?launch space:launched ?date ; space:spacecraft ?spacecraft . ?spacecraft foaf:name ?name ; space:mass ?mass . FILTER ( ?date >= "1965-01-01"^^xsd:date && ?date <= "1975-12-31"^^xsd:date ) } ORDER BY DESC(?mass) LIMIT 10 OFFSET 10
  64. 64. Tip 1: Find all the Properties SELECT DISTINCT ?p WHERE { ?s ?p ?o . }
  65. 65. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  66. 66. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  67. 67. Tip 2: Find all the Classes SELECT DISTINCT ?type WHERE { ?s a ?type . }
  68. 68. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  69. 69. /discipline/ space:Discipline a rdfs:label Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R /spacecraft/ space:Spacecraft a 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 space:Launch a /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) space:Launchsite a /launchsite/tyurata space:country U.S.S.R
  70. 70. This work is Copyright © 2010 Talis Systems Limited. It is licensed under the Creative Commons Attribution 3.0 Unported License. Full details at: http://creativecommons.org/licenses/by/3.0/ You are free: to Share — to copy, distribute and transmit the work to Remix — to adapt the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). • For any reuse or distribution, you must make clear to others the license terms of this work. • Any of the above conditions can be waived if you get permission from the copyright holder. • Nothing in this license impairs or restricts the author's moral rights. • Some Content in the work may be licensed under different terms, this is noted separately.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×