History of digg_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 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/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 02eb357..f2c53ce 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -31,7 +31,7 @@ The network has the following properties:
tags = ['Social', 'Online', 'Unweighted', 'Multigraph', 'Timestamps']
url = 'https://web.archive.org/web/20101201040745/http://www.public.asu.edu/~mdechoud/datasets.html'
citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'https://doi.org/10.1109/cse.2009.439')]
-icon_hash = '575751bbbd3e93b53c69556e'
+date_added = '2020-08-11'
upstream_license = ("Creative Commons Attribution-NonCommercial 3.0 United States (CC BY-NC 3.0 US)",
"https://creativecommons.org/licenses/by-nc/3.0/us/")
# The ASU page is no longer publicly available, so the file is obtained from
[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/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 7698c4c..02eb357 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -24,8 +24,10 @@ description = """A network of replies among users of the social news site Digg,
The network has the following properties:
-- Nodes: `name`, the Digg user name.
-- Edges: `time`, the time of the reply (Unix time, from the date given in the data, whose time zone is not documented and is assumed to be UTC); `story`, the Digg id of the story on which the comment was made; `comment`, the Digg id of the comment that was replied to."""
+- (Node) `name`: the Digg user name.
+- (Edge) `time`: the time of the reply (Unix time, from the date given in the data, whose time zone is not documented and is assumed to be UTC).
+- (Edge) `story`: the Digg id of the story on which the comment was made.
+- (Edge) `comment`: the Digg id of the comment that was replied to."""
tags = ['Social', 'Online', 'Unweighted', 'Multigraph', 'Timestamps']
url = 'https://web.archive.org/web/20101201040745/http://www.public.asu.edu/~mdechoud/datasets.html'
citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'https://doi.org/10.1109/cse.2009.439')]
[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/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 0af1aab..7698c4c 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -58,7 +58,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] Move more KONECT-derived entries to their original sources bf9dc0e
The entries now download the data from where KONECT obtained them (live, or via the Wayback Machine), using the same release as KONECT where it is still available, and gain the metadata KONECT dropped; descriptions and citations are rewritten from the original sources: - Linton Freeman's UCINET data page: bible_nouns, bison, cattle, hens, highschool, kangaroo, macaques, moreno_sheep, physician_trust (the three relations and the physicians' attributes), rhesus_monkey, train_terrorists, windsurfers (now the networks `interaction` and `closeness`), college_freshmen, crime, interactome_yeast (from the primary source), moreno_taro (undirected), residence_hall, zebras - other pages, archived: contiguous_usa, advogato, google, github, digg_reply, twitter, bookcrossing, dbtropes_feature (without KONECT's spurious "ItemName" tropes) - movielens_100k (in fact the MovieLens 10M tag assignments) - dblp release 2017-05-02: dblp_author_paper, dblp_cite, dblp_coauthor - DBpedia 3.9: dbpedia_country, dbpedia_genre, dbpedia_location, dbpedia_occupation, dbpedia_producer, dbpedia_recordlabel, dbpedia_starring, dbpedia_team, dbpedia_writer, dbpedia_all, dbpedia_link - Discogs releases dump of October 2015: discogs_affiliation, discogs_genre and discogs_label (now with genre and style networks)
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 1e039b8..0af1aab 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -17,20 +17,42 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
+import calendar
title = "Digg reply network (2008)"
-description = """Network of replies among users of digg.com. Each node in the network is a digg user, and each directed edge indicates that user i replied to user j.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Social', 'Online', 'Unweighted', 'Multigraph']
-url = 'http://konect.cc/networks/munmun_digg_reply'
+description = """A network of replies among users of the social news site Digg, collected by M. De Choudhury and collaborators with crawlers based on the Digg API. The data comprise stories on 56 topics, their comments, and the replies to these comments, written between late October and mid-November 2008. Each node is a Digg user, and a directed edge from $i$ to $j$ means that user $i$ replied to a comment by user $j$, with one edge per reply. Only replies to top-level comments included in the data are present (1,313 replies whose parent comment is not included are left out), and users replying to their own comments give self-loops.
+
+The network has the following properties:
+
+- Nodes: `name`, the Digg user name.
+- Edges: `time`, the time of the reply (Unix time, from the date given in the data, whose time zone is not documented and is assumed to be UTC); `story`, the Digg id of the story on which the comment was made; `comment`, the Digg id of the comment that was replied to."""
+tags = ['Social', 'Online', 'Unweighted', 'Multigraph', 'Timestamps']
+url = 'https://web.archive.org/web/20101201040745/http://www.public.asu.edu/~mdechoud/datasets.html'
citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'https://doi.org/10.1109/cse.2009.439')]
icon_hash = '575751bbbd3e93b53c69556e'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.munmun_digg_reply.tar.bz2', None, 'konect')]
+upstream_license = ("Creative Commons Attribution-NonCommercial 3.0 United States (CC BY-NC 3.0 US)",
+ "https://creativecommons.org/licenses/by-nc/3.0/us/")
+# The ASU page is no longer publicly available, so the file is obtained from
+# the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/20101201120326id_/http://www.public.asu.edu/~mdechoud/data'
+files = [(('digg_data.zip:digg_data/comments.sql',
+ 'digg_data.zip:digg_data/replies.sql'), None, None)]
+
+def read_mysql_dump(f):
+ """Records of a tab-separated MySQL dump (SELECT ... INTO OUTFILE), where
+ tabs, newlines and backslashes within the fields are escaped with a
+ backslash."""
+ pat = re.compile(rb'((?:[^\\\t\n]|\\.)*)([\t\n])', re.S)
+ rec = []
+ for m in pat.finditer(f.read()):
+ rec.append(m.group(1))
+ if m.group(2) == b"\n":
+ yield rec
+ rec = []
def fetch_upstream(force=False):
- return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
- force)
+ return retry_download(fetch_upstream_files, __name__.split(".")[-1],
+ upstream_prefix, files, force)
@cache_network()
@coerce_props()
@@ -41,9 +63,32 @@ def parse(alts=None):
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, "rb")) for fn in fnames]
- g = parse_graph(fs, fmt, directed=True)
+ # Comments: id, story id, date, (three undocumented counts),
+ # user name, text, crawl date, flag
+ comments = {r[0]: (r[6], r[1]) for r in read_mysql_dump(fs[0])}
+ # Replies: id, parent comment id, story id, date, (two
+ # undocumented counts), user name, text, crawl date, flag
+ replies = [(r[6], r[1], r[2], r[3]) for r in read_mysql_dump(fs[1])]
+ g = Graph(directed=True)
+ g.vp.name = g.new_vp("string")
+ g.ep.time = g.new_ep("int64_t")
+ g.ep.story = g.new_ep("int64_t")
+ g.ep.comment = g.new_ep("int64_t")
+ vs = {}
+ def get_v(u):
+ if u not in vs:
+ v = g.add_vertex()
+ g.vp.name[v] = u.decode("utf-8", errors="replace")
+ vs[u] = v
+ return vs[u]
+ for user, parent, story, date in replies:
+ if parent not in comments:
+ continue
+ e = g.add_edge(get_v(user), get_v(comments[parent][0]))
+ g.ep.time[e] = calendar.timegm(time.strptime(date.decode(),
+ "%Y-%m-%d %H:%M:%S"))
+ g.ep.story[e] = int(story)
+ g.ep.comment[e] = int(parent)
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index c4dc8f8..1e039b8 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2024 Tiago de Paula Peixoto <tiago@skewed.de>
+# 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
Update copyright information 3d288ea
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 4eb891e..c4dc8f8 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020-2023 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2024 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
Update copyright information 8d005ae
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 9ae0e5c..4eb891e 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2021 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2020-2023 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
Update copyright info db2efcc
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index f0bb460..9ae0e5c 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright (C) 2020 Tiago de Paula Peixoto <tiago@skewed.de>
+# Copyright (C) 2021 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
Un-orphan KONECT datasets 894eba5
KONECT has been brought back from the dead for the time being.
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index aad1516..f0bb460 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/munmun_digg_reply'
citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'https://doi.org/10.1109/cse.2009.439')]
icon_hash = '575751bbbd3e93b53c69556e'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.munmun_digg_reply.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Update citations to use DOIs e878874
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index a83ed9c..aad1516 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -23,7 +23,7 @@ description = """Network of replies among users of digg.com. Each node in the ne
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Online', 'Unweighted', 'Multigraph']
url = 'http://konect.cc/networks/munmun_digg_reply'
-citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5284289')]
+citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'https://doi.org/10.1109/cse.2009.439')]
icon_hash = '575751bbbd3e93b53c69556e'
upstream_prefix = 'http://konect.cc/files'
orphan = True
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 60988e7..a83ed9c 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/munmun_digg_reply'
citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5284289')]
icon_hash = '575751bbbd3e93b53c69556e'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.munmun_digg_reply.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 37afe0f..60988e7 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -3,18 +3,18 @@
#
# Copyright (C) 2020 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 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 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 General Public License for more details.
+# 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 General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# 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 *
Add explicit attribution to descriptions obtained from ICON 1645314
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
index 61dfc75..37afe0f 100644
--- a/entries/digg_reply/__init__.py
+++ b/entries/digg_reply/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Digg reply network (2008)"
-description = "Network of replies among users of digg.com. Each node in the network is a digg user, and each directed edge indicates that user i replied to user j."
+description = """Network of replies among users of digg.com. Each node in the network is a digg user, and each directed edge indicates that user i replied to user j.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Online', 'Unweighted', 'Multigraph']
url = 'http://konect.cc/networks/munmun_digg_reply'
citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5284289')]
Initial commit cc85872
diff --git a/entries/digg_reply/__init__.py b/entries/digg_reply/__init__.py
new file mode 100644
index 0000000..61dfc75
--- /dev/null
+++ b/entries/digg_reply/__init__.py
@@ -0,0 +1,48 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2020 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 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+from .. import *
+
+title = "Digg reply network (2008)"
+description = "Network of replies among users of digg.com. Each node in the network is a digg user, and each directed edge indicates that user i replied to user j."
+tags = ['Social', 'Online', 'Unweighted', 'Multigraph']
+url = 'http://konect.cc/networks/munmun_digg_reply'
+citation = [('M. De Choudhury et al., "Social synchrony: Predicting mimicry of user actions in online social media." In Proc. Int. Conf. on Computational Science and Engineering (CSE \'09), 151-158, (2009)', 'http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5284289')]
+icon_hash = '575751bbbd3e93b53c69556e'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.munmun_digg_reply.tar.bz2', None, 'konect')]
+
+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, "rb")) for fn in fnames]
+ g = parse_graph(fs, fmt, directed=True)
+ yield alt, g