February 27, 2004

Proto FAQ Entry - Why not use an RDF graph with blanks for querying RDF?

A. You can, some people have, it can be useful but is much less expressive than most full RDF query languages.

In RDF, blank notes are treated as existential variables - they indicate the existence of a thing without saying anything about the name of that thing. So it is reasonable to express a query as a graph with bNodes used as if they were wildcards and to define a query operation as something like "find all instances of the query graph which are entailed by the data". Perhaps, your operation might want to the find the union of that set of matching subgraphs rather than return the separate matches, depending on the application.

This can work but it is quite restrictive.

First, bNodes can only be used in place of nodes, not in place of properties. This is a big limitation since many queries require matching over properties. Second, you can't express constraints such as string pattern matches or range constraints on the literals to be matched. To get around this, attempts at this "query by example" approach often use metalevel annotations to allow such things to be expressed. For example, see our own experiments this area, RDF-QBE. Once, you start doing this you can use the annotations to identify the query nodes in the first place and not bother using bNodes at all. This is essentially, what the simplest of the Edutella query languages, RDF-QEL-1, does.

Other limitations are the inability to express disjunctive queries this way (RDF is purely conjunctive) and the akwardness of expressing constraints between variables.

Despite these limitations the symmetry of expressing queries, and indeed the resulting matches, directly in RDF rather than indirectly encoded in RDF is appealing and could be appropriate in some applications.

[N.B. This is an early version of a FAQ entry responding to one of the items on the FAQ ideas list. I'm sure others will be able to add more information on this topic and over time the proto-entry might turn into a real entry.]
Categories Frequently Asked Questions (FAQs)
Posted by dreynold2 at February 27, 2004 04:30 PM

Comments
Post a comment