I'd like to get a list of edge properties in the form of
[ {'src': nodeid, 'dst': nodeid, 'item': itemid},
{'src': nodeid, 'dst': nodeid, 'item': itemid},
...
]
Refer to this question, I formulate the query as the following in 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()
However, I got the following error
TypeError: 'Column' object is not callable
I am able to get a list of 'src' and 'dst' with
g.V(user_list).bothE().hasLabel('share_item').dedup(). \
project('src','dst'). \
by(outV().id()). \
by(inV().id()) \
.toList()
Did i miss out any python keyword? Or may I know what's the limitation lies in gremlin python?
Updates:
In my case, I do have a workaround for this. Only edges contain (src, dst, item) will be extracted however.
g.V(user_list).bothE().hasLabel('share_item').dedup(). \
has('item'). \
project('src','dst'). \
by(outV().id()). \
by(inV().id()) \
by('item'). \
toList()