Temporal Knowledge Graphs: Facts That Change Over Time

5 minute read

Published:

TL;DR: A temporal knowledge graph (TKG) extends the standard triple (s, r, o) to a quadruple (s, r, o, t) — each fact has a timestamp or validity interval. TKG completion asks: given (s, r, ?, t), predict the missing entity. This requires reasoning about temporal patterns: periodicity, recency, entity-relation-time interactions.
Key Insight: A static KG is a photograph — it captures one moment. A temporal KG is a film — facts have birth dates and expiry dates. The challenge is not just storing timestamps but reasoning about them: "Who was the CEO of Apple in 2005?" requires knowing that Steve Jobs held the role from 1997 to 2011, not just that he was ever CEO.

From Triples to Quadruples

Standard KG: {(s, r, o)} — timeless facts.

Temporal KG: {(s, r, o, t)} where t is a timestamp or interval [t_start, t_end].

Examples:

  • (Barack_Obama, presidentOf, USA, [2009, 2017])
  • (Bayern_Munich, wonChampionsLeague, 2020)
  • (Apple, ceoIs, Steve_Jobs, [1976, 1985] ∪ [1997, 2011])

Two types of TKG facts:

  1. Instantaneous: single timestamp (sports results, news events)
  2. Interval-based: valid during a period (job titles, relationships)

The TKG Completion Task

Interpolation: predict missing facts at known historical times — fill in KG gaps within the training period.

Extrapolation: predict future facts — given everything known up to time t, what triples will be true at t+1?

Extrapolation is the harder and more practically relevant task.

Key Models

TTransE (Time-aware TransE)

Adds time to the TransE scoring function:

f(s, r, o, t) = -||e_s + w_r + w_t - e_o||

Learns a separate time embedding w_t and treats time as another “relation” that shifts entity positions. Simple extension but ignores temporal dynamics.

TNTComplEx

Extends ComplEx to quadruples by adding temporal embeddings as additional mode:

f(s, r, o, t) = Re( e_s · w_r · e_o · w_t )

(4th-order tensor decomposition with complex embeddings.)

RE-NET (Recurrent Event Network)

Uses a recurrent architecture to model temporal sequences:

  1. For each entity pair (s, o), collect the sequence of relations over time
  2. Encode with GRU/LSTM to get history representation
  3. Aggregate with a GNN over the event subgraph at time t
  4. Score candidate triples for t+1

RE-NET explicitly models the temporal ordering of events — capturing recurrence patterns like “Player X scores goals in consecutive matches.”

TGAT (Temporal Graph Attention Network)

Assigns time-encoding to edges and applies attention over temporal neighbourhoods. Each neighbour message is weighted by both structural importance (attention) and temporal proximity (time encoding).

Why temporal patterns matter: "CountryX will hold elections" is more likely if elections occurred ~4 years ago (periodicity). "PersonY will be appointed to a position" depends on whether they recently left another position (temporal sequence). TKG models that capture periodicity and recency dramatically outperform static KG models on extrapolation tasks.

Worked Example: TTransE on a Political Event

Suppose we want to predict: (CountryX, holdsElection, ?, t=2024).

Static TransE embeds CountryX and holdsElection without time — it either always predicts elections or never does, based on training frequency.

TTransE scoring function: f(s, r, o, t) = - e_s + w_r + w_t - e_o 

With learned time embedding w_2024 ≈ w_2020 (both election years, similar temporal position in the 4-year cycle), TTransE will score 2024 candidates similarly to 2020 — capturing the periodicity pattern. For a non-election year like 2022, w_2022 is far from w_2020 in embedding space, so election predictions score low.

This illustrates why time embeddings help: they encode position in recurring cycles, giving the model a “calendar sense” that static embeddings completely lack.

2012 2016 2020 2024 2028 predicted? 2014 2018 2022 Election year Non-election year
TKG extrapolation: the model sees election events at 2012, 2016, 2020 and must predict whether 2024 will also be an election year — exploiting the 4-year periodicity in the time embedding space.

Temporal Reasoning Challenges

1. Irregular observation: facts are not observed at uniform time intervals — some entities have dense histories, others sparse.

2. Time granularity: a fact valid for decades appears at daily/monthly resolution differently than a single-day event.

3. Entity dynamics: entities change identity over time (companies merge, people change roles). The embedding of “CEO of Apple” should change as different people hold the role.

4. Causality vs correlation: temporal patterns in KGs often reflect causal chains, but models learn correlations. Disentangling these is an open problem.

TKG Benchmarks

  • ICEWS (Integrated Crisis Early Warning System): political events worldwide, timestamped daily
  • GDELT: global event database, fine-grained temporal resolution
  • YAGO15K: static YAGO with temporal annotations
  • WikiData (temporal subset): entity facts with validity intervals

Standard splits: train on t ≤ T, validate on T < t ≤ T’, test on t > T’.

Summary

ModelApproachTemporal pattern captured
TTransETime embedding + TransEBasic time displacement
TNTComplEx4-order tensor with timeComplex temporal interactions
RE-NETGNN + RNNTemporal event sequences
TGATTemporal attentionRecency-weighted neighbourhood

Temporal knowledge graphs are a stepping stone from static relational reasoning to full temporal graph learning (covered in the Dynamic Graphs section). The key insight: facts have lifetimes, and reasoning about the world requires reasoning about when facts were true — not just whether they are true.

References