2
我想創建頂點和泰坦圖形數據庫的邊緣(Titan1.0.0)創建頂點和邊..問題與泰坦圖形數據庫
gremlin> graph = TitanFactory.open('titan-1.0.0-hadoop1/conf/titan-cassandra-es.properties')
gremlin> t1 = graph.addVertex(label, "Testbed", "Name", "testbed1","Status","A","TId",101)
==>v[1228816568]
gremlin> r2= graph.addVertex(label, "Router", "RStatus","F","RId",1002, "TId", 101)
==>v[3686424680]
gremlin> t1.addEdge("tbConRtr", r2)
==>e[kblqtz-kblsxk-d6vp-1oysvhk][1228816568-tbConRtr->3686424680]
問題:
1)爲什麼這裏返回的頂點數是不是序列,它是一些隨機數?對於addEdge
步也被一些隨機值(kblqtz-kblsxk-d6vp-1oysvhk
)
e[kblqtz-kblsxk-d6vp-1oysvhk][1228816568-tbConRtr->3686424680]
2)我想創建邊緣我TId
值應該是唯一的 我曾嘗試以下,並得到錯誤信息:
gremlin> mgmt.buildIndex("TId",Vertex.class).addKey(TId).unique().buildCompositeIndex();
No such property: TId for class: groovysh_evaluate
我如何在Titan數據庫中創建獨特的屬性值?
請幫我解決這個問題。