I\'m using a framework that generates objects Node
and they already have assigned a id. Now they need to be converted to Titan vertices with the same ID control
Very few graph databases actually allow you to set the element identifier. They all tend to have their own ID systems whether you are using Neo4j, OrientDB, Titan, etc. TinkerGraph is really the only Blueprints implementation that allows ID assignment.
If you want to keep your ID, then you should simply rename it to something else. Instead of "id", perhaps you could use "iid". To make things more transparent, from a programming perspective, you might consider use of the IdGraph wrapper, which would allow you to do something like:
gremlin> base = TitanFactory.open('/tmp/titan-berkley')
==>titangraph[local:/tmp/titan-berkley]
gremlin> g = new IdGraph(base, true, false)
==>idgraph[titangraph[local:/tmp/titan-berkley]]
gremlin> g.addVertex(45)
==>v[45]
gremlin> g.v(45)
==>v[45]
You can see IdGraph
allows it to appear as though you are assigning the element id itself. Behind the scenes it is actually just using key indices.