Expand description
Temporal knowledge graph — edges with validity periods.
Provides bi-temporal edge tracking: each edge carries a valid_from /
valid_to validity interval. Adding a new edge for the same
(from_id, to_id, relation) triple automatically closes the previous open
interval so the graph stays consistent.
Structs§
- Graph
Diff - Summary of how the graph changed between two timestamps.
- Temporal
Edge - A directed edge in the temporal knowledge graph.
Constants§
- CREATE_
TEMPORAL_ EDGES_ TABLE - SQL that creates the
temporal_edgestable and its supporting indexes.
Functions§
- add_
edge - Add a new temporal edge.
- detect_
contradictions - Detect edges that share the same
(from_id, to_id, relation)triple and have overlapping validity periods — which should not exist under normal operation. - diff
- Compare the graph state at two different timestamps.
- invalidate_
edge - Set the
valid_totimestamp on an existing edge, effectively closing it. - relationship_
timeline - Return the complete edit history for a
(from_id, to_id)pair, ordered chronologically (valid_from ASC, thencreated_at ASC). - snapshot_
at - Return all edges that were valid at
timestamp.