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.

Is it possible for two entities to have multiple of the same relationships with each other?

This is my current graph model.

How do I represent that a leader may start leading a group, leave and come back to lead the same group multiple times?

Eg. Rambo may lead the expendables from 2015-2016, and then may also come back to lead them again in 2017-18.

John-Dag
1 ACCEPTED SOLUTION

asperlinga
Graph Buddy

Hi John, Yes we can:

CREATE (L:Leader{Name:"John Doe"})-[:LEADS{startDate:"2020-08-20", terminationDate:"2020-08-20"}]->(G:Group{Title:"Alpha"}) return L,G

match (L:Leader{Name:"John Doe"}),(G:Group{Title:"Alpha"})
create (L)-[:LEADS{startDate:"2019-08-20", terminationDate:"2019-08-20"}]->(G)
return L,G

But...
If you need to query event create a node (:EVENT) with start date and enddate can be useful.

Alessio

View solution in original post

2 REPLIES 2

Hello @jaedag

Yes, you are able to do it

Regards,
Cobra

asperlinga
Graph Buddy

Hi John, Yes we can:

CREATE (L:Leader{Name:"John Doe"})-[:LEADS{startDate:"2020-08-20", terminationDate:"2020-08-20"}]->(G:Group{Title:"Alpha"}) return L,G

match (L:Leader{Name:"John Doe"}),(G:Group{Title:"Alpha"})
create (L)-[:LEADS{startDate:"2019-08-20", terminationDate:"2019-08-20"}]->(G)
return L,G

But...
If you need to query event create a node (:EVENT) with start date and enddate can be useful.

Alessio