4
votes

I want to bulk delete nodes in the same way we can bulk load data using a curl operation in AWS Neptune. Is there an API convention for gremlin like I see for SPARQL? If so can you please post reference?

If there is no bulk delete via the API, how feasible is it to bulk delete with the gremlin python sdk?

2

2 Answers

7
votes

There is an example of how to delete a graph using multi threaded Python at this location. The code could be further improved to work with very large graphs. That is discussed in the comments. I have successfully deleted graphs with 20+ million vertices using this code.

https://github.com/awslabs/amazon-neptune-tools/tree/master/drop-graph

EDITED 2021-11-17 If you want to delete everything, Amazon Neptune now provides a "fast reset" API that allows you to efficiently delete all the data in a cluster.

https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-fast-reset.html

0
votes

We can pass batch of elements inside the vertex as an argument like below:

vertex_ids = ['f1b8','e5123','02d49','50804',c71c3','c1061577']
g.V(vertex_ids).drop().iterate()

I was taking a batch size of 10k vertex_ids. It worked fine for me.