Overview
Modeling Time in a Graph
Effective-from / valid-to properties vs temporal relationship nodes — pick per query pattern.
Why it matters
If queries always need 'what was true at T?', materialise time as a node so you can MATCH on it. Otherwise store from/to as properties and filter in WHERE.
Going deeper
Two idioms, chosen by query pattern:
| Idiom | Shape | Best when |
|---|---|---|
| Validity properties | [:WORKED_AT {from, to}] filtered in WHERE | Time is an occasional filter |
| Time as nodes | (:Event)-[:ON]->(:Date) you MATCH on | You repeatedly pivot on calendar points |
The validity-property pattern needs an open-ended guard so current facts (no to yet) survive the filter:
MATCH (p:Person)-[r:WORKED_AT]->(c:Company)
WHERE r.from <= date($asOf)
AND coalesce(r.to, date('9999-12-31')) >= date($asOf)
RETURN p.name, c.name;
Promote to :Date/:Month nodes only when calendar traversal itself becomes the query (e.g. 'show the timeline', 'co-occurrence on the same day') — otherwise you pay node-creation and join cost for filtering you could do in WHERE.
