logo Netzschleuder network catalog, repository, and centrifuge

History of wikics

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] New entry: wikics by Tiago de Paula Peixoto 14af69d
diff --git a/entries/wikics/__init__.py b/entries/wikics/__init__.py
new file mode 100644
index 0000000..1362278
--- /dev/null
+++ b/entries/wikics/__init__.py
@@ -0,0 +1,69 @@
+#! /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 = "Wikipedia computer science articles (Wiki-CS, 2019)"
+description = """A network of hyperlinks between the articles of the English Wikipedia about computer science, from the Wiki-CS dataset, a benchmark for node classification. The articles were selected from the Wikipedia dumps of August 2019, based on their categories, which were aggregated to ten branches of computer science (e.g. "Operating systems" or "Computer security") with the category sanitizer of Boldi and Monti (2016), and then cleaned up by hand; articles that would have been assigned to several branches were dropped. Each article is labeled with its branch.
+
+A directed edge from article A to article B means that A links to B. The links are as given by the dataset (in which the benchmark treats them as undirected): an article may link to another one more than once (6,071 repeated links, giving parallel edges), and 520 articles link to themselves.
+
+The node features of the benchmark (averages of the GloVe embeddings of the words of the articles), and the words of the articles themselves, are left out, as are the train, validation and test splits.
+
+The network has the following properties:
+
+- `title`: the title of the article.
+- `wikipedia_id`: the page identifier of the article in the English Wikipedia.
+- `branch`: the branch of computer science of the article, e.g. `Computer architecture`."""
+tags = ['Informational', 'Web graph', 'Unweighted', 'Multigraph', 'Metadata']
+url = 'https://github.com/pmernyei/wiki-cs-dataset'
+citation = [('P. Mernyei, C. Cangea, "Wiki-CS: A Wikipedia-Based Benchmark for Graph Neural Networks." Graph Representation Learning and Beyond workshop, ICML (2020)', 'https://doi.org/10.48550/arXiv.2007.02901')]
+icon_hash = None
+upstream_license = ('MIT', 'https://github.com/pmernyei/wiki-cs-dataset/blob/f5207315d649377f936edb66d7d93f5342f01d81/LICENSE')
+upstream_prefix = 'https://raw.githubusercontent.com/pmernyei/wiki-cs-dataset/f5207315d649377f936edb66d7d93f5342f01d81/dataset'
+files = [(('data.json', 'metadata.json'), None, None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+@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
+        with open_upstream_file(name, fnames[0], "r") as f:
+            links = json.load(f)["links"]
+        with open_upstream_file(name, fnames[1], "r") as f:
+            nodes = json.load(f)["nodes"]
+        N = len(nodes)
+        assert len(links) == N
+        g = Graph(directed=True)
+        g.add_vertex(N)
+        g.vp.title = g.new_vp("string", vals=[n["title"] for n in nodes])
+        g.vp.wikipedia_id = g.new_vp("int64_t", vals=[int(n["id"]) for n in nodes])
+        g.vp.branch = g.new_vp("string", vals=[n["label"] for n in nodes])
+        g.add_edge_list([(i, j) for i, l in enumerate(links) for j in l])
+        yield alt, g