History of network_science_book
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: network_science_book 3cf619b
diff --git a/entries/network_science_book/__init__.py b/entries/network_science_book/__init__.py
new file mode 100644
index 0000000..8f2dea5
--- /dev/null
+++ b/entries/network_science_book/__init__.py
@@ -0,0 +1,67 @@
+#! /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 *
+
+title = "Phone call, email, metabolic and citation networks of the Network Science book"
+description = r"""Four of the ten networks distributed with the textbook "Network Science" by A.-L. Barabási, which uses them throughout as reference data sets (e.g. in its Table 2.1). In all of them, nodes are anonymous and labeled consecutively from zero (the labels are the node indices), and there are no node or edge attributes. The networks are:
+
+- `phonecalls`: mobile phone calls among a sample of the most active users of the data set of C. Song, Z. Qu, N. Blumm and A.-L. Barabási (2010), who used the call records of about 10 million anonymized subscribers of a mobile phone carrier to study the predictability of human mobility; the data were provided by C. Song. Nodes are phone users, and a directed edge $i \to j$ means that $i$ called $j$ at least once during the observation period (the dates and the carrier are not given). The book's data page describes the edges as undirected ("called each other at least once"), but the file lists 91,826 ordered pairs (34,973 of the 56,853 connected pairs in both directions), the number of directed links given in the book's Table 2.1; the network is therefore stored as directed.
+- `email`: email traffic at the University of Kiel, Germany, collected over 112 days from the log files of the university's mail server by H. Ebel, L.-I. Mielsch and S. Bornholdt (2002). Nodes are email addresses (of the university and outside it), and a directed edge $i \to j$ means that $i$ sent at least one email to $j$. The 648 self-loops (addresses that sent emails to themselves) are kept.
+- `metabolic`: the metabolism of the bacterium *Escherichia coli*, derived from a metabolic reconstruction of the BiGG knowledgebase (J. Schellenberger et al., 2010); which reconstruction and version were used is not documented. Nodes are metabolites, and a directed edge $i \to j$ means that there is a reaction in which $i$ is an input (substrate) and $j$ a product. The metabolite names are not included.
+- `citation`: citations among the papers of the journals of the American Physical Society (APS): Physical Review Letters, Physical Review (its series A to E and earlier) and Reviews of Modern Physics, derived from the citation data that the APS makes available to researchers on request (S. Redner, 2005); the range of years is not documented. Nodes are papers, and a directed edge $i \to j$ means that paper $i$ cites paper $j$. The 118 self-loops and the 3,903 pairs of papers that cite each other are kept. The network is distributed here as it is in the book's data set.
+
+The other networks of the book's data set are already in this catalog and are not repeated here: the actor network (`imdb_actors_2004`), the condensed matter collaboration network (`CondMat` of `arxiv_authors`, from SNAP), the Internet router network (`skitter_routers_2003`, with the same 192,244 nodes and 609,066 edges), the power grid (`power`), the yeast protein interactions of Yu et al. (2008) (`y2h_union` of `yeast_interactome_ccsb`), and the WWW network of Notre Dame (`notre_dame_web`).
+
+The networks have no properties besides the node indices."""
+tags = ['Social', 'Communication', 'Biological', 'Metabolic', 'Informational', 'Citation', 'Unweighted']
+url = 'https://networksciencebook.com/translations/en/resources/data.html'
+citation = [('A.-L. Barabási, "Network Science." Cambridge University Press (2016).', 'https://networksciencebook.com/'),
+ ('C. Song, Z. Qu, N. Blumm, and A.-L. Barabási, "Limits of predictability in human mobility." Science 327(5968), 1018-1021 (2010).', 'https://doi.org/10.1126/science.1177170'),
+ ('H. Ebel, L.-I. Mielsch, and S. Bornholdt, "Scale-free topology of e-mail networks." Physical Review E 66, 035103 (2002).', 'https://doi.org/10.1103/PhysRevE.66.035103'),
+ ('J. Schellenberger, J. O. Park, T. M. Conrad, and B. Ø. Palsson, "BiGG: a Biochemical Genetic and Genomic knowledgebase of large scale metabolic reconstructions." BMC Bioinformatics 11, 213 (2010).', 'https://doi.org/10.1186/1471-2105-11-213'),
+ ('S. Redner, "Citation statistics from 110 years of Physical Review." Physics Today 58(6), 49-54 (2005).', 'https://doi.org/10.1063/1.1996475')]
+icon_hash = None
+upstream_license = None
+upstream_prefix = 'https://networksciencebook.com/translations/en/resources'
+files = [('networks.zip:phonecalls.edgelist.txt', 'phonecalls', 'snap'),
+ ('networks.zip:email.edgelist.txt', 'email', 'snap'),
+ ('networks.zip:metabolic.edgelist.txt', 'metabolic', 'snap'),
+ ('networks.zip:citation.edgelist.txt', 'citation', 'snap')]
+
+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]
+ # nodes are labeled consecutively from zero, and all of them
+ # appear in the edge lists
+ g = parse_graph(fs, fmt, directed=True)
+ yield alt, g