SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.14464 · 2022

Neural Methods for Logical Reasoning Over Knowledge Graphs

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2209.14464.json · badge: /api/ran/2209.14464.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
amayuelas/NNKGReasoning canonical (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
FunctionStatusWhere it lives
Identity Ran
ran, honoured the contract we drafted
amayuelas/NNKGReasoning/models/baselines.py
pointer only (licence: MIT); the stored copy get_code serves, from akirato/perm-gaussiankg, is pointer only (licence: GPL-3.0) · get_code("f44985272d18127a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from akirato/perm-gaussiankg, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

eval_tuple Ran
ran; our contract draft was wrong, not the code
amayuelas/NNKGReasoning/util.py
code served (permissive licence) · get_code("08bc9653c017dfb5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

def eval_tuple(arg_return):
    """Evaluate a tuple string into a tuple."""
    if type(arg_return) == tuple:
        return arg_return
    if arg_return[0] not in ['(', '[']:
        arg_return = eval(arg_return)
    else:
        splitted = arg_return[1:-1].split(',')
        List = []
        for item in splitted:
            try:
                item = eval(item)
            except:
                pass
            if item == '':
                continue
            List.append(item)
        arg_return = tuple(List)
    return arg_return


# Test case 1: arg_return is already a tuple
test_tuple = (1, 2, 3)

# Test case 2: arg_return is a string representation of a simple value
test_string_simple = "42"

# Test case 3: arg_return is a string representation of a tuple with parentheses
test_string_tuple = "(1, 2, 3)"

# Test case 4: arg_return is a string representation of a list with brackets
test_string_list = "[1, 2, 3]"

# For ARGS, we need to pick one representative test case
# The function takes one parameter: arg_return
ARGS = {
    "arg_return": "(1, 2, 'hello')"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
list2tuple Ran
ran; our contract draft was wrong, not the code
amayuelas/NNKGReasoning/util.py
code served (permissive licence) · get_code("8c314b5b308ab1ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function list2tuple recursively converts lists to tuples
# It takes a single parameter 'l' which should be a list (possibly nested)

# Create test data with nested lists
test_list = [
    1,
    [2, 3],
    [[4, 5], 6],
    "string",
    [7, [8, [9, 10]]]
]

ARGS = {
    "l": test_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tuple2list Ran
ran; our contract draft was wrong, not the code
amayuelas/NNKGReasoning/util.py
code served (permissive licence) · get_code("bbd072fbd86e1541")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

def tuple2list(t):
    return list((tuple2list(x) if type(x) == tuple else x for x in t))

# The function recursively converts nested tuples to lists
# It takes a single parameter 't' which should be a tuple (possibly containing nested tuples)

ARGS = {
    't': (1, 2, (3, 4, (5, 6)), 7)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
Identity 7 other papers
7 dated earlier
1806.01445 (2018-06)
Embedding Logical Queries on Knowledge Graphs
1909.05311 (2019-09)
Graph-Based Reasoning over Heterogeneous External Knowledge for Commonsense Question Answering
2002.05969 (2020-02)
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
and 4 more not named here
eval_tuple 4 other papers
3 dated earlier, 1 later
1806.01445 (2018-06)
Embedding Logical Queries on Knowledge Graphs
2010.11465 (2020-10)
Beta Embeddings for Multi-Hop Logical Reasoning in Knowledge Graphs
2204.12847 (2022-04)
Query2Particles: Knowledge Graph Reasoning with Particle Embeddings
and 1 more not named here
list2tuple 4 other papers
3 dated earlier, 1 later
1806.01445 (2018-06)
Embedding Logical Queries on Knowledge Graphs
2010.11465 (2020-10)
Beta Embeddings for Multi-Hop Logical Reasoning in Knowledge Graphs
2204.12847 (2022-04)
Query2Particles: Knowledge Graph Reasoning with Particle Embeddings
and 1 more not named here
tuple2list 4 other papers
3 dated earlier, 1 later
1806.01445 (2018-06)
Embedding Logical Queries on Knowledge Graphs
2010.11465 (2020-10)
Beta Embeddings for Multi-Hop Logical Reasoning in Knowledge Graphs
2204.12847 (2022-04)
Query2Particles: Knowledge Graph Reasoning with Particle Embeddings
and 1 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Reasoning is a fundamental problem for computers and deeply studied in Artificial Intelligence. In this paper, we specifically focus on answering multi-hop logical queries on Knowledge Graphs (KGs). This is a complicated task because, in real-world scenarios, the graphs tend to be large and incomplete. Most previous works have been unable to create models that accept full First-Order Logical (FOL) queries, which include negative queries, and have only been able to process a limited set of query structures. Additionally, most methods present logic operators that can only perform the logical operation they are made for. We introduce a set of models that use Neural Networks to create one-point vector embeddings to answer the queries. The versatility of neural networks allows the framework to handle FOL queries with Conjunction ($\wedge$), Disjunction ($\vee$) and Negation ($\neg$) operators. We demonstrate experimentally the performance of our model through extensive experimentation on well-known benchmarking datasets. Besides having more versatile operators, the models achieve a 10\% relative increase over the best performing state of the art and more than 30\% over the original method based on single-point vector embeddings.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2209.14464")
get_code_for_paper("2209.14464")
have("2209.14464")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2209.14464.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2209.14464.svg)](https://syntology.ai/paper/2209.14464)

Connect an agent — have() is free.