【发布时间】:2018-12-05 04:20:12
【问题描述】:
我想以
的形式获取边缘属性列表[ {'src': nodeid, 'dst': nodeid, 'item': itemid},
{'src': nodeid, 'dst': nodeid, 'item': itemid},
...
]
参考this question,我在gremlin_python中将查询表述如下:
g.V(user_list).bothE().hasLabel('share_item').dedup(). \
project('src','dst','item'). \
by(outV().id()). \
by(inV().id()) \
by(coalesce(values('item_id'),constant(''))). \
.toList()
但是,我得到了以下错误
TypeError: 'Column' object is not callable
我可以使用 'src' 和 'dst' 的列表
g.V(user_list).bothE().hasLabel('share_item').dedup(). \
project('src','dst'). \
by(outV().id()). \
by(inV().id()) \
.toList()
我错过了任何 python 关键字吗?或者我可以知道gremlin python的限制是什么?
更新:
就我而言,我确实有一个解决方法。但是,只会提取包含 (src, dst, item) 的边。
g.V(user_list).bothE().hasLabel('share_item').dedup(). \
has('item'). \
project('src','dst'). \
by(outV().id()). \
by(inV().id()) \
by('item'). \
toList()
【问题讨论】:
标签: python python-2.7 gremlin tinkerpop tinkerpop3