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. Join our new Community Site & Forum <https://community.neo4j.com> On Mon, Oct 21, 2019 at 8:38 PM Mark Novak <mr.mark.no...@gmail.com> wrote: > 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! > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/neo4j/0d6a5341-a686-4dde-9f9c-736ce8fcf3e6%40googlegroups.com > <https://groups.google.com/d/msgid/neo4j/0d6a5341-a686-4dde-9f9c-736ce8fcf3e6%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/neo4j/CAKZwuWkzDUKdiewJhscf6iHpg9hjivaie6PtghU_TWorZy819Q%40mail.gmail.com.