• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to store and mantain the dynamic hierarchy tree data ?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello onas Partner, Aleksa Vukotic, and Nicki Watt,

I had tried out to store dynamic hierarchy tree data in neo4j on last year but i personally found that it's not easy or not possible to store the dynamic hierarchy tree data.

Also, how would you manage inheritance property of one parent node to child node when we store the tree data in neo4j ..

Please let me know if you have any more detail data require for above question.


thanks you ..
 
Author
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pankaj,

I guess this depends on exactly what you mean by 'dynamic'. With regards to 'managing' inheritance of properties from one node to another, one strategy would be to deal with this as part of your query / traversal gathering the data as you traversed 'up' your hierarchy, where, if a property was not there, you obtain it from the parent otherwise use the one which exists.

If you are thinking of a 'hierarchy' in terms of a Java class hierarchy, for example you have a Person class which has Customer and User as subclasses, this does not generally translate into two distinct nodes within the graph. If you wanted to store the details for the instance 'Bob' as a 'Customer', you would typically only have one node with all the properties (related to both Person and Customer) in this single node. You may well have two Neo4j labels associated with this one 'Bob' node, (a 'Person' and 'Customer' label). This is one of the strategies employed by Spring Data Neo4j (SDN) in terms of representing a Java based hierarchy in Neo4j.
For more info on this you can see the SDN website here: http://docs.spring.io/spring-data/data-neo4j/docs/3.2.1.RELEASE/reference/html/, specifically the section on "Entity Type Representation".

Hope this helps
Nicki
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!