Hey guys,
I've remodelled the data set I'm working on so that it now has the following nodes/edges:
Person X -[worked on]-> Project 1
Person Y -[worked on]-> Project 1
where the 'worked on' relationship also contains properties such as 'start_date' and 'end_date' since people often worked on the same project in non overlapping intervals in which case there shouldn't be a relationship between them.
This is the query I have for linking directly between two people:
start n1=node(1), n2=node(2)
match n1-[r:worked_on]->project<-[r2:worked_on]-n2, project<-[r3:has]-client
where n1 <> n2 and r.start_date <= r2.end_date and r.end_date >= r2.start_date
Which works exactly how I want.
I've run into problems when trying to find the shortest path between nodes because I'm not sure how I can do the date checks in that query:
START a=node(1), x=node(2)
MATCH p = allShortestPaths( a-[:worked_on*]-x )
I want to do the same thing that I did above where I check the 'start_date' and 'end_date' which people worked on the project and only return that connection if the two people overlapped. Right now it will return a connection between people even if they were on a project at different times.
I thought maybe I should be using the 'relationships' function specified on the cypher documentation page but I don't really know how.
Any ideas?
Cheers, Mark