Question

What is the best way to meta model my Neo4j Nodes and Relationships. I need this because I will only know what object/node will be created during runtime. Here is some explanation of what I'm trying to do: Trying to store information about the nodes in another (maybe relational db) database - it's name (type), isIndexed, and list of properties with their label names and types. The same thing applied to the relationships plus start and end nodes. Then when data comes the node and relationship will be constructed on the fly.

Is there any disadvantages of this this type of modeling? May be there is already some project that helps me to do that. I already tried Spring Data for Neo4J but that's just let's me create an object/node/relationship that should be know before the compilation.

Was it helpful?

Solution

Yes, putting the TYPE of the object in your object model as a node property is common practise, that is how Spring Data Neo4j http://www.springsource.org/spring-data/neo4j and the Neo4j Ruby bindings, https://github.com/andreasronge/neo4j are doing it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top