RE: negation (was: Question regarding subselect)



> -----Original Message-----
> From: Steve Harris [mailto:steve.harris@garlik.com]
> Sent: 01 May 2009 14:54
> To: Seaborne, Andy
> Cc: 'RDF Data Access Working Group'
> Subject: 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.

There are ones - trivially (as I was taught never to say in a maths proof - "clearly" is worse) ones that don't need to be written as a subquery at all like a join of a BGP and a sub SELECT *.  But they aren't very interesting in terms of new features.

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

A good next step might be to draw up some use cases so we agree/scope on what's being solved.  

 Andy

> 
> - Steve

Received on Friday, 1 May 2009 19:27:51 UTC