I am working on Neptune AWS, and trying to fine out the start node id and end node id of the edge. The map step is working for Neo4j, but the same query is not working for the Neptune.
Data example: enter link description here
Query:
query = """g.V().hasLabel('Person').has("name", "marko").as("from", "to")
.repeat(bothE().as("e").otherV().as("to").as("to")).times(2).emit(hasLabel("Person")).hasLabel("Person").has("name", "josh")
.project("name", "Label","start", "end")
.by(select(all, "to").unfold().values("title").fold())
.by(select(all, "to").unfold().label().fold())
.by(select(all, "e").unfold().id().map{g.E(it.get()).next()}.outV().id().fold())
.by(select(all, "e").unfold().id().map{g.E(it.get()).next()}.inV().id().fold())
"""
This is giving error in Neptune, but its working on Neo4j. Is there is any other way to fetch the start and end node id's.
I'm not sure that I follow why you need to do this:
.by(select(all, "e").unfold().id().map{g.E(it.get()).next()}.outV().id().fold())
Isn't that simplified to:
.by(select(all, "e").unfold().outV().id().fold())
That would get rid of the lambdas, which I assume is your problem with Neptune.