Query Embedding on Hyper-Relational Knowledge Graphs

Dimitrios Alivanistos, Max Berrendorf, Michael Cochez, Mikhail Galkin

TL;DR

This paper introduces STARQE, the first neural query embedding framework designed specifically for hyper-relational knowledge graphs. By incorporating edge "qualifiers" (like dates, locations, or specific degrees) into the reasoning process, STARQE significantly improves the accuracy of complex multi-hop logical queries compared to traditional models that only process simple subject-relation-object triples.

What Problem Does This Paper Address?

Most research in Knowledge Graph (KG) reasoning treats data as a collection of simple triples: (Subject, Relation, Object). For example, a system might store the fact (Einstein, EducatedAt, ETH_Zurich). However, real-world KGs like Wikidata are hyper-relational. They include "qualifiers" that provide essential context, such as: (Einstein, EducatedAt, ETH_Zurich) paired with the qualifier (Degree, BSc).

Existing Query Embedding (QE) methods—which allow computers to answer logical questions by mapping them into a continuous vector space—ignore these qualifiers. This is a major limitation because qualifiers act as filters that narrow down the set of correct answers.

Comparison of standard vs. hyper-relational query embedding

As illustrated above, without qualifiers, a system might know a scientist went to both ETH Zurich and the University of Zurich, but it couldn't distinguish where they received their undergraduate versus their doctoral degree. The authors aim to bridge this gap by enabling neural reasoners to "understand" and utilize this higher-order information to pinpoint the exact target answer.

Methods

To solve this, the authors propose STARQE (Query Embedding for RDF Star Graphs). It builds on two main pillars:

  1. Message Passing Query Embedding (MPQE): A technique that represents a logical query as a graph and uses Graph Neural Networks (GNNs) to propagate information between nodes.
  2. StarE Architecture: A specialized GNN layer designed to handle hyper-relational data.
The STARQE message passing architecture

How STARQE works: * Qualifier Representation: For every edge in a query, STARQE first embeds the qualifier key-value pairs (e.g., Degree: BSc) into a single vector. * Qualified Relation: This qualifier vector is then combined with the representation of the main relation (e.g., EducatedAt) to create a unified "qualified relation" embedding. * Message Passing: The model passes these qualified messages across the query graph. This allows the representation of a variable (like ?Target university) to be updated based on the specific constraints provided by the qualifiers. * Similarity Scoring: Finally, the model computes a similarity score between the resulting query embedding and all possible entity embeddings in the KG to find the most likely answers.

Datasets

Since standard QE benchmarks (like those based on Freebase or NELL) are strictly triple-based, the authors created a new benchmark: WD50K-QE. Derived from a subset of Wikidata, it contains over 7 million training queries across 7 different logical patterns (e.g., simple projections, intersections, and combinations). Crucially, every edge in the query is associated with at least one qualifier, making it the first benchmark of its kind for complex hyper-relational reasoning.

Key Insights and Ideas

  • Qualifiers as Constraints: The core insight is that qualifiers aren't just supplementary data; they are logical constraints. Adding a qualifier reduces the size of the answer set, which actually makes the neural reasoning task more precise if the model can interpret it.
  • Robustness to Representation: The authors tested STARQE against "reification"—a common database trick where an edge is turned into a node to store extra attributes. They found that STARQE is robust to different ways of representing the same logic, suggesting it captures the underlying semantics rather than just graph topology.
  • The Power of Intersection: The model performs exceptionally well on intersection queries. Because qualifiers act as a form of "internal intersection" on a single edge, the GNN architecture is naturally adept at aggregating these multiple constraints.

Key Results

The results demonstrate that ignoring qualifiers leads to significantly worse performance:

  • Accuracy Boost: On complex intersection query patterns, STARQE achieved a Hits@10 of 81.6%, whereas a "Triple-Only" version of the same model (ignoring qualifiers) plummeted to 40.7%.
  • Mean Reciprocal Rank (MRR): Across almost all patterns, STARQE consistently outperformed baselines, often by double-digit margins.
  • Generalization: The model showed strong "zero-shot" generalization, meaning it could successfully answer complex query patterns even if it was only trained on simpler ones.

Limitations and Future Work

While STARQE represents a significant step forward, the authors note a few limitations:

  • Literals: The current model only handles entities as qualifier values. It cannot yet process "literals" like specific dates (e.g., 1905) or numerical values (e.g., weight: 70kg).
  • Logical Operators: The work focuses on conjunctive queries (AND). Future versions will need to incorporate negation (NOT) and disjunction (OR) in a hyper-relational context.
  • Explainability: Like most embedding-based methods, STARQE operates as a "black box." Providing human-readable explanations for why a certain entity was chosen as an answer remains an open challenge for the field.

Summary updated

BibTeX
@inproceedings{alivanistos2022query,
  author = {Dimitrios Alivanistos and Max Berrendorf and Michael Cochez and Mikhail Galkin},
  title = {{Query Embedding on Hyper-Relational Knowledge Graphs}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=3l96fr4xygI},
}
Figure