SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.09419 · 2019

Learning Hierarchy-Aware Knowledge Graph Embeddings for Link Prediction

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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; 2 failures of our instrument; 1 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/1911.09419.json · badge: /api/ran/1911.09419.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
MIRALab-USTC/KGE-HAKE canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
thu-keg/eakit community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
kamigaito/icml2022 extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
boot_update_triple Ran
ran on a synthesized input
thu-keg/eakit/semi_utils.py
code served (permissive licence) · get_code("b091391c5c3608e4")
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, ndim 2, 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

torch.manual_seed(0)

# Analyzing the function:
# - A and B are sequences (lists/arrays) that must have equal length
# - They are indexed with integers: A[i], B[i]
# - Elements of A and B are used as dictionary keys in h_rt and t_hr
# - triple is an iterable of tuples (h, r, t) where h, r, t are hashable
# - h, r, t from triple are compared with elements from A and B

# Simple approach: use integers as entity/relation identifiers
A = [0, 1, 2]
B = [3, 4, 5]

# Create a triple list with entity and relation IDs
# Format: (head, relation, tail)
triple = [
    (0, 'rel1', 1),
    (1, 'rel2', 2),
    (3, 'rel3', 4),
    (2, 'rel1', 0),
]

ARGS = {
    'A': A,
    'B': B,
    'triple': triple,
}
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, ndim 2, dtype family float — a list 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
div_list Ran
ran on a synthesized input
thu-keg/eakit/utils.py
code served (permissive licence) · get_code("3d325b122e3c6108")
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)

# The function div_list takes a list and divides it into n chunks
# It doesn't use any special attributes or methods on list elements
# So we can use simple Python objects like integers or strings

ls = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3

ARGS = {
    "ls": ls,
    "n": n
}
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
filter_mat Ran
ran on a synthesized input
thu-keg/eakit/semi_utils.py
code served (permissive licence) · get_code("3d11d81dffd5eb22")
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 set. 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 numpy as np

# Create a small test matrix with various values
mat = np.array([
    [1.0, 2.5, 3.2],
    [0.5, 4.1, 1.8],
    [5.0, 2.2, 3.9]
])

threshold = 2.5
greater = True
equal = False

