RE: INSERT/DELETE Update syntax



> -----Original Message-----
> From: public-rdf-dawg-request@w3.org [mailto:public-rdf-dawg-request@w3.org]
> On Behalf Of Steve Harris
> Sent: 08 October 2009 13:17
> To: public-rdf-dawg@w3.org Group
> Subject: INSERT/DELETE Update syntax
> 
> 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 ... }
> }

The reason is that it's a CONSTRUCT template + operation parameters.  It's not a strong reason.

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

We still need a DATA keyword to help distinguish bulk update and pattern update.  The alternative is that the pattern must  (if there is a pattern) come before the template.

INSERT DATA {
    GRAPH <uri> { ... some triples ... }
}

And we will have to be clear that the <uri> is a URI not a variable in that case.

What about 

INSERT {
    GRAPH ?g { ... template ... }
}
WHERE { ... pattern ... }

This has complexity : does it create the graph? (pros and cons about automatically creating graphs - some systems might prefer an enforced fixed set of named graphs and now it can't be determined syntactically).  What is ?g is a literal?  

> INSERT {
>     GRAPH <uri1> { <x> <y> ?a }
>     GRAPH <uri2> { <a> <b> ?b }
> }
> WHERE {
>     ?a <foo> ?b
> }

If ?a is a bnode, what happens? :-)

I suggest that both renaming bnode labels, and choosing not to, are legal.

 Andy

Received on Friday, 9 October 2009 15:46:56 UTC