TitanGraphDB + Cassandraを使用しています。次のようにTitanを起動しています
cd titan-cassandra-0.3.1
bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties
上記の Titan + Cassandra との通信に使用できる Rexster シェルがあります。
cd rexster-console-2.3.0
bin/rexster-console.sh
Python プログラムから Titan Graph DB をプログラムしたいのですが、そのために電球パッケージを使用しています。
from bulbs.titan import Graph
g = Graph()
vertex1 = g.vertices.get_or_create('dpid',dpid_str,{'state':'active','dpid':dpid_str,'type':'switch'}))
vertex2 = g.vertices.get_or_create('desc',desc,{'desc':desc,'port_id':port_id,'state':state,'port_state':port_state,'number':number,'type':'port'}))
例から、以下のように頂点間にエッジを作成する方法を理解しています
g.edges.create(vertex1,"out",vertex2)
しかし、私のプログラムには頂点への参照がないと仮定してください。
キー「dpid」を使用して vertex1 を取得し、キー「desc」を使用して vertex2 を取得したい
そして、取得した値を使用して、エッジを作成したいと思います。これを行うにはどうすればよいですか?