In neo4j, can one node and another node have multiple relationships of the same type?

I have a model for a teacher to offer a course. We know that a teacher can open a course in different semesters, so how do I create the relationship of the same type but different semester attributes between the teacher node and the course node ?

You can model this in more than one way and the model you chose will depend on the queries.

  1. You can have a separate node for CourseInstance, based upon the semester.
  2. You can have a property on the TEACHES_COURSE relationship that specifies the semester.
  3. You can use a specific relationship name such as TEACHES_COURSE_2019-01

You definitely do NOT want to create the same relationship between two nodes unless they differ by a property on the relationship. Using the specific relationship will most likely perform better for you, but specializing the CourseInstance may also perform well. You need to try the model that will give you the best performance for the queries.

Elaine

Thank your for your efficient reply ! I'm having a try, I will reply you again if I encounter other problems.Thanks again.:smile: