0

In this stackoverflow question a suggestion was made to use the query supplied in the first answer to do a particular gremlin_python traversal. Namely

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)))

I am able to import all but "keys" from the gremlin_python graph traversal library like the following

from gremlin_python.process.graph_traversal import union, project, valueMap, select, key, values, id, label, map

Looking at the gremlin_python repo, I don't see a way to define the portion that is "by(keys)"

Does anyone know how this can be accomplished?

Doug Moses
  • 176
  • 1
  • 6

1 Answers1

2

keys and values in that context should import from the Column enum - in the source code here. Note the full list of recommended imports in the Reference Documentation.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135