logo Netzschleuder network catalog, repository, and centrifuge

History of airports_struc2vec

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/airports_struc2vec/__init__.py b/entries/airports_struc2vec/__init__.py
index 2e3f4f4..396ef5e 100644
--- a/entries/airports_struc2vec/__init__.py
+++ b/entries/airports_struc2vec/__init__.py
@@ -22,13 +22,13 @@ from .. import *
 
 
 title = "Air traffic in Brazil, Europe and the USA (struc2vec, 2016)"
-description = """Three networks of airports connected by commercial flights in 2016, collected by Ribeiro et al. to evaluate the struc2vec node embedding method, as distributed in their repository:
+description = """Three networks of airports connected by commercial flights in 2016, collected by Ribeiro et al. to evaluate the struc2vec node embedding method:
 
 - `brazil`: airports of Brazil, from the data of the National Civil Aviation Agency (ANAC), from January to December 2016;
 - `europe`: airports of Europe, from the data of Eurostat, from January to November 2016;
 - `usa`: airports of the USA, from the data of the Bureau of Transportation Statistics, from January to October 2016.
 
-An undirected edge connects two airports if there were commercial flights between them during the period. Each airport is labeled with its level of activity, by the quartiles of its distribution in each network (so that the four classes have the same size): the number of landings plus takeoffs (Brazil and Europe), or the number of passengers who arrived or departed (USA). The edges are as in the files: `brazil` has 71 self-loops, and `europe` 2; the numbers of edges thus differ slightly from those stated in the paper (1,038 for Brazil). The data do not identify the airports, except presumably for `usa`, whose node identifiers look like the airport identifiers of the Bureau of Transportation Statistics.
+An undirected edge connects two airports if there were commercial flights between them during the period. Each airport is labeled with its level of activity, by the quartiles of its distribution in each network (so that the four classes have the same size): the number of landings plus takeoffs (Brazil and Europe), or the number of passengers who arrived or departed (USA). The edges are as in the data: `brazil` has 71 self-loops, and `europe` 2; the numbers of edges thus differ slightly from those stated in the paper (1,038 for Brazil). The data do not identify the airports, except presumably for `usa`, whose node identifiers look like the airport identifiers of the Bureau of Transportation Statistics.
 
 The networks have the following properties:
 
