我正在使用 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
我想从我的 python 程序中对 Titan Graph DB 进行编程。我为此使用了灯泡包。
我使用如下所示的灯泡从 python 创建一个顶点。
fe1 = self.g.vertices.get_or_create('switch_dpid',switch_dpid,
{'actionOutputPort':actionOutputPort,
'switch_state':'FE_SWITCH_UPDATED',
'matchInPort': MatchInPort,
'type': 'flow_entry',
'user_state':'FE_USER_ADD',
'actions': ['type':'ACTION_OUTPUT', 'action':[port=actionOutputPort maxLen=0];]})
这给了我一个错误
'actions': ['type':'ACTION_OUTPUT', 'action':[port=actionOutputPort maxLen=0];]})
SyntaxError: invalid syntax
我期望 Rexster 控制台的输出如下。
switch_dpid=00:00:00:00:00:00:02:05,
actionOutputPort=1,
switch_state=FE_SWITCH_UPDATED,
matchInPort=2,
flow_entry_id=0x4ee30a9400000012,
type=flow_entry,
actions=[[type=ACTION_OUTPUT action=[port=1 maxLen=0]];],
user_state=FE_USER_ADD
我如何编程actions
使其如上。