W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2011

Re: Bnodes in DELETE templates (was: SPARQL Update 1.1 review part1)

From: Axel Polleres <axel.polleres@deri.org>
Date: Tue, 22 Feb 2011 09:20:01 +0000
Cc: "Paul Gearon" <gearon@ieee.org>, "SPARQL Working Group" <public-rdf-dawg@w3.org>
Message-Id: <0B759463-3E4D-4787-B0E2-638D44FBE232@deri.org>
To: "Steve Harris" <steve.harris@garlik.com>
Hi Steve,

I agree with your understanding of CONSTRUCT. 

> * but actually, I can't find anywhere in the SPARQL 1.1 draft that explicitly says that. Could well be looking in the wrong places though.


As far as I can see, it is not really "formalized", but covered by the following sentence in Section 16.2 [1]

"The result is an RDF graph formed by taking each query solution 
in the solution sequence, substituting for the variables in the graph template, 
and combining the triples into a single RDF graph by set union."

I don't think we need to further formalise that, but it seems to me that it might be clearer to write:

"The result is an RDF graph formed by taking each query solution 
in the solution sequence, substituting for the variables in the graph template, 
and combining the <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-triple">valid RDF triples</a> into a single RDF graph by set union."

Opinions?

(The treatment of bnodes in CONSTRUCT templates is covered by what is said in Section 16.2.1.)

Axel



1. http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#construct


On 22 Feb 2011, at 08:43, Steve Harris wrote:

> My recollection of CONSTRUCT is that the template would match*, but only completely bound triples would be output, so
> 
> CONSTRUCT {
>   _:a :p 12 .
>   _:a :q ?o .
> }
> WHERE {
>   ?s :r ?q
>   OPTIONAL { ?s :s :o }
> }
> 
> Would give
> 
> _:b1 :p 12 .
> 
> This seems inline with a usecase for DELETE: "Delete this pattern, and if it exists also this pattern" e.g.
> 
> DELETE {
>   ?x :name ?name .
>   ?x :phone ?phone .
> }
> WHERE {
>   ?x a :Person .
>   OPTIONAL { ?x :name ?name }
>   OPTIONAL { ?x :phone ?phone }
> }
> 
> When I wrote this pattern, my intention was that it would delete whatever names and phone numbers for people it could find.
> 
> * but actually, I can't find anywhere in the SPARQL 1.1 draft that explicitly says that. Could well be looking in the wrong places though.
> 
> - Steve
Received on Tuesday, 22 February 2011 09:20:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:45 GMT