I have nodes with two labels: Country and Continent.
Each country has a property called continent_code and I want to create a relationship between all the countries and their corresponding continent.
What I could achieve is only to create the relationships for a given continent like this:
MATCH (u:Country {continent_code:"NORAM"}), (a:Continent {code:"NORAM"})
MERGE (u)-[r:IS_COUNTRY_OF]->(a)
RETURN u, a, r
Now what I would like to do is something more like this:
MATCH (u:Country {continent_code: a:Continent.code})
MERGE (u)-[r:IS_COUNTRY_OF]->(a)
RETURN u, a, r
Obviously this is not working, but I have no idea how to fix it, I am not even sure if it is possible in Neo4j/cypher.
Thanks for your help!