I'm new to Cypher and am trying to figure out how to exclude nodes from a query under certain circumstances.
The graph consists of friends ( me-[friend]-person ) and friend-of-friend relationships ( me-[fof]-person )
I need to find all friend of friend relationships (easy enough), but exclude those friends of friends who are also 'friends'
I thought I could do :
START me=node(0)
MATCH me-[r:fof]->fof, me-[f?:friend]->fof
WHERE f is null and NOT(r is null)
and ... [other filters]
But this seems like the wrong way to go about getting Friends of Friends who are NOT also friends.
Suggestions?