ARGS = {
    "mat": mat,
    "threshold": threshold,
    "greater": greater,
    "equal": equal
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
multi_cal_neg Ran
ran on a synthesized input
thu-keg/eakit/utils.py
code served (permissive licence) · get_code("7f9a46a57068bd32")
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, ndim 3, dtype family int; 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 random
import numpy as np

# Set seed for reproducibility
np.random.seed(42)
random.seed(42)

# Define small test data
# pos: list of tuples (h, r, t) indexed by task indices
pos = [
    (0, 1, 2),  # task 0
    (1, 2, 3),  # task 1
    (2, 1, 4),  # task 2
]

# task: list of indices into pos
task = [0, 1]

# triples: set of valid triples to avoid
triples = {
    (0, 1, 2),
    (1, 2, 3),
    (2, 1, 4),
    (5, 1, 6),
    (7, 2, 8),
}

# r_hs_dict: dict mapping relation r to list of possible heads
r_hs_dict = {
    1: [0, 2, 5, 9, 10],
    2: [1, 3, 7, 11, 12],
}

# r_ts_dict: dict mapping relation r to list of possible tails
r_ts_dict = {
    1: [2, 4, 6, 13, 14],
    2: [3, 8, 9, 15, 16],
}

# ids: list of entity groups/clusters
ids = [
    [0, 1, 5, 9],
    [2, 3, 4, 10],
    [6, 7, 8, 11],
    [12, 13, 14, 15, 16],
]

# k: number of negative samples to generate
k = 2

ARGS = {
    "pos": pos,
    "task": task,
    "triples": triples,
    "r_hs_dict": r_hs_dict,
    "r_ts_dict": r_ts_dict,
    "ids": ids,
    "k": k,
}
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 list, ndim 3, dtype family int — a list 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
multi_cal_rank Ran
ran on a synthesized input
thu-keg/eakit/utils.py
code served (permissive licence) · get_code("a6647903db5e8665")
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 numpy as np
import gc

# Analyze what the function needs:
# - task: a list/array of reference indices, used as task[i]
# - distance: a 2D numpy array where distance[i, :] is indexed and sorted
# - distanceT: a 2D numpy array where distanceT[:, i] is indexed and sorted
# - top_k: a list of integers used for threshold comparisons
# - args: appears to be unused in the function body

# Create small test data
num_samples = 3  # number of items in task
num_candidates = 5  # number of candidates to rank against

# task: array of reference indices (which candidate is the correct match for each item)
# Each value should be < num_candidates
task = np.array([1, 3, 2])

# distance: shape (num_samples, num_candidates)
# Represents distances from each item to each candidate (for left-to-right ranking)
distance = np.array([
    [10.0, 1.0, 5.0, 8.0, 3.0],
    [2.0, 7.0, 1.0, 4.0, 9.0],
    [6.0, 8.0, 2.0, 1.0, 5.0]
], dtype=np.float64)

# distanceT: shape (num_candidates, num_samples)
# Transpose perspective for right-to-left ranking
distanceT = np.array([
    [10.0, 2.0, 6.0],
    [1.0, 7.0, 8.0],
    [5.0, 1.0, 2.0],
    [8.0, 4.0, 1.0],
    [3.0, 9.0, 5.0]
], dtype=np.float64)

# top_k: list of cutoff thresholds for computing accuracy@k metrics
top_k = [1, 3, 5]

# args: unused in the function, can be any object
args = {}

ARGS = {
    "task": task,
    "distance": distance,
    "distanceT": distanceT,
    "top_k": top_k,
    "args": args
}
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 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
parse_args Ran
ran; our contract draft was wrong, not the code
MIRALab-USTC/KGE-HAKE/codes/runs.py
code served (permissive licence) · get_code("1a5f911b622c853e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Namespace. 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 argparse

# parse_args expects a list of command-line argument strings or None
# We'll construct a list of strings that represent valid command-line arguments

args_list = [
    '--do_train',
    '--do_valid',
    '--do_test',
    '--data_path', '/tmp/fake_data',
    '--model', 'TransE',
    '-n', '128',
    '-d', '500',
    '-g', '12.0',
    '-a', '1.0',
    '-b', '1024',
    '--test_batch_size', '4',
    '-mw', '1.0',
    '-pw', '0.5',
    '-lr', '0.0001',
    '-cpu', '10',
    '-init', '/tmp/checkpoint',
    '-save', '/tmp/save_path',
    '--max_steps', '100000',
    '--save_checkpoint_steps', '10000',
    '--valid_steps', '10000',
    '--log_steps', '100',
    '--test_log_steps', '1000',
    '--no_decay'
]

ARGS = {'args': args_list}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
parse_args Ran
ran; our contract draft was wrong, not the code
kamigaito/icml2022/KGE-HAKE/codes/runs.py
pointer only (licence: NONE) · get_code("1df6095f98d9a036")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kamigaito/icml2022 when it was checked. 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.

bootstrapping Not yet run
unverified (harvested, no recorded run)
thu-keg/eakit/semi_utils.py
code served (permissive licence) · get_code("f888582ea241e0cb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 6 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
bootstrapping 1 other paper
1 later
2004.13579 (2020-04)
TransEdge: Translating Relation-contextualized Embeddings for Knowledge Graphs
filter_mat 1 other paper
1 later
2004.13579 (2020-04)
TransEdge: Translating Relation-contextualized Embeddings for Knowledge Graphs

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

Knowledge graph embedding, which aims to represent entities and relations as low dimensional vectors (or matrices, tensors, etc.), has been shown to be a powerful technique for predicting missing links in knowledge graphs. Existing knowledge graph embedding models mainly focus on modeling relation patterns such as symmetry/antisymmetry, inversion, and composition. However, many existing approaches fail to model semantic hierarchies, which are common in real-world applications. To address this challenge, we propose a novel knowledge graph embedding model -- namely, Hierarchy-Aware Knowledge Graph Embedding (HAKE) -- which maps entities into the polar coordinate system. HAKE is inspired by the fact that concentric circles in the polar coordinate system can naturally reflect the hierarchy. Specifically, the radial coordinate aims to model entities at different levels of the hierarchy, and entities with smaller radii are expected to be at higher levels; the angular coordinate aims to distinguish entities at the same level of the hierarchy, and these entities are expected to have roughly the same radii but different angles. Experiments demonstrate that HAKE can effectively model the semantic hierarchies in knowledge graphs, and significantly outperforms existing state-of-the-art methods on benchmark datasets for the link prediction task.

For agents

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

get_harvested_code_for_paper("1911.09419")
get_code_for_paper("1911.09419")
have("1911.09419")

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

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

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

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

Connect an agent — have() is free.