Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-27-2019 12:43 PM
Hi everybody,
I'm quite new to Neo4j and doing currently some testing to check if Neo4j can help out in some complicated data modelling.
I have a requirement that I have to show some data in a table like style.
Let's say I have a hierarchy (very much simplified here)
(:department)-[:HAS_TEAM]->(:team)-[:HAS_MEMBER]->(:person)
all nodes are also represented in according domain entities
additionally let's assume that :department has much more other relations
now I need to show this data in a table like style,e.g.:
department.name, team.name,person.firstname,person.lastname
while it's quite easy to return this data by cypher statement and map it to a List<Map<String,Object>> I also have to consider that I want to manipulate the data. Having the data as List is easy then for UI representation but not for storing back entities in Neo4j
The other way round if I get the data in the domain model, I have to do the 'join' locally traversing down the path and always going back to call next node in Neo4J and also having some JSON pain about circular dependencies in DTOS, etc.
Is there any way to define the exact path that should be loaded in an eager way, so that I do get only those relations that are relevant for me ? Specifying the load depth gives me from my understanding every node in the defined distance so not only those that I'm interested in.
Or is there any other way to traverse the data ?
Any help appreciated from a Neo4j rookie
Cheers
Joern
02-27-2019 04:00 PM
I haven't analyzed your larger question, but just wanted to mention there are ways to map back and forth, with e.g. unwind
.
Now, if you analyze the Cypher logged by SDN Repository dynamic functions, they are short and rely on pattern comprehension, which is cool (and new to me). Using these patterns, you can fashion your own traversal patterns, using the @Query
annotation.
All the sessions of the conference are now available online