Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-03-2020 09:46 AM
I started using neo4j recently.I have a scenario like
Match (a:parent)-[r:father_of]->(b:daughter)-[r1:friend_of{talks_to:5 times}]->(c:daughter)-[r2:daughter_of]->(d:parent)
Now I want to marge all these nodes to one if talks_to property of r1 relationship is more that 2 times.Or create one master node to all these, like all these belong to that family if it meets given condition.How this can be done
03-03-2020 10:48 AM
Have you checked out the APOC merge nodes procedure? http://neo4j-contrib.github.io/neo4j-apoc-procedures/3.5/graph-refactoring/merge-nodes/ It might be what you're looking for.
03-03-2020 08:55 PM
Yeah I already used that but now I want to merge parent nodes based on child node properties
03-04-2020 12:01 AM
I guess you are trying to merge nodes based on the Relationship property of [friend_of]
Match (a:parent)-[r:father_of]->(b:daughter)-[r1:friend_of]->(c:daughter)-[r2:daughter_of]->(d:parent)
Where toInteger(split(r1.talks_to,' ')[0]) >'2'
03-04-2020 02:03 AM
Yes Exactly this is what I am trying...but how to merge a,d based on that
03-04-2020 02:23 AM
Could you please give me small sample data set
03-04-2020 03:45 AM
(a:parent)-[r:father_of]->(b:daughter)-[r1:friend_of{talks_to:5 times}]->(c:daughter)-[r2:daughter_of]->(d:parent)
(a:parent)-[rr:father_of]->(e:daughter)-[rr1:friend_of{talks_to:4 times}]->(f:daughter)-[rr2:daughter_of]->(g:parent)
(g:parent)-[rrr:father_of]->(h:daughter)-[rrr1:friend_of{talks_to:1 times}]->(i:daughter)-[rr2:daughter_of]->(n:parent)
See above is my data set.Now I want to merge a,d,g nodes because their talks_to is more than 2 and n should be seperate node because g -> n talks_to is less than 2
All the sessions of the conference are now available online