Complex schema constraints and constraint discovery - anyone tried it?

35 views
Skip to first unread message

Mark Novak

unread,
Oct 21, 2019, 2:38:02 PM10/21/19
to Neo4j
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?

Thanks!

Michael Hunger

unread,
Oct 21, 2019, 2:41:13 PM10/21/19
to ne...@googlegroups.com
Did you see the ontology checking article on https://jbarrasa.com/2016/04/06/building-a-semantic-graph-in-neo4j/
There is also imho a constraints extension from GraphAware for that.

I think you should also be able to use apoc triggers to veto transactions that violate your constraints.

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/neo4j/0d6a5341-a686-4dde-9f9c-736ce8fcf3e6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages