Re: ISSUE-48: Less verbose delete syntax

On 23 Nov 2009, at 13:38, Andy Seaborne wrote:
>>>
>>> (The question for me is more whether we should do less, not more,  
>>> than
>>> that.)
>>
>> I think my preference is BGPs + GRAPH only. Possibly no bNodes too,
>> depending on what the exact semantics of bNodes are in this case.
>>
>> I'm not really adverse to FILTER, but I have systems where optmising
>> DELETE WHERE { ?x a <Foo> } etc. is really easy, but
>> WHERE { ?x a ?type . FILTER (REGEX(STR(?type), "Foo")) } (i.e.  
>> anything
>> that doesn't trivially optimise down to algebra expressions) is  
>> hard to
>> do. Personal bias :)
>>
>> Would be nice to have some form of DELETE that will always be fast,
>> relative to the amount of data it has to remove.
>
> If there is a FILTER, then it can be more work but if no FILTER is  
> mentioned, there is no reason it should get in the way.  So FILTER- 
> less should be fast for you.
>
> With just BGP+FILTER, the FILTER is always the outermost and easy to  
> find.
>
> GRAPH changes that but then you don't need the FILTER to get  
> complicated:
>
> DELETE WHERE { ?x a <Foo> ; :p ?o. GRAPH ?g { ?y a <Bar> ; :p ?o} }
>
> There's an argument that we need a "no join" restriction (join  
> across quad patterns) and so it's always of the form:
>
>  filter?
>    graph?
>      BGP
>
> for optional filter and graph at the algebra level.

Aren't Joins only a problem if FILTER is present?

DELETE WHERE {
   ?x a <Foo> .
   GRAPH ?g {
     ?x a ?y
     FILTER (?y != <Foo>)
   }
   ?y a rdf:Class .
}

Otherwise the pattern can be reordered without changing the semantics,  
as far as I understand it.

> Because it's rather easy to detect the fast forms, I think  
> restricting the syntax is not the right way to go.  A clear  
> description as BGP+GRAPH+FILTER from query patterns is easier to  
> explain (and possibly parse/detect).

Agreed, restricting syntax is not ideal.

A grammar like 'DELETE' 'WHERE' '{' template '}' would be cleanest IMHO.

- Steve

-- 
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 Monday, 23 November 2009 14:51:27 UTC