Time in a Box: Advancing Knowledge Graph Completion with Temporal Scopes

Ling Cai, Krzysztof Janowicz, Bo Yan, Rui Zhu, Gengchen Mai

Abstract

Almost all statements in knowledge bases have a temporal scope during which they are valid. Knowledge base completion (KBC) on temporal knowledge bases (TKB) has thus attracted growing attention. However, prior works often assume scoping information is always present, ignoring the reality of missing data. We introduce TIME2BOX, a knowledge base embedding framework that handles atemporal and temporal statements simultaneously. By representing answer sets as axis-aligned hyper-rectangles (boxes) and modeling time as a filter through box intersections, TIME2BOX achieves state-of-the-art performance in both link and time prediction.

1. Introduction

Knowledge Bases (KBs) like Wikidata store facts as triples: (subject, relation, object). However, many facts are only true for a specific time—for example, (Albert Einstein, educatedAt, ETH Zurich, 1896-1900). Temporal Knowledge Graph Completion (TKGC) aims to fill in missing pieces of these time-aware facts.

Current approaches face two major hurdles:

  1. Missing Data: Real-world KBs frequently lack temporal information. Prior models often assume every statement must have a known time scope, limiting their utility on generic, "messy" datasets.
  2. Evaluation Flaws: Metrics for predicting time intervals, such as aeIOU, fail to distinguish between "near misses" and "far misses" when a predicted interval does not overlap with the ground truth.

2. The TIME2BOX Framework

The authors introduce TIME2BOX, built on the intuition that the answers to a temporal query—e.g., "Where did Einstein work in 1933?"—are always a subset of the answers to the broader, time-agnostic query "Where did Einstein work?".

2.1 Box Embeddings and the Subset Intuition

Instead of representing entities as single points, TIME2BOX represents sets of potential answer entities as boxes (axis-aligned hyper-rectangles) in a high-dimensional space. An entity is considered a valid answer if its point embedding falls inside the box.

2.2 Time as a Filter

The model uses two types of "projectors" to narrow down the search space:

  • Relation Projector ($OP_r$): Creates a box containing all entities that satisfy the relation (e.g., all places Einstein ever worked).
  • Time Projector ($OP_t$): Creates a box containing all entities relevant to a specific time (e.g., everything relevant to 1933).

The final answer set is found by calculating the intersection of these boxes. This naturally models the narrowing down of possibilities as more constraints (like specific years) are added.

Geometric modeling of atemporal, timestamped, and interval-based statements.

3. Improved Evaluation: The gaeIOU Metric

To better evaluate time prediction, the authors proposed Generalized Affinity Enhanced Intersection Over Union (gaeIOU). Unlike previous metrics, gaeIOU penalizes the "gap" between non-overlapping intervals, providing a more granular look at model performance. This allows the model to be rewarded for "near misses" rather than being treated the same as a completely irrelevant prediction.

4. Experimental Results

The model was evaluated on two Wikidata-based datasets: WIKIDATA12k (standard benchmark) and WIKIDATA114k (a new, larger, and "messier" dataset with 1.7 million statements).

  • Link Prediction: TIME2BOX consistently outperformed SOTA models like TNTComplEx and TIMEPLEX. On WIKIDATA12k, it improved HITS@1 by over 5 percentage points.
  • Time Prediction: The gains were even more significant. Using the gaeIOU metric, TIME2BOX outperformed baselines by a 15.81 point gain on WIKIDATA114k for gaeIOU@10.
  • Robustness: The model showed a much better Mean Rank (MR). While baselines sometimes produced "extremely bad" predictions (ranking the correct answer in the 300s), TIME2BOX's box constraints kept its guesses much closer to the target.

5. Conclusion and Future Work

TIME2BOX demonstrates that modeling temporal reasoning as a set-filtering process is both intuitive and effective. By using boxes, the model can handle various time types (instants, open intervals, closed intervals) within a single geometric framework. Future work may extend this "Box" framework to handle geographic constraints (spatial scopes) and mixed temporal granularities.

Summary updated

Abstract

Almost all statements in knowledge bases have a temporal scope during which they are valid. Hence, knowledge base completion (KBC) on temporal knowledge bases (TKB), where each statement \textit{may} be associated with a temporal scope, has attracted growing attention. Prior works assume that each statement in a TKB \textit{must} be associated with a temporal scope. This ignores the fact that the scoping information is commonly missing in a KB. Thus prior work is typically incapable of handling generic use cases where a TKB is composed of temporal statements with/without a known temporal scope. In order to address this issue, we establish a new knowledge base embedding framework, called TIME2BOX, that can deal with atemporal and temporal statements of different types simultaneously. Our main insight is that answers to a temporal query always belong to a subset of answers to a time-agnostic counterpart. Put differently, time is a filter that helps pick out answers to be correct during certain periods. We introduce boxes to represent a set of answer entities to a time-agnostic query. The filtering functionality of time is modeled by intersections over these boxes. In addition, we generalize current evaluation protocols on time interval prediction. We describe experiments on two datasets and show that the proposed method outperforms state-of-the-art (SOTA) methods on both link prediction and time prediction.
BibTeX
@inproceedings{cai2021time,
  author = {Ling Cai and Krzysztof Janowicz and Bo Yan and Rui Zhu and Gengchen Mai},
  title = {{Time in a Box: Advancing Knowledge Graph Completion with Temporal Scopes}},
  booktitle = {K-CAP},
  year = {2021},
  url = {https://openreview.net/forum?id=7eJKT0k2zx},
}
Figure