Assume we want to retrieve all in-coming and out-going edges for some specific vertex and have the result include from_vertex, edge and to_vertex.
The following should give us the result.
g.V(1).bothE().otherV().path()
==>path[v[...], e[...][...-...->...], v[...]]
The following adds .elementMap()
for vertices and edge.
g.V(1).bothE().otherV().path().by(__.elementMap())
==>path[{...} {...} {...}]
Now, we want to retrieve the properties, where we want to use .elementMap()
for the vertices and .valueMap()
for the edges. My first guess is the following
g.V(1).
bothE().as("edges").
otherV().as("nodes").
path().
by(__.select("nodes").elementMap().select("edges").valueMap())
which just returns
==>path[null, null, null]
Any ideas? Further, how to get the path output for an entire subtree starting from some specific vertex.
Your path will be an alternating list of node-edge-node etc. To get the desired results you just need to use two by
modulators.
g.V(1).
bothE().
otherV().
path().
by(elementMap()).
by(valueMap())