Relationship history
The collection of active and inactive relationships beween a party and another node constitute that relationship's history.
The history will build up as relationships are added and deactivated. For example:
- A party has a name relationship of type
displaywith a name node. The relationship starts off as active:
- The client changes their name to "Jon Client." Based on the business rules, we create a new name node for the new name, a new alias name node for the old name, and deactivate the old name relationship:
With these name node and relationship records intact (and of course, with appropriate dates on the HAS_NAME relationships), we can construct a history of the party's names:
cypher
MATCH (p:Party { id: $id})-[rel:HAS_NAME]->(names:Name)
RETURN names.type as type,
names.name as name,
rel.active as active,
rel.fromDate as fromDate,
rel.thruDate as thruDate,
rel.termReason as termReason
ORDER BY names.type, rel.active DESC, rel.thruDate DESC