logo Netzschleuder network catalog, repository, and centrifuge

History of freebase_fb15k

The changes to the source code of this entry in the repository, newest first, each with the differences it made to the entry's files. They are also listed on GitLab.

[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto beff7c9
The dates are those of the commits that first added the entries' files
(2020-08-11 for the entries of the initial commit); renamed entries keep
the date of their first name.

Changed: none
diff --git a/entries/freebase_fb15k/__init__.py b/entries/freebase_fb15k/__init__.py
index 34dc804..d0c252d 100644
--- a/entries/freebase_fb15k/__init__.py
+++ b/entries/freebase_fb15k/__init__.py
@@ -42,7 +42,7 @@ url = ['https://web.archive.org/web/20221204060113/https://everest.hds.utc.fr/do
 citation = [('A. Bordes, N. Usunier, A. Garcia-Durán, J. Weston, O. Yakhnenko, "Translating Embeddings for Modeling Multi-relational Data." Advances in Neural Information Processing Systems 26, 2787-2795 (2013)', 'https://papers.nips.cc/paper/2013/hash/1cecc7a77928ca8133fa24680a88d2f9-Abstract.html'),
             ('K. Toutanova, D. Chen, "Observed versus latent features for knowledge base and text inference." Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality, 57-66 (2015)', 'https://doi.org/10.18653/v1/W15-4007'),
             ('K. Toutanova, D. Chen, P. Pantel, H. Poon, P. Choudhury, M. Gamon, "Representing Text for Joint Embedding of Text and Knowledge Bases." Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 1499-1509 (2015)', 'https://doi.org/10.18653/v1/D15-1174')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = ('CC BY 2.5 (fb15k); Microsoft Research Data License Agreement, for non-commercial or research purposes only (fb15k_237)', None)
 upstream_prefix = None
 
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/freebase_fb15k/__init__.py b/entries/freebase_fb15k/__init__.py
index ce18c31..34dc804 100644
--- a/entries/freebase_fb15k/__init__.py
+++ b/entries/freebase_fb15k/__init__.py
@@ -33,9 +33,9 @@ The triples are divided into training, validation and test sets by the benchmark
 
 The networks have the following properties:
 
-- `mid`: the Freebase identifier of the entity, e.g. `/m/027rn`.
-- Edge `relation`: the Freebase relation, e.g. `/people/person/profession`.
-- Edge `split`: the set of the benchmark the triple belongs to: `train`, `valid` or `test`."""
+- (Node) `mid`: the Freebase identifier of the entity, e.g. `/m/027rn`.
+- (Edge) `relation`: the Freebase relation, e.g. `/people/person/profession`.
+- (Edge) `split`: the set of the benchmark the triple belongs to: `train`, `valid` or `test`."""
 tags = ['Informational', 'Relatedness', 'Unweighted', 'Multigraph', 'Metadata']
 url = ['https://web.archive.org/web/20221204060113/https://everest.hds.utc.fr/doku.php?id=en:transe',
        'https://www.microsoft.com/en-us/download/details.aspx?id=52312']
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 2c69f19
Unneeded "global files" statements, unused imports and variables,
f-strings without placeholders, duplicate keys in foodweb_little_rock
(keeping the order and the values used), and the second definition of
get_lines() in twitter_higgs. Nothing changes in the networks or
descriptions.

Changed: none
diff --git a/entries/freebase_fb15k/__init__.py b/entries/freebase_fb15k/__init__.py
index f3cd3fa..ce18c31 100644
--- a/entries/freebase_fb15k/__init__.py
+++ b/entries/freebase_fb15k/__init__.py
@@ -62,7 +62,6 @@ def fetch_upstream(force=False):
 @coerce_props()
 @annotate()
 def parse(alts=None):
-    global files
     name = __name__.split(".")[-1]
     for fnames, alt, fmt in files:
         if alts is not None and alt not in alts:
[entries] New entry: freebase_fb15k by Tiago de Paula Peixoto 727cd17
diff --git a/entries/freebase_fb15k/__init__.py b/entries/freebase_fb15k/__init__.py
new file mode 100644
index 0000000..f3cd3fa
--- /dev/null
+++ b/entries/freebase_fb15k/__init__.py
@@ -0,0 +1,85 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2026 Tiago de Paula Peixoto <tiago@skewed.de>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+
+from .. import *
+
+
+title = "Freebase knowledge graph benchmarks (FB15k and FB15k-237, 2013-2015)"
+description = """Two subsets of the Freebase knowledge base, widely used as benchmarks for knowledge graph completion (link prediction):
+
+- `fb15k`: the FB15k dataset of Bordes et al. (2013), with the 14,951 entities of Freebase that are also present in the Wikilinks database and have at least 100 mentions in Freebase, and the 1,345 relations between them that have at least 100 instances (592,213 triples); relations that merely reverse another one (e.g. the reverse of `/people/person/nationality`) were removed.
+- `fb15k_237`: the FB15k-237 dataset of Toutanova and Chen (2015), a subset of FB15k from which near-duplicate and inverse relations were removed (as well as the triples of the validation and test sets that link entities directly linked in the training set), keeping 237 relations and 14,541 entities (310,116 triples). The textual mentions of pairs of entities in the ClueWeb12 corpus, distributed with this dataset, are left out.
+
+Each node is an entity (e.g. a person, a place, a film or a profession), identified by its Freebase machine identifier (mid); the data do not include the names of the entities. A directed edge from entity A to entity B is a triple (A, relation, B), e.g. that a person has a given profession. Some relations of Freebase are two-hop relations, in which an intermediate entity (a "compound value type") was collapsed out (e.g. `/film/film/release_date_s./film/film_regional_release_date/film_release_region`). Pairs of entities may be connected by several edges with different relations.
+
+The triples are divided into training, validation and test sets by the benchmarks; all of them are included, and the set is given as an edge property.
+
+The networks have the following properties:
+
+- `mid`: the Freebase identifier of the entity, e.g. `/m/027rn`.
+- Edge `relation`: the Freebase relation, e.g. `/people/person/profession`.
+- Edge `split`: the set of the benchmark the triple belongs to: `train`, `valid` or `test`."""
+tags = ['Informational', 'Relatedness', 'Unweighted', 'Multigraph', 'Metadata']
+url = ['https://web.archive.org/web/20221204060113/https://everest.hds.utc.fr/doku.php?id=en:transe',
+       'https://www.microsoft.com/en-us/download/details.aspx?id=52312']
+citation = [('A. Bordes, N. Usunier, A. Garcia-Durán, J. Weston, O. Yakhnenko, "Translating Embeddings for Modeling Multi-relational Data." Advances in Neural Information Processing Systems 26, 2787-2795 (2013)', 'https://papers.nips.cc/paper/2013/hash/1cecc7a77928ca8133fa24680a88d2f9-Abstract.html'),
+            ('K. Toutanova, D. Chen, "Observed versus latent features for knowledge base and text inference." Proceedings of the 3rd Workshop on Continuous Vector Space Models and their Compositionality, 57-66 (2015)', 'https://doi.org/10.18653/v1/W15-4007'),
+            ('K. Toutanova, D. Chen, P. Pantel, H. Poon, P. Choudhury, M. Gamon, "Representing Text for Joint Embedding of Text and Knowledge Bases." Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 1499-1509 (2015)', 'https://doi.org/10.18653/v1/D15-1174')]
+icon_hash = None
+upstream_license = ('CC BY 2.5 (fb15k); Microsoft Research Data License Agreement, for non-commercial or research purposes only (fb15k_237)', None)
+upstream_prefix = None
+
+archived_files = {
+    'fb15k.tgz': 'https://web.archive.org/web/20221209122412id_/https://everest.hds.utc.fr/lib/exe/fetch.php?media=en:fb15k.tgz',
+    'FB15K-237.2.zip': 'https://download.microsoft.com/download/8/7/0/8700516A-AB3D-4850-B4BB-805C515AECE1/FB15K-237.2.zip'}
+files = [(tuple(f'fb15k.tgz:FB15k/freebase_mtr100_mte100-{s}.txt'
+                for s in ['train', 'valid', 'test']), 'fb15k', None),
+         (tuple(f'FB15K-237.2.zip:Release/{s}.txt'
+                for s in ['train', 'valid', 'test']), 'fb15k_237', None)]
+
+def fetch_upstream(force=False):
+    return fetch_archived_files(__name__.split(".")[-1], archived_files, force,
+                                tries=3)
+
+@cache_network()
+@coerce_props()
+@annotate()
+def parse(alts=None):
+    global files
+    name = __name__.split(".")[-1]
+    for fnames, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        triples = []
+        splits = []
+        for fname, split in zip(fnames, ["train", "valid", "test"]):
+            with open_upstream_file(name, fname, "r") as f:
+                for line in f:
+                    if not line.strip():
+                        continue
+                    h, r, t = line.rstrip("\n").split("\t")
+                    triples.append((h, t, r))
+                    splits.append(split)
+        g = Graph(directed=True)
+        g.vp.mid = g.add_edge_list(triples, hashed=True,
+                                   eprops=[("relation", "string")])
+        g.ep.relation = g.ep["relation"]
+        g.ep.split = g.new_ep("string", vals=splits)
+        yield alt, g