Short question
Does Neo4j support constraints based on a domain-model?
Explanation
In the basic tutorial, it says "Please keep this picture at hand all the time. It details the domain-model for this tutorial." (https://stack.versal.com/api2/assets/fdc05cea-e18b-44ea-8ba9-e119d7a8f872).
But is there any way to check that data stored into the graph respect this domain-model?
For relational databases, we have "create" instructions to build the domain-model and "insert" instructions to store data in compliance with this domain-model.
For graph database in Neo4j, I only found "create" instructions where we can specify a type (that would be part of the domain-model).
What I need to do
I need to create a domain-model that prevent the creation of nodes which are not compliants with the domain-modeln for example:
- the node type must be in the domain-model
- a type of association can only link nodes with specific types
Example
With the movie domain-model coming from the tutorial (https://stack.versal.com/api2/assets/fdc05cea-e18b-44ea-8ba9-e119d7a8f872) :
- A node can only be of type Person or Movie
- A Movie can't have outgoing edges
- A DIRECTED or ACTED_IN relationship can't link two Persons
- ...
Is this possible in Neo4j? Or do I have to create checkers on the model?