Re: ISSUE-48: Less verbose delete syntax

On 08/11/2009 14:23, Steve Harris wrote:
> On 6 Nov 2009, at 19:29, Andy Seaborne wrote:
>>
>> On 06/11/2009 17:55, Steve Harris wrote:
>>> On 6 Nov 2009, at 10:26, Andy Seaborne wrote:
>>>> Consider:
>>>>
>>>> DELETE { ?x :p ?o }
>>>> DELETE { ?x :p ?o } WHERE { ?x :p o . FILTER(?o = <doesnotexist> }
>>>>
>>>> which might arise from either using DELETE for INSERT by mistake the
>>>> second time or other bad editting
>>>
>>> I don't quite follow this example.
>>
>> The point is made better below. It shows that it's easy to make
>> mistakes - the accidently change to two operations, rather than one,
>> results in a less constrained DELETE with potentially dangerous effects.
>>
>> rm -rf *.rdf
>> and
>> rm -rf * .rdf
>>
>> are rather different.
>
> Ah, I understand now. I hadn't understood that you were proposing it
> could be read as a single statement. That would be addressed with the
> use of ; though, I think.
...
 >> Isn't this going to lead to potentially easy mistakes to make?
 >> Omitting the ";" isn't necessarily a syntax error - it's a different
 >> but valid set of requests.
 >
 > I think the ; is intended to be mandatory between operations.

I'm not sure it solves the problem in a useful (not making errors too 
easy) way.  Omitting ";" needs to lead to a synatx error, not an 
alternative parsing.

Example: from the F2F notes (and so I may have misunderstood):

DELETE { ... }
INSERT { ... }
WHERE { ... }

and

DELETE { ... } ;
INSERT { ... }
WHERE { ... }

are legal and different.  DELETE WHERE is better - maybe not better enough.

Looked at it like that, different names for specific shortcuts might be 
safer.  e.g. REMOVE { ... }

DELETE DATA, INSERT DATA could do with their own names.

It's a tricky balance of regularity and avoiding all-too-easy traps.  It 
is also a value judgement.

	Andy

Received on Sunday, 8 November 2009 17:31:01 UTC