W3C home > Mailing lists > Public > public-rdf-wg@w3.org > April 2011

Re: SPARQL update with blank nodes

From: Alex Hall <alexhall@revelytix.com>
Date: Wed, 20 Apr 2011 21:17:42 -0400
Message-ID: <BANLkTimn0edKxben=CPs8m8vLa3s_oBa-w@mail.gmail.com>
To: Peter Frederick Patel-Schneider <pfps@research.bell-labs.com>
Cc: public-rdf-wg@w3.org
Trying again, having had a chance to clear my head...

On Wed, Apr 20, 2011 at 1:55 PM, Peter Frederick Patel-Schneider <
pfps@research.bell-labs.com> wrote:

> From: Alex Hall <alexhall@revelytix.com>
> Subject: Re: SPARQL update with blank nodes
> Date: Wed, 20 Apr 2011 12:48:24 -0500
>
> > On Wed, Apr 20, 2011 at 1:36 PM, Peter Frederick Patel-Schneider <
> > pfps@research.bell-labs.com> wrote:
> >
> >> So now I don't understand SPARQL 1.1 Update, which states
> >>
> >> Deleting triples that are not present, or from a graph that is not
> >> present will have no effect and will result in success. *Using a new
> >> blank node in a delete template will lead to nothing being deleted, as
> >> the new blank node cannot match anything that already exists.*
> >> [emphasis added]
> >
> > A better way of phrasing that might be, "a blank node label in a delete
> > template may not be reliably assumed to denote any particular resource
> > in the
> > graph."
>
> Well, this is different, but, because it is different, I wouldn't call
> it a better phrasing, but instead ... "different".   The document uses
> "matching", and the only "matching" around for blank nodes in triples is
> RDF instance matching.
>

I understand the need for precise language in specs.  You've pointed out an
inconsistency in the language as written, and I'm trying to surmise what the
author intended and suggest alternate language which conveys that intention
without the inconsistency.


>
> >> because blank nodes *do* match, as per SPARQL 1.1 query.
> >
> > Blank nodes in the WHERE pattern act as local variables that match
> > anything,
> > but are projected out of the result set.
> >
> > A better comparison is probably to blank nodes in a CONSTRUCT template,
> > described here:
> >
> > http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#tempatesWithBNodes
> >
> > [[
> > A template can create an RDF graph containing blank nodes. The blank
> > node
> > labels are scoped to the template for each solution. If the same label
> > occurs
> > twice in a template, then there will be one blank node created for each
> > query
> > solution, but there will be different blank nodes for triples generated
> > by
> > different query solutions.
> > ]]
>
> I don't see where this bit has anything in common with matching.
>

What happens to the triple patterns in an INSERT or DELETE template is
called "instantiation" in the docs.  While I cannot find an explicit
definition for it, it appears to be loosely defined as the process of
replacing variables in the triple pattern with values bound as a result of
matching the pattern in the WHERE clause against some graph.  I don't think
it was the intent of the author to suggest that the triples in the INSERT or
DELETE template are themselves matched against the graph, although I don't
have any authoritative source to back me up there.

The reason I pointed you to the above section on CONSTRUCT is the following
passage from the definition of DELETE (
http://www.w3.org/TR/2010/WD-sparql11-update-20101014/#t414):

[[
The pattern in WHERE is matched against the graph store analogously to
SPARQL - Query. The resulting variable bindings are used to instantiate the
triple patterns in the DELETE template analogously to CONSTRUCT. The
resulting triples are then removed from the graph store. If the pattern
matching fails, no changes occur.
]]

In short, I think that the inconsistency arises from the mis-use of the term
"match" as a synonym for "denote".

-Alex
Received on Thursday, 21 April 2011 01:18:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:41 GMT