Search code examples
neo4jcyphergraph-databasesneo4jphpnosql

Graph data modeling (Neo4j)


i am new to graph databases. I am having some issues while modeling data. I am working on site which contains information about books. I have categorized books in different categories like: arts, fiction etc. I ve generated a node for each category. Nodes of categories are unconnected with each other and that where the first issue comes. To solve this issue i am going to index a node called category and connect all my category nodes to it which leads me to the second issue of dense node or super node. Now tell me how to solve both these issues.


Solution

  • You should use labels. The idea of super nodes was for neo4j < 2.*

    You can add a label BookCategory and when you want to return back all your bookCategoryNodes, just specify the label in the match query :

    MATCH (n:BookCategory) RETURN n