我正在使用 TitanGraphDB + Cassandra。我按如下方式启动 Titan
cd titan-cassandra-0.3.1
bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties
我有一个 Rexster shell,可以用来与上面的 Titan+Cassandra 通信。
cd rexster-console-2.3.0
bin/rexster-console.sh
我正在尝试使用 Titan Graph DB 对网络拓扑进行建模。我想从我的 python 程序中对 Titan Graph DB 进行编程。我正在为此使用灯泡包。我创建了三种类型的顶点
- switch
- port
- device
我在物理连接的端口之间创建标记边缘。我使用的标签是“链接”。
假设我有两个端口顶点portA
和portB
.
我想写一个函数如下
def is_connected(portA, portB):
...
...
...
如何查找两个顶点是否“由标记的边缘连接”?
我有两个图顶点
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