Joel Stevick
Joel Stevick

Reputation: 2028

Gremlin on Neptune: how to get "outV" from an edge that is returned from "select"

I have a graph with two vertices: 'a' & 'b'

There is an edge between 'a' and 'b' labeled 'Y'

gremlin> g.V('a').outE()

==>e[dcb543f5-2189-9ffe-e617-b928dc565c1a][a-Y->b]

The edge has a property 'foo'

gremlin> g.V('a').outE().valueMap(true)

==>{label=Y, foo=bar, id=dcb543f5-2189-9ffe-e617-b928dc565c1a}

My question: why is the following statement returning an edge? I expected a vertex.

gremlin> g.E('dcb543f5-2189-9ffe-e617-b928dc565c1a').as('e').properties('foo').as('foo').select('e').outV()

==>e[dcb543f5-2189-9ffe-e617-b928dc565c1a][a-Y->b]

Upvotes: 0

Views: 277

Answers (1)

stephen mallette
stephen mallette

Reputation: 46216

It shouldn't behave that way. Note that TinkerGraph doesn't exhibit that behavior:

gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.E().as('e').properties('weight').as('w').select('e').outV()
==>v[1]
==>v[1]
==>v[1]
==>v[4]
==>v[4]
==>v[6]

Is there some sample data that will reproduce this problem? Perhaps it is a bug in the graph you are using?

Upvotes: 1

Related Questions