W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > May 2006

UNION example

From: Richard Newman <r.newman@reading.ac.uk>
Date: Mon, 8 May 2006 19:15:22 -0700
Message-Id: <951B85DB-1EEC-4FBB-A1A7-3F4E58E54D50@reading.ac.uk>
To: public-rdf-dawg-comments@w3.org

Hi all,
   I was just working my way through the SPARQL CR, and noticed a  
slight annoyance in <http://www.w3.org/TR/rdf-sparql-query/#unionOp>.

   The example data only specifies titles:

===================================================
@prefix dc10:  <http://purl.org/dc/elements/1.0/> .
@prefix dc11:  <http://purl.org/dc/elements/1.1/> .

_:a  dc10:title     "SPARQL Query Language Tutorial" .

_:b  dc11:title     "SPARQL Protocol Tutorial" .

_:c  dc10:title     "SPARQL" .
_:c  dc11:title     "SPARQL (updated)" .
===================================================

   but the second query references creators:


===================================================
PREFIX dc10:  <http://purl.org/dc/elements/1.1/>
PREFIX dc11:  <http://purl.org/dc/elements/1.0/>

SELECT ?title ?author
WHERE  { { ?book dc10:title ?title .  ?book dc10:creator ?author }
          UNION
          { ?book dc11:title ?title .  ?book dc11:creator ?author }
        }
===================================================

   Running this query against the data in the document will not  
produce the stated results:

author         |  title
====================================================
"Alice"        |  "SPARQL Protocol Tutorial"
----------------------------------------------------
"Bob"          |  "SPARQL Query Language Tutorial"
====================================================


   I suggest adding the triples

_:b  dc11:creator  "Alice" .
_:a  dc10:creator  "Bob" .

   to the example data, if only for clarity's sake.

-R
Received on Tuesday, 9 May 2006 02:15:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:50 GMT