Re: DELETE and blank nodes

On 2010-3-3 17:41 , Steve Harris wrote:
>>>
>>> DELETE {
>>>  :x :p ?tmp3 .
>>>  ?tmp1 rdf:first 2 .
>>>  ?tmp1 rdf:rest rdf:nil .
>>>  ?tmp2 rdf:first 1 .
>>>  ?tmp2 rdf:rest ?tmp1 .
>>>  ?tmp3 rdf:first 0 .
>>>  ?tmp3 rdf:rest ?tmp2 .
>>> }
>>> WHERE {
>>>  :x :p ?tmp3 .
>>>  ?tmp1 rdf:first 2 .
>>>  ?tmp1 rdf:rest rdf:nil .
>>>  ?tmp2 rdf:first 1 .
>>>  ?tmp2 rdf:rest ?tmp1 .
>>>  ?tmp3 rdf:first 0 .
>>>  ?tmp3 rdf:rest ?tmp2 .
>>> }
>>>
>>> Which I believe would delete the list.
>>
>> yes, that would work but, oh boy!, it is ugly:-)
> 
> That expansion is equivalent to what the store would do, the user would
> use the () syntax.
>

But that would be a departure from the turtle syntax which defines
(....) as being implicitly expanded into an RDF list construct with
bnodes... O.k., it is done behind the scenes in both cases, but
nevertheless...

>>> More complex things like:
>>>
>>> DELETE {
>>>  :x :p (0 1 2) .
>>> }
>>> WHERE {
>>>  :x :q (3 4 5) .
>>> }
>>>
>>> Aren't going to work, you'd have to write them in full, but I don't see
>>> any way round that.
>>
>> But what does it mean "writing them in full"? The other alternative of
>> Lee is to prohibit blank nodes in the DELETE template, ie, one cannot
>> have a list.
> 
> I think it can, just not expressed using SPARQL "bNodes".
> 
> Writing out in full, is like the machine conversion above, I agree it's
> not very user-friendly.

And I am not even sure I see how that would work. If we expand it like
above, we would get

DELETE {
  :x :p ?tmp3_d .
  ?tmp1_d rdf:first 2 .
  ?tmp1_d rdf:rest rdf:nil .
  ?tmp2_d rdf:first 1 .
  ?tmp2_d rdf:rest ?tmp1_d .
  ?tmp3_d rdf:first 0 .
  ?tmp3_d rdf:rest ?tmp2_d .
}
WHERE {
  :x :q ?tmp3_w .
  ?tmp1_w rdf:first 5 .
  ?tmp1_w rdf:rest rdf:nil .
  ?tmp2_w rdf:first 4 .
  ?tmp2_w rdf:rest ?tmp1_w .
  ?tmp3_w rdf:first 3 .
  ?tmp3_w rdf:rest ?tmp2_w .
}

ie, the two sets of variables would be disjoint (and they have to be).
As a consequence, the DELETE part is essentially void for deletion,
because no variable is bound...

Ivan

> 
> - Steve
> 

-- 

Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF   : http://www.ivan-herman.net/foaf.rdf
vCard  : http://www.ivan-herman.net/HermanIvan.vcf

Received on Wednesday, 3 March 2010 17:02:59 UTC