Is there some way to model type hierarchies in Neo4j? If for example I want to build a class hierarchy of cars, I might have a base type of "Car" and then have sub classes that extend that, like "SportCar", etc.
I'd like to be able to create instances of "SportCar", but run a query to get all "Car"s. Is this possible? If so what is the technique?
I think what I'm trying to do is create a "label hierarchy" - but I just don't think that's supported in neo4j.
Additionally, Neo4j has scalability weaknesses related to scaling writes, hence if your application is expected to have very large write throughputs, then Neo4j is not for you.
Graph Query Language (GQL) Is Now a Global Standards Project. Platform Overview → Neo4j graph technology products help the world make sense of data.
The World's Leading Organizations Rely on Neo4j. With more than 950 enterprise customers, Neo4j is the world's leading provider of scalable graph technology, enabling connected data applications for more than 75% of the Fortune 100.
Heap Sizing The size of the available heap memory is an important aspect for the performance of Neo4j. Generally speaking, it is beneficial to configure a large enough heap space to sustain concurrent operations. For many setups, a heap size between 8G and 16G is large enough to run Neo4j reliably.
There are at least two ways to do that:
1) Use multiple lables for each object
CREATE(BMW325d:Car:PassengerCar:DieselCar)
CREATE(Porsche911:Car:SportsCar:...)
2) Create an Ontology
The second way of modeling a class hierarchy is using ontologies. Although Neo4j models data as a property graph and ontologies are more suitible for RDF Triple Stores there are ways to use them.
You can create the ontology using Protégé (Open Source). Then you save the Ontology in an .owl-File and upload it to Neo4j using this Plugin. Afterwords you assert your nodes in Neo4j to the Metagraph created in Protégé. A more detailed description is described here.
more on this topic...
For your purposes an RDF Triple Store is an interesting option, escpecially if you want to add semantics to your data like to use inferences and inheritance. I recommend to take a closer look on RDF Triple Stores, which are also graphs - but they store data in triples (subject - predicate - object) instead of nodes and relations. Top Braid Composer is an "easy-to-learn"-tool to get started with them.
Although, I hope that the gap between Property Graphs and RDF triple stores will get smaller soon at the moment it is a tradeoff. SO you should carefully set your requirements on the database before choosing one of them.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With