W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > October 2004

Re: Coments on first working draft of SPARQL

From: Peter F. Patel-Schneider <pfps@research.bell-labs.com>
Date: Mon, 25 Oct 2004 09:38:30 -0400 (EDT)
Message-Id: <20041025.093830.55868071.pfps@research.bell-labs.com>
To: andy.seaborne@hp.com
Cc: public-rdf-dawg-comments@w3.org

From: "Seaborne, Andy" <andy.seaborne@hp.com>
Subject: RE: Coments on first working draft of SPARQL
Date: Mon, 25 Oct 2004 13:44:59 +0100

> Peter,
> 
> Thank you very much for the comments:
> 
> Changes where mentioned are started in v1.121.  As a wokring draft
> document, there will be quite a few changes to come.  Some of the
> matters arising can't be completely finished until other documents are
> ready.
> 
> 	Andy
> 
> -------- Original Message --------
> > From: Peter F. Patel-Schneider <>
> > Date: 13 October 2004 17:09
> > 
> > I took a quick look at
> > 
> >     SPARQL RDF query language
> >     http://www.w3.org/TR/rdf-sparql-query/
> > 
> > For a first working draft it is quite good.

[Agreements elided.]

> > Nevertheless, I have a number of things that I think need bringing up.
> > Now for some more substantive issues:
> > 
> > 
> > SPARQL allows bnodes in triple patterns and in constraints.  This
> leads
> > to a number of thorny issues.
> > 
> > How are blank nodes handled in constraints?  For example, what does
> > 	_:a < 30  (where _:a is a blank node)
> > evaluate to?
> 
> The exact evaluation will depend on the constraint function but in this
> example it would evaluate to an error and hence lead to the rejection of
> potental solutions where a bNode is compared.

I don't see any language in the working draft supporting this.  Remember, a
blank node is not a variable.

> The working draft had very little in this area and the editors version
> has added some material, especially the use of (a subset of) the
> Xquery/Xpath functions and operators.
> 
> I have also 
	       ^^^???

> > How are blank nodes handled in triple patterns?  For example, does the
> > triple pattern
> > 	( ?x ex:r _:v )
> > match the RDF graph
> > 	ex:a ex:r _:a .
> > 	ex:a ex:r _:b .
> 
> Your comments suggest that a section devoted to the details around
> bNodes would be helpful.  This has been started in the editors working
> draft.
> 
> The query syntax does not allow bNodes in queries. bNodes can not be put
> in query requests and that needs to be explained somewhere.

The working draft has explicit wording to the contrary.

  <p class="defn"><b>Definition:</b> RDF Term<br />
  <br />
  An <span class="definedTerm">RDF Term</span> is anything that can
  occur in the <a href=
  "http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-data-model">
  RDF data model</a>.<br />
  let RDF-U be the set of all <a href=
  "http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">
  RDF URI References</a><br />
  let RDF-L be the set of all <a href=
  "http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-literal">
  RDF Literals</a><br />
  let RDF-B be the set of all <a href=
  "http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">
  bNodes</a><br />
  <br />
  The set of RDF Terms, RDF-T, is RDF-U union RDF-L union RDF-B</p>


  <p class="defn"><b>Definition:</b> <a id="defn_TriplePattern"
  name="defn_TriplePattern">Triple Pattern</a><br />
  <br />
  The set of <span class="definedTerm">triple patterns</span>
  is<br />
  &nbsp;&nbsp;&nbsp; (RDF-U union RDF-B union V) x (RDF-U union V)
  x (RDF-T union V)</p>

So both subjects and objects in Triple Patterns can be blank nodes.

The SPARQL grammar appears to agree with these definition.  Of course, that
grammar is not very well written, as it makes literals include URIs.

> > In general, what is the status of blank nodes in SPARQL?  For example,
> > which definition of subgraph does SPARQL use - the standard one from
> > graph 
> > theory or the expansive one used in RDF semantics in the presence of
> > bnode 
> > relabelling?
> > 
> > Even if bnodes do not appear in a query, how are multiple matches that
> > differ only with respect to bnodes handled?
> > 
> > 
> > Theses issues are all a consequence of the following issue:
> > 
> > SPARQL appears to depend on an unsanctioned extension of RDF, namely
> > that 
> > bnodes in an RDF graph have identity that can be taken out of the graph
> > and 
> > transmitted elsewhere.  Is this the case?  If so, how is this extension
> > going to work?  If not, how can bnodes be handled reasonably in SPARQL?
> 
> In the case where results are serialized, XML or RDF/XML forms, there
> are merely labels (c.f. like bNodes ids in RDF/XML) that are document
> scoped. 

Then this should be stated early and often.  As well, the examples should
use different lexical forms for the bnodes.

> The working group is currently actively desiging the result
> serialization formats.  They only enable one bNode in a serialized
> result form to be distinguished from another in the same serialized
> result.  

> They can not be used to get back to the original bNode in the
> graph - that would have to be done by reusing a graph pattern that found
> it.

> In the local case (no serialization of results, directly working with
> the graph), the query processor can be working directly with the graph
> and can return programming language objects that the graph
> implementation uses for bNodes.  bNodes do not leave the graph; the
> programming system has whatever mechanisms it uses to pass references
> around just like literals and URIs in RDF APIs.

Huh?  How does this work?  Is this really going to part of the SPARQL spec?
If so, it exposes a part of RDF that I had safely thought was hidden.  

> 	Andy

Peter F. Patel-Schneider
Bell Labs Research
Received on Monday, 25 October 2004 13:37:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:47 GMT