[orientdb] Re: Complex query

2016-09-02 Thread Sam Hard
@nagaraja sosale ramaswamy, I'm trying to understand how this query works.  
Specifically, I can't see how "in" and "out" are defined.  I built a quick 
sample database using this script, but when I run the query (either yours 
or Andrey's), I get a syntax error saying "invalid script".  I'm using the 
BROWSE tab of OrientDB Studio, version 2.2.8.  Has something changed in the 
language since this was posted, or am I missing something?  I found the 
link to this topic in the OrientDB 2.2.x documentation 
.

Initial setup:
insert into V (name) values ('V1'),('V2')
create edge E from (select from V where name = 'V1') to (select from V where 
name = 'V2') set count = 17
create edge E from (select from V where name = 'V2') to (select from V where 
name = 'V1') set count = 3

Test query (you will have to substitute "#17:0" for the actual key in your 
DB):
select v.name, sum(count) as cnt from (select if(eval("in=#17:0"),out,in) as 
v,count from E where (in=#17:0 or out=#17:0)) order by cnt desc group by v




On Friday, June 5, 2015 at 5:26:30 AM UTC-5, nagaraja sosale ramaswamy 
wrote:

> Andrey,
>
> you are very welcome. i'll be adding this to the Query Examples wiki page 
> if you don't mind.
>
>
> ~nagu.
>
> On Friday, June 5, 2015 at 12:30:12 AM UTC+5:30, Andrey Yesyev wrote:
>>
>> This is the final version of the query I need
>>
>> select v.name, sum(count) as cnt from (select if(eval("in=#17:0"),out,in) 
>> as v,count from E where (in=#17:0 or out=#17:0)) order by cnt desc group 
>> by v
>>
>> Nagu, I greatly appreciate your help and time you spent on this!
>>
>

-- 

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


Re: [orientdb] Re: Complex query

2015-06-05 Thread Andrey Yesyev
I was thinking of creating something like that myself, so sure, go ahead!

On 5 June 2015 at 06:26, nagaraja sosale ramaswamy nagud...@gmail.com
wrote:

 Andrey,

 you are very welcome. i'll be adding this to the Query Examples wiki page
 if you don't mind.


 ~nagu.


 On Friday, June 5, 2015 at 12:30:12 AM UTC+5:30, Andrey Yesyev wrote:

 This is the final version of the query I need

 select v.name, sum(count) as cnt from (select if(eval(in=#17:0),out,in)
 as v,count from E where (in=#17:0 or out=#17:0)) order by cnt desc group
 by v

 Nagu, I greatly appreciate your help and time you spent on this!

  --

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups OrientDB group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 orient-database+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 

--- 
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] Re: Complex query

2015-06-05 Thread nagaraja sosale ramaswamy
Andrey,

you are very welcome. i'll be adding this to the Query Examples wiki page 
if you don't mind.


~nagu.

On Friday, June 5, 2015 at 12:30:12 AM UTC+5:30, Andrey Yesyev wrote:

 This is the final version of the query I need

 select v.name, sum(count) as cnt from (select if(eval(in=#17:0),out,in) 
 as v,count from E where (in=#17:0 or out=#17:0)) order by cnt desc group 
 by v

 Nagu, I greatly appreciate your help and time you spent on this!


-- 

--- 
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] Re: Complex query with hierarchy

2015-06-05 Thread Daniel08
This worked for me.
Answered by aw31n http://stackoverflow.com/users/2957091/aw31n on 
Stackoverflow:

You should consider reading the chapter about traversing - that should be 
the missing link to answer your question. You can find it here: 
http://orientdb.com/docs/last/SQL-Traverse.html

Basically, if you think of your graph as a family tree, you want to achieve 
3 things:

   - 
   
   Find all children, grand-children, grand-grand-children (and so on) from 
   tree 1 for a given family member (=Hierarchy1)
   - 
   
   Find those who have relations to members of another family tree 
   (=ASSIGNED)
   - 
   
   Show me who's on top of this tree (=Hierarchy2)
   
One of the possible solutions should look a little something like this:

Since you want to end up on top of hierarchy2, you have to start on the 
other side, i.e. hierarchy1.

   1. 
   
   Get hierarchy1 (top-to-bottom)
   
TRAVERSE out(CHILD) FROM Car
   
   2. 
   
   Choose all relations
   
   SELECT out(MADE_IN) FROM ([1])
   
   3. 
   
   and from those, go bottom-to-top
   
   TRAVERSE in(CHILD) FROM ([2])
   
   4. 
   
   Who's on top?
   
   SELECT FROM ([3]) WHERE @class=Country
   
   
Combined into one sql, it looks as ugly as this:

SELECT FROM (
   TRAVERSE in(CHILD) FROM (
  SELECT out(MADE_IN) FROM (
 TRAVERSE out(CHILD) FROM Car
  )
   )
) WHERE @class=Country

You could replace Car with any @rid in hierarchy1 to get a list of 
countries it or any part of it was made in.

There might be better solutions for sure. But at least this one should 
work, so I hope it will help.

On Thursday, 4 June 2015 10:54:54 UTC-4, Daniel08 wrote:

 Version:  OrientDB Server v2.0.10
 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.
 For example, say we have Car-Child-Engine-Child-Piston and 
 Country-Child-State-Child-City And a relationship Made_In which relates 
 Car or Engine or Piston to either Country or State or City So if there is a 
 relation with either of Country or State or City, the Country should be 
 returned. Example, Engine1-Made_In-Berlin, this would return Germany. 
 Sorry for such a toyish example. I hope it is clear.
 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] Re: Complex query

2015-06-04 Thread nagaraja sosale ramaswamy
Andrey

I have slightly modified my earlier solution so that it now retrieves the 
vertex name instead of the rid. i believe this query is far simpler than 
proposed by SavioL and should give the same results.. Please let me know 
your feedback on this query if it does not meet your requirement:

select v,sum(count) from (select if(eval(in=#11:0),out*.name*,in*.name*) 
as v,count from E where in=#11:0 or out=#11:0) group by v



regards,
~nagu.

On Wednesday, June 3, 2015 at 9:13:33 PM UTC+5:30, SavioL wrote:

 Hi Andrey,
 i'm sorry for the name in the previous answers, I do some test then I 
 tell you...

 regards,
 Luigi S.



-- 

--- 
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] Re: Complex query

2015-06-04 Thread Andrey Yesyev
This is the final version of the query I need

select v.name, sum(count) as cnt from (select if(eval(in=#17:0),out,in) as 
v,count from E where (in=#17:0 or out=#17:0)) order by cnt desc group by v

Nagu, I greatly appreciate your help and time you spent on this!

-- 

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


Re: [orientdb] Re: Complex query

2015-06-04 Thread Andrey Yesyev
Nagu,

Frankly, I think this is it!
I did some quick tests and looks like it works. Anyway, it's a very good
starting point for me.
Thank you very much!

-- 

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


Re: [orientdb] Re: Complex query

2015-06-03 Thread Andrey Yesyev
Thanks Luigi!

How to add traverse to this query, lets say you have the next graph

V1 --related -- V2
V1 --related -- V2
V1 --related -- V2
V2 --related -- V1
V2 --related -- V1
V1 --related -- V3
V1 --related -- V3
V3 --related -- V1

So the result for query for V1 would be

V2 5
V3 3

On 3 June 2015 at 04:56, SavioL gigi85.tempora...@gmail.com wrote:

 Hi Ziink,

 I created V1 and V2, and i linked them so:

 V1 --related -- V2
 V1 --related -- V2
 V1 --related -- V2
 V2 --related -- V1
 V2 --related -- V1

 so i have 3 link from V1 to V2, and 2 link from V2 to V1.

 With this query:   select count(*) FROM Related LET $c = in.size()
 i get Count = 5. (five is number of total link with V1 and V2)

 i hope is this the answer you were looking for..

 Regards,
 Luigi S.


 Il giorno martedì 2 giugno 2015 00:10:15 UTC+2, Andrey Yesyev ha scritto:

 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 a topic in the
 Google Groups OrientDB group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 orient-database+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 

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


Re: [orientdb] Re: Complex query

2015-06-03 Thread Andrey Yesyev
Thanks Nagu!

But I also need to group by vertices I related to.

On 3 June 2015 at 07:02, nagaraja sosale ramaswamy nagud...@gmail.com
wrote:

 select sum(count) from RELATED where in = #11:0 or out = #11:0


 hope that helps...
 ~nagu.


 On Wednesday, June 3, 2015 at 2:26:24 PM UTC+5:30, SavioL wrote:

 Hi Ziink,

 I created V1 and V2, and i linked them so:

 V1 --related -- V2
 V1 --related -- V2
 V1 --related -- V2
 V2 --related -- V1
 V2 --related -- V1

 so i have 3 link from V1 to V2, and 2 link from V2 to V1.

 With this query:   select count(*) FROM Related LET $c = in.size()
 i get Count = 5. (five is number of total link with V1 and V2)

 i hope is this the answer you were looking for..

 Regards,
 Luigi S.

  --

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups OrientDB group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 orient-database+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 

--- 
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] Re: Complex query

2015-06-03 Thread SavioL
Hi Ziink,

I created V1 and V2, and i linked them so:

V1 --related -- V2  
V1 --related -- V2  
V1 --related -- V2  
V2 --related -- V1  
V2 --related -- V1  

so i have 3 link from V1 to V2, and 2 link from V2 to V1.

With this query:   select count(*) FROM Related LET $c = in.size()
i get Count = 5. (five is number of total link with V1 and V2)

i hope is this the answer you were looking for..

Regards,
Luigi S.


Il giorno martedì 2 giugno 2015 00:10:15 UTC+2, Andrey Yesyev ha scritto:

 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.


[orientdb] Re: Complex query

2015-06-03 Thread nagaraja sosale ramaswamy
select sum(count) from RELATED where in = #11:0 or out = #11:0 


hope that helps...
~nagu.


On Wednesday, June 3, 2015 at 2:26:24 PM UTC+5:30, SavioL wrote:

 Hi Ziink,

 I created V1 and V2, and i linked them so:

 V1 --related -- V2  
 V1 --related -- V2  
 V1 --related -- V2  
 V2 --related -- V1  
 V2 --related -- V1  

 so i have 3 link from V1 to V2, and 2 link from V2 to V1.

 With this query:   select count(*) FROM Related LET $c = in.size()
 i get Count = 5. (five is number of total link with V1 and V2)

 i hope is this the answer you were looking for..

 Regards,
 Luigi S.


-- 

--- 
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] Re: Complex query

2015-06-03 Thread Andrey Yesyev
Hi SavioL,

It's not Ziink was asking it's me.
Thanks a lot for your answer, I'll try it shortly. This is quite a work 
you've done right there, I do appreciate it.

I have concerns regarding performance of this query on large sets of data...
And I still need to add one tweak, I don't know how many other vertices V1 
is connected to (either by in or out connection). So I need to traverse ALL 
its connection and calculate those number for each found vertex that is 
connected to some V1.

I was hoping to get any input from orientdb devs on this, unfortunately 
they keep being unresponsive.

On Wednesday, June 3, 2015 at 10:00:10 AM UTC-4, SavioL wrote:

 Hi Ziink,

 the result you were looking for, is return with (not easy:) query:

 select name, sum from (select expand($totale) 
 let $v2 = (select name, sum(sum) from (
 select expand($c) let $a = (select name, sum(count) from (select name, 
 count(*) from (select expand(out(Related)) from Vertex where name=V1) 
 group by name) group by name ), $b = (select name, sum(count) from (select 
 name, count(*) from (select expand(in(Related)) from Vertex where 
 name=V1) group by name) group by name ), $c = unionAll( $a, $b ) ) where 
 name = V2), 
 $v3 = (select name, sum(sum) from (
 select expand($c) let $a = (select name, sum(count) from (select name, 
 count(*) from (select expand(out(Related)) from Vertex where name=V1) 
 group by name) group by name ), $b = (select name, sum(count) from (select 
 name, count(*) from (select expand(in(Related)) from Vertex where 
 name=V1) group by name) group by name ), $c = unionAll( $a, $b ) ) where 
 name = V3), 
 $totale = unionAll( $v2, $v3 ))

 the result is:


 https://lh3.googleusercontent.com/-g9Ea-V_QuQM/VW8HrsnqigI/ABY/gxgIbnvBz-g/s1600/somma%2Bnodi.png


-- 

--- 
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] Re: Complex query

2015-06-03 Thread SavioL
Hi Ziink,

the result you were looking for, is return with (not easy:) query:

select name, sum from (select expand($totale) 
let $v2 = (select name, sum(sum) from (
select expand($c) let $a = (select name, sum(count) from (select name, 
count(*) from (select expand(out(Related)) from Vertex where name=V1) 
group by name) group by name ), $b = (select name, sum(count) from (select 
name, count(*) from (select expand(in(Related)) from Vertex where 
name=V1) group by name) group by name ), $c = unionAll( $a, $b ) ) where 
name = V2), 
$v3 = (select name, sum(sum) from (
select expand($c) let $a = (select name, sum(count) from (select name, 
count(*) from (select expand(out(Related)) from Vertex where name=V1) 
group by name) group by name ), $b = (select name, sum(count) from (select 
name, count(*) from (select expand(in(Related)) from Vertex where 
name=V1) group by name) group by name ), $c = unionAll( $a, $b ) ) where 
name = V3), 
$totale = unionAll( $v2, $v3 ))

the result is:

https://lh3.googleusercontent.com/-g9Ea-V_QuQM/VW8HrsnqigI/ABY/gxgIbnvBz-g/s1600/somma%2Bnodi.png

-- 

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


Re: [orientdb] Re: Complex query

2015-06-03 Thread nagaraja sosale ramaswamy
see if this helps:

select v,sum(count) from (select if(eval(in=#11:0),out,in) as v,count 
from E where in=#11:0 or out=#11:0) group by v


~nagu.

On Wednesday, June 3, 2015 at 5:15:52 PM UTC+5:30, Andrey Yesyev wrote:

 Thanks Nagu!

 But I also need to group by vertices I related to.

 On 3 June 2015 at 07:02, nagaraja sosale ramaswamy nagu...@gmail.com 
 javascript: wrote:

 select sum(count) from RELATED where in = #11:0 or out = #11:0 


 hope that helps...
 ~nagu.


 On Wednesday, June 3, 2015 at 2:26:24 PM UTC+5:30, SavioL wrote:

 Hi Ziink,

 I created V1 and V2, and i linked them so:

 V1 --related -- V2  
 V1 --related -- V2  
 V1 --related -- V2  
 V2 --related -- V1  
 V2 --related -- V1  

 so i have 3 link from V1 to V2, and 2 link from V2 to V1.

 With this query:   select count(*) FROM Related LET $c = in.size()
 i get Count = 5. (five is number of total link with V1 and V2)

 i hope is this the answer you were looking for..

 Regards,
 Luigi S.

  -- 

 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups OrientDB group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/orient-database/CRR-simpmLg/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to 
 orient-databa...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 

--- 
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] Re: Complex query

2015-06-03 Thread SavioL
Hi Andrey,
i'm sorry for the name in the previous answers, I do some test then I tell 
you...

regards,
Luigi S.

-- 

--- 
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] Re: Complex query

2015-06-02 Thread Ziink A
Sorry, I don't have an answer but I'd explore one of the following options.

1. UNIONALL
2. both() for Vertex, bothE() for count, group by

On Monday, June 1, 2015 at 3:10:15 PM UTC-7, Andrey Yesyev wrote:

 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.


[orientdb] Re: Complex query

2015-06-02 Thread Andrey Yesyev
Someone!? Please?

On Monday, June 1, 2015 at 6:10:15 PM UTC-4, Andrey Yesyev wrote:

 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.


[orientdb] Re: Complex query

2015-06-01 Thread Andrey Yesyev
I come up with a two steps solution, query first outgoing connection and 
then incoming, something like this

select out.name, count from RELATED where in=@rid
and
select in.name, count from RELATED where out=@rid

but this approach is very inconvenient, as it requires merging these two 
results... 



On Monday, June 1, 2015 at 6:10:15 PM UTC-4, Andrey Yesyev wrote:

 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.