Re: Draft response JB-2 (was: MINUS vs. NOT EXISTS (comment JB-2))

I'd appreciate if someone could have a look at that draft response...

 http://www.w3.org/2009/sparql/wiki/CommentResponse:JB-2

Thanks,
Axel

On 22 Mar 2011, at 13:39, Axel Polleres wrote:

> Hi all,
> 
> based on Greg's example, I updated the draft response at:
> 
> http://www.w3.org/2009/sparql/wiki/CommentResponse:JB-2
> 
> Let me know whether that works for you.
> 
> Thanks a lot,
> Axel
> 
> On 1 Mar 2011, at 15:23, Gregory Williams wrote:
> 
>> On Mar 1, 2011, at 10:12 AM, Andy Seaborne wrote:
>> 
>>> I added the nested FILTER example recently.  This is a different difference as it's based on scoping of variables.
>> 
>> 
>> (Responding to the issue raised in JB-2 as part of ACTION-403.)
>> 
>> 
>> I had posted an example of where MINUS and NOT EXISTS are different to Jeen's weblog (where he posted JB-2 before sending it to the list):
>> 
>> http://jeenbroekstra.blogspot.com/2011/02/implementing-sparql-11-query-first.html?showComment=1297185762180#c1530706422809325453
>> 
>> The difference in my example is based on NOT EXISTS relying on the variable substitution that happens during filter function evaluation:
>> 
>> 
>> 
>> In this example, the ?n variable isn't bound (isn't in scope) in the MINUS block, and so the FILTER inside the MINUS does something different than FILTER inside the NOT EXISTS block.
>> 
>> ### Data
>> 
>> @prefix : <http://example.com/> .
>> 
>> :a :p 1 ; :q 1,2 .
>> :b :p 3.0 ; :q 4.0, 5.0 .
>> 
>> ### Query 1: NOT EXISTS
>> 
>> PREFIX : <http://example.com/>
>> SELECT * WHERE {
>> 	?a :p ?n
>> 	FILTER NOT EXISTS {
>> 		?a :q ?m .
>> 		FILTER(?n = ?m)
>> 	}
>> }
>> 
>> +------------------------+-----+
>> | a                      | n   |
>> +------------------------+-----+
>> | <http://example.com/b> | 3.0 |
>> +------------------------+-----+
>> 
>> ### Query 2: MINUS
>> 
>> PREFIX : <http://example.com/>
>> SELECT * WHERE {
>> 	?a :p ?n
>> 	MINUS {
>> 		?a :q ?m .
>> 		FILTER(?n = ?m)
>> 	}
>> }
>> 
>> +------------------------+-----+
>> | a                      | n   |
>> +------------------------+-----+
>> | <http://example.com/a> | 1   |
>> | <http://example.com/b> | 3.0 |
>> +------------------------+-----+
>> 
>> 
>> 
>> 
>> .greg
>> 
>> 
> 
> 

Received on Monday, 28 March 2011 21:57:54 UTC