Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-10-2022 03:17 AM
Hi, everyone
I want to try to collapse a path between red nodes in the pic. below
And get something like that
Is it worth trying to make with collapse path, or I get only 1 relationship between each pare of nodes?
Or maybe there exist easier alternatives, I be grateful for suggestions?
Solved! Go to Solution.
08-11-2022 11:43 AM
Can you share your cypher code.
In GDS usually collapse path should generate 1 relationship per path
and then you might need to use relationship aggregation to result in 1 relationship between a pair of nodes
08-11-2022 11:43 AM
Can you share your cypher code.
In GDS usually collapse path should generate 1 relationship per path
and then you might need to use relationship aggregation to result in 1 relationship between a pair of nodes
08-17-2022 07:14 AM
Thanks Michael, that's exactly what I wanted to know
and the link will come in handy 🙂
I can share code but I didnt try run GDS collapse path yet because have problems with MATCH
I try that code below and get olny paths through 2 user nodes. (red nodes from pic. are(Community) and yellow nodes are (users) )
MATCH (c1:Community)<-[:MEMBER_OF]-(u1:user)
MATCH (u1:user)-[:FOLLOWING]-(u2:user)
MATCH (u2:user)-[:MEMBER_OF]->(c2:Community)
RETURN c1.name as source, c2.name as target
Also I try that code below and get path through 3 user nodes
MATCH (c1:Community)<-[:MEMBER_OF]-(u1:user)-[]-()-[]-(u2:user)-[:MEMBER_OF]->(c2:Community)
RETURN c1.name as source, c2.name as target
I dont know how to combine so i can get paths through arbitrary number of nodes between red nodes.
All the sessions of the conference are now available online