Re: INSERT/DELETE Update syntax

On 8 Oct 2009, at 22:09, Ivan Mikhailov wrote:

> Steve,
>
> I like your idea, despite that we've implemented INSERT INTO <uri>
> syntax already.
>
> My reasons are
> 1) it makes construction templates more similar to patterns
> 2) Why not permit CONSTRUCT { GRAPH <uri> ... } then to make NQuads/ 
> TriG
> at the output ? :)

That one's a little tricky, there's no syntax in the W3C standards  
track (that I know of) which can represent quads/graphs. It would be  
convenient though, doing:

CONSTRUCT { GRAPH ?g { ?s ?p ?o } }
WHERE { GRAPH ?g { ?s ?p ?o } }

Would be a very handy dump of all the named graphs, which currently  
requires a loop over all the graphs in the application layer, so is  
quite inefficient.

> 3) With federation, it may become INSERT { SERVICE <endpoint-uri>
> { ... } } in a natural way
> 4) I can write INSERT { GRAPH `expression-for-iri` { ... }}

Those are very good points that I hadn't considered.

> So I'd vote for support of both syntax variants.
>
> In addition, I'd like to keep INSERT DATA for statements without WHERE
> clause and probably without any expressions, static data only. This  
> will
> permit the use of very long INSERT DATA statements without the use of
> the optimizing compiler (even without the complete parsing of the  
> whole
> statement before first triple is inserted)

Oh, sorry, I think I misused the INSERT syntax. But yes, that's a good  
idea.

- Steve

> On Thu, 2009-10-08 at 13:17 +0100, Steve Harris wrote:
>> Reflecting on the update syntax I'm just wondering why the syntax
>> looks like:
>>
>> INSERT DATA INTO <uri> {
>>   ... some triples ...
>> }
>>
>> rather than:
>>
>> INSERT {
>>    GRAPH <uri> { ... some triples ... }
>> }
>>
>> which seems like a more obvious parallel to SPARQL 1.0, and allows
>> inserts to multiple graphs in a single insert block, with GRAPH you
>> would be able to write:
>>
>> INSERT {
>>    GRAPH <uri1> { <x> <y> ?a }
>>    GRAPH <uri2> { <a> <b> ?b }
>> }
>> WHERE {
>>    ?a <foo> ?b
>> }
>>
>> which would be less verbose than using the draft syntax, and arguably
>> easier to understand. c.f.
>>
>> INSERT DATA INTO <uri1> {
>>    <x> <y> ?a
>> }
>> WHERE {
>>    ?a <foo> ?b
>> }
>> INSERT DATA INTO <uri2> {
>>    <a> <b> ?b
>> }
>> WHERE {
>>    ?a <foo> ?b
>> }
>>
>> - Steve
>>
>

-- 
Steve Harris
Garlik Limited, 2 Sheen Road, Richmond, TW9 1AE, UK
+44(0)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 Friday, 9 October 2009 08:26:43 UTC