{"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/neural-symbolic-models-for-logical-queries-on","title":"Neural-Symbolic Models for Logical Queries on Knowledge Graphs","arxiv_id":"2205.10128","date":"2022-05-16","proceeding":"ICML 2022 7","authors":["Zhaocheng Zhu","Mikhail Galkin","Zuobai Zhang","Jian Tang"],"abstract":"Answering complex first-order logic (FOL) queries on knowledge graphs is a fundamental task for multi-hop reasoning. Traditional symbolic methods traverse a complete knowledge graph to extract the answers, which provides good interpretation for each step. Recent neural methods learn geometric embeddings for complex queries. These methods can generalize to incomplete knowledge graphs, but their reasoning process is hard to interpret. In this paper, we propose Graph Neural Network Query Executor (GNN-QE), a neural-symbolic model that enjoys the advantages of both worlds. GNN-QE decomposes a complex FOL query into relation projections and logical operations over fuzzy sets, which provides interpretability for intermediate variables. To reason about the missing links, GNN-QE adapts a graph neural network from knowledge graph completion to execute the relation projections, and models the logical operations with product fuzzy logic. Experiments on 3 datasets show that GNN-QE significantly improves over previous state-of-the-art models in answering FOL queries. Meanwhile, GNN-QE can predict the number of answers without explicit supervision, and provide visualizations for intermediate variables.","url_abs":"https://arxiv.org/abs/2205.10128v2","url_pdf":"https://arxiv.org/pdf/2205.10128v2.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":"neural-symbolic-models-for-logical-queries-on","repo_url":"https://github.com/DeepGraphLearning/GNN-QE","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":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":null,"task_name":"Relation"}],"methods":[{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/complex-query-answering-on-fb15k","task":"Complex Query Answering","dataset":"FB15k","model":"GNN-QE","rank_in_archive_order":4,"of":9,"metrics":{"MRR 1p":"0.885","MRR 2i":"0.797","MRR 2p":"0.693","MRR 2u":"0.741","MRR 3i":"0.835","MRR 3p":"0.587","MRR ip":"0.704","MRR pi":"0.699","MRR up":"0.610"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k-237","task":"Complex Query Answering","dataset":"FB15k-237","model":"GNN-QE","rank_in_archive_order":3,"of":9,"metrics":{"MRR 1p":"0.428","MRR 2i":"0.383","MRR 2p":"0.147","MRR 2u":"0.162","MRR 3i":"0.541","MRR 3p":"0.118","MRR ip":"0.189","MRR pi":"0.311","MRR up":"0.134"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-nell-995","task":"Complex Query Answering","dataset":"NELL-995","model":"GNN-QE","rank_in_archive_order":4,"of":6,"metrics":{"MRR 1p":"0.533","MRR 2i":"0.424","MRR 2p":"0.189","MRR 2u":"0.159","MRR 3i":"0.525","MRR 3p":"0.149","MRR ip":"0.189","MRR pi":"0.308","MRR up":"0.126"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2205.10128","atlas_url":"https://app.syntology.ai/?focus=2205.10128","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.10128"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/DeepGraphLearning/GNN-QE","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":3},"by_repo_kind":{"official":{"samples":4,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6b999fe6d54461d0","entry":"computation_graph_layout","repo":"DeepGraphLearning/GNN-QE","repo_kind":"official","path":"script/visualize.py","file_url":"https://github.com/DeepGraphLearning/GNN-QE/blob/HEAD/script/visualize.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6b999fe6d54461d0"}},{"code_sha256_prefix":"eab8b6a6ced6d93e","entry":"detect_variables","repo":"DeepGraphLearning/GNN-QE","repo_kind":"official","path":"gnnqe/util.py","file_url":"https://github.com/DeepGraphLearning/GNN-QE/blob/HEAD/gnnqe/util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eab8b6a6ced6d93e"}},{"code_sha256_prefix":"70a68fd646c6e4a7","entry":"get_root_logger","repo":"DeepGraphLearning/GNN-QE","repo_kind":"official","path":"gnnqe/util.py","file_url":"https://github.com/DeepGraphLearning/GNN-QE/blob/HEAD/gnnqe/util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70a68fd646c6e4a7"}},{"code_sha256_prefix":"0fdf31f60a2c67ea","entry":"get_topk_prediction","repo":"DeepGraphLearning/GNN-QE","repo_kind":"official","path":"script/visualize.py","file_url":"https://github.com/DeepGraphLearning/GNN-QE/blob/HEAD/script/visualize.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0fdf31f60a2c67ea"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}