Re: Review of "SPARQL 1.1 Update"

On 08/01/2010 4:16 PM, Paul Gearon wrote:
> Fri, Jan 8, 2010 at 11:04 AM, Steve Harris<steve.harris@garlik.com>  wrote:
> <snip/>
>> Well, I'd have thought the common case was a single operation in a request,
>> so:
>>
>> WITH<uri>
>> DELETE { ?x :p ?v }
>> INSERT { ?x :q 234 }
>> WHERE { ?x :q 123 }
>>
>> That mean less characters are used on average, if you care about that sort
>> of thing. And if you want two operations:
>>
>> WITH<uri>
>> DELETE { ?x :p ?v }
>> ;
>> INSERT { ?x :q 234 }
>> WHERE { ?x :q 123 }
>>
>> That seems visually like two statements to me. Some SQL systems use ; to
>> separate statements too, and it's familiar to programmers of C-derived
>> languages.
>>
>> - Steve
>
> Makes sense. So do we tack a [ ';' ] to the end of the expression?
>
> Paul

Not overloading DELETE would work now we have not got a short-form of 
INSERT and the multiple use of DELETE and INSERT with one WHERE.

I suggest:

    REMOVE { ?x :p ?v }

for the short form of delete.

So now the keyword DELETE is only used with required WHERE giving a 
grammar of:

DELETE {} (INSERT {} )? WHERE {}
INSERT {} WHERE {}
REMOVE {}

-----

Another way to proceed is to put the WHERE pattern first because the 
keyword introduces the operator.  There is a similarity with the some 
programming language features so USING is a possible choice:

USING { pattern }
DELETE {}
INSERT {}

And the grammar is

USING { pattern } ( DELETE {} (INSERT {} )? | INSERT {} )

where () are EBNF grammar brackets, not SPARQL update tokens.

Separating the DELETE from it's pattern by a INSERT is not now possible.


For completeness, if WITH were a scoped form, USING could be as well for 
style consistency.

USING { pattern }
{
   DELETE {}
   INSERT {}
}


-----

Overall, I prefer both the use of REMOVE and of the first USING example.

	Andy

Received on Friday, 8 January 2010 18:28:29 UTC