I am trying to clear all loaded graphs into my Apache Marmotta instance. I have tried several SPARQL queries to do so, but I am not able to remove the RDF/XML graph that I imported. What is the appropriate syntax to do so?
Apache Marmotta Delete All Graphs using SPARQL Update
559 Views Asked by Sara Lafia At
1
Try this query:
Be careful, as it deletes every triple in the database, including the built-in ones of Marmotta.
A couple of things I did for experimenting:
I downloaded the source code of Marmotta and used the Silver Searcher tool for searching for
DELETE
queries with the following command:This did not help much.
I navigated to the Marmotta installation directory and watched the debug log:
This showed that the parser is not able to process the query
DELETE DATA { ?s ?p ?o }
. The exception behind the "error while executing update" was:This shows that the parser does not allow variables in the query after
DELETE DATA
.Based on a related StackOverflow answer, I tried
CLEAR
/CLEAR GRAPH
/DROP
/DROP GRAPH
, but they did not work.I tried many combinations of
DELETE
,*
,?s ?p ?p
and accidentally managed to get it working with the DELETE WHERE construct. According to the W3C documentation: