Re: ISSUE-48: Less verbose delete syntax

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.

> Assuming the INSERT is optional as well, which I think is the intent,
> we have to be a bit careful about creating traps for the unwary:
>
> And DELETE without WHERE is potentially ambiguous as a grammar and
> certainly optically:
>
> DELETE
> INSERT
> WHERE
>
> Is that one request
>  DELETE-INSERT-WHERE
> or two
>  DELETE
>  INSERT-WHERE

I think we agreed that there would be some separator (from memory ';')  
to avoid that kind of problem, though I don't think we discussed the  
DELETE { ... } syntax explicitly.

> What about missing the template out instead:
>
> DELETE WHERE {?x :p ?o }

If we're going to support this kind of syntax abbreviation, then this  
looks better to me.

I've had several bad experiences with SQL and typing:
    DELETE FROM table<enter>
when I was just thinking what I would type next and pressed enter  
reflexively. I'm happy to chalk it up to incompetence on my part, but  
I think we can do better than SQL in this area.

- Steve

> 2009/11/6 Kjetil Kjernsmo <kjetil@kjernsmo.net>:
>> On Friday 6. November 2009 02:30:37 Axel Polleres wrote:
>>> We didn't consider this particularly,
>>
>> OK!
>>
>>> but having the
>>> WHERE part optional for a DELETE in that sense you propose
>>> doesn't seem problematic to me, at first sight.
>>
>> Yeah, it breaks the earlier assumption that all variables needs to  
>> be bound
>> in the WHERE clause, but since the value in this case will not be  
>> returned,
>> it will simply be deleted, I think it looks like a nice way to  
>> resolve
>> ISSUE-48.
>>
>> Cheers,
>>
>> Kjetil
>> --
>> Kjetil Kjernsmo
>> kjetil@kjernsmo.net
>> http://www.kjetil.kjernsmo.net/
>>
>>
>> ______________________________________________________________________
>> This email has been scanned by the MessageLabs Email Security System.
>> For more information please visit http://www.messagelabs.com/email
>> ______________________________________________________________________
>>
>

-- 
Steve Harris, CTO, Garlik Limited
2 Sheen Road, Richmond, TW9 1AE, UK
+44(0)20 8973 2465  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10  
9AD

Received on Friday, 6 November 2009 17:55:57 UTC