ArangoDB マニュアルの「実行時にグラフ定義を変更する」セクションに、実行時にエッジ定義を変更する次の方法が示されています。
新しいエッジ定義を既存のグラフに追加:
/* load graph module */
var graph_module = require("org/arangodb/general-graph");
/* load existing graph by name */
var graph = graph_module._graph("myGraph");
/* add a relation for edge collection myEC2, with vertices
between collections myVC1 and myVC3 */
var defs = graph_module._relation("myEC2", ["myVC1"], ["myVC3"]);
/* update the existing graph's definition */
graph._extendEdgeDefinitions(defs);
既存のグラフの既存のエッジ定義を変更する:
/* load graph module */
var graph_module = require("org/arangodb/general-graph");
/* load existing graph by name */
var graph = graph_module._graph("myGraph");
/* update the relation for edge collection myEC2, with vertices
between collections myVC23 and [ myVC42, myVC99 ] */
var defs = graph_module._relation("myEC2", ["myVC23"], ["myVC42", "myVC99"]);
/* update the existing graph's definition */
graph._editEdgeDefinitions(defs);