How to delete edges

Now I have some edge information stored in a ListAccum@@treebranch. Is there any way to delete these edges from the graph I defined, and then delete the remaining edges and nodes for output?

you want to delete the data stored in the edges and nodes ?

Does your accumulator contain edges, or does it contain copies of some attribute values that you read from some edges? Edges and vertices are like objects. When we say that an accumulator contains vertices or edges, it contains references to those objects. If you delete those objects, then those references will be broken.

Any, if you want to delete edges, you can use the DELETE statement.

There are two versions: a standalone statement and one that sits insight an ACCUM clause. In practice, the latter is used more often, because users often need the SELECT-ACCUM to find the edges that they want to delete.

There are also REST endpoints for inserting and deleting edges:

1 Like

Thank you for your reply. I will take your advice.What should I do if I want to delete the edges stored in SetAccum @@edge_set from the original image in the query?

Based on the documentation, I think you could delete those edges using a FOREACH loop:

Note that in GSQL, inserts and deletes do not become visible until the query is completed. That is, you can’t insert/delete in one part of a query and expect to see the effect later in the same query.