Skip to content

BL-17 #18

Description

@davidfauth

MATCH (country:Country {name: 'Spain'})
with country
MATCH (a:Person)-[:IS_LOCATED_IN]->(:City)-[:IS_PART_OF]->(country)
with collect(distinct a) as aPrime
with aPrime, aPrime as bPrime
unwind aPrime as ap
with ap,bPrime
unwind bPrime as bp
MATCH (ap)-[:KNOWS]-(bp)
where ap.id < bp.id
with ap, bp
match (bp)-[:KNOWS]-(c) where c.id<ap.id
and (c)-[:IS_LOCATED_IN]->(:City)-[:IS_PART_OF]->(:Country {name: 'Spain'})
and (c)-[:KNOWS]-(ap)
RETURN count(*) AS count

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions