NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

GNNQ: A Neuro-Symbolic Approach to Query Answering over Incomplete Knowledge Graphs

Maximilian Pflueger, David J. Tena Cucala, Egor V. Kostylev

Introduction

Knowledge Graphs (KGs) such as Freebase and Wikidata are essential for modern AI applications, yet they are notoriously incomplete. This incompleteness presents a significant challenge for query answering. Traditional symbolic engines like SPARQL are precise but brittle; they fail if even a single required fact is missing. Conversely, embedding-based methods can predict missing links but are typically transductive, meaning they cannot generalize to entities unseen during training. Graph Neural Networks (GNNs) offer an inductive alternative, but answering complex queries often requires deep architectures that suffer from over-smoothing and training instability.

The GNNQ Framework

GNNQ is a novel neuro-symbolic framework designed to bridge the gap between symbolic precision and neural robustness. It enables inductive query answering over incomplete KGs by following a three-step pipeline: Symbolic Augmentation, Hypergraph Encoding, and a specialized Hyper-Relational Graph Convolutional Network (HRGCN).

Query representation $q(x)$ and its mapping to a Knowledge Graph $\mathcal{K}$.

1. Symbolic Augmentation

Instead of relying on a deep GNN to traverse long paths in the graph, GNNQ extracts logical rules directly from the target query. These rules are used to "pre-compute" partial matches within the KG. For example, if a query involves a chain of relations, the system symbolically adds new facts (hyperedges) that represent these fragments. This step effectively "compresses" the graph structure relative to the query.

2. Hypergraph Encoding

Because the augmented facts can involve multiple entities (n-ary relations), the KG is transformed into a colored directed hypergraph. Standard binary relations remain as edges, while the new symbolic facts are represented as hyperedges.

The query fragment $\psi$ and the resulting augmented hypergraph $R'_q(\mathcal{K})$ with hyperedges $H$.

3. Hyper-Relational GCN (HRGCN)

The authors introduce the HRGCN, a neural architecture that generalizes the Relational GCN (RGCN). By aggregating information across hyperedges, the HRGCN can traverse complex query fragments in a single layer. A core theoretical contribution of the paper (Theorem 1) proves that this symbolic augmentation allows a shallow HRGCN to emulate the expressive power of a much deeper vanilla GNN, thereby bypassing the over-smoothing problem.

Key Results and Insights

The authors evaluated GNNQ on nine novel inductive benchmarks derived from WatDiv and FB15k-237.

  • Superior Performance: GNNQ consistently outperformed vanilla GNN baselines. On the real-world FB15k237-Q1 benchmark, GNNQ achieved an Average Precision (AP) of 0.976, compared to 0.581 for a baseline with equivalent depth.
  • Noise Robustness: The performance advantage was most pronounced on irregular, noisy datasets, suggesting that symbolic augmentation helps the model focus on relevant subgraphs.
  • Efficiency: By using symbolic rules to do the "heavy lifting" of path traversal, GNNQ achieves high accuracy with fewer neural layers, making it faster and more stable to train.

Limitations and Future Work

Currently, GNNQ is limited to tree-shaped conjunctive queries and cannot handle cycles or negation. Additionally, rule selection for complex datasets currently requires some manual tuning. Future research will focus on automating rule discovery and expanding the framework to support more expressive query languages.

Summary updated

BibTeX
@inproceedings{pflueger2022gnnq,
  author = {Maximilian Pflueger and David J. Tena Cucala and Egor V. Kostylev},
  title = {{GNNQ: A Neuro-Symbolic Approach to Query Answering over Incomplete Knowledge Graphs}},
  booktitle = {ISWC},
  year = {2022},
  doi = {10.1007/978-3-031-19433-7\_28},
}
Figure