[Mulgara-dev] RE: Blank nodes in queries (was: Recent commits to Mulgara.)

Paul Gearon gearon at ieee.org
Tue Oct 10 16:51:56 UTC 2006


HI Andy,

On 10/10/06, Seaborne, Andy <andy.seaborne at hp.com> wrote:
<snip/>

> PREFIX  : <http://example/ns#>
> PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>
> SELECT  ?X
> WHERE
>   { ?X  rdf:type    :Worker ;
>         :hasFriend  _:Y .
>     _:Y  rdf:type    :Employee ;
>         :hasFriend  _:Z .
>     _:Z  rdf:type    :Manager .
>   }

Since I've spent less time with SPARQL than I care to admit (a
cardinal sin, I know), I have to comment:
The "blank nodes" of _:Y and _:Z are just existentials here, and do
not refer to nodes which are really blank at all (as all the matches
have URIs).  The only difference I see between these and the ?X is
that the latter appears in the SELECT.  Is this right, or is there
something more subtle that I'm missing?

<snip/>
> The main thing that this simple example shows is that it is impossible
> to find a unique completion (a unique deductive closure) over which the
> query can be evaluated. There are *three* incompatible completions,
> i.e., none of them is minimal (i.e., none of them is included in all
> the others).
> A real reasoning by cases mechanism should be employed to answer this
> query.

I have two comments on this.

First is that Mulgara is a plain RDF store.  The Semantics you are
putting on it here are way above RDF.  From the perspective of RDF,
the answer is an empty set.

Second is that we *do* want to support OWL (or other reasoning systems
if we can make them work in RDF).  That's why I'm writing a response
here.  :-)

One approach is to try to infer as much as possible from the system
statically, and to place these results into the data store.  Then any
queries on the store don't need to do the reasoning themselves, as it
has already been done.  That gets you some of the way, but it won't
give you the result you're looking for in this example (since the
query looks for a composite property that is not described in the
ontology - a more complex ontology language would allow such a
property to be defined, and a static inferencer could find it for
you).

The other approach is to try to inference on the fly.  However, some
types of queries are going to be coNP-complete (I have a gut feeling
that the above query might be one such case, but I'm terrible at
calculating complexity), and that makes me a little nervous!  Sure, it
works for small systems, but it doesn't take that much for it to get
out of hand.  Is this a concern for you?

You probably know that I've been working on a static inferencer
(though I've been drawn into other things this year).  This has the
advantage of working well on large amount of data, but it is poor for
changing data (ie. new assertions) and for finding composite
information of the type you describe here.  For that reason I've been
thinking we will also need a dynamic reasoning engine.  The most
complete that I can think of is DLV, since it tests all possible
cases, but I'd like something with better efficiency for systems with
no disjunctions.  Do you have any thoughts here please?

Regards,
Paul Gearon



More information about the Mulgara-dev mailing list