MATCH (a:Actor)-[r:ACTED_IN]-(m:Movie) MERGE (x:Role {name: r.role}) MERGE (a)-[:PLAYED]→(x) MERGE (x)-[:IN_MOVIE]→(m) SET r.role = null
This is given as the solution code but it's not working. I Updated it as below, still not working. Can somebody help?
MATCH (a:Actor)-[r:ACTED_IN]-(m:Movie) WHERE r.role is NOT NULL MERGE (x:Role {name: r.role}) MERGE (a)-[:PLAYED]-(x) MERGE (x)-[:IN_MOVIE]-(m) SET r.role = null