W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > June 2005

Blank Nodes and SPARQL

From: Ron Alford <ronwalf@umd.edu>
Date: Fri, 24 Jun 2005 08:44:53 -0400
Message-ID: <42BC0045.40802@umd.edu>
To: public-rdf-dawg-comments@w3.org
CC: Amy Alford <aloomis@glue.umd.edu>
== Suggested Change ==
Strike the following section from the SPARQL Query spec:
"""It behaves as a variable, although it can not be mentioned in the
query result form or anyplace else outside a graph pattern.

Blank nodes in queries are distinct from all blank nodes in the data. A
blank node in a graph pattern does not match a blank node in the data by
blank node label."""

Change "is only" to "might only be" in "An application or client
receiving the results of a query can tell that two solutions or two
variable bindings differ in blank nodes but this information is only
scoped to the results as defined in "SPARQL Variable Binding Results XML
Format" or the CONSTRUCT result form."

== Motivation ==

As the spec stands, it cannot be extended to allow bnodes to be used as
temporary identifiers across queries within a session.  We would like to
work on an extension to sparql that supports sessions in which bnodes
labels are persistent and may be referred to.

== Use Cases Supported by BNode Reference ==

=== RDF Browsing ===

Interactive browsing of RDF data requires sequential queries to the
database based on user interaction and prior results.

=== Lists ===

RDF Collections use bnodes to create a linked list.  OWL, among other
languages, uses these list as part of its syntax.  Without being able to
reference bnodes, any query that wished to expand a list would have to
iteratively expand its original query.

== Use Cases Supported by BNode Stability ==

=== Multiple Arity Predicates ===

A query for multiple high-arity predicates leads to excessively large
result sets, since the semantics of SPARQL state that the results
contain all possible graph matches.

Take the following rough example:  A foaf description of a person
includes 6 foaf:nicks, 4 foaf:mboxes, and 7 foaf:knows. The result set
querying for these specific properties will return 168 rows.

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?nick ?mbox ?knows
FROM <http://sarn.org/foaf.rdf>
WHERE { ?person foaf:mbox <mailto:aloomis@sarn.org> .
        ?person foaf:knows ?knows.
        ?person foaf:mbox ?mbox
        ?person foaf:nick ?nick.

The solution to this is to split the query into one query per property.
 However, combining the results relies on bnode stability (especially in
the case of foaf).

=== Limit / Offset ===

If limit and offset are going to be used as a cursor on data that makes
use of bnodes, the bnodes need to be stable between the results.

Received on Friday, 24 June 2005 17:21:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:01:21 UTC