History of train_terrorists
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] 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/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index d566e62..ff663ce 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__init__.py
@@ -19,21 +19,46 @@
from .. import *
title = "Madrid train bombing terrorists (2004)"
-description = """A network of associations among the terrorists involved in the 2004 Madrid train bombing, as reconstructed from press stories after-the-fact. Edge weights encode four levels of connection strength: friendships, ties to Al Qaeda and Osama Bin Laden, co-participants in wars, and co-participants in previous terrorist attacks.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Social', 'Offline', 'Weighted']
-url = 'http://konect.cc/networks/moreno_train'
+description = """Network of the individuals involved in the bombing of commuter trains in Madrid on 11 March 2004, reconstructed by J. A. Rodríguez (University of Barcelona) from accounts in the two major Spanish daily newspapers (El País and El Mundo), and popularized by B. Hayes (2006). The individuals are the people suspected of having participated in the bombing and their relatives. Four kinds of ties were recorded: (1) trust–friendship (contact, kinship, links in the telephone center); (2) ties to Al Qaeda and to Osama Bin Laden; (3) co-participation in training camps and/or wars; (4) co-participation in previous terrorist attacks (11 September, Casablanca). The four relations were added together to give a "strength of connection" index from 1 to 4. The data were distributed by L. C. Freeman on his network data page at the University of California, Irvine (no longer online), from which this version was obtained via the Internet Archive.
+
+An undirected edge (i, j) indicates a tie of at least one kind between individuals i and j. Six individuals have no ties, and are isolated nodes.
+
+The network has the following properties:
+
+- Nodes: `name`, the name of the individual.
+- Edges: `weight`, the strength of the connection (the number of kinds of ties, from 1 to 4)."""
+tags = ['Social', 'Offline', 'Weighted', 'Metadata']
+url = 'https://web.archive.org/web/20210115130726/http://moreno.ss.uci.edu/data.html#train'
citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'https://doi.org/10.1511/2006.61.3495')]
icon_hash = '57cf1f1767351c5e0ccd7a0f'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.moreno_train.tar.bz2', None, 'konect')]
+upstream_license = None
+upstream_prefix = 'https://web.archive.org/web/20210115130726id_/http://moreno.ss.uci.edu'
+files = [('train.dat', None, None)]
def fetch_upstream(force=False):
- return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
- force)
+ # The Wayback Machine refuses connections or fails when rate-limited, so
+ # retry with increasing pauses (files already fetched are skipped)
+ return retry_download(fetch_upstream_files, __name__.split(".")[-1],
+ upstream_prefix, files, force)
+
+def read_edgelist1(f):
+ """Read a UCINET DL file in EDGELIST1 format, with the labels in the
+ header, returning (labels, edges)."""
+ lines = f.read().decode("latin-1").replace("\r", "\n").split("\n")
+ i = lines.index("LABELS:") + 1
+ j = lines.index("DATA:")
+ labels = [l.strip().strip('"').strip() for l in lines[i:j] if l.strip()]
+ edges = []
+ for l in lines[j + 1:]:
+ x = l.split()
+ if len(x) == 3:
+ edges.append((int(x[0]) - 1, int(x[1]) - 1, int(x[2])))
+ else:
+ assert len(x) == 0 or x == ["!"], l
+ return labels, edges
@cache_network()
-@coerce_props()
+@coerce_props(vforce={"name": "string"})
@annotate()
def parse(alts=None):
global files
@@ -44,6 +69,16 @@ def parse(alts=None):
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=False)
+ fs = [stack.enter_context(open_upstream_file(name, fn, "rb"))
+ for fn in fnames]
+ labels, edges = read_edgelist1(fs[0])
+ # each tie is listed in both directions, with the same strength
+ w = {(i, j): x for i, j, x in edges}
+ assert all(w[(j, i)] == x for (i, j), x in w.items())
+ g = Graph(directed=False)
+ g.add_vertex(len(labels))
+ g.vp.name = g.new_vp("string", vals=labels)
+ g.ep.weight = g.new_ep("int")
+ g.add_edge_list([(i, j, x) for (i, j), x in sorted(w.items()) if i < j],
+ eprops=[g.ep.weight])
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index d8fddb1..d566e62 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__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/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index 3e0ad90..d8fddb1 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__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/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index 0e43c16..3e0ad90 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__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/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index ca4749f..0e43c16 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__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/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index 2a8f76f..ca4749f 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/moreno_train'
citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'https://doi.org/10.1511/2006.61.3495')]
icon_hash = '57cf1f1767351c5e0ccd7a0f'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.moreno_train.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Update citations to use DOIs e878874
diff --git a/entries/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index 20cdbcb..2a8f76f 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__init__.py
@@ -23,7 +23,7 @@ description = """A network of associations among the terrorists involved in the
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Weighted']
url = 'http://konect.cc/networks/moreno_train'
-citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'http://www.americanscientist.org/issues/id.3495,y.2006,no.5,page.5/postComment.aspx')]
+citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'https://doi.org/10.1511/2006.61.3495')]
icon_hash = '57cf1f1767351c5e0ccd7a0f'
upstream_prefix = 'http://konect.cc/files'
orphan = True
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index 6b6dbab..20cdbcb 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/moreno_train'
citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'http://www.americanscientist.org/issues/id.3495,y.2006,no.5,page.5/postComment.aspx')]
icon_hash = '57cf1f1767351c5e0ccd7a0f'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.moreno_train.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index 5d3d406..6b6dbab 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__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/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
index d44ab09..5d3d406 100644
--- a/entries/train_terrorists/__init__.py
+++ b/entries/train_terrorists/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Madrid train bombing terrorists (2004)"
-description = "A network of associations among the terrorists involved in the 2004 Madrid train bombing, as reconstructed from press stories after-the-fact. Edge weights encode four levels of connection strength: friendships, ties to Al Qaeda and Osama Bin Laden, co-participants in wars, and co-participants in previous terrorist attacks."
+description = """A network of associations among the terrorists involved in the 2004 Madrid train bombing, as reconstructed from press stories after-the-fact. Edge weights encode four levels of connection strength: friendships, ties to Al Qaeda and Osama Bin Laden, co-participants in wars, and co-participants in previous terrorist attacks.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Social', 'Offline', 'Weighted']
url = 'http://konect.cc/networks/moreno_train'
citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'http://www.americanscientist.org/issues/id.3495,y.2006,no.5,page.5/postComment.aspx')]
Initial commit cc85872
diff --git a/entries/train_terrorists/__init__.py b/entries/train_terrorists/__init__.py
new file mode 100644
index 0000000..d44ab09
--- /dev/null
+++ b/entries/train_terrorists/__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 = "Madrid train bombing terrorists (2004)"
+description = "A network of associations among the terrorists involved in the 2004 Madrid train bombing, as reconstructed from press stories after-the-fact. Edge weights encode four levels of connection strength: friendships, ties to Al Qaeda and Osama Bin Laden, co-participants in wars, and co-participants in previous terrorist attacks."
+tags = ['Social', 'Offline', 'Weighted']
+url = 'http://konect.cc/networks/moreno_train'
+citation = [('B. Hayes, "Connecting the Dots: Can the tools of graph theory and social-network studies unravel the next big plot?" American Scientist 94(5), 400-404 (2006)', 'http://www.americanscientist.org/issues/id.3495,y.2006,no.5,page.5/postComment.aspx')]
+icon_hash = '57cf1f1767351c5e0ccd7a0f'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.moreno_train.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=False)
+ yield alt, g