Re: [SPARQL-Update] WITH, GRAPH, and USING [NAMED]

On Thu, Aug 4, 2016 at 11:04 PM, Pavel Klinov <pavel@complexible.com> wrote:

>
> According to my, perhaps incorrect, reading of 3.1.3 this should be
> equivalent to:
>
> DELETE
> {
>   GRAPH <http://example.org/g1> { ?s ?p ?o }
> }
> USING <http://example.org/g2> WHERE
> {
>   GRAPH <http://example.org/g1> { :a foaf:knows ?s . ?s ?p ?o }
> }
>
> that is, WITH is ignored for DELETE because there's the explicit GRAPH
> clause but applies to WHERE because there's no USING [NAMED]. Then this
> query should not delete any triples because the dataset for WHERE is
> composed of the empty default graph and :g2 as the only named graph, while
> WHERE matches triples in :g2.
>

A correction here: the dataset for WHERE should be :g2 as the default graph
and no named graphs (or unspecified named graphs, as per 13.2 in [3]). But
the rest of the email holds, the query can still return no results contarry
to the test.

Thanks,
Pavel

[3] https://www.w3.org/TR/sparql11-query/#specDataset


>
> However, this is not what DAWG tests [2] expect and it is not how ARQ or
> Sesame implement it (they pass the test). What I can tell from ARQ's source
> code is that it treats the query as follows:
>
> DELETE
> {
>   GRAPH <http://example.org/g1> { ?s ?p ?o }
> }
> {
>   GRAPH <http://example.org/g2> {
>     GRAPH <http://example.org/g1> { :a foaf:knows ?s . ?s ?p ?o }
>   }
> }
>
> In this case, of course, WHERE will match triples because the inner GRAPH
> will set :g1 as the active graph for the BGP. However 3.1.3 says explicitly
> that WITH, when not ignored, defines an RDF Dataset -- this isn't what
> happens here.
>
> Another interpretation could be as follows: WITH is in effect for WHERE if
> there's no USING [NAMED] *and* there is no GRAPH clause in either DELETE or
> INSERT. According to that interpretation the test again should pass because
> WITH is simply ignored for the whole query, including WHERE, even though
> there's no USING [NAMED].
>
> So the question is: which interpretation is the intended one?
>
> Thanks,
> Pavel
>
> [1] https://www.w3.org/TR/sparql11-update/#deleteInsert
> [2] https://www.w3.org/2009/sparql/docs/tests/data-
> sparql11/delete/manifest#dawg-delete-with-02
>

Received on Friday, 5 August 2016 08:39:24 UTC