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

Andrew Newman andrewfnewman at gmail.com
Fri Apr 13 11:36:42 UTC 2007


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?

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 ;

> > It was introduced to provide a limited
> > form of negation, and one that interacts poorly with the open-world
> > assumption.  We also now have minus, which is well defined,
> > corresponds closely to our intuitive understanding of the operation,
> > and is (I am told) what was actually required.
> >

Maybe you would care to repond to what I said last time about this and
its possible uses?
http://mulgara.org/pipermail/mulgara-dev/2006-October/000130.html

And SPARQL has !bound which is NAF:
"One may test that a graph pattern is not expressed by specifying an
OPTIONAL graph pattern that introduces a variable and testing to see
that the variable is not bound. This is called Negation as Failure in
logic programming."

http://www.w3.org/TR/rdf-sparql-query/#func-bound

> > If my memory is correct we should probably at least deprecate, if not
> > remove exclude entirely from mulgara.
> >
> > Do we agree that exclude should be removed?
>
> We don't have a problem with that.
>

Like I said before, there's probably a better way to implement it and
express it syntactically but the functionality (the operation on the
tuples) is fundamental.  How it's expressed probably isn't of course.



More information about the Mulgara-dev mailing list