cypher - Relationship count duplicating in neo4j -
i trying resolve query since last 3 days. unable find proper solution. have asked question before. reduced query 1 number see whats problem. issue in end received 7 nodes 2 way relationships. means total 17 relationships 7 nodes. in graphical view 14 in count table relationships count 28. means doubles in count. more clarification attaching images , query.
start n= node(2679) match p=(n)-[:calls]-(a),(n)-[:calls]-(b),(a)-[:calls]-(n)-[:calls]-(b) a,b,n,p optional match q=(a)-[:calls]-(b),(b)-[:calls]-(a) a,b,n,p,q return q;
for same data when count relationships distinct clause while using query
start n= node(2679) match p=(n)-[:calls]-(a),(n)-[:calls]-(b),(a)-[:calls]-(n)-[:calls]-(b) a,b,n,p optional match q=(a)-[:calls]-(b),(b)-[:calls]-(a) a,b,n,p,q return count (distinct p ) all_paths, count (distinct q) backyard_paths order given_numbers asc;
i can not check each values data in millions. in advance
does after?
// find , of friends call match (me:node {name:'center'})-[:calls]->(friend) // put of friends in collection me, collect(friend) friends // collection of friends // find out of friends call unwind friends one_friend match one_friend-[r:calls]->(another_friend) // match other friends in friends list another_friend in friends , not one_friend = another_friend return count(r)
Comments
Post a Comment