I have gremlin-console connected to gremlin-server with janusGraph on backend.
I want to recreate edgeLabel with multiplicity so I send script to gremlin-server with removeEdgeLabel()
command to remove label "hasNext":
graph_creation_script="""
tx = graph.newTransaction();
g.V().drop().iterate();
g.E().drop().iterate();
g.tx().commit()
tx = graph.newTransaction();
a = tx.addVertex(label, "A");
b = tx.addVertex(label, "B");
tx.commit()
mgmt = graph.openManagement()
mgmt.getEdgeLabel("hasNext").remove()
// mgmt.makeEdgeLabel("hasNext").multiplicity(ONE2ONE).make()
//a.addEdge("hasNext",b);
mgmt.commit()
"""
:> @graph_creation_script
Then I comment out the line mgmt.getEdgeLabel("hasNext").remove()
and remove comment symbols from makeEdgeLabel(...)
line to create new label with multiplicity(ONE2ONE)
:
...
// mgmt.getEdgeLabel("hasNext").remove()
mgmt.makeEdgeLabel("hasNext").multiplicity(ONE2ONE).make()
...
and I get error:
Adding this property for key [~T$SchemaName] and value [rtâ–²hasNext] violates a uniqueness constraint [SystemIndex#~T$SchemaName]
So it seems that label was not removed from the schema, but why that happens?