15.5.1 Altering Graphs
This section explains the graph alteration mutation used to add or remove vertex and edge providers of a graph.
You can add or remove vertex and edge providers in a graph that has been loaded or created previously. The mutation can either create a new independent graph, or create a new snapshot for the graph.
You must first create a graph-alteration builder to start altering an existing graph. For example, the following code shows how to start a graph alteration on a graph that is stored in a variable graph
:
Starting a Graph Alteration Using JShell
opg-jshell> var alterationBuilder = graph.alterGraph();
Starting a Graph Alteration Using Java
import oracle.pgx.api.*; import oracle.pgx.api.graphalteration.GraphAlterationBuilder; GraphAlterationBuilder alterationBuilder = graph.alterGraph();
The following topics explain in detail on adding and removing vertex and edge providers: