SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1902.10197 · 2019

RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 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/1902.10197.json · badge: /api/ran/1902.10197.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
davendw49/gakg community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
data_loader Ran
ran on a synthesized input
davendw49/gakg/code/baselines/transH/TransH.py
code served (permissive licence) · get_code("f103f76a05c11c85")
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 os
import tempfile
import codecs

# Create a temporary directory with the required files
temp_dir = tempfile.mkdtemp()

# Create entity2id.txt
entity2id_path = os.path.join(temp_dir, 'entity2id.txt')
with open(entity2id_path, 'w') as f:
    f.write('entity_A\t0\n')
    f.write('entity_B\t1\n')
    f.write('entity_C\t2\n')

# Create relation2id.txt
relation2id_path = os.path.join(temp_dir, 'relation2id.txt')
with open(relation2id_path, 'w') as f:
    f.write('relation_X\t0\n')
    f.write('relation_Y\t1\n')

# Create train.txt
train_path = os.path.join(temp_dir, 'train.txt')
with open(train_path, 'w') as f:
    f.write('entity_A\tentity_B\trelation_X\n')
    f.write('entity_B\tentity_C\trelation_Y\n')
    f.write('entity_A\tentity_C\trelation_X\n')
    f.write('entity_B\tentity_A\trelation_Y\n')

# The file parameter should be the directory path with trailing separator
file_path = temp_dir + os.sep

ARGS = {
    'file': file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
dataloader Ran
ran on a synthesized input
davendw49/gakg/code/baselines/transE/TransE_pytoch.py
code served (permissive licence) · get_code("0577997988d41269")
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 tempfile
import os

# Create temporary directory and files
tmpdir = tempfile.mkdtemp()

# Create entities file (file2): entity_name \t entity_id
entities_file = os.path.join(tmpdir, "entities.txt")
with open(entities_file, 'w') as f:
    f.write("entity_0\t0\n")
    f.write("entity_1\t1\n")
    f.write("entity_2\t2\n")
    f.write("entity_3\t3\n")

# Create relations file (file3): relation_name \t relation_id
relations_file = os.path.join(tmpdir, "relations.txt")
with open(relations_file, 'w') as f:
    f.write("relation_0\t0\n")
    f.write("relation_1\t1\n")

# Create training triples file (file1): head \t relation \t tail
train_file = os.path.join(tmpdir, "train_triples.txt")
with open(train_file, 'w') as f:
    f.write("entity_0\trelation_0\tentity_1\n")
    f.write("entity_1\trelation_1\tentity_2\n")
    f.write("entity_0\trelation_0\tentity_2\n")
    f.write("entity_2\trelation_1\tentity_3\n")

# Create validation triples file (file4): head \t relation \t tail
valid_file = os.path.join(tmpdir, "valid_triples.txt")
with open(valid_file, 'w') as f:
    f.write("entity_0\trelation_0\tentity_1\n")
    f.write("entity_1\trelation_1\tentity_3\n")

ARGS = {
    "file1": train_file,
    "file2": entities_file,
    "file3": relations_file,
    "file4": valid_file,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
dataloader Ran
ran on a synthesized input
davendw49/gakg/code/baselines/transE/transE.py
code served (permissive licence) · get_code("dbe17b25039229ed")
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 tempfile
import os

# Create temporary files with the required format
temp_dir = tempfile.mkdtemp()

# Create entities file (file2)
entities_file = os.path.join(temp_dir, "entities.txt")
with open(entities_file, 'w') as f:
    f.write("entity1\t0\n")
    f.write("entity2\t1\n")
    f.write("entity3\t2\n")

# Create relations file (file3)
relations_file = os.path.join(temp_dir, "relations.txt")
with open(relations_file, 'w') as f:
    f.write("relation1\t0\n")
    f.write("relation2\t1\n")

# Create triples file (file1)
triples_file = os.path.join(temp_dir, "triples.txt")
with open(triples_file, 'w') as f:
    f.write("entity1\trelation1\tentity2\n")
    f.write("entity2\trelation2\tentity3\n")
    f.write("entity3\trelation1\tentity1\n")

ARGS = {
    "file1": triples_file,
    "file2": entities_file,
    "file3": relations_file,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
norm_l1 Ran
ran on a synthesized input
davendw49/gakg/code/baselines/transE/TransE_pytoch.py
code served (permissive licence) · get_code("334b60ecd2bd5b68")
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 float64, ndim 0, 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 numpy as np

# Create small numpy arrays for h, r, t
# These represent embeddings in a knowledge graph embedding model
# h: head entity embedding
# r: relation embedding  
# t: tail entity embedding
# Using distinct sizes to make dimensions unambiguous

h = np.random.randn(2, 4)  # batch_size=2, embedding_dim=4
r = np.random.randn(2, 4)  # batch_size=2, embedding_dim=4
t = np.random.randn(2, 4)  # batch_size=2, embedding_dim=4

ARGS = {
    "h": h,
    "r": r,
    "t": t
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
norm_l2 Ran
ran on a synthesized input
davendw49/gakg/code/baselines/transE/TransE_pytoch.py
code served (permissive licence) · get_code("85ce51631a65b76e")
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 float64, ndim 0, 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 numpy as np

# Create small numpy arrays for the function parameters
# The function computes: sum((h + r - t)^2)
# All parameters should be numpy arrays of compatible shapes

h = np.array([1.0, 2.0, 3.0, 4.0])
r = np.array([0.5, 1.5, 2.5, 3.5])
t = np.array([1.2, 2.1, 3.3, 4.2])

ARGS = {
    "h": h,
    "r": r,
    "t": t
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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.

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

We study the problem of learning representations of entities and relations in knowledge graphs for predicting missing links. The success of such a task heavily relies on the ability of modeling and inferring the patterns of (or between) the relations. In this paper, we present a new approach for knowledge graph embedding called RotatE, which is able to model and infer various relation patterns including: symmetry/antisymmetry, inversion, and composition. Specifically, the RotatE model defines each relation as a rotation from the source entity to the target entity in the complex vector space. In addition, we propose a novel self-adversarial negative sampling technique for efficiently and effectively training the RotatE model. Experimental results on multiple benchmark knowledge graphs show that the proposed RotatE model is not only scalable, but also able to infer and model various relation patterns and significantly outperform existing state-of-the-art models for link prediction.

For agents

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

get_harvested_code_for_paper("1902.10197")
get_code_for_paper("1902.10197")
have("1902.10197")

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

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

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

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

Connect an agent — have() is free.