History of digg_votes
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 networks to existing entries 3023ce5
- digg_votes: the Digg friendship network (`friends`, next to `votes`) - facebook_wall: the friendship links (`friends`, next to `wall`) - interactome_vidal: CCSB's HI-I-05 interactions (`HI-I-05`, next to `maayan`) - trackers: ssc.io's tracker embedding network (`trackers`, next to KONECT's `third_parties`), with corrected description and citations - dblp_author_paper, dblp_cite, dblp_coauthor: the dblp release of 2026-10-03 (`2026-10`, next to `2017`) - fullerene_structures: year, licence and description
diff --git a/entries/digg_votes/__init__.py b/entries/digg_votes/__init__.py
index 73002bc..1aae7fc 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__init__.py
@@ -18,19 +18,32 @@
from .. import *
-title = "Digg story votes (2009)"
-description = """A bipartite network between users and stories on digg.com from 2009. Each user node connects to all story nodes on which that user voted. Edges are timestamped.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Economic', 'Preferences', 'Multigraph', 'Timestamps']
-url = 'http://konect.cc/networks/digg-votes'
-citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'https://doi.org/10.1140/epjds5')]
+title = "Digg story votes and friendships (2009)"
+description = """Votes on stories and friendship links among users of the social news site Digg, collected by K. Lerman and R. Ghosh. The data cover 3,553 stories promoted to Digg's front page over a period of a month in 2009. For each story, all votes ("diggs") made up to the time of data collection were retrieved, together with their time (the votes span 31 May to 5 July 2009); the earliest vote on each story is that of its submitter. The friendship links of the voters were also retrieved. Users and stories are anonymized, but user ids are consistent across the two data sets, so that a user with a given id in one network is the same user in the other. The collection comprises two networks:
+
+- `votes`: a bipartite network of 139,409 users and the stories they voted for. Nodes are users and stories, and an edge connects a user to a story the user voted for, with one edge per vote. A few users voted more than once on the same story, so the network has some multiple edges.
+- `friends`: the friendship links of the 71,367 voters who had specified friends at the time of data collection (voters who do not appear had none). Nodes are users, and a directed edge $(i,j)$ means that user $i$ added $j$ as a friend, i.e. that $i$ watches the activities of (is a fan of) $j$. Only the friend lists of voters were retrieved, so the users who appear only as friends have no out-going edges, and the reverse of a mutual friendship is present only if both users are voters. Five users list themselves as friends (self-loops). The links were created between November 2005 and July 2009.
+
+The networks have the following properties:
+
+- `votes`: Nodes: `is_user`, whether the node is a user (otherwise it is a story); `id`, the anonymized id of the user or story in the source data. Edges: `time`, the time of the vote (Unix time).
+- `friends`: Nodes: `id`, the anonymized id of the user in the source data (the same as in the `votes` network). Edges: `time`, the time when the friendship link was created (Unix time; 0 if unknown, for 1,670 links); `mutual`, whether the friendship is mutual, i.e. whether $j$ also added $i$ as a friend."""
+tags = ['Social', 'Online', 'Economic', 'Preferences', 'Multigraph', 'Timestamps']
+url = 'https://web.archive.org/web/20131126061858/http://www.isi.edu/~lerman/downloads/digg2009.html'
+citation = [('K. Lerman, R. Ghosh, "Information contagion: An empirical study of the spread of news on Digg and Twitter social networks." Proceedings of the International AAAI Conference on Web and Social Media 4(1), 90-97 (2010)', 'https://doi.org/10.1609/icwsm.v4i1.14021'),
+ ('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'https://doi.org/10.1140/epjds5')]
icon_hash = '5818e6f08cf714f319c3eae5'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.digg-votes.tar.bz2', None, 'konect')]
+upstream_license = ("For research purposes only (see the source page)",
+ "https://web.archive.org/web/20131126061858/http://www.isi.edu/~lerman/downloads/digg2009.html")
+# The ISI page is no longer online, so the file is obtained from the
+# Internet Archive.
+upstream_prefix = 'https://web.archive.org/web/20131126090001id_/http://www.isi.edu/~lerman/downloads'
+files = [('digg_votes.zip', 'votes', None),
+ ('digg_friends.zip', 'friends', None)]
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()
@@ -38,12 +51,41 @@ def fetch_upstream(force=False):
def parse(alts=None):
global files
name = __name__.split(".")[-1]
- for fnames, alt, fmt in files:
+ for fname, 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)
+ # The archives are protected with a password, given in the source page
+ csv_name = {"votes": "digg_votes1.csv", "friends": "digg_friends.csv"}[alt]
+ with open_upstream_file(name, fname, "rb") as f:
+ with zipfile.ZipFile(f) as zf:
+ data = zf.read(csv_name, pwd=b"digg2009_user")
+ data = data.replace(b'"', b"").replace(b"\r", b"\n").replace(b",", b" ")
+ m = numpy.loadtxt(io.BytesIO(data), dtype="int64")
+ del data
+ if alt == "votes":
+ # Lines: "<vote_date>","<voter_id>","<story_id>"
+ votes = m
+ users = numpy.unique(votes[:, 1])
+ stories = numpy.unique(votes[:, 2])
+ NU = len(users)
+ g = Graph(directed=False)
+ g.add_vertex(NU + len(stories))
+ g.ep.time = g.new_ep("int64_t")
+ g.add_edge_list(numpy.column_stack((numpy.searchsorted(users, votes[:, 1]),
+ NU + numpy.searchsorted(stories, votes[:, 2]),
+ votes[:, 0])), eprops=[g.ep.time])
+ g.vp.is_user = g.new_vp("bool")
+ g.vp.is_user.a[:NU] = 1
+ g.vp.id = g.new_vp("int")
+ g.vp.id.a[:NU] = users
+ g.vp.id.a[NU:] = stories
+ else:
+ # Lines: "<mutual>","<friend_date>","<user_id>","<friend_id>",
+ # meaning that user_id is a fan of friend_id
+ g = Graph(directed=True)
+ g.ep.mutual = g.new_ep("bool")
+ g.ep.time = g.new_ep("int64_t")
+ g.vp.id = g.add_edge_list(m[:, [2, 3, 0, 1]], hashed=True,
+ hash_type="int64_t",
+ eprops=[g.ep.mutual, g.ep.time])
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/digg_votes/__init__.py b/entries/digg_votes/__init__.py
index 9653a42..73002bc 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__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_votes/__init__.py b/entries/digg_votes/__init__.py
index fc0366f..9653a42 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__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_votes/__init__.py b/entries/digg_votes/__init__.py
index c380adc..fc0366f 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__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_votes/__init__.py b/entries/digg_votes/__init__.py
index 0998b9f..c380adc 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__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_votes/__init__.py b/entries/digg_votes/__init__.py
index b9f6d75..0998b9f 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/digg-votes'
citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'https://doi.org/10.1140/epjds5')]
icon_hash = '5818e6f08cf714f319c3eae5'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.digg-votes.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Update citations to use DOIs e878874
diff --git a/entries/digg_votes/__init__.py b/entries/digg_votes/__init__.py
index 0f7646e..b9f6d75 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__init__.py
@@ -23,7 +23,7 @@ description = """A bipartite network between users and stories on digg.com from
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Economic', 'Preferences', 'Multigraph', 'Timestamps']
url = 'http://konect.cc/networks/digg-votes'
-citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'http://link.springer.com/article/10.1140/epjds5')]
+citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'https://doi.org/10.1140/epjds5')]
icon_hash = '5818e6f08cf714f319c3eae5'
upstream_prefix = 'http://konect.cc/files'
orphan = True
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/digg_votes/__init__.py b/entries/digg_votes/__init__.py
index 8cf21a1..0f7646e 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/digg-votes'
citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'http://link.springer.com/article/10.1140/epjds5')]
icon_hash = '5818e6f08cf714f319c3eae5'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.digg-votes.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/digg_votes/__init__.py b/entries/digg_votes/__init__.py
index 8d29383..8cf21a1 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__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_votes/__init__.py b/entries/digg_votes/__init__.py
index 9c4946f..8d29383 100644
--- a/entries/digg_votes/__init__.py
+++ b/entries/digg_votes/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Digg story votes (2009)"
-description = "A bipartite network between users and stories on digg.com from 2009. Each user node connects to all story nodes on which that user voted. Edges are timestamped."
+description = """A bipartite network between users and stories on digg.com from 2009. Each user node connects to all story nodes on which that user voted. Edges are timestamped.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Economic', 'Preferences', 'Multigraph', 'Timestamps']
url = 'http://konect.cc/networks/digg-votes'
citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'http://link.springer.com/article/10.1140/epjds5')]
Initial commit cc85872
diff --git a/entries/digg_votes/__init__.py b/entries/digg_votes/__init__.py
new file mode 100644
index 0000000..9c4946f
--- /dev/null
+++ b/entries/digg_votes/__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 story votes (2009)"
+description = "A bipartite network between users and stories on digg.com from 2009. Each user node connects to all story nodes on which that user voted. Edges are timestamped."
+tags = ['Economic', 'Preferences', 'Multigraph', 'Timestamps']
+url = 'http://konect.cc/networks/digg-votes'
+citation = [('T. Hogg, and K. Lerman. "Social dynamics of digg." EPJ Data Science 1, 5 (2012)', 'http://link.springer.com/article/10.1140/epjds5')]
+icon_hash = '5818e6f08cf714f319c3eae5'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.digg-votes.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