cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Graph modelling question: many relationships between two same nodes, or separate relationships and have more nodes?

Hi guys. As all of these posts often start, I am quite new to the Neo4j/GDB world. I am working on a project to find pathways for health insurees (and make predictions on what to recommend next). I am questioning whether my model architecture is the best to go with after reading this article

The Model
I modeled the problem as follows: say we have disease D and treatments X1, X2, X3, and insurees I1, I2. Then we would have a total of 6 nodes, where the relationships between treatments hold a property saying which insuree had this treatment. So in Cypher e.g.:
(D)-[:HAS_DISEASE]->(I1)-[:NEXT {id: I1.id}] -> (X1) -[:NEXT {id: I1.id}] -> (X3)-[:NEXT {id: I1.id}] -> (X2)

With the current graph modeling, we would have many next relationships between two treatment nodes with the insuree as property. The idea here is to extract the path for an insuree, to apply algorithms that suit the prediction methods (to be determined..).

My question is whether this is the right/ok way to do it. With my browser not being able to load a simple query to find two paths, and the article above, I have my doubts. An alternative I have also been thinking of is making separate treatment nodes for each insuree. That is there is only one relationship between two treatments, namely the one belonging to the insuree in question. But then I struggled with how could I use this to run similarity algorithms for example as we have no real connections between the data. This project is really comparable to that from a modelling standpoint.

Really looking for some insights here, appreciate your time and response. Also, it is my first time posting on a forum such as this. If there are unclarities or practices I am not adhering to, I would like to hear about it to do it better in the future.

1 REPLY 1

Hi,
there are quite some people dealing with patient journeys and there are also already some best practices on how to model stuff, I guess. Look at that post: Patient Journey Model Template - Projects & Collaboration - Neo4j Online Community

You could probably just message the mentioned people. Hope it helps.

Regards,
Elena