Question answering over spatio-temporal knowledge graph

Xinbang Dai, Huiying Li, Nan Hu, Yongrui Chen, Rihui Jin, Huikang Hu, Guilin Qi · OpenReview

Abstract

Spatio-temporal knowledge graphs (STKGs) extend the concept of knowledge graphs (KGs) by incorporating time and location information. While the research community's focus on Knowledge Graph Question Answering (KGQA), the field of answering questions incorporating both spatio-temporal information based on STKGs remains largely unexplored. Furthermore, a lack of comprehensive datasets also has hindered progress in this area. To address this issue, we present STQAD, a dataset comprising 10,000 natural language questions for spatio-temporal knowledge graph question answering (STKGQA). Unfortunately, various state-of-the-art KGQA approaches fall far short of achieving satisfactory performance on our dataset. In response, we propose STCQA, a new spatio-temporal KGQA approach that utilizes a novel STKG embedding method named STComplEx. By extracting temporal and spatial information from a question, our QA model can better comprehend the question and retrieve accurate answers from the STKG. Through extensive experiments, we demonstrate the quality of our dataset and the effectiveness of our STKGQA method.

The Spatio-Temporal Reasoning Gap

Traditional Knowledge Graphs (KGs) are essentially static snapshots of facts. However, real-world information is inherently dynamic: a person’s employer changes over time, and events occur at specific geographic coordinates. While Spatio-Temporal Knowledge Graphs (STKGs) like YAGO2 have been developed to store this multi-dimensional data, the systems used to query them—Question Answering (QA) models—have lagged behind.

Answering a natural language question involving both time and space requires a system to resolve implicit entities (e.g., identifying the dates of "World War II"), perform geometric calculations (e.g., orientation or distance), and execute temporal comparisons simultaneously.

Examples of spatio-temporal questions requiring joint reasoning over time and space.

The STCQA Framework

To address these complexities, we propose STCQA (Spatio-Temporal Complex Question Answering), a three-stage framework designed for robust reasoning:

  1. Preprocessing: The system utilizes Named Entity Recognition (NER) and entity linking (via FLERT and BLINK) to identify "clues" within the question. These are replaced with special tokens (e.g., [TS] for temporal clues, [GEO] for spatial) to help the model focus on logical structure rather than raw entity names.
  2. Neural Answer Retrieval: We extend the TComplEx embedding method to create STComplEx. While TComplEx represents facts as (subject, relation, object, time), our method incorporates a location vector ($l$). The scoring function $\phi_{ST}$ learns to assign high scores to valid facts by calculating the Hermitian dot product of the subject, relation, time, and location embeddings.
  3. Symbolic Answer Filtering: Recognizing that neural embeddings often struggle with precise mathematical constraints (such as calculating if a point is exactly "within 2 miles"), we implement a symbolic filter. This module uses the Haversine formula for geographic distances and explicit rules for temporal intervals (e.g., "before," "during") to prune the candidate list generated by the neural retriever.

The STQAD Dataset

A primary contribution of this work is STQAD (Spatio-Temporal Question Answering Dataset), the first comprehensive benchmark for this task. Built by aligning YAGO15K (temporal) with YAGO2 (spatial), the dataset features 10,000 natural language questions requiring joint reasoning.

Comparison of STQAD with existing temporal and spatial KGQA datasets.

As shown in the comparison above, previous benchmarks like CronQuestions focus solely on temporal reasoning, while others like GeoQuery focus on spatial constraints. STQAD is unique in requiring models to handle temporal, spatial, and paraphrased variations simultaneously across 138k facts and 15k entities.

Experimental Results and Insights

Our experiments reveal several key insights into the current state of KGQA:

  • State-of-the-Art Performance: STCQA achieved a Hits@1 of 61.52% and Hits@10 of 84.29% on the STQAD dataset, significantly outperforming specialized temporal models that lack spatial awareness.
  • LLMs are Spatially "Blind": Even powerful Large Language Models (LLMs) like GPT-4 struggle with STKGQA. While they possess vast general knowledge, they fail at precise coordinate-based reasoning (e.g., calculating orientation) without external tools. STCQA outperformed the best-performing LLM baseline by nearly 40% in Hits@1.
  • The Hybrid Advantage: The combination of neural embeddings for graph navigation and symbolic rules for "hard math" proved essential. Ablation studies showed that removing the symbolic constraint filter caused a notable performance drop, while removing spatio-temporal knowledge entirely led to a massive 31.7% decrease in accuracy.

Conclusion and Future Work

STQAD provides a rigorous new benchmark for the community, highlighting the limitations of current LLMs and KGQA systems in multi-constraint reasoning. Future work will focus on scaling these methods to even larger STKGs and exploring "tool-augmented" LLMs that can leverage dedicated temporal and spatial calculators to bridge the reasoning gap.

Summary updated

BibTeX
@article{dai2024question,
  author = {Xinbang Dai and Huiying Li and Nan Hu and Yongrui Chen and Rihui Jin and Huikang Hu and Guilin Qi},
  title = {{Question answering over spatio-temporal knowledge graph}},
  journal = {Knowledge-Based Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=YJyaBBvMwp},
}
Figure