Is there a way to set the T.label
after the vertex has been created. I have tried the following:
Vertex v = graph.addVertex();
v.property(T.label.name(), "test");
But when I try the following traversal:
graph.traversal().V().hasLabel("test").next
I get
org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException
Is there something special about T.label
that limits it to being set at the step of constructing the vertex ?
No, labels cannot be changed. If you need this type of functionality, you should use a vertex property instead.
From the TinkerPop documentation: "NOTE: In TinkerPop3, vertices are allowed a single immutable string label (similar to an edge label). This functionality did not exist in TinkerPop2. Likewise, element id’s are immutable as they were in TinkerPop2."