0

I want to set up my own id to vertex like the way mentioned below.

BaseConfiguration configuration = new BaseConfiguration();
configuration.setProperty("storage.backend", "hbase");
configuration.setProperty("storage.hostname", "slave05");
configuration.setProperty("storage.port", "2181");
configuration.setProperty("storage.tablename", "REC_GRAPH1");
TitanGraph graph = TitanFactory.open(configuration);

Vertex vertex = graph.addVertex(200);
graph.commit();

But I'm not able to.. I guess I'm missing some configuration setup.

Please help me..

Thanks, Vivek

user3322698
  • 265
  • 1
  • 5
  • 19

1 Answers1

2

Titan assigns it's own identifiers. You can not assign your own. This behavior is typical of most graph databases (you will find this situation in nearly all Blueprints implementations). If you have an identifier you wish to persist that is custom to you, you should create an appropriate index for fast lookup of that value and treat it as a property on your vertex.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • It means you are saying we can have it as a property of that vertex (something like id=2)? We can't override the default vertex-id ? – user3322698 Apr 07 '14 at 12:17
  • You can't override the id and "id" itself is a reserved property name. Just rename it to to something else and reference it as such (e.g. _id, uid, etc) – stephen mallette Apr 07 '14 at 12:58