I want to query a vertex in OrientDB graph database to get the second level 
vertices, keeping the in between vertex id.

The relationship would be represented as such:

User <--edge--> User <--edge--> User
(1)             (2)             (3)

For User 1, I want to get all User 3 (distance of 2 edges), but I want to 
keep as a result all User 2 rids. The direction isn't important (will use 
both() method to traverse)

An example:

#10:1 <--edge--> #10:2
#10:1 <--edge--> #10:3
#10:2 <--edge--> #10:4
#10:2 <--edge--> #10:5
#10:3 <--edge--> #10:6

For the example above, the query for #10:1 should return: (don't know how 
to represent this any better, but the query should return the object from 
the class User AND the rid from the intermediate User)

User(#10:4), #10:2
User(#10:5), #10:2
User(#10:6), #10:3

The query to find the vertices from the second level would look like: select 
expend(both('edge').both('edge')) from #10:2 (of course the query can be 
optimized with set function and other conditions in case of inter-relations 
of the output users). To this output, I would like to see an additional 
field (property / column, whatever you want to call it) where I can see the 
in between vertex of this kind of relationship.

Hope somebody can help me with this, tell me if you need more information, 
or if you did not understand something. Thank you.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to