【发布时间】:2014-08-28 20:59:03
【问题描述】:
我正在使用 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
【问题讨论】:
-
gremlindocs.com 是一个有很多 gremlin 说明和食谱的甜蜜网站。例如:gremlindocs.com/#recipes/finding-edges-between-vertices
标签: groovy cassandra gremlin titan bulbs