When we use MATCH and MERGE to create an intermediate node, for example like below. It seems to me there is a state maintained between MATCH and MERGE statements so that the pre-existing relationship property between Actor and Movie in the case of the property, role, is able to replicated in the new relationships using the new intermediate nodes created. Esp. the 1st MERGE statement to create Role nodes, which is totally different from a single, random MERGE (x:Role {name: r.role}). Although only r.role is used in the statement, the corresponding actor and movie node info is kept in the memory. Don't know if someone can share some insights on this. A follow-up question is if it's true that the corresponding nodes info is always kept for any relationship, then we can use the corresponding nodes info without explicitly declaring them, right? In another word, using r.role not only brings us a bunch of strings, but the corresponding nodes info are hidden but attached to them, right? Thank you so much.
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