Negation decision : unexpected effects

The decision at F2F3 to have just the form of NOT EXISTs in an explicit 
FILTER has a limitation. I should have realised at the time but it 
didn't occur to me until after the meeting.

FILTERs get moved to the end of the BGP during translation from syntax 
to algebra. The form without the word "FILTER" does not move e.g.

{ ?s rdf:type :T
   NOT EXISTS { ?s :p ?v . }
   ?s :q ?v
}

then NOT EXISTS is not moved about by the FILTER placement rules.

One reason for NOT EXISTS is as a better form of the OPTIONAL/!BOUND 
idiom, where the OPTIONAL block anchors the location of the existence 
test by it's effect of setting, or not, a variable to be tested later.

The FILTER could be artificially forced using a extra {}

{ { ?s rdf:type :T
     FILTER NOT EXISTS { ?s :p ?v . }
    }
     ?s :q ?v
}

This is unnecessary - the more direct syntax is closer to the 
OPTIONAL/!BOUND idiom that I think it the important thing to make easier.

Therefore I propose we adopt both negation proposals without modification.

It only affects the grammar and translation from syntax to algebra - 
actual execution is unchanged and there is no additional implementation 
cost for execution.

 Andy

Received on Friday, 2 April 2010 21:06:22 UTC