logo Netzschleuder network catalog, repository, and centrifuge

History of livejournal_asu

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: livejournal_asu by Tiago de Paula Peixoto 4de22c8
diff --git a/entries/livejournal_asu/__init__.py b/entries/livejournal_asu/__init__.py
new file mode 100644
index 0000000..e7f254a
--- /dev/null
+++ b/entries/livejournal_asu/__init__.py
@@ -0,0 +1,56 @@
+#! /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 *
+import pandas
+
+title = "LiveJournal friendships, ASU crawl (2010)"
+description = """A network of friendships among users of LiveJournal, a virtual community where users keep a blog, journal or diary, crawled in July 2010 by R. Zafarani, W. D. Cole and H. Liu (Arizona State University) and distributed by the Social Computing Data Repository (originally at Arizona State University, now at Syracuse University). Nodes are users (anonymized), and a directed edge $i \\to j$ indicates that user $i$ lists user $j$ as a friend (in LiveJournal, friendship is declared by one user and need not be reciprocated; the source data state only that "user $i$ is friend with user $j$"). About 3.5 million of the 14.6 million edges are reciprocated, and 68,853 edges are self-loops.
+
+This crawl is different from the other LiveJournal networks in the repository (e.g. `livejournal`, `ljournal_2008`)."""
+tags = ['Social', 'Online', 'Unweighted']
+url = 'https://datasets.syr.edu/'
+citation = [('R. Zafarani, W. D. Cole, H. Liu, "Sentiment propagation in social networks: a case study in LiveJournal." Advances in Social Computing (SBP 2010), Lecture Notes in Computer Science 6007, 413-420 (2010)', 'https://doi.org/10.1007/978-3-642-12079-4_52'),
+            ('R. Zafarani, H. Liu, "Social Computing Data Repository at ASU." Arizona State University, School of Computing, Informatics and Decision Systems Engineering (2009)', 'https://web.archive.org/web/2018/http://socialcomputing.asu.edu/')]
+icon_hash = '592dea3167ec90f1500d4e47'
+upstream_license = None
+# The repository moved from Arizona State University to Syracuse University
+upstream_prefix = 'https://datasets.syr.edu/uploads/1283881421'
+files = [('LiveJournal-dataset.zip:LiveJournal-dataset/data/edges.csv', 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 fname, alt, fmt in files:
+        if alts is not None and alt not in alts:
+            continue
+        # One edge per line, "i,j", with user ids from 1 to 2,238,731 (the
+        # list of users in nodes.csv is the same range)
+        with open_upstream_file(name, fname, "rb") as f:
+            E = pandas.read_csv(f, header=None, dtype="int64").values
+        g = Graph(directed=True)
+        g.add_vertex(int(E.max()))
+        g.add_edge_list(E - 1)
+        yield alt, g