Actually, you can remove multiple vertices and edges in one round with those endpoints.
The vertex ID in
DELETE /vertices is optional. If you do not specify an ID, then you can use an additional parameter called
filter that allows you to specify a set of simple conditions over the vertex attributes, so you can delete a bunch of vertices meeting that condition(s) in one round.
NOTE: the primary ID is normally not an attribute, so you can’t refer to it in the
filter. If you need to do it, you need to add
WITH primary_id_as_attribute="true" to the vertex definition.
Deleting multiple edges is a bit more restricted, as you must specify a source vertex ID, so you can’t just delete all edges having a specific attribute value; you would need to iterate through all relevant source vertices, and delete the corresponding edges. But if you want to delete some edges originating from the same vertex, you can use the
filter parameter here too.
The workaround for this limitation is to write a query that deletes the edges you don’t need. GSQL is quite flexible and versatile; you can write a query that accepts some value(s) as parameters and delete edges accordingly.
In general, you are free to extend the REST API with whatever functionality you need (as long as it’s data manipulation). Since the installed queries come with REST endpoint, you can use these queries just like the official (i.e. built-in) end points.
What’s more, you do not even need to install queries: through
POST /gsqlserver/interpreted_query you can immediately run queries (skipping the lengthy installation step). There are some limitations on what an interpreted query can do (vs. installed ones), plus of course, interpreted queries are slower (although by not that much), but in your app (that uses the REST API) you can even generate the query body!
I have created a Postman collection for the TigerGraph REST++ API, all endpoints with comments and docs, you might want to have a look at it.
Also, we already have a connector for Python, to make workign with the REST API easier for data scientist and engineers. If Python is not your tool, let us know what is. We might be able to develop a new connector (might be, not guaranteed!).