I have a requirement of placing a set of constraints on nodes, relationships and properties, and making these discoverable.
For instance, a constraint might be that a relationship X may exist between nodes with labels A and B, , D and B, or B and C, but not between A and C or A and D.
Or, a constraint may be that a property P set on a node with label A might only have a number of valid values: P1 or P2. An attempt to create a node with label A and a property P set to anything other than P1 and P2 would be invalid.
Further, I'd like to be able to query these constrains to offer only legal choices when new nodes and relationships are created.
Has anyone had a similar problem? How have you solved it?
I am thinking of modeling these constraints as a graph in their own right, but maybe there is an existing solution or idea I should look at?