{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/nqe-n-ary-query-embedding-for-complex-query","title":"NQE: N-ary Query Embedding for Complex Query Answering over Hyper-Relational Knowledge Graphs","arxiv_id":"2211.13469","date":"2022-11-24","proceeding":"AAAI 2023 6","authors":["Haoran Luo","Haihong E","Yuhao Yang","Gengxian Zhou","Yikai Guo","Tianyu Yao","Zichen Tang","Xueyuan Lin","Kaiyang Wan"],"abstract":"Complex query answering (CQA) is an essential task for multi-hop and logical reasoning on knowledge graphs (KGs). Currently, most approaches are limited to queries among binary relational facts and pay less attention to n-ary facts (n>=2) containing more than two entities, which are more prevalent in the real world. Moreover, previous CQA methods can only make predictions for a few given types of queries and cannot be flexibly extended to more complex logical queries, which significantly limits their applications. To overcome these challenges, in this work, we propose a novel N-ary Query Embedding (NQE) model for CQA over hyper-relational knowledge graphs (HKGs), which include massive n-ary facts. The NQE utilizes a dual-heterogeneous Transformer encoder and fuzzy logic theory to satisfy all n-ary FOL queries, including existential quantifiers, conjunction, disjunction, and negation. We also propose a parallel processing algorithm that can train or predict arbitrary n-ary FOL queries in a single batch, regardless of the kind of each query, with good flexibility and extensibility. In addition, we generate a new CQA dataset WD50K-NFOL, including diverse n-ary FOL queries over WD50K. Experimental results on WD50K-NFOL and other standard CQA datasets show that NQE is the state-of-the-art CQA method over HKGs with good generalization capability. Our code and dataset are publicly available.","url_abs":"https://arxiv.org/abs/2211.13469v3","url_pdf":"https://arxiv.org/pdf/2211.13469v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"nqe-n-ary-query-embedding-for-complex-query","repo_url":"https://github.com/lhrlab/nqe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"complex-query-answering","task_name":"Complex Query Answering"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"logical-reasoning","task_name":"Logical Reasoning"},{"task_slug":"negation","task_name":"Negation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/complex-query-answering-on-wd50k-nfol","task":"Complex Query Answering","dataset":"WD50K-NFOL","model":"NQE","rank_in_archive_order":1,"of":1,"metrics":{"AVGn-MRR":"0.1406","AVGp-MRR":"0.3687"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-wd50k-qe","task":"Complex Query Answering","dataset":"WD50K-QE","model":"NQE","rank_in_archive_order":1,"of":1,"metrics":{"AVGp-MRR":"0.7584"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.13469","mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}