Query2box: Reasoning over Knowledge Graphs in Vector Space Using Box Embeddings

Query2box is a multi-hop knowledge graph reasoning framework using box embeddings. It provides a way to efficiently embed queries with new neural logical operators to handle existential quantification, conjunction and disjunction.

Method

Answering complex queries on incomplete knowledge graph is a challenging task. A promising direction is to embed queries and answer them in the embedding space. However, the previous methods embed queries as single points, but rather each query represents a set of answer entities, and the (logical) operations over queries are operations over sets. We propose Query2box that models queries as hyper-rectangles (box) in the embedding space. It naturally handles existential quantification and conjunction by taking projection and intersection respectively.

For disjunction, we prove a negative result that handling disjunction requires embedding with dimension proportional to the number of entities. However, we propose to transform queries into its equivalent disjunctive normal form (DNF), so as to handle union only at the last step.


We construct different query structures and show that Query2box not only generalizes within unseen queries of same query structure as well as unseen query structures.


Please refer to our paper for detailed explanations and more results.

Code

A reference implementation of Query2box in Python is available on GitHub.

Datasets

The datasets used by Query2box are included in the code repository.

Contributors

The following people contributed to Query2box:
Hongyu Ren*
Weihua Hu*
Jure Leskovec

References

Query2box: Reasoning over Knowledge Graphs in Vector Space Using Box Embeddings. H. Ren*, W. Hu*, J. Leskovec. International Conference on Learning Representations (ICLR), 2020.