Search code examples
graphneo4jproperty-graph

Representing that a Player has played for the same team over multiple years in a property graph


Below is the property graph model I am planning to use to represent various sports leagues. I am wondering the best approach to represent the fact that a Player has played for the same team over multiple years. For e.g. John might have been playing with Broncos in 2011, 2012 and 2013.

enter image description here


Solution

  • You can have the same relationship type connected to the same nodes multiple times.

    Player1 -[r:BELONGED_TO] -> Team1
    Player1 -[q:BELONGED_TO] -> Team1
    r.in_year = 2009
    q.in_year = 2009