neptune drop graph sparql
I learned this when trying to clear our records in AWS Neptune.
I was hitting the query timeout when trying to drop an entire graph.
If you don't want to/can't raise the timeout, you can drop
smaller parts of the graph in each transaction.
curl -sX POST http://<cluster-prefix>.rds.amazonaws.com:8182/sparql --data-urlencode 'update=
DELETE {
GRAPH <http://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph> { ?s ?p ?o }
}
WHERE {
GRAPH <http://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph> {
{
SELECT ?s ?p ?o
WHERE {
?s ?p ?o .
}
LIMIT 10
}
}
}
'
This will delete 10 records, specifically the first 10
that are returned for a SELECT * WHERE { ?s ?p ?o } query.
You can adjust the limit value to find a batch size that keeps you under the timeout.