W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2009

Re: Updates

From: Andy Seaborne <andy.seaborne@talis.com>
Date: Tue, 01 Dec 2009 13:58:13 +0000
Message-ID: <4B1520F5.1080108@talis.com>
To: Paul Gearon <gearon@ieee.org>
CC: SPARQL Working Group <public-rdf-dawg@w3.org>

On 01/12/2009 02:05, Paul Gearon wrote:
> Hi Everyone,


Are there exampe cases where WITH/INTO/FROM is better than GRAPH?
(i.e. am I missing something?)

> - MODIFY is no longer there.
> - Templated updates start with an optional "WITH", which defines the
> graph to use when one is not specified in either a template or a WHERE
> clause.

Shouldn't WITH apply to INSERT DATA / DELETE DATA as well?

> - Instead of the strict form of DELETE...INSERT...WHERE, there is now
> a list of directives of DELETE or INSERT, followed by an optional
> WHERE. The list is executed in order.

I confess I don't see the arbitrary order of INSERTs and DELETEs as very 
clear.  Is there a reason for multiple INSERTs and DELETEs, and allowing 

INSERT { ?s :p 23 }
DELETE { ?s :p 23 }
WHERE  { ?s :p 24 }

is a no-op?  If DELETEs go before INSERTs, it makes it clear DELETEs 
don't apply to INSERTs in the same operation.  Or do they?

> - If the WHERE clause is missing from the end of a templated update,
> each template is treated as its own WHERE clause to use for that
> statement.

Is each abbreviated form is executed on it's own?  The point at which 
patterns are matched matters.

> - I did not include a ; to separate the DELETE/INSERT list because
> there appeared to be no need (given that each is followed by a
> template surrounded by curly braces).

The forms themselves are terminated by } but

directive [ directive ]*

only works if nothing following starts with a directive.

WITH is optional, how do does the parser know when one set of 
INSERT/DELETE ends and another (without WITH) begins?

At the moment there is the possibility of:

directive [ directive ]*

directive [ directive ]*

on it's own is legal.

and where a gap, if any, goes between directives is ambiguous.


could be

<end operation>
<end operation>

<end operation>

Using GRAPH in templates, and having one template being multiple 
GRAPH/BGPs chunks, together with having one DELETE and then one INSERT, 
doesn't get into this situation.

WITH can be scoped or just apply to the rest of the file - which needs 

I think that if ";" is necessary then we have a design flaw because it 
means a simple mistake of omitting ";", or inserting a stray one, may 
change one set of valid operations into another valid set.  The parser 
will not help.

DELETE { ?s ?p ?o }
INSERT { ?s ?p 123 }
WHERE  { ?s ?p ?o . FILTER ( ?o < 45 ) }

is rather different from:

DELETE { ?s ?p ?o } ;
INSERT { ?s ?p 123 }
WHERE  { ?s ?p ?o . FILTER ( ?o < 45 ) }

> If I've missed something that was mentioned in one of the meetings,
> please let me know, and I'll get it in. I should note that I haven't
> touched the grammar definition yet.

Received on Tuesday, 1 December 2009 13:58:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:00:57 UTC