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.


The DAWG has four publications:


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: <>
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: <>
 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: <>
SELECT ?name ?room ?roomDesc ?start ?end

would get an XML document of solutions.

   <head><variable name="name" />
         <variable name="room" />
         <variable name="roomDesc" />
         <variable name="start" />
         <variable name="end" /></head>
         <binding name="name"><literal>Improving Recommendation Lists Through Topic Diver</literal></binding>
         <binding name="room"><uri href=""/></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>



From the Issues List: