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

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 UTC