Modeling Relational Patterns for Logical Query Answering over Knowledge Graphs

Yunjie He, Mojtaba Nayyeri, Bo Xiong, Yuqicheng Zhu, Evgeny Kharlamov, Steffen Staab

TL;DR

The paper introduces RoConE, a novel query embedding method that models entity sets as geometric cones and logical operations as rotations in complex space. By combining these two paradigms, RoConE successfully captures crucial relational patterns—such as symmetry, inversion, and composition—to significantly improve first-order logical (FOL) query answering over incomplete knowledge graphs.

What Problem Does This Paper Address?

Knowledge Graphs (KGs) are powerful structures for representing relational data, but they are notoriously incomplete. Answering complex First-Order Logical (FOL) queries (which include operations like AND, OR, NOT, and existential quantifiers) requires reasoning over these missing links.

Traditional query embedding (QE) methods address this by mapping entities, relations, and queries into a low-dimensional vector space, representing entity sets as geometric shapes (like boxes or cones). However, these existing models rely heavily on deep neural networks (like multi-layer perceptrons) to handle relational projections. This turns the projection into a "black box," making it difficult or impossible for the model to explicitly learn and exploit fundamental relational patterns—such as symmetry (e.g., spouse_of), inversion (e.g., child_of vs. parent_of), and composition (e.g., parent_of + spouse_of $\rightarrow$ parent_in_law_of). This paper bridges the gap by introducing an inductive bias specifically designed to capture these patterns during logical reasoning.

Methods

The authors propose RoConE (Rotation on Cones Embedding), which integrates geometric representations with algebraic rotation operators in complex space:

  1. Cone Embeddings for Entity Sets: Following the intuition that entity sets can be represented as angular regions, RoConE models queries and entity sets as cones in a $2\text{D}$ complex plane. Each cone is parameterized by its upper and lower boundaries ($h_U, h_L$).
  2. Relational Rotating Projection: Instead of using a standard neural network for relational projection, RoConE treats each relation as a counter-clockwise angular rotation applied directly to the cone's boundaries. This algebraic formulation is mathematically proven to preserve and infer relational patterns like symmetry, inversion, and composition.
  3. Logical Operators: The model defines specific geometric operators for:
  4. Intersection ($\wedge$): Computes the semantic center and minimizes the aperture of the intersecting cones.
  5. Disjunction ($\vee$): Handled via Disjunctive Normal Form (DNF) transformations, evaluating the union at the final step.
  6. Negation ($\neg$): Modeled as the geometric complement of the cone.

The mechanism of how relational patterns are captured via cone rotations is illustrated below:

Relational rotations corresponding to symmetry, inversion, and composition on a 2D complex plane.

Datasets

The model was evaluated on two widely accepted benchmark datasets for knowledge graph reasoning:

  • FB15k-237: A subset of Freebase containing general-world knowledge.
  • NELL995: A dataset extracted from the "Never-Ending Language Learner" project.

Both datasets were split into training, validation, and testing sets across various query structures (e.g., 1p, 2p, 3p, 2i, 3i, etc.), representing different combinations of projections, intersections, and unions.

Key Insights and Ideas

  • The Power of Inductive Bias: By replacing black-box MLPs with strict algebraic rotations, the authors explicitly force the model to respect the mathematical properties of relational patterns. The paper provides formal proofs (Lemmas 1-3) demonstrating that RoConE can perfectly infer symmetry, inversion, and composition.
  • Dataset Characteristics Matter: RoConE showed more pronounced performance gains on NELL995 compared to FB15k-237. The authors hypothesize that this is due to a higher concentration and cleaner distribution of clear relational patterns within the NELL995 dataset.
  • The Negation Bottleneck: Like all its predecessors, RoConE struggles to improve performance on queries involving negation ($\neg$). This highlights a broader issue in the field: modeling negation simply as a set complement introduces massive geometric uncertainty, which standard vector space representations fail to capture effectively.

Key Results

RoConE was compared against state-of-the-art query embedding models, including GQE, Query2Box, BetaE, and ConE, using Mean Reciprocal Rank (MRR) as the primary metric.

  • Existential Positive FOL (EPFOL) Queries: RoConE outperformed the baselines on the majority of query types without negation. For instance, on NELL995, RoConE achieved an MRR of 54.5% on 1p queries and 17.7% on 2p queries, outperforming the standard ConE baseline (53.1% and 16.1%, respectively).
  • Ablation Studies: Replacing the relational rotation module with non-linear functions (like sigmoids) caused a noticeable drop in performance, confirming that the algebraic rotation mechanism is the primary driver of the model's success.

Limitations and Future Work

  • Geometric Restrictions: The relational rotating projection designed here is strictly bound to the natural geometric properties of cones. It cannot be easily generalized to other popular query embedding geometries, such as boxes or beta distributions.
  • Negation Failure: The model does not yield significant improvements for queries containing negation.

For future work, the authors aim to develop more general and flexible strategies that can capture relational patterns across diverse geometric embedding spaces while better addressing the challenge of logical negation.

Summary updated

BibTeX
@misc{he2023modeling,
  author = {Yunjie He and Mojtaba Nayyeri and Bo Xiong and Yuqicheng Zhu and Evgeny Kharlamov and Steffen Staab},
  title = {{Modeling Relational Patterns for Logical Query Answering over Knowledge Graphs}},
  year = {2023},
  eprint = {2303.11858},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.11858},
}
Figure