3

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

Titan Graph DB を使用してネットワーク トポロジをモデル化しようとしています。Python プログラムから Titan Graph DB をプログラムしたいと考えています。そのために電球パッケージを使用しています。3 種類の頂点を作成します

 - switch
 - port 
 - device

物理的に接続されているポート間にラベル付きのエッジを作成します。使用するラベルは「リンク」です。

2 つのポート頂点portAとがあるとしportBます。

以下のような関数を書きたい

def is_connected(portA, portB):
     ...
     ... 
     ...

2 つの頂点が「ラベル付きエッジで接続されている」かどうかを確認するにはどうすればよいですか?

私は2つのグラフ頂点を持っています

src_sw_other_ports
<Vertex: http://localhost:8182/graphs/graph/vertices/48>

dst_sw_other_ports
<Vertex: http://localhost:8182/graphs/graph/vertices/72>

私が試してみました

link_exists = src_sw_other_ports.out.retain([dst_sw_other_ports]).hasNext()

次のエラーが表示されます。

  File "/home/karthik/Projects/ryu/ryu/app/simple_switch.py", line 238, in compute_path
    link_exists = src_sw_other_ports.out.retain([dst_sw_other_ports]).hasNext()
  File "/usr/local/lib/python2.7/dist-packages/bulbs/element.py", line 209, in __getattr__
    raise AttributeError(name)
AttributeError: out
4

2 に答える 2