[orientdb] Complex query with hierarchy

2015-06-04 Thread Daniel08
I am trying to come up with a query for the following scenario.

I have 2 hierarchies: A->B->C and D->E->F
The number of nodes in the hierarchy can change.
The node in 1st hierarchy can be connected to the other using some relation 
say 'Assigned'.
What I want is the parent node of the 2nd hierarchy if there is any 
incoming edge to any of the node in that 2nd hierarchy from the 1st.
How can I do this? Is it too complex to be achieved?

Thanks.

-- 

--- 
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.


[orientdb] Complex query

2015-06-01 Thread Andrey Yesyev
Hi there,

I need help with a query.
My schema is pretty simple. Vertices are connected with Edges of type 
RELATED which have property count.
2 vertices can have connection in both ways at the same time.

V1--RELATED(count=17)-->V2

V2--RELATED(count=3)-->V1

I need to build a query that for vertex Vn, will find all vertices 
connected with RELATED edge to this Vn and also, for each pair [Vn, Vx] 
will calculate SUM of in_RELATED.count and out_RELATED.count.

For that simple example above, this query result for V1 would be

|  Vertex   |Count|
||
|V2  |  20|

Is it possible to do in one query at all?

Any help is very much appreciated!

-Andrey

-- 

--- 
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.