History of gd2006_world_cup
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/gd2006_world_cup/__init__.py b/entries/gd2006_world_cup/__init__.py
index c24810d..32e48e4 100644
--- a/entries/gd2006_world_cup/__init__.py
+++ b/entries/gd2006_world_cup/__init__.py
@@ -36,7 +36,7 @@ The network has the following properties:
tags = ['Social', 'Offline', 'Sports', 'Unweighted', 'Multigraph', 'Temporal', 'Metadata']
url = 'https://web.archive.org/web/20220928003623/http://gd2006.iti.kit.edu/contest/details.php'
citation = [('"Graph Drawing Contest", 14th International Symposium on Graph Drawing (GD 2006), Karlsruhe, Germany (2006)', 'https://web.archive.org/web/20220928003623/http://gd2006.iti.kit.edu/contest/details.php')]
-icon_hash = None
+date_added = '2026-10-25'
upstream_license = None
# The symposium's site (gd2006.iti.kit.edu) is no longer reachable; the files
# are obtained from the Internet Archive.
[entries] Prefix the properties in the descriptions with (Node), (Edge) or (Graph) 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/gd2006_world_cup/__init__.py b/entries/gd2006_world_cup/__init__.py
index 8e39c26..c24810d 100644
--- a/entries/gd2006_world_cup/__init__.py
+++ b/entries/gd2006_world_cup/__init__.py
@@ -26,8 +26,13 @@ Scores include the goals of penalty shoot-outs: for a match decided by penalties
The network has the following properties:
-- Nodes: `name`, the name of the team as in the source (e.g. "Brazil", "W. Germany", "So. Korea").
-- Edges: `year`, the year of the tournament; `goals_source` and `goals_target`, the goals scored by the source and target teams (including penalty shoot-out goals); `draw`, whether the match was a draw at the end of play (true for all matches decided by penalties); `penalties`, whether the match was decided by a penalty shoot-out; `goals_source_play` and `goals_target_play`, the score at the end of play before the shoot-out (equal to `goals_source` and `goals_target` for matches without a shoot-out); `note`, the annotation of the source: "withdrawal" (the loser withdrew), "replayed" (a match that was repeated as a decision match), "decision" (a decision match), "penalties" (decided by penalty shoot-out), or empty."""
+- (Node) `name`: the name of the team as in the source (e.g. "Brazil", "W. Germany", "So. Korea").
+- (Edge) `year`: the year of the tournament.
+- (Edge) `goals_source` and `goals_target`: the goals scored by the source and target teams (including penalty shoot-out goals).
+- (Edge) `draw`: whether the match was a draw at the end of play (true for all matches decided by penalties).
+- (Edge) `penalties`: whether the match was decided by a penalty shoot-out.
+- (Edge) `goals_source_play` and `goals_target_play`: the score at the end of play before the shoot-out (equal to `goals_source` and `goals_target` for matches without a shoot-out).
+- (Edge) `note`: the annotation of the source: "withdrawal" (the loser withdrew), "replayed" (a match that was repeated as a decision match), "decision" (a decision match), "penalties" (decided by penalty shoot-out), or empty."""
tags = ['Social', 'Offline', 'Sports', 'Unweighted', 'Multigraph', 'Temporal', 'Metadata']
url = 'https://web.archive.org/web/20220928003623/http://gd2006.iti.kit.edu/contest/details.php'
citation = [('"Graph Drawing Contest", 14th International Symposium on Graph Drawing (GD 2006), Karlsruhe, Germany (2006)', 'https://web.archive.org/web/20220928003623/http://gd2006.iti.kit.edu/contest/details.php')]
[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/gd2006_world_cup/__init__.py b/entries/gd2006_world_cup/__init__.py
index 153dab8..8e39c26 100644
--- a/entries/gd2006_world_cup/__init__.py
+++ b/entries/gd2006_world_cup/__init__.py
@@ -62,7 +62,6 @@ def clean_lines(f):
@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: gd2006_world_cup e3d0498
diff --git a/entries/gd2006_world_cup/__init__.py b/entries/gd2006_world_cup/__init__.py
new file mode 100644
index 0000000..153dab8
--- /dev/null
+++ b/entries/gd2006_world_cup/__init__.py
@@ -0,0 +1,99 @@
+#! /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 re
+
+title = "FIFA World Cup matches (1930-2006)"
+description = """Directed temporal network of the matches played in the final tournaments of the FIFA World Cup (football/soccer) from the first edition in 1930 to 2006, distributed as a data set for the graph drawing contest of the 14th International Symposium on Graph Drawing (GD 2006, Karlsruhe), in the category "History of the World Cup". Nodes are national teams, and a directed edge represents a match between two teams in a given year, pointing from the winner to the loser (for a draw, the direction is the order in which the teams are listed in the source, and carries no meaning). Two teams that met several times are connected by parallel edges. Qualification matches are not included. Teams are named as in the source, which keeps the political changes of the participating countries as distinct nodes (e.g. "Germany", "W. Germany" and "E. Germany"; "USSR"; "Czechoslovakia" and "Czech Republic"; "Yugoslavia" and "Serbia and Montenegro").
+
+Scores include the goals of penalty shoot-outs: for a match decided by penalties, the score is the sum of the goals in regular (and extra) time and in the shoot-out, and the score at the end of play is given separately. In 1938, Austria withdrew and Sweden advanced without a match; the source records it with a score of 0:-1. Some matches were replayed, because the first match was a draw, or as a decision match after the group stage; both the original and the decision match are included.
+
+The network has the following properties:
+
+- Nodes: `name`, the name of the team as in the source (e.g. "Brazil", "W. Germany", "So. Korea").
+- Edges: `year`, the year of the tournament; `goals_source` and `goals_target`, the goals scored by the source and target teams (including penalty shoot-out goals); `draw`, whether the match was a draw at the end of play (true for all matches decided by penalties); `penalties`, whether the match was decided by a penalty shoot-out; `goals_source_play` and `goals_target_play`, the score at the end of play before the shoot-out (equal to `goals_source` and `goals_target` for matches without a shoot-out); `note`, the annotation of the source: "withdrawal" (the loser withdrew), "replayed" (a match that was repeated as a decision match), "decision" (a decision match), "penalties" (decided by penalty shoot-out), or empty."""
+tags = ['Social', 'Offline', 'Sports', 'Unweighted', 'Multigraph', 'Temporal', 'Metadata']
+url = 'https://web.archive.org/web/20220928003623/http://gd2006.iti.kit.edu/contest/details.php'
+citation = [('"Graph Drawing Contest", 14th International Symposium on Graph Drawing (GD 2006), Karlsruhe, Germany (2006)', 'https://web.archive.org/web/20220928003623/http://gd2006.iti.kit.edu/contest/details.php')]
+icon_hash = None
+upstream_license = None
+# The symposium's site (gd2006.iti.kit.edu) is no longer reachable; the files
+# are obtained from the Internet Archive.
+upstream_prefix = 'https://web.archive.org/web'
+files = [(('WCNodes', 'WCEdges'), None, None)]
+archived_urls = {
+ 'WCNodes': 'https://web.archive.org/web/20221202193908id_/http://gd2006.iti.kit.edu/contest/WCData/WCNodes',
+ 'WCEdges': 'https://web.archive.org/web/20221202183821id_/http://gd2006.iti.kit.edu/contest/WCData/WCEdges'}
+
+def fetch_upstream(force=False):
+ return fetch_archived_files(__name__.split(".")[-1], archived_urls, force,
+ tries=4)
+
+# country1 , country2 , x:y [(z:z)] [, (A)]
+match_re = re.compile(r"^(.+?)\s*,\s*(.+?)\s*,\s*(-?\d+):(-?\d+)"
+ r"(?:\s*\((\d+):(\d+)\))?\s*(?:,?\s*\(([WRDP])\))?\s*$")
+notes = {None: "", "W": "withdrawal", "R": "replayed", "D": "decision",
+ "P": "penalties"}
+
+def clean_lines(f):
+ # the files are wrapped in an HTML <div> element
+ for line in f:
+ line = re.sub(r"<[^>]*>", "", line).strip()
+ if line:
+ yield line
+
+@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[0], "r") as f:
+ teams = list(clean_lines(f))
+ idx = {t: i for i, t in enumerate(teams)}
+ edges = []
+ year = None
+ with open_upstream_file(name, fnames[1], "r") as f:
+ for line in clean_lines(f):
+ if line.startswith("YEAR"):
+ year = int(line.split()[1])
+ continue
+ m = match_re.match(line)
+ if m is None:
+ raise ValueError(f"cannot parse line: {line!r}")
+ a, b, x, y, px, py, note = m.groups()
+ x, y = int(x), int(y)
+ pen = px is not None
+ px, py = (int(px), int(py)) if pen else (x, y)
+ edges.append((idx[a], idx[b], year, x, y, px == py, pen,
+ px, py, notes[note]))
+ g = Graph(directed=True)
+ g.add_vertex(len(teams))
+ g.vp.name = g.new_vp("string", vals=teams)
+ enames = [("year", "int"), ("goals_source", "int"),
+ ("goals_target", "int"), ("draw", "bool"),
+ ("penalties", "bool"), ("goals_source_play", "int"),
+ ("goals_target_play", "int"), ("note", "string")]
+ for k, t in enames:
+ g.ep[k] = g.new_ep(t)
+ g.add_edge_list(edges, eprops=[g.ep[k] for k, t in enames])
+ yield alt, g