W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2011

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

From: Axel Polleres <axel.polleres@deri.org>
Date: Mon, 28 Mar 2011 22:57:19 +0100
Message-Id: <896B4018-755E-4A0E-BC51-12683665C66B@deri.org>
To: SPARQL Working Group <public-rdf-dawg@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:45 GMT