- From: Andy Seaborne <andy.seaborne@talis.com>
- Date: Tue, 01 Dec 2009 13:58:13 +0000
- 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,
...
Overall:
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
INSERTs before DELETEs?
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:
WITH
directive [ directive ]*
directive [ directive ]*
but
directive
on it's own is legal.
and where a gap, if any, goes between directives is ambiguous.
WITH
DELETE
INSERT
WHERE
could be
WITH
DELETE
<end operation>
INSERT
WHERE
<end operation>
or
WITH
DELETE
INSERT
WHERE
<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
WITH DEFAULT.
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.
Andy
Received on Tuesday, 1 December 2009 13:58:32 UTC