Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-24-2020 10:53 AM
Hi Guys,
i have this query that outputs what is in the attached picture. I will connect the two "Generalization" nodes (green ones) but i want to add a "strenght" property to the new relationship with the number of connections between the "Perception_Group" nodes (yellow ones). So in this case i would have strenght=4. How can i count the relationships between the yellow nodes?
MATCH (g1:Generalization)-[i1:INSTANCEOF]-(pg1:Perception_Group)-[s:SEQUENCE]-(pg2:Perception_Group)-[i2:INSTANCEOF]-(g2:Generalization)
WHERE g1 <> g2
RETURN g1,g2,i1,i2,pg1,s
05-24-2020 11:57 AM
Guys.
It was easier than i thought, so before anyone spends time with this question here is the cypher i got.
MATCH (g1:Generalization)-[i1:INSTANCEOF]-(pg1:Perception_Group)-[s:SEQUENCE]-(pg2:Perception_Group)-[i2:INSTANCEOF]-(g2:Generalization)
WHERE g1 <> g2
WITH count(distinct s) as strength, g1,g2
MERGE (g1)-[gs:GENERALIZATION_SEQUENCE {subType:'UE7',strength:strength}]-(g2)
All the sessions of the conference are now available online