Created
November 15, 2012 21:34
-
-
Save Iknewthisguy/4081444 to your computer and use it in GitHub Desktop.
Outer_circle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START n=node(127) | |
MATCH | |
(n)-[:friends]->(y)-[:friends]->(z) | |
WHERE | |
(z<>n) | |
AND(z-[:friends]->y-[:friends]->n) | |
AND NOT(n-[:friends]->z-[:friends]->n) | |
AND NOT(n-[:blocked_friends]->y-[:blocked_friends|friends]->z) | |
AND NOT(n-[:blocked_friends|friends]->y-[:blocked_friends]->z) | |
AND NOT(n-[:blocked_friends]->z) | |
AND NOT(has(z.deleted_at)) | |
WITH n, count(distinct(z)) as foaf_count, collect(distinct(z)) as foaf | |
MATCH | |
(n)-[:outer_only_friends|friends]->(i)-[:outer_only_friends|friends]->(n) | |
WHERE | |
(i<>n) | |
AND NOT(n-[:friends]->i-[:friends]->n) | |
AND NOT(n-[:blocked_friends]->i) | |
AND NOT(has(i.deleted_at)) | |
WITH n, count(distinct(i)) as outeronly_count, collect(distinct(i)) as outeronly,foaf,foaf_count | |
RETURN collect(foaf + outeronly) as total, (foaf_count + outeronly_count) as total_count |
Oh, no, that will give you more results than you want. I think I get it...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this work?