Combine connected patterns into a single path
@@ -17,8 +17,7 @@ WITH country, floor(socialNormalFloat) AS socialNormal
MATCH
(country)<-[:IS_PART_OF]-(:City)<-[:IS_LOCATED_IN]-(person2:Person)
OPTIONAL MATCH
- (country)<-[:IS_PART_OF]-(:City)<-[:IS_LOCATED_IN]-(friend2:Person),
- (person2)-[:KNOWS]-(friend2)
+ (country)<-[:IS_PART_OF]-(:City)<-[:IS_LOCATED_IN]-(friend2:Person)-[:KNOWS]-(person2)
WITH country, person2, count(friend2) AS friend2Count, socialNormal
WHERE friend2Count = socialNormal
RETURN
