logo Netzschleuder network catalog, repository, and centrifuge

History of reddit_reply

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/reddit_reply/__init__.py b/entries/reddit_reply/__init__.py
index 7f2b350..dc770cd 100644
--- a/entries/reddit_reply/__init__.py
+++ b/entries/reddit_reply/__init__.py
@@ -36,7 +36,7 @@ url = ['https://www.cs.cornell.edu/~arb/data/temporal-reddit-reply/',
        'http://www.cs.cornell.edu/~jhessel/projectPages/redditHRC.html']
 citation = [('P. Liu, A. R. Benson, M. Charikar, "Sampling Methods for Counting Temporal Motifs." Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining (WSDM), 294-302 (2019)', 'https://doi.org/10.1145/3289600.3290988'),
             ('J. Hessel, C. Tan, L. Lee, "Science, AskScience, and BadScience: On the Coexistence of Highly Related Communities." Proceedings of the International AAAI Conference on Web and Social Media 10(1), 171-180 (2016)', 'https://doi.org/10.1609/icwsm.v10i1.14739')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = None
 # networks of more than about 300 million edges: only stored and served in the
 # gt format
[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/reddit_reply/__init__.py b/entries/reddit_reply/__init__.py
index ddf62d2..7f2b350 100644
--- a/entries/reddit_reply/__init__.py
+++ b/entries/reddit_reply/__init__.py
@@ -29,8 +29,8 @@ There are 646,044,687 replies, of which 9,748,878 are replies of users to themse
 
 The network has the following properties:
 
-- `name`: the user name.
-- Edge `time`: the time of the reply, in Unix time (seconds since 1970-01-01 UTC)."""
+- (Node) `name`: the user name.
+- (Edge) `time`: the time of the reply, in Unix time (seconds since 1970-01-01 UTC)."""
 tags = ['Social', 'Online', 'Communication', 'Unweighted', 'Multigraph', 'Temporal', 'Timestamps', 'Metadata']
 url = ['https://www.cs.cornell.edu/~arb/data/temporal-reddit-reply/',
        'http://www.cs.cornell.edu/~jhessel/projectPages/redditHRC.html']
[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/reddit_reply/__init__.py b/entries/reddit_reply/__init__.py
index 3984c8e..ddf62d2 100644
--- a/entries/reddit_reply/__init__.py
+++ b/entries/reddit_reply/__init__.py
@@ -75,7 +75,6 @@ def read_replies(name, fname):
 @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] Store the networks of more than 300 million edges of the new large entries only in the gt format by Tiago de Paula Peixoto 68260af
The networks of the large datasets added recently with more than about
300 million edges (published counts, or estimates where the networks
have not been parsed yet) are listed in `skip_conversion`, so that they
are not converted to GraphML, GML and CSV, which would take about 5 TB.
diff --git a/entries/reddit_reply/__init__.py b/entries/reddit_reply/__init__.py
index 7438213..3984c8e 100644
--- a/entries/reddit_reply/__init__.py
+++ b/entries/reddit_reply/__init__.py
@@ -38,6 +38,9 @@ citation = [('P. Liu, A. R. Benson, M. Charikar, "Sampling Methods for Counting
             ('J. Hessel, C. Tan, L. Lee, "Science, AskScience, and BadScience: On the Coexistence of Highly Related Communities." Proceedings of the International AAAI Conference on Web and Social Media 10(1), 171-180 (2016)', 'https://doi.org/10.1609/icwsm.v10i1.14739')]
 icon_hash = None
 upstream_license = None
+# networks of more than about 300 million edges: only stored and served in the
+# gt format
+skip_conversion = [None]
 upstream_prefix = 'gdrive://'
 _z = '1JCiDApvzOml1adq1tKUiWe8KsBmqarbM:zip:temporal-reddit-reply'   # temporal-reddit-reply.zip
 files = [((f'{_z}/temporal-reddit-reply.txt',
[entries] New entry: reddit_reply by Tiago de Paula Peixoto 6ad3354
diff --git a/entries/reddit_reply/__init__.py b/entries/reddit_reply/__init__.py
new file mode 100644
index 0000000..7438213
--- /dev/null
+++ b/entries/reddit_reply/__init__.py
@@ -0,0 +1,104 @@
+#! /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/>.
+
+import pyarrow
+import pyarrow.csv
+
+from .. import *
+
+
+title = "Reddit comment replies (2005-2015)"
+description = """A temporal network of the replies between users of the discussion website Reddit, compiled by Liu, Benson and Charikar from a large collection of Reddit comments curated by Hessel, Tan and Lee from the data of Jason Baumgartner (pushshift.io), from December 2005 to December 2015. Each node is a user, and a directed edge from user A to user B, with a timestamp, means that A commented on a post or comment of B at that time; pairs of users are connected by one edge per reply. The users whose accounts were deleted were removed by the source.
+
+There are 646,044,687 replies, of which 9,748,878 are replies of users to themselves (self-loops; the statistics of the source page, 636,295,809 replies, leave them out). The source lists 11,742,777 users, of which only the 8,901,033 that take part in some reply are included.
+
+The network has the following properties:
+
+- `name`: the user name.
+- Edge `time`: the time of the reply, in Unix time (seconds since 1970-01-01 UTC)."""
+tags = ['Social', 'Online', 'Communication', 'Unweighted', 'Multigraph', 'Temporal', 'Timestamps', 'Metadata']
+url = ['https://www.cs.cornell.edu/~arb/data/temporal-reddit-reply/',
+       'http://www.cs.cornell.edu/~jhessel/projectPages/redditHRC.html']
+citation = [('P. Liu, A. R. Benson, M. Charikar, "Sampling Methods for Counting Temporal Motifs." Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining (WSDM), 294-302 (2019)', 'https://doi.org/10.1145/3289600.3290988'),
+            ('J. Hessel, C. Tan, L. Lee, "Science, AskScience, and BadScience: On the Coexistence of Highly Related Communities." Proceedings of the International AAAI Conference on Web and Social Media 10(1), 171-180 (2016)', 'https://doi.org/10.1609/icwsm.v10i1.14739')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'gdrive://'
+_z = '1JCiDApvzOml1adq1tKUiWe8KsBmqarbM:zip:temporal-reddit-reply'   # temporal-reddit-reply.zip
+files = [((f'{_z}/temporal-reddit-reply.txt',
+           f'{_z}/users-temporal-reddit-reply.txt'), None, None)]
+
+def fetch_upstream(force=False):
+    return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
+                                force)
+
+# For checks only: if set, only (about) this many replies are read
+_check_rows = None
+
+def read_replies(name, fname):
+    """The replies "<i> <j> <time>" (i replied to j at the time, in Unix
+    time; users numbered from 1), in blocks of (i, j, time) arrays."""
+    n = 0
+    with open_upstream_file(name, fname, "rb") as f:
+        reader = pyarrow.csv.open_csv(
+            f,
+            read_options=pyarrow.csv.ReadOptions(column_names=["i", "j", "t"],
+                                                 block_size=1 << 26),
+            parse_options=pyarrow.csv.ParseOptions(delimiter=" "),
+            convert_options=pyarrow.csv.ConvertOptions(
+                column_types={k: pyarrow.int64() for k in "ijt"}))
+        for batch in reader:
+            if _check_rows is not None and n >= _check_rows:
+                break
+            n += batch.num_rows
+            yield [c.to_numpy() for c in batch.columns]
+
+@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
+        # "<id> <user name>", with ids from 1 to n, in order
+        names = []
+        with open_upstream_file(name, fnames[1], "r") as f:
+            for i, line in enumerate(f):
+                uid, uname = line.rstrip("\n").split(" ", 1)
+                assert int(uid) == i + 1
+                names.append(uname)
+        # Only the users that take part in some reply (a first pass over the
+        # replies), numbered in the order of their ids
+        used = numpy.zeros(len(names) + 1, dtype="bool")
+        for i, j, t in read_replies(name, fnames[0]):
+            used[i] = True
+            used[j] = True
+        assert not used[0]
+        index = numpy.cumsum(used) - 1
+        g = Graph(directed=True)
+        g.add_vertex(used.sum())
+        g.vp.name = g.new_vp("string", vals=[names[k - 1] for k in numpy.flatnonzero(used)])
+        del names, used
+        # The replies, added block by block, to save memory
+        g.ep.time = g.new_ep("int64_t")
+        for i, j, t in read_replies(name, fnames[0]):
+            g.add_edge_list(numpy.column_stack([index[i], index[j], t]),
+                            eprops=[g.ep.time])
+        yield alt, g