Designing a database for querying by timestamp across multiple scenarios

How might one setup a neo4j database to query versions of entities, relationships, and properties that change both in time and along parallel (or branching) timelines? Greycat refers to this as many-worlds--it is used in scenario analysis in urban planning, branching narratives in gaming, and likely other domains. With neo4j, is this handled via timetrees, versioning, partitioning? The only requirement is that the entities, relationships, and properties have unique IDs with values that vary along two or more dimensions (e.g. time & branch).

I think if you use a common approach to versioning in a graph, it should work for you. The basic concept is to separate the concepts of identity and state. The root node is the identity of whatever it is you're versioning and it has relationships to the various versions or state history of that identity node. In those state nodes you can use your timestamps to track from start time to end time that a state was active.

Helpful article Network versions - graphgists

2 Likes

Thanks @mike_r_black. I'll read the material you linked to.

1 Like