BTW, would it be complicated to display the number of triples affected by the query, in the log message?
On Mon, Jul 11, 2011 at 11:43 AM, Olivier Rossel <[email protected]> wrote: > At http://www.w3.org/Submission/SPARQL-Update/#sec_examples , example (b) > says: > > DELETE DATA FROM <http://example/bookStore> > { <http://example/book3> dc:title "Fundamentals of Compiler Desing" } > > It should work too. Does it? > > On Mon, Jul 11, 2011 at 11:34 AM, Rob Vesse <[email protected]> wrote: >> Hi Camel >> >> Yes the DELETE is formulated incorrectly, you have specified things to be >> deleted but not said explicitly where to delete them from. So though it is >> matching your triples in a specific graph it tries to delete them from the >> default graph which is not where they are located so they aren't actually >> deleted. >> >> Try the following instead: >> >> WITH <http://test> >> DELETE >> { >> ?s ?p ?v >> } >> WHERE >> { >> ?s ?p ?v . >> <http://a/resource/> ?p ?v . >> } >> >> The WITH should set the graph to be used both for the DELETE and the WHERE >> clause. If that doesn't work (or you need to match from one graph but >> delete in another) you can state the GRAPH explicitly in both clauses: >> >> DELETE >> { >> GRAPH <http://text> { >> ?s ?p ?v >> } >> } >> WHERE >> { >> GRAPH <http://test> { >> ?s ?p ?v . >> http://a/resource/> ?p ?v . >> } >> } >> >> Hope that helps, >> >> Rob Vesse >> >> >>> -----Original Message----- >>> From: Camel Christophe [mailto:[email protected]] >>> Sent: 11 July 2011 10:21 >>> To: [email protected] >>> Subject: How delete works on Fuseki >>> >>> Hello everybody ! >>> >>> I want to make the removal of a resource in the Fuseki triple store. >>> >>> For example, the resource has been inserted like this (into a named >>> graph) : >>> >>> INSERT DATA INTO <http://test> { >>> <http://a/resource/> <http://a/property> "a first value" . >>> <http://a/resource/> <http://a/property> "a second value" . >>> } >>> >>> I can easily see its triples like this : >>> >>> select * where { >>> graph <http://test> { >>> ?s ?p ?v . >>> <http://a/resource/> ?p ?v . >>> } >>> } >>> >>> Ok, now I want to delete those triples from the store (i.e. I want to >>> delete the resource). I do the following: >>> >>> DELETE >>> { ?s ?p ?v } >>> WHERE >>> { >>> graph <http://test> { >>> ?s ?p ?v . >>> <http://a/resource/> ?p ?v . >>> } >>> } >>> >>> >>> Fuseki answers "Update succeeded". Good, but the triples haven't been >>> deleted. The previous select request still returns the following >>> content : >>> >>> <http://a/resource/> <http://a/property> "a first value" >>> <http://a/resource/> <http://a/property> "a second value" >>> >>> >>> What's going wrong ? I suspect a bad formulation of the delete query, >>> yet it seems to me correct. >>> >>> Thanks ! >> >> >
