On 10/05/13 14:52, Cekov, Luchesar wrote:
Hi Damian,

Many thanks!

The query
DELETE { GRAPH ?g { <http://s/1>  ?p ?o } } WHERE { GRAPH ?g {
<http://s/1>  ?p ?o  } }
Worked!


Just to make sure I made my point:
Yes my store is configured so that the default graph is union of all the
named graphs. That's way I am expecting when deleting without a graph to
delete from any of the named graphs as it is per spec.

My delete query "DELETE { <http://s/1>  ?p ?o } WHERE { <http://s/1>  ?p
?o .}" is a case of DELETE/INSERT query with no INSERT and no WITH or
WHERE clauses.

According to the sparql11-update specification for DELETE/INSERT
http://www.w3.org/TR/sparql11-update/#deleteInsert

"The WITH clause defines the graph that will be modified or matched
against for any of the subsequent elements (in DELETE, INSERT, or WHERE
clauses) if they do not specify a graph explicitly. If not provided, *then
the default graph of the Graph Store (or an explicitly declared dataset in
the WHERE clause) will be assumed.*"

dataset != graph store.

The uniongraph applies to the dataset for queries.

The graph store has a concrete default graph which has zero triples in it. It's much more focused on data management.

The default graph for me is any or all graphs so my DELETE/INSERT query
should delete from any and all the graphs.
Why should the query be specific as the spec implicitly defines the scope
very well? What the spec defines is also the common sense in my opinion.

        Andy


Thanks again,
Luchesar

On 10/05/2013 13:44, "Damian Steer" <[email protected]> wrote:

On 10/05/13 13:13, Cekov, Luchesar wrote:
Hi there,

Hi,

I started using Jena TDB and Fuseki just recently and I am trying to
post some Sparql Update Delete statements.
I am experiencing a problem when deleting with no explicit graph
specified.

DELETE { <http://s/1>  ?p ?o } WHERE { <http://s/1>  ?p ?o .}

The above will not delete any statements that have been inserted in a
specific graph.


WITH <http://test/uri>
DELETE { <http://s/1>  ?prop ?obj  }  WHERE {<http://s/1>  ?prop ?obj}


The statements get really deleted!


According to Sparql 1.1 Update spec [1] the default graph should be
used if there is no graph explicitly specified in the update query which
I reason means that the statements above should be deleted even if a
GRAPH is not explicitly specified. Furthermore if I query with no
explicit graph specified like:


select * where {<http://s/1> ?p ?q}


I get all the statements from above.

Your store is configured so that the default graph is a union of all the
named graphs, rather than a distinct graph in itself. For queries that's
fine, but for update operations you need to be specific about where the
data is stored.* So try:

DELETE { GRAPH ?g { <http://s/1>  ?p ?o } } WHERE { GRAPH ?g {
<http://s/1>  ?p ?o  } }

instead, which remembers where the triple was found.

Damian

* What you want could be made to work, I think. You've just bumped into
the limits of the current illusion.

Reply via email to