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.*"
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.
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.
********************************************************************************
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and
attachments (if any). No contracts may be concluded on behalf of Macmillan
Publishers Limited or its agents by means of e-mail communication. Macmillan
Publishers Limited Registered in England and Wales with registered number
785998
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS
********************************************************************************