I'd like to be able to create a constraint in the database that ensures a relationship is only used between two specific labels. It seems that there is no such support in Cypher (or I just haven't found a way to do it). Given the lack of support for such constraints, I can write the following:
CREATE (:Person {name: "savas"})-[:rated {stars: 5}]->(:Movie {title: "StarWars"})
MATCH (p:Person {name: "savas"})
CREATE (p)-[:rated {stars: 1}]->(:Database { name: "neo4j"})
I wouldn't be able to do the above if I had a constraint that looked something like this:
CREATE CONSTRAINT IF NOT EXISTS FOR (:Person)-[:rated]->(:Movie)
Update: It seems there was a similar request from 5y ago: Can I have a Constraint that a specific Relationship exists between two nodes/labels?