History of aids_blogs
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/aids_blogs/__init__.py b/entries/aids_blogs/__init__.py
index 2a5e789..c9af48c 100644
--- a/entries/aids_blogs/__init__.py
+++ b/entries/aids_blogs/__init__.py
@@ -30,7 +30,7 @@ tags = ['Informational', 'Web graph', 'Unweighted']
url = 'https://cran.r-project.org/package=sand'
citation = [('S. Gopal, "The evolving social geography of blogs." In H. J. Miller (ed.), Societies and Cities in the Age of Instant Access, 275-293, Springer (2007)', 'https://doi.org/10.1007/1-4020-5427-0_18'),
('E. D. Kolaczyk, G. Csárdi, "Statistical Analysis of Network Data with R", 2nd edition, Springer (2020)', 'https://doi.org/10.1007/978-3-030-44129-6')]
-icon_hash = '59233b6e62da63251188ee8b'
+date_added = '2026-10-25'
upstream_license = ('GPL-3', 'https://cran.r-project.org/web/licenses/GPL-3')
upstream_prefix = 'https://cran.r-project.org/src/contrib'
files = [('sand_2.0.0.tar.gz:sand/data/aidsblog.rda', None, None)]
[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/aids_blogs/__init__.py b/entries/aids_blogs/__init__.py
index d136f87..2a5e789 100644
--- a/entries/aids_blogs/__init__.py
+++ b/entries/aids_blogs/__init__.py
@@ -43,7 +43,6 @@ def fetch_upstream(force=False):
@coerce_props()
@annotate()
def parse(alts=None):
- global files
import rpy2.robjects as robjects
name = __name__.split(".")[-1]
for fnames, alt, fmt in files:
[entries] New entry: aids_blogs 352c1c0
diff --git a/entries/aids_blogs/__init__.py b/entries/aids_blogs/__init__.py
new file mode 100644
index 0000000..d136f87
--- /dev/null
+++ b/entries/aids_blogs/__init__.py
@@ -0,0 +1,68 @@
+#! /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 tempfile
+import shutil
+
+title = "AIDS blog network (2005)"
+description = """The pattern of links among 146 blogs related to AIDS, patients, and their support networks, collected by S. Gopal over a randomly selected three-day period in August 2005. This version was distributed with the R package `sand`, accompanying the book "Statistical Analysis of Network Data with R" by E. D. Kolaczyk and G. Csárdi, where it is used as an example.
+
+A directed edge (i, j) indicates that blog i links to blog j in its "blogroll" (list of recommended blogs). Blog names are not included."""
+tags = ['Informational', 'Web graph', 'Unweighted']
+url = 'https://cran.r-project.org/package=sand'
+citation = [('S. Gopal, "The evolving social geography of blogs." In H. J. Miller (ed.), Societies and Cities in the Age of Instant Access, 275-293, Springer (2007)', 'https://doi.org/10.1007/1-4020-5427-0_18'),
+ ('E. D. Kolaczyk, G. Csárdi, "Statistical Analysis of Network Data with R", 2nd edition, Springer (2020)', 'https://doi.org/10.1007/978-3-030-44129-6')]
+icon_hash = '59233b6e62da63251188ee8b'
+upstream_license = ('GPL-3', 'https://cran.r-project.org/web/licenses/GPL-3')
+upstream_prefix = 'https://cran.r-project.org/src/contrib'
+files = [('sand_2.0.0.tar.gz:sand/data/aidsblog.rda', 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
+ import rpy2.robjects as robjects
+ name = __name__.split(".")[-1]
+ for fnames, alt, fmt in files:
+ if alts is not None and alt not in alts:
+ continue
+ with open_upstream_file(name, fnames, "rb") as f:
+ with tempfile.NamedTemporaryFile() as temp:
+ shutil.copyfileobj(f, temp)
+ temp.flush()
+ env = robjects.Environment()
+ robjects.r["load"](temp.name, envir=env)
+ # igraph object: number of vertices, directedness, and the
+ # (0-based) edge source and target vectors
+ x = robjects.r["unclass"](env["aidsblog"])
+ n = int(x[0][0])
+ directed = bool(x[1][0])
+ edges = numpy.array([numpy.array(x[2]), numpy.array(x[3])],
+ dtype="int").T
+ g = Graph(directed=directed)
+ g.add_vertex(n)
+ g.add_edge_list(edges)
+ yield alt, g