Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j (or any other graph database) modeling

I'm starting to work with graph databases, and in my team we've started modeling a graph for our software. The problem comes when we try to "document" the model, to see the structure of our database. With SQL databases you only have to look at the SQL schema.

We've spent some time reading neo4j blogs and documentation, but we've seen that the usual way to show how a graph works is with a minimal graph showing some sample data (Random samples: sample1, sample2, etc). That's great for educational purposes, but we'd love to be able to do it in a little more formal way. We'd like to set what kind of node can relate with another one, and with what kind of relationship, that kind of stuff.

Using Spring you can wrap the graph with classes, but it's very specific to Java and OO model, and we're working with Erlang. We're looking for some kind of formal language (SQL Schema equivalent), or a E-R model equivalent, or something like that.

like image 658
César García Tapia Avatar asked Apr 22 '12 16:04

César García Tapia


People also ask

What is data Modelling in Neo4j?

The data model in Neo4j organizes data using the concepts of nodes and relationships. Both nodes and relationships can have properties, which store the data items associated with nodes and relationships. Nodes can have labels: A node can have zero, one, or several labels.

Is Neo4j a graph database?

Neo4j is the only enterprise-strength graph database that combines native graph storage, advanced security, scalable speed-optimized architecture, and ACID compliance to ensure predictability and integrity of relationship-based queries.

What is graph database model?

Graph data modeling is the process in which a user describes an arbitrary domain as a connected graph of nodes and relationships with properties and labels.


1 Answers

One way to do this is to put the "meta-model" of your graph (a type network) in the graph as well and then connect the instances (nodes) to their meta-model-type. So you can visualize the meta-model using the graph visualization and at the same time use the meta-model to enforce additional constraints (by storing constraint information in the meta-model and using that when the actual model is updated) and also use the type-nodes of the meta-model to quickly access all "instance"-nodes of this type.

What is the domain you want to model?

like image 157
Michael Hunger Avatar answered Oct 28 '22 20:10

Michael Hunger