Re: negation (was: Question regarding subselect)

On 1 May 2009, at 13:55, Seaborne, Andy wrote:
>>>> Yes, that's my fault, I think I created that wiki page - SubQuery
>>>> would have been a better name, and was my intention. It's SQL  
>>>> legacy
>>>> where the only query verb is SELECT. Well... actually there's SHOW,
>>>> but it's a bit different and you can't do sub-shows.
>>>>
>>>> SubASKs don't have to go in a FILTER, they're also useful in WHERE
>>>> clauses, assuming they project either a solution with no bindings
>>>> (for
>>>> true) or no solutions (for false).
>
> On reflection (well, have to think of something on my lunchtime  
> run), I think it's a bit more involved for negation (!ASK) because  
> of variable scoping.  The usage I have in mind is that NOT EXIXTS  
> {pattern} is testing to see if the pattern does not match and the  
> variables in-scope include those from the previous part of the query  
> (it's not bottom up evaluation).  This form of negation is order  
> dependent as is OPTIONAL/!BOUND - NOT EXISTS has the same effect  
> except it does not rely on at least one free variable.  Without  
> assignment, NOT EXIST (in pattern or in filter) is much easier to  
> use than OPTIONAL/!BOUND.

That sounds like what I had in mind. I suspect that all subqueries are  
order-dependent.

> Let's sketch some examples around the F2F.  We probably in strong  
> agreement but using different words.

Yes, I suspect so.

- Steve

Received on Friday, 1 May 2009 13:54:14 UTC