[Mulgara-general] Re: [Mulgara-dev] Removing exclude.

Andrew Newman andrewfnewman at gmail.com
Sat Apr 14 11:36:30 UTC 2007


On 4/14/07, Life is hard, and then you die <ronald at innovation.ch> wrote:
> On Fri, Apr 13, 2007 at 09:36:42PM +1000, Andrew Newman wrote:
> > On 4/13/07, Life is hard, and then you die <ronald at innovation.ch> wrote:
> > >On Fri, Apr 13, 2007 at 01:58:42PM +1000, Andrae Muys wrote:
> > >>
> > >> My current focus is on the Non-union compatible disjunction bug.  As
> > >> a part of this I am back in TuplesOperations.project() and friends,
> > >> where there is some ugliness resulting from the current
> > >> implementation of exclude.  I'm not going to get sidetracked on a
> > >> cleanup job, but it does remind me that we never did reach an
> > >> agreement on the future of exclude.
> > >>
> > >> As I recall the conversation we hadn't yet found anyone who actually
> > >> uses it - and of those who have tried to, no-one has managed to
> > >> actually use it correctly.
> > >
> > >Well, we do use it, and I do think we use it "correctly" in the sense
> > >that given our pattern of triples it will do the right thing (and we
> > >understand that if there are patterns of triples under which it will
> > >not do what we want). But it's horrible, and we will switch to minus
> > >soon.
> >
> > So how is it horrible compared to minus?  Isn't the only difference
> > brackets?
>
> No, the difference is much more.
>
> > For example, using minus:
> > ...
> > where $person <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> > <urn:test:human>
> > and $person <urn:test:hasParent> $parent
> > minus (
> >  $parent <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <urn:test:alien>
> >  or $parent <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> >  <urn:test:hybrid>
> > )
> > order by $person $parent ;
> >
> > Using exclude:
> > ...
> > where $person <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> > <urn:test:human>
> > and $person <urn:test:hasParent> $parent
> > and exclude (  $parent
> > <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <urn:test:alien> )
> > and exclude ( $parent
> > <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <urn:test:hybrid> )
> > order by $person $parent ;
>
> These will give different results if you have the following triples in
> your model:
>
>   <a:p1> <urn:test:hasParent> <a:p2>
>   <a:p1> <urn:test:hasParent> <a:p3>
>   <a:p1> <rdf:type> <urn:test:human>
>   <a:p2> <rdf:type> <urn:test:alien>
>   <a:p3> <rdf:type> <urn:test:hybrid>
>   <a:p2> <foo:name> 'joe'
>   <a:p3> <foo:name> 'bob'
>
> The exclude version will still give you
>
>   <a:p1> <a:p2>
>   <a:p1> <a:p3>
>
> whereas minus will return an empty result. See below for details.
>

So the idea around this has been to put the exclude in a subquery to
reduce the scope - hence the equivalence with minus.



More information about the Mulgara-dev mailing list