I have a weighted graph illustrating communications between entities. What I want to do is to get the top N nodes that communicate with a node, and then perform some other query on that set of nodes and relationships.
So my query to get the top N is something like
start me=node({id})
match (me)-[r]-(you)
return r, you, order by r.count DESC limit {num}
I have the query I want to perform working on the entire graph, I'm just not certain how to make it only work on the subgraph. One example:
start me=node({id})
match (me)-[*2..2]-(you)
where not (me)--(you)
return u