我正在使用 TitanGraphDB + Cassandra。我开始泰坦如下
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
- flow
- flow_entry
我在逻辑连接的顶点之间创建边。边缘没有标记。
假设我想测试和之间的连通Vertex A
性Vertex B
我有一个 groovy 脚本 is_connected.groovy
def isConnected (portA, portB) {
return portA.both().retain([portB]).hasNext()
}
现在从我的 rexster 控制台
g = rexster.getGraph("graph")
==>titangraph[embeddedcassandra:null]
rexster[groovy]> g.V('type', 'flow')
==>v[116]
==>v[100]
rexster[groovy]> g.V('type', 'flow_entry')
==>v[120]
==>v[104]
正如你在上面看到的,我有两个流类型的顶点v[116]
和v[100]
我有两个类型的顶点flow_entry
v[120]
和v[104]
我想检查v[120]
和v[116]
例如之间的连接
rexster[groovy]> ?e is_connected.groovy
==>null
rexster[groovy]> is_connected(g.v[116],g.v[120])
==>An error occurred while processing the script for language [groovy]. All transactions across all graphs in the session have been concluded with failure: java.util.concurrent.ExecutionException: javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: v for class: com.thinkaurelius.titan.graphdb.database.StandardTitanGraph
要么我做错了什么,要么我遗漏了一些明显的东西。如果你能指出我正确的方向,那就太好了。