History of cora_linqs
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 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/cora_linqs/__init__.py b/entries/cora_linqs/__init__.py
index 27a8277..37f741b 100644
--- a/entries/cora_linqs/__init__.py
+++ b/entries/cora_linqs/__init__.py
@@ -32,7 +32,7 @@ tags = ['Informational', 'Citation', 'Unweighted', 'Metadata', 'Text']
url = 'https://linqs.org/datasets/#cora'
citation = [('A. K. McCallum, K. Nigam, J. Rennie, K. Seymore, "Automating the Construction of Internet Portals with Machine Learning." Information Retrieval 3(2), 127-163 (2000)', 'https://doi.org/10.1023/A:1009953814988'),
('P. Sen, G. Namata, M. Bilgic, L. Getoor, B. Gallagher, T. Eliassi-Rad, "Collective Classification in Network Data." AI Magazine 29(3), 93-106 (2008)', 'https://doi.org/10.1609/aimag.v29i3.2157')]
-icon_hash = None
+date_added = '2026-10-25'
upstream_license = None
# The LINQS host (https://linqs-data.soe.ucsc.edu/public/lbc/cora.tgz) was
# unreachable at the time of writing, so we use the Internet Archive's copy
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/cora_linqs/__init__.py b/entries/cora_linqs/__init__.py
index d8fe9a2..27a8277 100644
--- a/entries/cora_linqs/__init__.py
+++ b/entries/cora_linqs/__init__.py
@@ -25,9 +25,9 @@ description = """A directed citation network of machine learning papers, from th
An edge from paper A to paper B means that A cites B. The network has the following properties:
-- `id`: the identifier of the paper in the source data.
-- `subject`: the machine learning subtopic of the paper, one of `Case_Based`, `Genetic_Algorithms`, `Neural_Networks`, `Probabilistic_Methods`, `Reinforcement_Learning`, `Rule_Learning` and `Theory`.
-- `words`: a vector of 1,433 binary values, where the i-th value is 1 if the i-th word of the vocabulary appears in the paper, and 0 otherwise."""
+- (Node) `id`: the identifier of the paper in the source data.
+- (Node) `subject`: the machine learning subtopic of the paper, one of `Case_Based`, `Genetic_Algorithms`, `Neural_Networks`, `Probabilistic_Methods`, `Reinforcement_Learning`, `Rule_Learning` and `Theory`.
+- (Node) `words`: a vector of 1,433 binary values, where the i-th value is 1 if the i-th word of the vocabulary appears in the paper, and 0 otherwise."""
tags = ['Informational', 'Citation', 'Unweighted', 'Metadata', 'Text']
url = 'https://linqs.org/datasets/#cora'
citation = [('A. K. McCallum, K. Nigam, J. Rennie, K. Seymore, "Automating the Construction of Internet Portals with Machine Learning." Information Retrieval 3(2), 127-163 (2000)', 'https://doi.org/10.1023/A:1009953814988'),
[entries] Remove unneeded code from the entries 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/cora_linqs/__init__.py b/entries/cora_linqs/__init__.py
index eb18a20..d8fe9a2 100644
--- a/entries/cora_linqs/__init__.py
+++ b/entries/cora_linqs/__init__.py
@@ -48,7 +48,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: cora_linqs 26c41f8
diff --git a/entries/cora_linqs/__init__.py b/entries/cora_linqs/__init__.py
new file mode 100644
index 0000000..eb18a20
--- /dev/null
+++ b/entries/cora_linqs/__init__.py
@@ -0,0 +1,87 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020-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 = "Cora machine learning papers (LINQS, 2000)"
+description = """A directed citation network of machine learning papers, from the version of the Cora dataset distributed by the LINQS group (Sen et al.) as a benchmark for collective classification. Cora was a search engine for computer science research papers, built by McCallum et al. by automatically crawling the web for papers and extracting their references, which were classified into a hierarchy of topics. This dataset is a selection of the papers in the machine learning topic, each assigned to one of seven subtopics, chosen such that every paper cites or is cited by at least one other paper of the selection. Each paper is described by the presence or absence of 1,433 words of a vocabulary obtained after stemming and removing stopwords, and discarding words that appear in fewer than 10 papers. The words themselves are not included in the data. This is a different version of the Cora data from the one in the `cora` entry.
+
+An edge from paper A to paper B means that A cites B. The network has the following properties:
+
+- `id`: the identifier of the paper in the source data.
+- `subject`: the machine learning subtopic of the paper, one of `Case_Based`, `Genetic_Algorithms`, `Neural_Networks`, `Probabilistic_Methods`, `Reinforcement_Learning`, `Rule_Learning` and `Theory`.
+- `words`: a vector of 1,433 binary values, where the i-th value is 1 if the i-th word of the vocabulary appears in the paper, and 0 otherwise."""
+tags = ['Informational', 'Citation', 'Unweighted', 'Metadata', 'Text']
+url = 'https://linqs.org/datasets/#cora'
+citation = [('A. K. McCallum, K. Nigam, J. Rennie, K. Seymore, "Automating the Construction of Internet Portals with Machine Learning." Information Retrieval 3(2), 127-163 (2000)', 'https://doi.org/10.1023/A:1009953814988'),
+ ('P. Sen, G. Namata, M. Bilgic, L. Getoor, B. Gallagher, T. Eliassi-Rad, "Collective Classification in Network Data." AI Magazine 29(3), 93-106 (2008)', 'https://doi.org/10.1609/aimag.v29i3.2157')]
+icon_hash = None
+upstream_license = None
+# The LINQS host (https://linqs-data.soe.ucsc.edu/public/lbc/cora.tgz) was
+# unreachable at the time of writing, so we use the Internet Archive's copy
+upstream_prefix = 'https://web.archive.org/web/20260923154413id_/https://linqs-data.soe.ucsc.edu/public/lbc'
+files = [(('cora.tgz:cora/cora.cites', 'cora.tgz:cora/cora.content'),
+ 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
+ if isinstance(fnames, str):
+ fnames = [fnames]
+ with ExitStack() as stack:
+ fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+
+ # Content: "<paper_id> <1433 binary word attributes> <class_label>"
+ ids = []
+ subjects = []
+ words = []
+ for line in fs[1]:
+ row = line.split()
+ if not row:
+ continue
+ ids.append(int(row[0]))
+ subjects.append(row[-1])
+ words.append(numpy.array(row[1:-1], dtype=numpy.uint8))
+ idx = {i: v for v, i in enumerate(ids)}
+ assert len(idx) == len(ids)
+
+ g = Graph(directed=True)
+ g.add_vertex(len(ids))
+ g.vp.id = g.new_vp("int", vals=ids)
+ g.vp.subject = g.new_vp("string", vals=subjects)
+ g.vp.words = g.new_vp("vector<bool>")
+ for v, w in enumerate(words):
+ g.vp.words[v] = w
+
+ # Cites: "<cited> <citing>"; edges go from citing to cited
+ c = read_ints(fs[0]).reshape(-1, 2)
+ g.add_edge_list([(idx[int(b)], idx[int(a)]) for a, b in c])
+ g = Graph(g, vorder=g.vp.id)
+ yield alt, g