Reputation: 1664
I am working on a new web project and am using neo4j as the database so I can use relationships and create suggestions. It's a simple dating web site for non dating people so they can hang out and talk about their professions. I started modeling the data and have a person node. I want to have the relationship 'met_with' to track when people hang out. I have the property 'meet_date' and 'rating' on the met_with relationship so I can track when people hung out and what they though of the hangout.
Problem I am having is I want to also record where they hung out at with a 'Location' node but I want to store when 2 people met there. (i.e. Steve and Mary met at Java House on 8/28/2015) I assume that location would also be a node but I am not sure how I can track which two people met where. I know I can have a relationship 'met_at' between the Person and the Location but how can I keep it tied to the two people. I don't want it to be that I have 6 relationships between a person and a location (if that person happens to love that place to meet) and not be able to tell who they met with each time.
In relational database I can just have a join table that stores the 2 people's ID and the location ID along with the meet date but I am, of course, trying to get away from the join mindset for this project.
Thanks for any advice anyone can offer!
Upvotes: 1
Views: 50
Reputation: 20185
Right, so your problem is telling you something. Apparently the notion of meeting is important right here and is a priority entity in your domain.
So I would create new "Meeting" nodes, these nodes can relate the both persons and can be related to a location. Furthermore this opens new possibilities like connecting your meeting nodes to a timetree, or even to topics, ...
Upvotes: 2