SlideShare a Scribd company logo
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/photonquantique/3272712288/
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
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 collection of human-readable knowledge
(and opinion)
Documents are linked, but links are not qualified
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
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
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
What is RDF?
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
Allow anyone
to say anything
about anything
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
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
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)
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
Properties are...
The relationship between Resources
Named using URIs
Described in Schema
(or vocabularies, or ontologies)
Apollo 11 Command and                                        Cape Canaveral,
                        launchsite   Cape Canaveral   name
    Service Module                                            United States
Apollo 11 Command and                                        Cape Canaveral,
                        launchsite   Cape Canaveral   name
    Service Module                                            United States
Subject                 Property       Value

Apollo 11 Command and                                          Cape Canaveral,
                          launchsite   Cape Canaveral   name
    Service Module                                              United States
Subject                 Property       Value

Apollo 11 Command and                                               Cape Canaveral,
                          launchsite    Cape Canaveral      name
    Service Module                                                   United States




                                       Subject           Property   Value
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

Subject                 Property       Value

Apollo 11 Command and                                               Cape Canaveral,
                          launchsite    Cape Canaveral      name
    Service Module                                                   United States




                                       Subject           Property   Value

                                                 Statement or Triple
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
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''
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
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
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 merged
allows anyone say anything about anything
is not new
the spec is from 1999
the idea stems back to the late 1960s
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/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
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 useful syntax for quickly hand-writing
RDF
Forms the basis of patterns in SPARQL
http://...   a
                                   http://...
        /1969-059A               /Spacecraft




<http://.../1969-059A> a <http://.../Spacecraft> .
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
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
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://...                                  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 .
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 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
/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
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" .

?something foaf:name ?name .
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 .
}
/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
Triple Patterns

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


SELECT ?label WHERE {
  ?something rdfs:label ?label .
}
/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
/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
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 .
}
/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
/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
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 .
}
/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
/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
/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
/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
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 .

}
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>
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 .

}
/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
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
Tip 1: Find all the Properties

SELECT DISTINCT ?p WHERE {

    ?s ?p ?o .

}
/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
/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
Tip 2: Find all the Classes

SELECT DISTINCT ?type WHERE {

    ?s a ?type .

}
/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
/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
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.
Linked Data, Rdf & Sparql

More Related Content

More from mmmmmrob

KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...
KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...
KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...
mmmmmrob
 
Ways of thinking about Linked Data
Ways of thinking about Linked DataWays of thinking about Linked Data
Ways of thinking about Linked Data
mmmmmrob
 
Linked Bibliographic Data
Linked Bibliographic DataLinked Bibliographic Data
Linked Bibliographic Data
mmmmmrob
 
Www2008, Semantic Marc
Www2008, Semantic MarcWww2008, Semantic Marc
Www2008, Semantic Marcmmmmmrob
 
Get Access Case Study
Get Access Case StudyGet Access Case Study
Get Access Case Studymmmmmrob
 
AT vs Ut
AT vs UtAT vs Ut
AT vs Ut
mmmmmrob
 
Eusidic, The Outlook And The Future
Eusidic, The Outlook And The FutureEusidic, The Outlook And The Future
Eusidic, The Outlook And The Futuremmmmmrob
 
Www2007, Open Data, Licensing
Www2007, Open Data, LicensingWww2007, Open Data, Licensing
Www2007, Open Data, Licensing
mmmmmrob
 
X Tech2007, Open Data, Licensing
X Tech2007, Open Data, LicensingX Tech2007, Open Data, Licensing
X Tech2007, Open Data, Licensing
mmmmmrob
 

More from mmmmmrob (9)

KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...
KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...
KORG 2012, Oslo, From Silo To (Semantic) Web. What Happens To The Library Sys...
 
Ways of thinking about Linked Data
Ways of thinking about Linked DataWays of thinking about Linked Data
Ways of thinking about Linked Data
 
Linked Bibliographic Data
Linked Bibliographic DataLinked Bibliographic Data
Linked Bibliographic Data
 
Www2008, Semantic Marc
Www2008, Semantic MarcWww2008, Semantic Marc
Www2008, Semantic Marc
 
Get Access Case Study
Get Access Case StudyGet Access Case Study
Get Access Case Study
 
AT vs Ut
AT vs UtAT vs Ut
AT vs Ut
 
Eusidic, The Outlook And The Future
Eusidic, The Outlook And The FutureEusidic, The Outlook And The Future
Eusidic, The Outlook And The Future
 
Www2007, Open Data, Licensing
Www2007, Open Data, LicensingWww2007, Open Data, Licensing
Www2007, Open Data, Licensing
 
X Tech2007, Open Data, Licensing
X Tech2007, Open Data, LicensingX Tech2007, Open Data, Licensing
X Tech2007, Open Data, Licensing
 

Recently uploaded

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 

Recently uploaded (20)

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 

Linked Data, Rdf & Sparql

  • 1. Linked Data, RDF & SPARQL Rob Styles Senior Technical Consultant http://creativecommons.org/licenses/by/2.0/uk/
  • 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.
  • 4. 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
  • 6. What is The Web of Documents?
  • 7. 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
  • 8. 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
  • 9. 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
  • 10. 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
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 18. 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
  • 19. Allow anyone to say anything about anything
  • 20.
  • 21. 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
  • 22. 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
  • 23. 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)
  • 24. 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
  • 25. Properties are... The relationship between Resources Named using URIs Described in Schema (or vocabularies, or ontologies)
  • 26. Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States
  • 27. Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States
  • 28. Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States
  • 29. Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States Subject Property Value
  • 30. Statement or Triple Subject Property Value Apollo 11 Command and Cape Canaveral, launchsite Cape Canaveral name Service Module United States Subject Property Value
  • 31. 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
  • 32. 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
  • 33. 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''
  • 34. 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
  • 35. 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
  • 36. Any RDF can be merged with any other RDF
  • 37. 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
  • 38. What does RDF look like?
  • 39. 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
  • 40. Turtle (TTL) stands for Terse Triple Language
  • 41. 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
  • 42. http://... a http://... /1969-059A /Spacecraft <http://.../1969-059A> a <http://.../Spacecraft> .
  • 43. 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
  • 44. 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
  • 45. 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
  • 46. 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 .
  • 47. How do I SPARQL?
  • 48. 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
  • 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
  • 52. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" .
  • 53. Triple Patterns <http://example.com/spacecraft/1957-001B> foaf:name "Sputnik 1" . ?something foaf:name "Sputnik 1" . ?something foaf:name ?name .
  • 54. 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 . }
  • 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. Triple Patterns PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?label WHERE { ?something rdfs:label ?label . }
  • 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. /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. 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 . }
  • 60. /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
  • 61. /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
  • 62. 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 . }
  • 63. /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
  • 64. /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
  • 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. /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. 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 . }
  • 68. 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>
  • 69. 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 . }
  • 70. /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
  • 71. 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
  • 72. Tip 1: Find all the Properties SELECT DISTINCT ?p WHERE { ?s ?p ?o . }
  • 73. /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
  • 74. /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
  • 75. Tip 2: Find all the Classes SELECT DISTINCT ?type WHERE { ?s a ?type . }
  • 76. /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
  • 77. /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
  • 78. 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.