How to purge all vertices and edges from a tigergraph database?

What would be the correct way to purge all vertices and edges from a tigergraph database please?

Any standard endpoint? How to configure?

Anyone have a custom query?

Thanks,
Martyn

1 Like

There are a couple of options. If you are running the Developer version, then simply change the schema and publish it, it automatically purges the database.

A more normal way to do it is to go into Graph Studio -> Load Data and look for the waste bin icon at the top of the screen.

I don’t think there is a REST endpoint for that function. I’ll have a look and get back here if I find it.

Regards

Richard Henderson

OK, there is this: https://docs.tigergraph.com/dev/restpp-api/built-in-endpoints#delete-graph-graph_name-delete_by_type-vertices

You’ll need to iterate through each of your vertex types, but otherwise it will do what you want.

Regards

RH

Jon, there has got to be a better way to do this. In development, there are many times people need to clear the data and reload it without rebuilding the schema. They need to be able to do it quickly.

(Schema rebuilds in TG usually take a minute or more. This is an issue in itself. Why do schema rebuilds take so long? Why are they necessary? Could this be reworked to make schema changes more performant.)

Cypher allows users to clear a graph with a command like
MATCH (n) DETACH DELETE n;

This simply detaches and removes all relationships and then deletes all of the nodes.

Isn’t there possibly some way to do something like this in GSQL with TigerGraph using DELETE statements? Is there a way to specify the universal deletion of all relationships (of all types) and all nodes (of all types)?

TigerGraph is so powerful in so many areas. It seems like many users would benefit from some simple function that clears the graph quickly without forcing a schema rebuild.

@anthony.gatlin how about clearing the graph store?
https://docs.tigergraph.com/dev/gsql-ref/ddl-and-loading/running-a-loading-job#clearing-and-initializing-the-graph-store

Bruno

2 Likes

Thank you, @Bruno_Simic! This is perfect!

1 Like