{"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/embedding-logical-queries-on-knowledge-graphs","title":"Embedding Logical Queries on Knowledge Graphs","arxiv_id":"1806.01445","date":"2018-06-05","proceeding":"NeurIPS 2018 12","authors":["William L. Hamilton","Payal Bajaj","Marinka Zitnik","Dan Jurafsky","Jure Leskovec"],"abstract":"Learning low-dimensional embeddings of knowledge graphs is a powerful approach used to predict unobserved or missing edges between entities. However, an open challenge in this area is developing techniques that can go beyond simple edge prediction and handle more complex logical queries, which might involve multiple unobserved edges, entities, and variables. For instance, given an incomplete biological knowledge graph, we might want to predict \"em what drugs are likely to target proteins involved with both diseases X and Y?\" -- a query that requires reasoning about all possible proteins that {\\em might} interact with diseases X and Y. Here we introduce a framework to efficiently make predictions about conjunctive logical queries -- a flexible but tractable subset of first-order logic -- on incomplete knowledge graphs. In our approach, we embed graph nodes in a low-dimensional space and represent logical operators as learned geometric operations (e.g., translation, rotation) in this embedding space. By performing logical operations within a low-dimensional embedding space, our approach achieves a time complexity that is linear in the number of query variables, compared to the exponential complexity required by a naive enumeration-based approach. We demonstrate the utility of this framework in two application studies on real-world datasets with millions of relations: predicting logical relationships in a network of drug-gene-disease interactions and in a graph-based representation of social interactions derived from a popular web forum.","url_abs":"https://arxiv.org/abs/1806.01445v4","url_pdf":"https://arxiv.org/pdf/1806.01445v4.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":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/williamleif/graphqembed","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/Blidge/KGReasoning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/LHY-24/KG-Compilation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/francoisluus/KGReasoning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/pminervini/kgreasoning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/snap-stanford/KGReasoning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/zhiweihu1103/qe-temp","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/MindSpore-scientific-2/code-10/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/MindSpore-scientific-2/code-11/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/MindSpore-scientific-2/code-2/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/MindSpore-scientific-2/code-8/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"embedding-logical-queries-on-knowledge-graphs","repo_url":"https://github.com/MindSpore-scientific/code-13/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"complex-query-answering","task_name":"Complex Query Answering"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/complex-query-answering-on-fb15k","task":"Complex Query Answering","dataset":"FB15k","model":"GQE","rank_in_archive_order":7,"of":9,"metrics":{"MRR 1p":"0.546","MRR 2i":"0.397","MRR 2p":"0.153","MRR 2u":"0.221","MRR 3i":"0.514","MRR 3p":"0.108","MRR ip":"0.191","MRR pi":"0.276","MRR up":"0.116"},"uses_additional_data":false},{"leaderboard":"/sota/complex-query-answering-on-fb15k-237","task":"Complex Query Answering","dataset":"FB15k-237","model":"GQE","rank_in_archive_order":6,"of":9,"metrics":{"MRR 1p":"0.35","MRR 2i":"0.233","MRR 2p":"0.072","MRR 2u":"0.082","MRR 3i":"0.346","MRR 3p":"0.053","MRR ip":"0.107","MRR pi":"0.165","MRR up":"0.057"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1806.01445","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1806.01445"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/snap-stanford/KGReasoning","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/pminervini/kgreasoning","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Blidge/KGReasoning","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/francoisluus/KGReasoning","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-2/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhiweihu1103/qe-temp","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/williamleif/graphqembed","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-8/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-11/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific-2/code-10/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/LHY-24/KG-Compilation","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-13/tree/main/UE-Unified-Embedding-Battle-Tested-Feature","reach":null}],"summary":{"ran_honours":1,"ran_draft_wrong":3},"by_repo_kind":{"listed":{"samples":3,"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":1,"samples":[{"code_sha256_prefix":"f44985272d18127a","entry":"Identity","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"f44985272d18127a"}},{"code_sha256_prefix":"08bc9653c017dfb5","entry":"eval_tuple","repo":"francoisluus/KGReasoning","repo_kind":"listed","path":"util.py","file_url":"https://github.com/francoisluus/KGReasoning/blob/HEAD/util.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"08bc9653c017dfb5"}},{"code_sha256_prefix":"8c314b5b308ab1ad","entry":"list2tuple","repo":"francoisluus/KGReasoning","repo_kind":"listed","path":"util.py","file_url":"https://github.com/francoisluus/KGReasoning/blob/HEAD/util.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8c314b5b308ab1ad"}},{"code_sha256_prefix":"bbd072fbd86e1541","entry":"tuple2list","repo":"francoisluus/KGReasoning","repo_kind":"listed","path":"util.py","file_url":"https://github.com/francoisluus/KGReasoning/blob/HEAD/util.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bbd072fbd86e1541"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}