Fabian Tan
Fabian Tan

Reputation: 63

OrientDB -- is there a way to find out which edge was traversed?

I've been researching/looking around high and low for this, but, could not find any leads. I'm thinking this is a limitation, but, I would like to be sure.

Scenario (1): In this scenario, I've explicitly informed which edge I'd like to traverse through. Thus, I know who is attending the VPN-101 event.

orientdb {db=event}> select firstname from (traverse in('people_attending_event')  from (select from Event where name='VPN-101')) where @class='People';

0   |null  |Mohammed
1   |null  |Sed
2   |null  |Fob

Scenario (2): In this scenario, I'd like to know which vertices are associated to the VPN-101 vertex, therefore I used _in() over here. The output provides me with 3 names, but, is there a way to know which specific edges were traversed to get the output? In this example, I have only selected firstname, however even if I perform a select *, it does not tell me which edges were traversed to get the output, it just provides me with the attributes associated to the vertices.

orientdb {db=event}> select firstname from (traverse in()  from (select from Event where name='VPN-101')) where @class='People';

0   |null  |Mohammed
1   |null  |Sed
2   |null  |Fob

Is there anything I can do to know what I am looking for? I appreciate any insight or help. Thank you.

Upvotes: 1

Views: 194

Answers (1)

Lvca
Lvca

Reputation: 9060

Returns last 3 traversed edge(s) of TRAVERSE command:

SELECT traversedEdge(-1, 3) FROM ( TRAVERSE outE(), inV() from #34:3232 WHILE $depth <= 10 )

For more info, look at documentation: http://orientdb.com/docs/last/SQL-Functions.html#traversededge.

Upvotes: 2

Related Questions