I need to change the name of the property in a relationship between nodes
I have node A and B and R as a relationship between them. In R there is a NAME property and I need to change NAME to OCCURRENCE. I tried to use this syntax to overwrite NAME but it doesn't work, It creates a new property
Match (a), (b) Merge (a)-[r]->(b) Set r.Occurrence="8" Return r
You're doing too much here, it's generating a cartesian product between a and b.
If you want to find existing relationships and change the property, you can use this:
MATCH (a)-[r]->(b) SET r.Occurrence = r.Name REMOVE r.Name
Make sure you have the casing correct on the property name since those are case sensitive, and you provided conflicting information in your post (OCCURRENCE in your description vs Ocurrence in your query.
Also if this only applies to relationships of a certain type, or off of nodes of a certain label, add those into your query, as right now this is looking at all relationships of all nodes, which is fine for a small graph, but won't scale well if you only need to do this to a subset of relationships instead of all of them.