W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > July 2007

example in current cand. rec....

From: Axel Polleres <axel.polleres@deri.org>
Date: Thu, 05 Jul 2007 14:35:21 +0100
To: "public-rdf-dawg-comments@w3.org" <public-rdf-dawg-comments@w3.org>
Message-id: <468CF399.3050100@deri.org>

referring to the examples in Section 12.2.2
of http://www.w3.org/TR/2007/CR-rdf-sparql-query-20070614/

2 issues:

1) What happened here?
---------
Example: group consisting of a basic graph pattern and an optional graph 
pattern:
{ ?s :p1 ?v1 OPTIONAL {?s :p2 ?v2 } }
LeftJoin(
     Join(Z, BGP(?s :p1 ?v1)),
     Join(Z, BGP(?s :p1 ?v1)) ),
     true)
LeftJoin(BGP(?s :p1 ?v1), BGP(?s :p2 ?v2), true)
---------

---------
Example: group consisting of a basic graph pattern and an optional graph 
pattern with a filter:

{ ?s :p1 ?v1 OPTIONAL {?s :p2 ?v2 FILTER(?v1<3) } }

LeftJoin(
      Join(Z, BGP(?s :p1 ?v1)),
      Join(Z, BGP(?s :p1 ?v1)),
      (?v1<3) )
LeftJoin(
     BGP(?s :p1 ?v1) ,
     BGP(?s :p2 ?v2) ,
    (?v1<3) )
-----------

these two examples seem to have some copy-paste-errors, yes?

2) Another question concerning FILTERs in OPTIONALS
(I checked this with http://www.sparql.org/validator.html)

Please just verify: It is indeed true that

SELECT ?N ?M WHERE { ?X foaf:name ?N . ?X :age ?Age .
OPTIONAL { ?X foaf:mbox ?M. FILTER(?Age > 30) } }


is equivalent to

SELECT ?N ?M WHERE { ?X foaf:name ?N . ?X :age ?Age .
OPTIONAL { { ?X foaf:mbox ?M. FILTER(?Age > 30) } } }

but

SELECT ?N ?M WHERE { ?X foaf:name ?N . ?X :age ?Age .
OPTIONAL { ?X foaf:name ?N . { ?X foaf:mbox ?M. FILTER(?Age > 30) } } }

is not semantically equivalent, yes?
I am asking, because I originally also thought the second variant would 
treat the FILTER local to ist group graph pattern

thanks & best regards,
axel



-- 
Dr. Axel Polleres
email: axel@polleres.net  url: http://www.polleres.net/
Received on Thursday, 5 July 2007 13:35:40 GMT

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