[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/airports_struc2vec/__init__.py b/entries/airports_struc2vec/__init__.py
index 953cfe6..2e3f4f4 100644
--- a/entries/airports_struc2vec/__init__.py
+++ b/entries/airports_struc2vec/__init__.py
@@ -37,7 +37,7 @@ The networks have the following properties:
 tags = ['Transportation', 'Airport', 'Unweighted', 'Metadata']
 url = 'https://github.com/leoribeiro/struc2vec'
 citation = [('L. F. R. Ribeiro, P. H. P. Saverese, D. R. Figueiredo, "struc2vec: Learning Node Representations from Structural Identity." Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 385-394 (2017)', 'https://doi.org/10.1145/3097983.3098061')]
-icon_hash = None
+date_added = '2026-10-27'
 upstream_license = ('MIT', 'https://github.com/leoribeiro/struc2vec/blob/77b4cc63e79a37b1496f340c7772d932038417ec/LICENSE')
 upstream_prefix = 'https://raw.githubusercontent.com/leoribeiro/struc2vec/77b4cc63e79a37b1496f340c7772d932038417ec/graph'
 files = [((f'{alt}-airports.edgelist', f'labels-{alt}-airports.txt'), alt, None)
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) by Tiago de Paula Peixoto bc3dbbd
The lists of properties at the end of the descriptions marked edge
properties with "Edge" but left node properties unmarked, or grouped
them in "Nodes: `a`, ...; `b`, ..." items, so the kind of a property
was often unclear. Every item now starts with (Node), (Edge) or (Graph),
followed by the property names, a colon and the explanation, one item
per property or group of properties; qualifications (kinds of nodes,
networks) follow the names in parentheses. Properties that were only
named got a short explanation, and a few items that named the wrong
kind of property were corrected.
diff --git a/entries/airports_struc2vec/__init__.py b/entries/airports_struc2vec/__init__.py
index 44f2140..953cfe6 100644
--- a/entries/airports_struc2vec/__init__.py
+++ b/entries/airports_struc2vec/__init__.py
@@ -32,8 +32,8 @@ An undirected edge connects two airports if there were commercial flights betwee
 
 The networks have the following properties:
 
-- `id`: the identifier of the airport in the source data.
-- `activity`: the activity class of the airport, from 0 (the 25% most active airports) to 3 (the 25% least active ones); the order is not stated by the source, but is evident from the degrees of the airports in each class."""
+- (Node) `id`: the identifier of the airport in the source data.
+- (Node) `activity`: the activity class of the airport, from 0 (the 25% most active airports) to 3 (the 25% least active ones); the order is not stated by the source, but is evident from the degrees of the airports in each class."""
 tags = ['Transportation', 'Airport', 'Unweighted', 'Metadata']
 url = 'https://github.com/leoribeiro/struc2vec'
 citation = [('L. F. R. Ribeiro, P. H. P. Saverese, D. R. Figueiredo, "struc2vec: Learning Node Representations from Structural Identity." Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 385-394 (2017)', 'https://doi.org/10.1145/3097983.3098061')]
[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/airports_struc2vec/__init__.py b/entries/airports_struc2vec/__init__.py
index 0640218..44f2140 100644
--- a/entries/airports_struc2vec/__init__.py
+++ b/entries/airports_struc2vec/__init__.py
@@ -51,7 +51,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] New entry: airports_struc2vec by Tiago de Paula Peixoto 88b29f2
diff --git a/entries/airports_struc2vec/__init__.py b/entries/airports_struc2vec/__init__.py
new file mode 100644
index 0000000..0640218
--- /dev/null
+++ b/entries/airports_struc2vec/__init__.py
@@ -0,0 +1,73 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 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 = "Air traffic in Brazil, Europe and the USA (struc2vec, 2016)"
+description = """Three networks of airports connected by commercial flights in 2016, collected by Ribeiro et al. to evaluate the struc2vec node embedding method, as distributed in their repository:
+
+- `brazil`: airports of Brazil, from the data of the National Civil Aviation Agency (ANAC), from January to December 2016;
+- `europe`: airports of Europe, from the data of Eurostat, from January to November 2016;
+- `usa`: airports of the USA, from the data of the Bureau of Transportation Statistics, from January to October 2016.
+
+An undirected edge connects two airports if there were commercial flights between them during the period. Each airport is labeled with its level of activity, by the quartiles of its distribution in each network (so that the four classes have the same size): the number of landings plus takeoffs (Brazil and Europe), or the number of passengers who arrived or departed (USA). The edges are as in the files: `brazil` has 71 self-loops, and `europe` 2; the numbers of edges thus differ slightly from those stated in the paper (1,038 for Brazil). The data do not identify the airports, except presumably for `usa`, whose node identifiers look like the airport identifiers of the Bureau of Transportation Statistics.
+
+The networks have the following properties:
+
+- `id`: the identifier of the airport in the source data.
+- `activity`: the activity class of the airport, from 0 (the 25% most active airports) to 3 (the 25% least active ones); the order is not stated by the source, but is evident from the degrees of the airports in each class."""
+tags = ['Transportation', 'Airport', 'Unweighted', 'Metadata']
+url = 'https://github.com/leoribeiro/struc2vec'
+citation = [('L. F. R. Ribeiro, P. H. P. Saverese, D. R. Figueiredo, "struc2vec: Learning Node Representations from Structural Identity." Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 385-394 (2017)', 'https://doi.org/10.1145/3097983.3098061')]
+icon_hash = None
+upstream_license = ('MIT', 'https://github.com/leoribeiro/struc2vec/blob/77b4cc63e79a37b1496f340c7772d932038417ec/LICENSE')
+upstream_prefix = 'https://raw.githubusercontent.com/leoribeiro/struc2vec/77b4cc63e79a37b1496f340c7772d932038417ec/graph'
+files = [((f'{alt}-airports.edgelist', f'labels-{alt}-airports.txt'), alt, None)
+         for alt in ['brazil', 'europe', 'usa']]
+
+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 open_upstream_file(name, fnames[1], "r") as f:
+            assert next(f).split() == ["node", "label"]
+            labels = [tuple(int(x) for x in l.split()) for l in f if l.strip()]
+        with open_upstream_file(name, fnames[0], "r") as f:
+            edges = [tuple(int(x) for x in l.split()) for l in f if l.strip()]
+        ids = sorted(i for i, l in labels)
+        index = {x: i for i, x in enumerate(ids)}
+        g = Graph(directed=False)
+        g.add_vertex(len(ids))
+        g.vp.id = g.new_vp("int", vals=ids)
+        g.vp.activity = g.new_vp("int")
+        for i, l in labels:
+            g.vp.activity[index[i]] = l
+        g.add_edge_list([(index[s], index[t]) for s, t in edges])
+        yield alt, g