gremlin python retrieve ids and labels (valueMap(True))
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Industries in Orbit Looping
--
Chapters
00:00 Question
01:22 Accepted answer (Score 3)
02:10 Thank you
--
Full question
https://stackoverflow.com/questions/4835...
Accepted answer links:
https://issues.apache.org/jira/browse/TI...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #python3x #gremlin #tinkerpop3 #amazonneptune
#avk47
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Industries in Orbit Looping
--
Chapters
00:00 Question
01:22 Accepted answer (Score 3)
02:10 Thank you
--
Full question
https://stackoverflow.com/questions/4835...
Accepted answer links:
https://issues.apache.org/jira/browse/TI...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #python3x #gremlin #tinkerpop3 #amazonneptune
#avk47
ACCEPTED ANSWER
Score 3
My guess is that you are running into trouble with this recently reported bug with valueMap(true):
https://issues.apache.org/jira/browse/TINKERPOP-1860
it is patched and will be fixed with release of 3.3.2. Until then you will have to work around the issue as there really is no fix short of reverting to GraphSON 2.0 (which comes with it's own set of downsides). One workaround would be to project() your results:
gremlin> g.V().project('props','id','label').
......1> by(valueMap()).
......2> by(id).
......3> by(label)
==>[props:[name:[marko],age:[29]],id:1,label:person]
==>[props:[name:[vadas],age:[27]],id:2,label:person]
==>[props:[name:[lop],lang:[java]],id:3,label:software]
==>[props:[name:[josh],age:[32]],id:4,label:person]
==>[props:[name:[ripple],lang:[java]],id:5,label:software]
==>[props:[name:[peter],age:[35]],id:6,label:person]