[Mulgara-dev] Re: [Mulgara-JIRA] Created: (MGR-55) OPTIONAL operator

Paul Gearon gearon at ieee.org
Mon Apr 16 16:03:17 UTC 2007


On 4/16/07, Andrae Muys <andrae at netymon.com> wrote:
>
> Would prefer to see if this couldn't be provided via an extension/
> enhancement of subqueries.  I believe some sort of flatten/expand/
> product projection operator would suffice.  Certainly I would be
> reluctant to accept a <null> parameter - I understand the correct
> semantic required for this is NO_KNOWN defined as "no known value
> satisfies this constraint" - which under NAF would result in row
> elimination, however under open-world results in the SPARQL OPTIONAL
> semantic.
>

I have several reasons for wanting to do it as a new operator.

We already have <null>s being returned from constraint disjunctions, so we
wouldn't be introducing a totally new concept into our results.  Also, the
SPARQL documents simply say, "No value", without specifying what that
means.  For an API, I would think that <null> would work well for this,
especially since null can already be returned from disjunctive queries.
It's the natural thing for our implementation to be returning anyway.

Implementing OPTIONAL as a subquery structure makes me concerned about
performance, as I believe this would require more processing per row.  The
structure of a returned Answer is also inappropriate, and would require
"flattening" before being returned.  Given that we currently pass Answers
directly back to the client, this would require a messy (IMO) interception.

Finally, performing OPTIONAL as an extra constraint operation would be very
easy in light of its similarity to existing code.  In fact, it is almost a
cut and paste of ConstraintConjunction (for the join) and
ConstraintDisjunction (for the projection), with an extra if() statement
thrown in.

I'm not closing the door on this - just putting up my arguments.  In the end
it comes down to whoever implements it correctly first.  :-P

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mulgara.org/pipermail/mulgara-dev/attachments/20070416/cf1027a6/attachment.htm>


More information about the Mulgara-dev mailing list