Reputation: 6152
I have the graph at the bottom.
I want to bring all the connections between GraphTarget
that the FriendOf
is not b-directional.
Everything inside the red zone, (max 5 levels of FriendOf
)
http://console.neo4j.org/r/pb9mp - a place to play with the query
Upvotes: 2
Views: 161
Reputation: 385
I hope this can help you a bit:
MATCH (gt:GraphTarget)
MATCH path_account = (:Account)-[:FriendOf*]->(:Account)
MATCH (account1:Account)-[:FriendOf]->(account2:Account)
MATCH (account2:Account)-[:FriendOf]->(account1:Account)
WHERE none(node IN nodes(path_account) WHERE node=account1 OR node=account2)
RETURN gt, nodes(path_account)
I checked it graphically in Neo4j and this is the result:
Your graph
The query
Upvotes: 2