logo Netzschleuder network catalog, repository, and centrifuge

History of terrorist_attacks

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] Remove superfluous details of the upstream distribution from the descriptions by Tiago de Paula Peixoto dc07aa0
The descriptions mentioned incidental details of how the upstream data
are made available: the file formats (CSV, JSON, XML, GEXF, SBML, HIF,
Pajek, UCINET, ...), file names, where the files were published or
obtained from (Zenodo, figshare, Kaggle, the Pajek datasets page, the
Internet Archive), and that some networks are only available in the gt
format. These are left out; caveats about the data themselves are kept,
referring to "the data" instead of "the file". The description of
sp_baboons now lists its properties instead of the upstream columns,
and says that events without a recipient are left out.
diff --git a/entries/terrorist_attacks/__init__.py b/entries/terrorist_attacks/__init__.py
index 2197109..b5e222e 100644
--- a/entries/terrorist_attacks/__init__.py
+++ b/entries/terrorist_attacks/__init__.py
@@ -26,7 +26,7 @@ Nodes are attacks, and there are two networks:
 - `colocation`: an edge connects two attacks that occurred in the same geographical location.
 - `colocation_same_org`: an edge connects two attacks that occurred in the same location and were carried out by the same organization (a subset of the edges of `colocation`).
 
-The networks have the following vertex properties: `name`, the identifier of the attack in PIT (for most attacks, the name of the organization responsible, or "Unknown", followed by the date in the format YYYYMMDD; the remaining identifiers are URLs of PIT documents); `attack_type`, the class of the attack (arson, bombing, kidnapping, NBCR attack, i.e. nuclear, biological, chemical or radiological, weapon attack, or other attack); and `features`, a vector of 106 binary attributes of the attack (according to the source, including information such as the year of the attack and keywords from its description; their meanings are not given in the data). The same two networks, restricted to the attacks with at least one edge, are also distributed by the UCINET datasets collection as "Linux Terrorists"."""
+The networks have the following vertex properties: `name`, the identifier of the attack in PIT (for most attacks, the name of the organization responsible, or "Unknown", followed by the date in the format YYYYMMDD; the remaining identifiers are URLs of PIT documents); `attack_type`, the class of the attack (arson, bombing, kidnapping, NBCR attack, i.e. nuclear, biological, chemical or radiological, weapon attack, or other attack); and `features`, a vector of 106 binary attributes of the attack (according to the source, including information such as the year of the attack and keywords from its description; their meanings are not given in the data)."""
 tags = ['Social', 'Offline', 'Unweighted', 'Metadata']
 url = 'https://linqs.org/datasets/'
 citation = [('B. Zhao, P. Sen, and L. Getoor, "Event classification and relationship labeling in affiliation networks." Proceedings of the Workshop on Statistical Network Analysis (SNA) at the 23rd International Conference on Machine Learning (ICML) (2006)', 'http://www.cs.umd.edu/~sen/pubs/sna2006/RelClzPIT.pdf')]
[entries] Add the date when each entry was added, and remove icon_hash by Tiago de Paula Peixoto 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/terrorist_attacks/__init__.py b/entries/terrorist_attacks/__init__.py
index 570a005..2197109 100644
--- a/entries/terrorist_attacks/__init__.py
+++ b/entries/terrorist_attacks/__init__.py
@@ -30,7 +30,7 @@ The networks have the following vertex properties: `name`, the identifier of the
 tags = ['Social', 'Offline', 'Unweighted', 'Metadata']
 url = 'https://linqs.org/datasets/'
 citation = [('B. Zhao, P. Sen, and L. Getoor, "Event classification and relationship labeling in affiliation networks." Proceedings of the Workshop on Statistical Network Analysis (SNA) at the 23rd International Conference on Machine Learning (ICML) (2006)', 'http://www.cs.umd.edu/~sen/pubs/sna2006/RelClzPIT.pdf')]
