Gremlin遍历语言:如何添加一个列表作为Edge的属性?

2024-06-28 20:43:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在努力更新我的图表。我有这个SerialNode,我需要添加一个新的边。问题是,当我的数据包含list/list of dicts时,它不起作用

所以每次我试图执行这个以list作为属性值的查询时,graph都不会得到更新

真正让我困惑的是,所有“旧记录”的属性中都包含一些列表……我尝试了不同的方法来编写这个查询,使用引号。但是,当我添加列表时,一切都停止工作

工作:

gremlinClient.submitAsync("g.V().hasLabel('000123').has('NodeType','SerialNode').addE('Current').to(g.addV('E000123').property('NodeType','A').property('PropertyA','123').property('PropertyB','456').property('PropertyC','789').inV().id()")

不工作:

gremlinClient.submitAsync("g.V().hasLabel('000123').has('NodeType','SerialNode').addE('Current').to(g.addV('E000123').property('NodeType','A').property('PropertyA','123').property('PropertyB','456').property('PropertyC',[{'y': '111', 'z': '222', 'x': '333', 'r': '444', 's': '555'}, {'y': '666', 'z': '777', 'x': '888', 'r': '999'}]).inV().id()")

谢谢你的建议


Tags: to列表属性propertycurrentlisthasnodetype