How best to model nodes and relationships in a structure that changes every year?

I need advice on the best way to model our graph.
We maintain a 3-level learning course in the graph and the syllabus of this course changes every year. I need to be able to extract the full course structure for a selected 'Level' and for a specific 'year'.

I want to avoid unnecessary duplication of nodes, but also make sure that I am able to filter the structure as required above.

There are 2 parts to the structure:

  • Concepts
  • Syllabus

The Concepts are units of knowledge; effectively they are subgraphs:
(:Concept)<--(:Atom {Instructional | Assessment})

The Syllabus is a 'super'graph and describes the hierarchical navigational structure of the course:
(:Reading)-->(:Session)-->(:Topic)-->(:Level)-->(:Course)

The Concepts are linked to the Readings: (Concept)-->(Reading)---

Each year, the superstructure changes and many of the nodes' relationships change and their node numbering therefore changes. So, in 2017 we might have 2 'readings' pointing one 'session':
(r1:Reading {name:'Alpha', num:R01})-->(s1:Session {num:SS01)
(r2:Reading {name:'Bravo' num:R02})-->(s1:Session {num:SS01)

..but in 2018 this changes, and the second reading moves to a different 'session':
(r1:Reading {name:'Alpha', num:R01})-->(s1:Session {num:SS01)
(r2:Reading {name:'Bravo', num:R02})-->(s2:Session {num:SS02)

.. and in 2019 we insert a brand new 'reading' that becomes the new 'R02'
(r1:Reading {name:'Alpha', num:R01})-->(s1:Session {num:SS01)
(r2:Reading {name:'Charlie', num:R02})-->(s2:Session {num:SS02)
(r3:Reading {name:'Bravo', num:R03})-->(s1:Session {num:SS01)

I am considering having single 'Reading' nodes, unique by their name, or other reference. And the Reading 'number' (R01 / R02..) would then be a parameter on the relationship between the 'Reading' and the 'Session', along with another relationship parameter for the 'year'.

For example:
(:Reading {ref:"rAAA", name:"Alpha"} )-[:PART_OF {year:2019, num:"R01"}]->(:Session)

I am going to want to query the graph to give me 'all related nodes for a specific 'year'' and 'all related nodes where the relationships are the most recent'

Is this the right way to achieve my changing syllabus?
Is there a better way of modelling this?

Thanks
Fergus

0 REPLIES 0