-icon_hash = '59fe7b08ee01e9ab21ac7fb2'
+date_added = '2026-10-25'
 upstream_license = None
 upstream_prefix = 'https://web.archive.org/web/20240725121120id_/https://linqs-data.soe.ucsc.edu/public/lbc'
 files = [(('TerrorAttack.tgz:terrorist-attacks/terrorist_attack_loc.edges',
[entries] Remove unneeded code from the entries by Tiago de Paula Peixoto 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/terrorist_attacks/__init__.py b/entries/terrorist_attacks/__init__.py
index fd04265..570a005 100644
--- a/entries/terrorist_attacks/__init__.py
+++ b/entries/terrorist_attacks/__init__.py
@@ -50,7 +50,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] Use American spelling in the descriptions by Tiago de Paula Peixoto 802d564
British spellings in the titles and descriptions of 69 entries (e.g.
labelled, organisation, millimetres, centres, anonymised, neighbours,
analysed, modelled, colour, licence) are replaced by the American ones.
Proper names keep their spelling (Otago Harbour, the Centre for Water
Systems, the Centre jeunesse de Montréal, the Dutch Ministry of Defence),
as do quoted upstream terms, citations, and property names.
diff --git a/entries/terrorist_attacks/__init__.py b/entries/terrorist_attacks/__init__.py
index e75a4a5..fd04265 100644
--- a/entries/terrorist_attacks/__init__.py
+++ b/entries/terrorist_attacks/__init__.py
@@ -19,7 +19,7 @@
 from .. import *
 
 title = "Terrorist attacks, LINQS (2005)"
-description = """Networks of terrorist attacks from the Profiles in Terror (PIT) knowledge base of the MIND Lab at the University of Maryland, as distributed by the LINQS group (Zhao, Sen and Getoor) as a benchmark for relational (collective) classification. PIT was a semantic knowledge base of terrorism intelligence (attacks, terrorists and terrorist organisations) extracted from sources such as news media reports. The dataset contains 1293 terrorist attacks, each classified into one of six types.
+description = """Networks of terrorist attacks from the Profiles in Terror (PIT) knowledge base of the MIND Lab at the University of Maryland, as distributed by the LINQS group (Zhao, Sen and Getoor) as a benchmark for relational (collective) classification. PIT was a semantic knowledge base of terrorism intelligence (attacks, terrorists and terrorist organizations) extracted from sources such as news media reports. The dataset contains 1293 terrorist attacks, each classified into one of six types.
 
 Nodes are attacks, and there are two networks:
 
[entries] New entry: terrorist_attacks by Tiago de Paula Peixoto a526568
diff --git a/entries/terrorist_attacks/__init__.py b/entries/terrorist_attacks/__init__.py
new file mode 100644
index 0000000..e75a4a5
--- /dev/null
+++ b/entries/terrorist_attacks/__init__.py
@@ -0,0 +1,92 @@
+#! /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 = "Terrorist attacks, LINQS (2005)"
+description = """Networks of terrorist attacks from the Profiles in Terror (PIT) knowledge base of the MIND Lab at the University of Maryland, as distributed by the LINQS group (Zhao, Sen and Getoor) as a benchmark for relational (collective) classification. PIT was a semantic knowledge base of terrorism intelligence (attacks, terrorists and terrorist organisations) extracted from sources such as news media reports. The dataset contains 1293 terrorist attacks, each classified into one of six types.
+
+Nodes are attacks, and there are two networks:
+
+- `colocation`: an edge connects two attacks that occurred in the same geographical location.
+- `colocation_same_org`: an edge connects two attacks that occurred in the same location and were carried out by the same organization (a subset of the edges of `colocation`).
+
+The networks have the following vertex properties: `name`, the identifier of the attack in PIT (for most attacks, the name of the organization responsible, or "Unknown", followed by the date in the format YYYYMMDD; the remaining identifiers are URLs of PIT documents); `attack_type`, the class of the attack (arson, bombing, kidnapping, NBCR attack, i.e. nuclear, biological, chemical or radiological, weapon attack, or other attack); and `features`, a vector of 106 binary attributes of the attack (according to the source, including information such as the year of the attack and keywords from its description; their meanings are not given in the data). The same two networks, restricted to the attacks with at least one edge, are also distributed by the UCINET datasets collection as "Linux Terrorists"."""
+tags = ['Social', 'Offline', 'Unweighted', 'Metadata']
+url = 'https://linqs.org/datasets/'
+citation = [('B. Zhao, P. Sen, and L. Getoor, "Event classification and relationship labeling in affiliation networks." Proceedings of the Workshop on Statistical Network Analysis (SNA) at the 23rd International Conference on Machine Learning (ICML) (2006)', 'http://www.cs.umd.edu/~sen/pubs/sna2006/RelClzPIT.pdf')]
+icon_hash = '59fe7b08ee01e9ab21ac7fb2'
+upstream_license = None
+upstream_prefix = 'https://web.archive.org/web/20240725121120id_/https://linqs-data.soe.ucsc.edu/public/lbc'
+files = [(('TerrorAttack.tgz:terrorist-attacks/terrorist_attack_loc.edges',
+           'TerrorAttack.tgz:terrorist-attacks/terrorist_attack.nodes'),
+          'colocation', None),
+         (('TerrorAttack.tgz:terrorist-attacks/terrorist_attack_loc_org.edges',
+           'TerrorAttack.tgz:terrorist-attacks/terrorist_attack.nodes'),
+          'colocation_same_org', None)]
+
+_PREFIX = "http://counterterror.mindswap.org/2005/ict_events.owl#"
+
+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
+        with ExitStack() as stack:
+            fs = [stack.enter_context(open_upstream_file(name, fn, "r")) for fn in fnames]
+
+            # Nodes: "<id> <106 binary attributes> <class label URL>"
+            ids = []
+            labels = []
+            feats = []
+            for line in fs[1]:
+                row = line.split()
+                if not row:
+                    continue
+                ids.append(row[0])
+                labels.append(row[-1].split("#")[-1].replace("_", " "))
+                feats.append(numpy.array(row[1:-1], dtype=numpy.uint8))
+            idx = {i: v for v, i in enumerate(ids)}
+            assert len(idx) == len(ids)
+
+            g = Graph(directed=False)
+            g.add_vertex(len(ids))
+            g.vp.name = g.new_vp("string", vals=[i[len(_PREFIX):] if i.startswith(_PREFIX) else i
+                                                 for i in ids])
+            g.vp.attack_type = g.new_vp("string", vals=labels)
+            g.vp.features = g.new_vp("vector<bool>")
+            for v, x in enumerate(feats):
+                g.vp.features[v] = x
+
+            edges = set()
+            for line in fs[0]:
+                row = line.split()
+                if not row:
+                    continue
+                u, v = idx[row[0]], idx[row[1]]
+                edges.add((min(u, v), max(u, v)))
+            g.add_edge_list(sorted(edges))
+        yield alt, g