What SPARQL command can be used to delete all graphs (except for Virtuoso system graphs) from a Virtuoso RDF store?
Can "DROP GRAPH <uri>" be combined with a subquery that selects URIs of all the graphs?
While there are some other ways to delete all triples in Virtuoso, they did not work correctly for me. SPARQL 1.1 defines "DROP [...] ALL" but looks like it is not implemented in Virtuoso yet.
asked 12 Nov '12, 13:22
You can't do exactly what you want as you can't input the results of a
However you could do something like the following which should give you roughly the same effect:
This isn't a great approach and the performance will likely be poor compared to using a
If you simply want to delete the contents of all graphs you can simplify to the following:
I'm a little confused as to why you don't want a Virtuoso-specific solution, when your question specified a Virtuoso back-end...
Virtuoso's SPARQL 1.1 implementation is still a work in progress. If you raise your need through the above paths, we should be able to notify you of progress and/or completion.
Depending on what you're using as a client tool, you could write a procedure that first queries for all graph names, and then steps through the list DROPping each. Similar could be done with Virtuoso's internal procedure language, and run through iSQL or any other SQL connection, using our SPASQL (or SPARQL-in-SQL) feature.
answered 14 Nov '12, 23:30
I work with data sets around 100-500M triples regularly w/ Virtuoso.
Honestly I don't know how long it takes to CLEAR GRAPH when the graph is that big because I've never waited for it to finish.
I just shut the server down, delete all the virtuoso.* files other than virtuoso.ini, and restart the server.
In an unstriped setup it is back up in < 30 seconds. If you have stripes it may spend some time filling them before it starts but this is still much quicker than CLEAR GRAPH for a huge graph.
answered 17 Nov '12, 14:05