issue with test filter-scope-1

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 UTC