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

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top