W3C home > Mailing lists > Public > www-rdf-rules@w3.org > September 2001

What is an RDF Query?

From: Sandro Hawke <sandro@w3.org>
Date: Fri, 07 Sep 2001 18:22:14 -0400
Message-Id: <200109072222.SAA10210@tux.w3.org>
To: www-rdf-rules@w3.org

I agree that RDF queries and RDF rule premises are basically the same
things.  So what is an RDF query?

At a very abstract level, I think the RDF query API is something like:

    match(dataset, pattern) -> set of solutions

This vaguely matches every RDF query system I've heard of.  The
dataset is a set of RDF statements (triples), and the pattern is a set
of RDF statements (triples) which may have existential variable
elements.  A solution is either (1) a mapping from the variables to
constants or (2) a set of triples which match the pattern (that is,
with the variable subsitution done), or (3) both.  I think this is
equivalent to a relational join.

There is a shift in complexity if we go with the interpretation of RDF
"anonymous nodes" as existential variables.  That simplifies things by
saying the pattern is just an RDF graph like any other, but it
complicates things by allowing the dataset to have variables too.
This seems to be equivalent to trying to perform unification [1]
between the two sets as conjunctions of their triples, with the
complication that the elements have no intrinsic ordering.  (Does that
turn this into a much harder problem, or is there a trick to making it
not matter?)

This makes the match seem more symmetric, but it's still being able to
match all the triples in the second argument which constitutes
"success".   

If a match fails, it would be nice to have a pointer to a triple in
the pattern it was unable to find in the dataset under any consistent
set of variable bindings.  (I've been playing around with ideas for
DAML diff [2], and that seems like good information to get out.)

I don't think inference being used to arrive at either dataset changes
the basic query operation (which is part of what makes queries and
rule-premises the same thing), but it does suggest we'd like solutions
to perhaps include proofs.

    -- sandro          
       http://www.w3.org/People/Sandro/

[1] http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?unification
[2] http://www.daml.org/tools/wishlist.html#diff
Received on Friday, 7 September 2001 18:22:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:53:09 GMT