SPARQL Overview

Eric Prud'hommeaux

Chiba, Japan 12 May 2005
$Revision: 1.4 $ of $Date: 2005/05/12 05:43:59 $

Data Access Working Group homepage.

Publications

The DAWG has four publications:

Requirements

Requirements are expected to be in the specification.

Design objectives

Design Objectives are desired but not required goals.

SPARQL Example

Give me the name and homepage (if known) of joe@host.example :

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?homepage
 WHERE { ?someone foaf:mbox <mailto:joe@host.example> .
         ?someone foaf:name ?name .
         OPTIONAL { ?someone foaf:homepage ?homepage }
       }

Find solutions like:

name homepage
"Joe Svenopolous" <http://host.example/People/Joe/>

Result Formats

SPARQL has three defined result formats:

The Query Controls the Result Format

The Query Controls the Result Format

The Query Controls the Result Format

RDF Graph Results

RDF Graph Results Example

A query like:

PREFIX w5: <http://www.w3.org/2004/10/18-RDF-WWW2005/>
CONSTRUCT *
 WHERE {?author  w5:Author_name      "Sean M. McNee" .
        ?author  w5:Author_paper     ?paper .
        ?paper   w5:Paper_name       ?name . 
        ?paper   w5:Paper_session    ?session .
        ?session w5:Session_room     ?room .
        ?room    w5:Room_description ?roomDesc .
        ?program w5:Program_session  ?session .
        ?program w5:Program_start1    ?start .
        ?program w5:Program_start1    ?end }

can be written as a URL.

RDF Graph Results Example

Requesting variables

PREFIX w5: <http://www.w3.org/2004/10/18-RDF-WWW2005/>
SELECT ?name ?room ?roomDesc ?start ?end
...

would get an XML document of solutions.

<sparql
 xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result#">
   <head><variable name="name" />
         <variable name="room" />
         <variable name="roomDesc" />
         <variable name="start" />
         <variable name="end" /></head>
   <results>
      <result>
         <binding name="name"><literal>Improving Recommendation Lists Through Topic Diver</literal></binding>
         <binding name="room"><uri href="http://www.w3.org/2004/10/18-RDF-WWW2005/Room__id_6"/></binding>
         <binding name="roomDesc"><literal>Room 301</literal></binding>
         <binding name="start"><literal>2005-05-11 10:50:00</literal></binding>
         <binding name="end"><literal>2005-05-11 10:50:00</literal></binding>
      </result>
   </results>
</sparql>

Protocol

Issues

From the Issues List:

Schedule