I am looking for a general aproach to realize a restrictional schema on a graph database.
I am familiar with relational database systems where one defines tables with specific columns. All incoming data is then stored exactly like one modeled in the schema of the database. All incoming data is automatically validated, i.e. one cannot store a record with missing required column values.
Graph databases, like neo4j, allow unrestricted and freestyle storage of nodes and relations. I am wondering if there is something like a schema for graph databases. I am looking for an established notation / definition or general aproach for modelling restrictive schemas in graph databases, which corresponds to table schema definitions in relational table based databases.
An example restriction could be: A node representing a "User" always needs to have at least one relation to a node representing a "Department".
I am not particularly looking for a neo4j way, but rather a general formalism or notation. Does something like this exists?
In meantime I have found a suggestion to add nodes to the database that define a meta model here. But I hope to find answers that can point me to established best practices, research papers or mathematical definitions like, say, A database schema is a subgraph of the overall graph and forms a bipartite graph with the nodes containing the actual data
.