Re: Example updates

On 03/12/2009 10:57, Steve Harris wrote:
> On 3 Dec 2009, at 01:44, Paul Gearon wrote:
>
>> On Wed, Dec 2, 2009 at 6:32 AM, Steve Harris <steve.harris@garlik.com>
>> wrote:
>>> On 1 Dec 2009, at 21:06, Paul Gearon wrote:
>>>
>>>> The main question on updates seems to be around referring to multiple
>>>> graphs, so these operations are based on that idea. I'll be using some
>>>> common prefixes (foaf:, contact:), so I hope no one minds if I don't
>>>> define them.
>>>>
>>>> I can't recall if I'm supposed to be writing according to a specific
>>>> syntax, so I'll offer a couple of variations.
>>>>
>>>> The first case has one source for pattern matching, and one
>>>> destination for insertion.
>>>> This example copies the contents of one graph into another.
>>>>
>>>> (1) The original form would be:
>>>>
>>>> INSERT INTO <destination> { ?s ?p ?o }
>>>> WHERE { GRAPH <source> { ?s ?p ?o } }
>>>>
>>>> (2) With the recent changes:
>>>>
>>>> WITH <source>
>>>> INSERT INTO <destination> { ?s ?p ?o }
>>>> WHERE { ?s ?p ?o }
>>>>
>>>>
>>>> (3) Or using GRAPH instead of INTO:
>>>>
>>>> WITH <source>
>>>> INSERT { GRAPH <destination> { ?s ?p ?o } }
>>>> WHERE { ?s ?p ?o }
>>>
>>> So, in this case wouldn't INSERT ... FROM be a perfectly reasonable
>>> thing to
>>> write? It would have the same meaning as in SELECT, wouldn't it?
>>
>> I'm not sure where you're going here.
>>
>> Are you suggesting using FROM to indicate what the WHERE clause should
>> be resolved against? If so, then sure. However, the advantage of WITH
>> is that it also applies to INSERT and DELETE where no graph is
>> supplied. In that case, the word "FROM" isn't appropriate. WITH is a
>> little more general, even if it's not very pretty.
>
> Ah, I see, I think.
>
> ...

Having a "apply to this particular graph" form is a good idea but it 
needs scoping - I prefer an explicit scope form: how about:

USING <a>
{
    DELETE
    INSERT
    WHERE
}

When looking at abbreviated DELETEs combined with WITH, the forward 
scope of the qualification needs to be considered and this makes 
explicit what it is.

((Similar issues for the backwards scope of WHERE  - this proposal 
doesn't help that one.))

	Andy

Received on Thursday, 3 December 2009 11:34:04 UTC