在此stackoverflow question中,建议使用第一个答案中提供的查询来进行特定的gremlin_python遍历。即
g.V().has('name', 'USA').limit(1000).hasLabel('Country').
map(union(project('id','label').
by(id).
by(label),
valueMap()).unfold().
group().
by(keys).
by(select(values)))
我可以从gremlin_python图遍历库中导入除“键”以外的所有内容,如下所示
from gremlin_python.process.graph_traversal import union, project, valueMap, select, key, values, id, label, map
看着gremlin_python回购,我看不到定义“ by(keys)”部分的方法。
有人知道如何做到这一点吗?
答案 0 :(得分:0)
keys
和values
应该从Column
枚举中导入-在源代码here中。请注意Reference Documentation中的建议导入的完整列表。