title: How to model a schema for a graph database?
body: <p>I am looking for a general aproach to realize a restrictional schema on a graph database.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>An example restriction could be: <code>A node representing a "User" always needs to have at least one relation to a node representing a "Department".</code></p>
  
  <p>I am not particularly looking for a neo4j way, but rather a general formalism or notation. Does something like this exists?</p>
  
  <hr>
  
  <p>In meantime I have found a suggestion to add nodes to the database that define a meta model <a href="https://stackoverflow.com/a/10305950/529359">here</a>. But I hope to find answers that can point me to established best practices, research papers or mathematical definitions like, say, <code>A database schema is a subgraph of the overall graph and forms a bipartite graph with the nodes containing the actual data</code>.</p>