Tinkerpop path() step translation to OrientDB SQL

Hi all,

I have the following working query in Tinkerpop/Gremlin that can return an ordered lists of elements traversed until current step… How can I make a similar one in OrientDB SQL?

g.V().hasLabel('Firma').has('cui','13904073').until(hasLabel('Persoana')).repeat(inE('Actionar').otherV()).sack().path()

I did a similar traverse using MATCH in OrientDB but i can’t find a way to get the ordered lists of elements traversed:

MATCH{class:Firma,as: FirmaBaza,where:(cui=13904073)}.(inE("Actionar") {as:actEdge}.outV()) {as:act,where:($matched.FirmaBaza!= $currentMatch and @class=="Firma"),while:(true)}.in("Actionar") {as:actPers,where:(@class=="Persoana")} return $pathElements

Is there any way to get the ordered list of traversed elements using OrientDB SQL ?

Hi @misu200

You can try to use pathAlias, see https://orientdb.org/docs/3.0.x/sql/SQL-Match.html
It’s not 100% equivalent to TinkerPop path() maybe it’s enough for your needs

Thanks

Luigi