Search code examples
tinkerpop3amazon-neptune

Print Edges associated with the path


I was able to get the path of a graph with the command below,

g.V('v6').repeat(out().simplePath()).until(hasId('v8')).path().limit(1)

gives,

==>[v[v6], v[v3], v[v1], v[v4], v[v8]]

I would like to print with the edges associated with the path. Tried few ways could not get it to print.


Solution

  • Solved it by outE().inV()

    g.V('v6').repeat(outE().inV().simplePath()).until(hasId('v8')).path().limit(1)

    gives the vertices and their edges,

        [v[v6], e[es63][v6-sonof->v3], v[v3], 
    e[esb34][v3-siblingof->v4], v[v4], 
    e[es48][v4-daughterof->v8], v[v8]]