Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top