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

issue with test filter-scope-1

From: Francis McCabe <frankmccabe@mac.com>
Date: Thu, 25 Oct 2007 09:49:09 -0700
Message-Id: <9B1A6ECF-1A27-41FC-8938-4FBD84F672E7@mac.com>
To: public-rdf-dawg-comments@w3.org

I am having some trouble reconciling this test with the spec, the  
reported results of the query.

The test reads:

FILTERs in an OPTIONAL do not extend to variables bound outside of  
the LeftJoin(...) operation



however, the spec reads

Query variables in SPARQL queries have global scope; use of a given  
variable name anywhere in a query identifies the same variable.

The reported results of the test:

PREFIX :    <http://example/>

SELECT *
{
     :x :p ?v .
     { :x :q ?w
       OPTIONAL {  :x :p ?v2 FILTER(?v = 1) }
     }
}

include the results

v w
(4, 3)

(4, 2)

(4, 1)

(3, 3)

(3, 2)

(3, 1)

(2, 3)

(2, 2)

(2, 1)

(1, 3)

(1, 2)

(1, 1)



(My formatting, the XML is illegible by mortals)

However, I think that the test is wrong: v2 should be v. On my  
budding implementation, I get the above results only if I change v2  
to v. If I don't, I get:




v v2 w
(4, (null), 3)

(4, (null), 2)

(4, (null), 1)

(3, (null), 3)

(3, (null), 2)

(3, (null), 1)

(2, (null), 3)

(2, (null), 2)

(2, (null), 1)

(1, 4, 3)

(1, 3, 3)

(1, 2, 3)

(1, 1, 3)

(1, 4, 2)

(1, 3, 2)

(1, 2, 2)

(1, 1, 2)

(1, 4, 1)

(1, 3, 1)

(1, 2, 1)

(1, 1, 1)


Note that optional implies that there will be solutions that do not  
bind v2.

I would appreciate clarification on this matter.



Frank
Received on Thursday, 25 October 2007 16:49:34 GMT

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