tinkerpop/blueprints — Issue #194: tinkergraph addVertex vertex as ID
Author: i000
Created: 2011-12-12 22:02:32+00:00
State: open

the documentation for addVertex reads:

"If the identifier is a vertex (perhaps from another graph), then the vertex is duplicated for this graph. Thus, a vertex can not be an identifier."

However, the following seems to work:

gremlin> tg = new TinkerGraph()
==>tinkergraph[vertices:0 edges:0]
gremlin> tg.addVertex(1,['a':2])
==>v[1]
gremlin> tg.V
==>v[1]
gremlin> tg.v(1)
==>v[1]
gremlin> tg.addVertex(tg.v(1))
==>v[v[1]]
gremlin> tg.v(1)
==>v[1]
gremlin> tg.v(tg.v(1))
==>v[v[1]]