I played with sql OrientDB queries to get a result set containing not only the vertices, but also the inner edges existing between them.
The request may be expressed as:
- I want all the vertices associated with
project(without the project itself) and all the edges between the vertices included in the results

This is how I achieved it, but I think that this is not the right way to do it.

select expand($union) let $vertices = ( select from ( traverse both() from (select from V where label = 'project') ) skip 1 ), $edges = ( select from ( select from E where @rid in ( select bothE() from ( select from ( traverse both() from (select from V where label = 'project') ) skip 1 ) ) ) where out in ( select from ( traverse both() from (select from V where label = 'project') ) skip 1 ) and in in ( select from ( traverse both() from (select from V where label = 'project') ) skip 1 ) ), $union = unionall($vertices, $edges)
And expected results:

Problems with this solution:
- I need to cross the graph several times (first to get the vertices, and then to get the edges to finally merge the results)
- The basic query is
select from V where label = 'project'also executed several times.
Is there a better way to solve this use case?
Thanks.