Intro to Linked Data: SPARQL

3,916
-1

Published on

Published in: Education, Technology
2 Comments
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,916
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
160
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide

Intro to Linked Data: SPARQL

  1. 1. An Introduction to Linked Data Part 4 of 5 David Hyland-Wood SPARQL Query Language University of Mary WashingtonMonday, May 16, 2011
  2. 2. SPARQL: A query language for RDFMonday, May 16, 2011
  3. 3. 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 SQLMonday, May 16, 2011
  4. 4. Queries • ASK — True or False Simple, Fast • SELECT — Tabular data easy to work with • DESCRIBE — RDF whatever the store has • CONSTRUCT — RDF Whatever you wantMonday, May 16, 2011
  5. 5. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  6. 6. Triple PatternsMonday, May 16, 2011
  7. 7. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" .Monday, May 16, 2011
  8. 8. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" .Monday, May 16, 2011
  9. 9. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" . ?something foaf:name ?name .Monday, May 16, 2011
  10. 10. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" . ?something foaf:name ?name . ASK WHERE { ?something foaf:name "Sputnik 1" . }Monday, May 16, 2011
  11. 11. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label a Tyuratam (Baikonur Cosmodrome) space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  12. 12. Triple Patterns PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> ASK WHERE { ?something rdfs:label ?label . }Monday, May 16, 2011
  13. 13. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  14. 14. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  15. 15. Triple Patterns PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> ASK WHERE { ?something rdfs:label ?label ; rdf:type space:Discipline . }Monday, May 16, 2011
  16. 16. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  17. 17. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  18. 18. Triple Patterns PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> ASK WHERE { ?spacecraft foaf:name “Sputnik 1” . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . }Monday, May 16, 2011
  19. 19. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  20. 20. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  21. 21. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  22. 22. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  23. 23. 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 . }Monday, May 16, 2011
  24. 24. 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> </binding> </result>Monday, May 16, 2011
  25. 25. 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 . }Monday, May 16, 2011
  26. 26. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  27. 27. Example SELECT DISTINCT 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 DISTINCT ?date WHERE { ?launch space:launched ?date . }Monday, May 16, 2011
  28. 28. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  29. 29. Example OPTIONAL PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?image WHERE { ?spacecraft foaf:name ?name . OPTIONAL { ?spacecraft foaf:depiction ?image . } }Monday, May 16, 2011
  30. 30. Example OPTIONAL <?xml version="1.0"?> <sparql xmlns="http://www.w3.org/2005/sparql-results#"> <head> <variable name="name"/> <variable name="image"/> </head> <results> <result> <binding name="name"> <literal>Soyuz 2</literal> </binding> </result> <result> <binding name="name"> <literal>Apollo 10</literal> </binding> <binding name="image"> <uri>http://nssdc.gsfc.nasa.gov/image/spacecraft/ apollo_10_cm.jpg</uri> </binding> </result>Monday, May 16, 2011
  31. 31. Example UNION PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?subject ?displayLabel WHERE { { ?subject foaf:name ?displayLabel . } UNION { ?subject rdfs:label ?displayLabel . } }Monday, May 16, 2011
  32. 32. Example UNION <?xml version="1.0"?> <sparql xmlns="http://www.w3.org/2005/sparql-results#"> <head> <variable name="subject"/> <variable name="displayLabel"/> </head> <results> <result> <binding name="subject"> <uri>http://nasa.dataincubator.org/spacecraft/ATLAS2</uri> </binding> <binding name="displayLabel"> <literal>Atlas 2</literal> </binding> </result> <result> <binding name="subject"> <uri>http://nasa.dataincubator.org/spacecraft/ATLAS3</uri> </binding> <binding name="displayLabel"> <literal>Atlas 3</literal> </binding> </result>Monday, May 16, 2011
  33. 33. Example ORDER BY PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?name ?launchdate WHERE { ?spacecraft foaf:name ?name . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . }Monday, May 16, 2011
  34. 34. Example ORDER BY PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?name ?launchdate WHERE { ?spacecraft foaf:name ?name . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . } ORDER BY DESC(?launchdate)Monday, May 16, 2011
  35. 35. Example ORDER BY PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?name ?launchdate WHERE { ?spacecraft foaf:name ?name . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . } ORDER BY DESC(?launchdate) LIMIT 10Monday, May 16, 2011
  36. 36. Example ORDER BY PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?name ?launchdate WHERE { ?spacecraft foaf:name ?name . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . } ORDER BY DESC(?launchdate) LIMIT 10 OFFSET 10Monday, May 16, 2011
  37. 37. Example FILTER 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 WHERE { ?launch space:launched ?date ; space:spacecraft ?spacecraft . ?spacecraft foaf:name ?name . FILTER ( ?date >= "1969-01-01"^^xsd:date && ?date <= "1969-12-31"^^xsd:date ) }Monday, May 16, 2011
  38. 38. Example FILTER 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 ?spacecraft ?name WHERE { ?spacecraft foaf:name ?name ; space:mass ?mass . FILTER( xsd:double(?mass) < 90.0 ) }Monday, May 16, 2011
  39. 39. Example FILTER 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 WHERE { ?spacecraft foaf:name ?name . FILTER( regex(?name, “ollo”, “i” ) ) }Monday, May 16, 2011
  40. 40. Built-in Filters • Logical (!, &&, ||) • Math (+, -, *, /) • Comparison (=, !=, >, <, ...) • Tests isURI, isBlank, isLiteral, bound, sameTerm, langMatches, regex • Accessors str, lang, datatypeMonday, May 16, 2011
  41. 41. Example NOT PREFIX space: <http://purl.org/net/schemas/space/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?s WHERE { ?s a space:Spacecraft . OPTIONAL { ?s foaf:depiction ?image . } FILTER ( !bound(?image) ) }Monday, May 16, 2011
  42. 42. Queries • ASK — True or False Simple, Fast • SELECT — Tabular data easy to work with • DESCRIBE — RDF whatever the store has • CONSTRUCT — RDF Whatever you wantMonday, May 16, 2011
  43. 43. Example DESCRIBE DESCRIBE <http://example.com/launch/1969-059>Monday, May 16, 2011
  44. 44. Example DESCRIBE <rdf:RDF xmlns:space="http://purl.org/net/schemas/space/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > <rdf:Description rdf:about="http://nasa.dataincubator.org/launch/1969-059"> <space:spacecraft rdf:resource="http://nasa.dataincubator.org/spacecraft/1969-059C"/> <space:spacecraft rdf:resource="http://nasa.dataincubator.org/spacecraft/1969-059B"/> <space:spacecraft rdf:resource="http://nasa.dataincubator.org/spacecraft/1969-059A"/> <space:launchvehicle>Saturn 5</space:launchvehicle> <space:launchsite rdf:resource="http://nasa.dataincubator.org/launchsite/capecana..."/> <space:launched rdf:datatype="http://www.w3.org/2001/XMLSchema#date"> 1969-07-16 </space:launched> <rdf:type rdf:resource="http://purl.org/net/schemas/space/Launch"/> </rdf:Description> </rdf:RDF>Monday, May 16, 2011
  45. 45. Example DESCRIBE PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> DESCRIBE ?spacecraft WHERE { ?launch space:launched "1969-07-16"^^xsd:date . ?spacecraft space:launch ?launch . }Monday, May 16, 2011
  46. 46. Example DESCRIBE <rdf:RDF xmlns:space="http://purl.org/net/schemas/space/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" > <rdf:Description rdf:about="http://nasa.dataincubator.org/spacecraft/1969-059B"> <foaf:homepage rdf:resource="http://nssdc.gsfc.nasa.gov/database/MasterCatalog? sc=1969-059B"/> <dc:description>The...</dc:description> <space:mission rdf:resource="http://nasa.dataincubator.org/mission/apollo-11"/> <space:agency>United States</space:agency> <rdf:type rdf:resource="http://purl.org/net/schemas/space/Spacecraft"/> <space:launch rdf:resource="http://nasa.dataincubator.org/launch/1969-059"/> <space:discipline rdf:resource="http://nasa.dataincubator.org/discipline/ planetaryscience"/> <space:alternateName>04040</space:alternateName> <space:alternateName>Apollo 11 Saturn V third stage</space:alternateName> <foaf:name>Apollo 11 SIVB</foaf:name> <space:internationalDesignator>1969-059B</space:internationalDesignator> <space:mass>13300.0</space:mass> </rdf:Description> ...Monday, May 16, 2011
  47. 47. Example DESCRIBE PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> DESCRIBE ?spacecraft ?launch WHERE { ?launch space:launched "1969-07-16"^^xsd:date . ?spacecraft space:launch ?launch . }Monday, May 16, 2011
  48. 48. Example CONSTRUCT PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?spacecraft foaf:name ?name ; space:agency ?agency ; space:launched ?launchdate . } WHERE { ?spacecraft foaf:name ?name ; space:agency ?agency . ?launch space:spacecraft ?spacecraft . ?launch space:launched ?launchdate . }Monday, May 16, 2011
  49. 49. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  50. 50. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name space:discipline Sputnik 1 dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label Tyuratam (Baikonur Cosmodrome) a space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  51. 51. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label a Tyuratam (Baikonur Cosmodrome) space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  52. 52. Common Problems • Typos wrong case for property or class name • wrong prefix URI missing # or / or the URI for the web page • Missing OPTIONAL you wont even notice... • Comparing Literals Literals are compared on all of value, type and languageMonday, May 16, 2011
  53. 53. Tip 1: Find all the Properties SELECT DISTINCT ?p WHERE { ?s ?p ?o . }Monday, May 16, 2011
  54. 54. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label a Tyuratam (Baikonur Cosmodrome) space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  55. 55. a rdfs:label /discipline/ space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched a 1957-10-04 space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label a Tyuratam (Baikonur Cosmodrome) space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  56. 56. Tip 2: Find all the Classes SELECT DISTINCT ?type WHERE { ?s a ?type . }Monday, May 16, 2011
  57. 57. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label a Tyuratam (Baikonur Cosmodrome) space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  58. 58. a /discipline/ rdfs:label space:Discipline Space Physics spacephysics foaf:name Sputnik 1 space:discipline dc:description The Sputnik 1 spacecraft was ... space:agency U.S.S.R a /spacecraft/ space:Spacecraft 1957-001B space:mass 86.3 foaf:depiction /images/sputnik.jpg space:spacecraft space:launched 1957-10-04 a space:Launch /launch/1957-001 space:launchvehicle Modified SS-6 (Sapwood) space:launchsite rdfs:label a Tyuratam (Baikonur Cosmodrome) space:Launchsite /launchsite/tyurata space:country U.S.S.RMonday, May 16, 2011
  59. 59. Thanks to • Rob Styles, Talis Group Ltd for his CC-BY licensed “Two Day Introduction to the Web of Data” slides and spacecraft example data.Monday, May 16, 2011
  60. 60. This work is Copyright © 2010 David Hyland-Wood Based partially on CC-BY licensed content Copyright © 2010 Talis Systems Limited by Rob Styles. 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 authors moral rights. • Some Content in the work may be licensed under different terms, this is noted separately.Monday, May 16, 2011

×