{"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/inductive-logical-query-answering-in","title":"Inductive Logical Query Answering in Knowledge Graphs","arxiv_id":"2210.08008","date":"2022-10-13","proceeding":null,"authors":["Mikhail Galkin","Zhaocheng Zhu","Hongyu Ren","Jian Tang"],"abstract":"Formulating and answering logical queries is a standard communication interface for knowledge graphs (KGs). Alleviating the notorious incompleteness of real-world KGs, neural methods achieved impressive results in link prediction and complex query answering tasks by learning representations of entities, relations, and queries. Still, most existing query answering methods rely on transductive entity embeddings and cannot generalize to KGs containing new entities without retraining the entity embeddings. In this work, we study the inductive query answering task where inference is performed on a graph containing new entities with queries over both seen and unseen entities. To this end, we devise two mechanisms leveraging inductive node and relational structure representations powered by graph neural networks (GNNs). Experimentally, we show that inductive models are able to perform logical reasoning at inference time over unseen nodes generalizing to graphs up to 500% larger than training ones. Exploring the efficiency--effectiveness trade-off, we find the inductive relational structure representation method generally achieves higher performance, while the inductive node representation method is able to answer complex queries in the inference-only regime without any training on queries and scales to graphs of millions of nodes. Code is available at https://github.com/DeepGraphLearning/InductiveQE.","url_abs":"https://arxiv.org/abs/2210.08008v2","url_pdf":"https://arxiv.org/pdf/2210.08008v2.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":"inductive-logical-query-answering-in","repo_url":"https://github.com/tgebhart/sheaf_kg_transind","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"complex-query-answering","task_name":"Complex Query Answering"},{"task_slug":"entity-embeddings","task_name":"Entity Embeddings"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"link-prediction","task_name":"Link Prediction"},{"task_slug":"logical-reasoning","task_name":"Logical Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.08008","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.08008"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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":"deterministic:regex_extraction","url":"https://github.com/DeepGraphLearning/InductiveQE","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tgebhart/sheaf_kg_transind","reach":null}],"summary":{"ran_draft_wrong":3,"unverified":1},"by_repo_kind":{"listed":{"samples":4,"ran":3,"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":4,"samples":[{"code_sha256_prefix":"44ba9622ce9741b3","entry":"Laplacian","repo":"tgebhart/sheaf_kg_transind","repo_kind":"listed","path":"script/batch_harmonic_extension.py","file_url":"https://github.com/tgebhart/sheaf_kg_transind/blob/HEAD/script/batch_harmonic_extension.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"44ba9622ce9741b3"}},{"code_sha256_prefix":"6a064ad2a4f650b9","entry":"coboundary","repo":"tgebhart/sheaf_kg_transind","repo_kind":"listed","path":"script/batch_harmonic_extension.py","file_url":"https://github.com/tgebhart/sheaf_kg_transind/blob/HEAD/script/batch_harmonic_extension.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6a064ad2a4f650b9"}},{"code_sha256_prefix":"7fbb00914311fa3b","entry":"get_matrix_indices","repo":"tgebhart/sheaf_kg_transind","repo_kind":"listed","path":"script/batch_harmonic_extension.py","file_url":"https://github.com/tgebhart/sheaf_kg_transind/blob/HEAD/script/batch_harmonic_extension.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7fbb00914311fa3b"}},{"code_sha256_prefix":"e827dfe7532f8e5f","entry":"harmonic_extension","repo":"tgebhart/sheaf_kg_transind","repo_kind":"listed","path":"script/batch_harmonic_extension.py","file_url":"https://github.com/tgebhart/sheaf_kg_transind/blob/HEAD/script/batch_harmonic_extension.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e827dfe7532f8e5f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}