Re: DELETE and blank nodes

On 3 Mar 2010, at 12:26, Ivan Herman wrote:
...
>> == My Opinion ==
>>
>> While I'm sympathetic to Sandro's use case, I'm frightened of the  
>> fact
>> that:
>>
>>  DELETE { _:b1 :p :o } WHERE { }
>> and
>>  DELETE { ?b1 :p :o } WHERE { }
>>
>> do dramatically different things. Because of this, I'd rather we go  
>> with
>> the first proposal and prohibit blank nodes in the DELETE template
>> entirely.
>
> I think Sandro's use case is important. Eg, this is the only way we  
> can
> manipulate, via SPARQL UPDATE, RDF graphs encoding OWL constructs  
> or, if
> Sandro's RIF-in-RDF encoding is done, RIF rules. With entailment  
> regimes
> around the corner, I think this is important. (And yes, as you say,  
> the
> restriction on non-named blank nodes is difficult to justify.)

One possibility, which I shied away from mentioning before because  
it's probably a hornets nest, is to change the definition of (0 1 2)  
to produce non-*-projected variables, instead of bNodes. I think this  
will be compatible with the semantics of SPARQL 1.0, but wouldn't  
swear to it.

This means that DELETE WHERE { :x :p (0 1 2) } would expand to  
something like:

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.

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.

- 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 Wednesday, 3 March 2010 14:03:39 UTC