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