Re: DELETE and blank nodes

On 3 Mar 2010, at 17:03, Ivan Herman wrote:

> 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...

Yes, that's part of the hornets nest aspect.

>>>> 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 .
> }

Yes, that's what I meant about it not going to work, you'd have to  
write the long-form above, but with the same variables.

- Steve

-- 
Steve Harris, Garlik Limited
2 Sheen Road, Richmond, TW9 1AE, UK
+44 20 8973 2465  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10  
9AD

Received on Thursday, 4 March 2010 14:54:54 UTC