SlideShare une entreprise Scribd logo
1  sur  79
Télécharger pour lire hors ligne
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

Contenu connexe

Plus de 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 Datammmmmrob
 
Linked Bibliographic Data
Linked Bibliographic DataLinked Bibliographic Data
Linked Bibliographic Datammmmmrob
 
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
 
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, Licensingmmmmmrob
 
X Tech2007, Open Data, Licensing
X Tech2007, Open Data, LicensingX Tech2007, Open Data, Licensing
X Tech2007, Open Data, Licensingmmmmmrob
 

Plus de 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
 

Dernier

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Dernier (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

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.