One Model, Any Conjunctive Query: Graph Neural Networks for Answering Queries over Incomplete Knowledge Graphs
Krzysztof Olejniczak, Xingyue Huang, Mikhail Galkin, İsmail İlkan Ceylan
TL;DR
This work reframes complex query answering over incomplete knowledge graphs as two binary tasks—Query Answer Classification and Query Answer Retrieval—and introduces AnyCQ, a neuro-symbolic, reinforcement-learning-guided GNN framework that scores existential Boolean conjunctive queries by searching over variable assignments. By constructing a query-conditioned computational graph with PE and LE edge labels guided by a link predictor, AnyCQ efficiently handles arbitrarily structured, cyclic queries beyond the reach of prior CQA methods. The approach delivers strong results on new high-complexity benchmarks, demonstrates transferability to unseen KGs, and shows substantial potential under a perfect predictor, underscoring practical applicability for querying incomplete data. The work also provides theoretical guarantees (completeness and, with a perfect predictor, soundness) and discusses limitations and avenues for future extension, including inductive, multi-dataset training and alternative search strategies.
Abstract
Motivated by the incompleteness of modern knowledge graphs, a new setup for query answering has emerged, where the goal is to predict answers that do not necessarily appear in the knowledge graph, but are present in its completion. In this paper, we formally introduce and study two query answering problems, namely, query answer classification and query answer retrieval. To solve these problems, we propose AnyCQ, a model that can classify answers to any conjunctive query on any knowledge graph. At the core of our framework lies a graph neural network trained using a reinforcement learning objective to answer Boolean queries. Trained only on simple, small instances, AnyCQ generalizes to large queries of arbitrary structure, reliably classifying and retrieving answers to queries that existing approaches fail to handle. This is empirically validated through our newly proposed, challenging benchmarks. Finally, we empirically show that AnyCQ can effectively transfer to completely novel knowledge graphs when equipped with an appropriate link prediction model, highlighting its potential for querying incomplete data.
