History of wiki_link_dyn
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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 9ae0f29..92d9a1a 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -41,7 +41,7 @@ tags = ['Informational', 'Web graph', 'Multigraph', 'Signed', 'Timestamps', 'Tem
url = 'https://dumps.wikimedia.org/'
citation = [('"Wikimedia Foundation. Wikimedia downloads."', 'https://dumps.wikimedia.org/'),
('J. Preusse, J. Kunegis, M. Thimm, S. Staab, T. Gottron, "Structural Dynamics of Knowledge Networks." Proceedings of the International AAAI Conference on Web and Social Media 7(1), 506-515 (2013)', 'https://doi.org/10.1609/icwsm.v7i1.14402')]
-icon_hash = '57ec17198cf714f319c38eb6'
+date_added = '2020-08-11'
upstream_license = ("Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0) and GFDL",
"https://dumps.wikimedia.org/legal.html")
[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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index c190755..9ae0f29 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -33,10 +33,10 @@ This network replaces an earlier version of the same kind, extracted from the hi
The network has the following properties:
-- `name`: the article title.
-- `is_redirect`: whether the article is a redirect at the time of the dump.
-- Edge `time`: the time of the revision (Unix time, in seconds).
-- Edge `sign`: $+1$ if the link was added, $-1$ if it was removed."""
+- (Node) `name`: the article title.
+- (Node) `is_redirect`: whether the article is a redirect at the time of the dump.
+- (Edge) `time`: the time of the revision (Unix time, in seconds).
+- (Edge) `sign`: $+1$ if the link was added, $-1$ if it was removed."""
tags = ['Informational', 'Web graph', 'Multigraph', 'Signed', 'Timestamps', 'Temporal', 'Metadata']
url = 'https://dumps.wikimedia.org/'
citation = [('"Wikimedia Foundation. Wikimedia downloads."', 'https://dumps.wikimedia.org/'),
[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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 004439f..c190755 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -171,7 +171,6 @@ def fetch_upstream(force=False):
@coerce_props(vforce={"name": "string"})
@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] Remove the mentions of KONECT from the descriptions of edit_wikibooks, edit_wikinews, edit_wikipedia, edit_wikiquote, edit_wiktionary, linux, prosper, reactome, unicodelang, wiki_categories, wiki_link_dyn, wikipedia_link and wordnet 2216557
These entries were originally taken from KONECT and now download their data from the original sources, so their descriptions no longer refer to KONECT.
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 87a4627..004439f 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -29,7 +29,7 @@ The links of each revision were extracted from its wikitext as the targets of `[
The static network of the links of the current versions of the pages, from the database tables of the same dumps (and thus including the links generated by templates), is the network `simple` of the entry `wikipedia_link`.
-This network replaces an earlier version of the same kind, extracted by KONECT from the history until September 2011 (J. Preusse et al., 2013), with 100,312 nodes and 1,627,472 edges and no node names.
+This network replaces an earlier version of the same kind, extracted from the history until September 2011 by J. Preusse et al. (2013), with 100,312 nodes and 1,627,472 edges and no node names.
The network has the following properties:
[entries] Merge duplicate entries and add cross-references between related ones 9bc6033
- Removed duplicates, merged into the entries holding the same data: dblp_coauthor_snap (soc_net_comms), cattle and bison (dom; bison's breeding data move there, as do the wolves' age and sex), football_tsevans (football, with both conference assignments), eu_procurements_alt (eu_procurements), foursquare_friendships (foursquare_global). - software_dependencies: colt and scolt are one network; ambassador: the duplicate 2001 network is dropped and the three same-edge networks combined; dom: the dataset count corrected (436). - macaque_neural: Young's 71-area network added (young71; the 47-area one is now cocomac47), both from archived copies. - collins_yeast, celegans_interactomes: from archived copies of the dead CCSB site (byte-identical files). - Cross-references between entries holding versions of the same data (food webs, Wikipedia, Slashdot, physicians, SNAP/Mislove, CCSB). - ICON ids of duplicate records added; macaque_neural's corrected. - prosper, dbpedia_all: string properties given in edge-index order (needs graph-tool with the fixed vals ordering).
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 833b66a..87a4627 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -27,6 +27,8 @@ description = """The evolving network of hyperlinks between the articles of the
The links of each revision were extracted from its wikitext as the targets of `[[...]]` links (after removing section anchors and leading colons, and capitalizing the first letter, as MediaWiki does), and compared with those of the previous revision of the same page: multiple links to the same target count once, and revisions whose text has been hidden are skipped. Only links to pages that exist in the main namespace at the time of the dump are kept, so links to deleted or never created pages ("red links"), to other namespaces (categories, files, etc.) and to other wikis are omitted; links generated by templates are not included, and links to redirects are not resolved to their targets. Deleted pages and deleted revisions are absent from the dump. Articles without any link event are included as isolated nodes.
+The static network of the links of the current versions of the pages, from the database tables of the same dumps (and thus including the links generated by templates), is the network `simple` of the entry `wikipedia_link`.
+
This network replaces an earlier version of the same kind, extracted by KONECT from the history until September 2011 (J. Preusse et al., 2013), with 100,312 nodes and 1,627,472 edges and no node names.
The network has the following properties:
[entries] Rebuild the Wikimedia and Stack Overflow entries from the original dumps b65b158
- edit_wikibooks, edit_wikinews, edit_wikiquote, edit_wiktionary, wikipedia_link, wiki_categories, wiki_link_dyn: from the Wikimedia dumps of 2026-10-01 (newer than KONECT's extractions), with page titles, user names (including unregistered editors, marked `anonymous`), timestamps and namespaces; the sister projects gain the language editions added since. - stackoverflow: from the Stack Exchange data dump of December 2011 (the one KONECT used), with KONECT's swapped sides corrected and user and question properties.
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index cb322bb..833b66a 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -17,23 +17,156 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .. import *
+import array
+import bz2
+import html
+import re
-title = "Wikipedia link dynamics (2011)"
-description = """Six networks of the evolving hyperlink structure among wikipedia articles, for simple English (en), German (de), Dutch (nl), Polish (pl), Italian (it), French (fr), taken in August 2011. Each edge is timestamped, and an edge (i,j) indicates that article i hyperlinks to j. The edge sign indicates the addition (+1) or deletion (-1) of that link at the specified time.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Informational', 'Web graph', 'Unweighted', 'Timestamps']
-url = 'http://konect.cc/networks/link-dynamic-simplewiki'
-citation = [('J. Preusse et al., "Structural Dynamics of Knowledge Networks." Proc. Int. Conf. on the Web and Social Media (ICWSM 2013).', 'http://www.mthimm.de/pub/2013/Preusse_2013.pdf')]
+title = "Wikipedia link dynamics (2001-2026)"
+description = """The evolving network of hyperlinks between the articles of the Simple English Wikipedia, reconstructed from its complete edit history in the Wikimedia "pages-meta-history" dump of 1 October 2026, which contains the full text of every revision of every page existing at the time of the dump. Nodes are the articles (pages in the main namespace, including redirect pages), and each directed edge $(i,j)$ is an event at which a link from article $i$ to article $j$ was added to (sign $+1$) or removed from (sign $-1$) the wikitext of article $i$, timestamped with the time of the revision. The network is therefore a multigraph, in which the links present in article $i$ at time $t$ are the pairs whose signs up to $t$ sum to one.
+
+The links of each revision were extracted from its wikitext as the targets of `[[...]]` links (after removing section anchors and leading colons, and capitalizing the first letter, as MediaWiki does), and compared with those of the previous revision of the same page: multiple links to the same target count once, and revisions whose text has been hidden are skipped. Only links to pages that exist in the main namespace at the time of the dump are kept, so links to deleted or never created pages ("red links"), to other namespaces (categories, files, etc.) and to other wikis are omitted; links generated by templates are not included, and links to redirects are not resolved to their targets. Deleted pages and deleted revisions are absent from the dump. Articles without any link event are included as isolated nodes.
+
+This network replaces an earlier version of the same kind, extracted by KONECT from the history until September 2011 (J. Preusse et al., 2013), with 100,312 nodes and 1,627,472 edges and no node names.
+
+The network has the following properties:
+
+- `name`: the article title.
+- `is_redirect`: whether the article is a redirect at the time of the dump.
+- Edge `time`: the time of the revision (Unix time, in seconds).
+- Edge `sign`: $+1$ if the link was added, $-1$ if it was removed."""
+tags = ['Informational', 'Web graph', 'Multigraph', 'Signed', 'Timestamps', 'Temporal', 'Metadata']
+url = 'https://dumps.wikimedia.org/'
+citation = [('"Wikimedia Foundation. Wikimedia downloads."', 'https://dumps.wikimedia.org/'),
+ ('J. Preusse, J. Kunegis, M. Thimm, S. Staab, T. Gottron, "Structural Dynamics of Knowledge Networks." Proceedings of the International AAAI Conference on Web and Social Media 7(1), 506-515 (2013)', 'https://doi.org/10.1609/icwsm.v7i1.14402')]
icon_hash = '57ec17198cf714f319c38eb6'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.link-dynamic-simplewiki.tar.bz2', None, 'konect')]
+upstream_license = ("Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0) and GFDL",
+ "https://dumps.wikimedia.org/legal.html")
+
+# Fixed dump date (see entries/edit_wikipedia)
+DUMP_DATE = "20261001"
+upstream_prefix = 'https://dumps.wikimedia.org'
+files = [(sql_files("simplewiki", ["page"], date=DUMP_DATE) +
+ (f"simplewiki/{DUMP_DATE}/simplewiki-{DUMP_DATE}-pages-meta-history.xml.bz2",),
+ None, None)]
+
+LINK_RE = re.compile(rb"\[\[([^\[\]|\n]+?)(?:\||\]\])")
+
+def parse_link_dynamics(f_page, f_history):
+ """Link addition/removal events between main-namespace pages, from the
+ page table dump `f_page` and the (decompressed) full-history XML dump
+ `f_history`, read line by line (the dump has one XML element per line,
+ and the revision text is XML-escaped, so that its lines contain no '<')."""
+ page_ids, redirect, length, titles, index = read_pages(f_page)
+ pidx = numpy.argsort(page_ids)
+ page_keys = page_ids[pidx]
+
+ targets = {} # raw link target -> node (or -1)
+ def target(raw):
+ v = targets.get(raw)
+ if v is not None:
+ return v
+ t = raw.decode("utf8", errors="replace")
+ if "&" in t:
+ t = html.unescape(t) # XML escaping (and HTML entities)
+ t = t.split("#", 1)[0].replace("_", " ")
+ t = " ".join(t.split())
+ if t.startswith(":"):
+ t = t[1:].lstrip()
+ v = -1
+ if t:
+ t = t[0].upper() + t[1:]
+ v = index.get(t.replace(" ", "_").encode("utf8"), -1)
+ if len(targets) > 10_000_000:
+ targets.clear()
+ targets[raw] = v
+ return v
+
+ e_s = array.array("i")
+ e_t = array.array("i")
+ e_time = array.array("q")
+ e_sign = array.array("b")
+
+ page = -1 # current source node, or -1 if skipped
+ ns = None
+ in_rev = in_text = False
+ for line in f_history:
+ if in_text:
+ text.append(line)
+ if line.endswith(b"</text>\n"):
+ in_text = False
+ continue
+ s = line.strip()
+ if in_rev:
+ if s.startswith(b"<timestamp>"):
+ ts = s[11:-12]
+ elif s.startswith(b"<text"):
+ if b'deleted="deleted"' in s:
+ text = None
+ elif s.endswith(b"/>"):
+ text = []
+ else:
+ text = [line]
+ in_text = not line.endswith(b"</text>\n")
+ elif s == b"</revision>":
+ in_rev = False
+ if page < 0 or text is None:
+ continue
+ text = b"".join(text)
+ if text == prev_text:
+ continue
+ prev_text = text
+ links = set(target(m) for m in LINK_RE.findall(text))
+ links.discard(-1)
+ t = wiki_time(ts)
+ for v in links - prev_links:
+ e_s.append(page)
+ e_t.append(v)
+ e_time.append(t)
+ e_sign.append(1)
+ for v in prev_links - links:
+ e_s.append(page)
+ e_t.append(v)
+ e_time.append(t)
+ e_sign.append(-1)
+ prev_links = links
+ elif s == b"<revision>":
+ in_rev = True
+ text = None
+ elif s == b"<page>":
+ page = -1
+ ns = None
+ prev_text = None
+ prev_links = set()
+ elif s.startswith(b"<ns>"):
+ ns = int(s[4:-5])
+ elif s.startswith(b"<id>") and ns is not None and page == -1:
+ if ns == 0:
+ pid = int(s[4:-5])
+ i = numpy.searchsorted(page_keys, pid)
+ if i < len(page_keys) and page_keys[i] == pid:
+ page = int(pidx[i])
+ ns = None
+ del targets, index
+
+ g = Graph(directed=True)
+ g.add_vertex(len(titles))
+ e_time = numpy.frombuffer(e_time, dtype="int64")
+ idx = numpy.argsort(e_time, kind="stable") # chronological order
+ g.add_edge_list(numpy.column_stack((numpy.frombuffer(e_s, dtype="int32")[idx],
+ numpy.frombuffer(e_t, dtype="int32")[idx])))
+ g.ep.time = g.new_ep("int64_t", vals=e_time[idx])
+ g.ep.sign = g.new_ep("int16_t", vals=numpy.frombuffer(e_sign, dtype="int8")[idx])
+ g.vp.name = g.new_vp("string", vals=titles)
+ g.vp.is_redirect = g.new_vp("bool", vals=redirect)
+ return g
def fetch_upstream(force=False):
return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
force)
@cache_network()
-@coerce_props()
+@coerce_props(vforce={"name": "string"})
@annotate()
def parse(alts=None):
global files
@@ -41,9 +174,8 @@ def parse(alts=None):
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=True)
+ with open_upstream_file(name, fnames[0], "rb") as f_page:
+ with open_upstream_file(name, fnames[1], "rb") as f:
+ with bz2.open(f) as f_history:
+ g = parse_link_dynamics(f_page, f_history)
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 7a67d8d..cb322bb 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 6308360..7a67d8d 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 15ab698..6308360 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 0280b1b..15ab698 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 7cffa91..0280b1b 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/link-dynamic-simplewiki'
citation = [('J. Preusse et al., "Structural Dynamics of Knowledge Networks." Proc. Int. Conf. on the Web and Social Media (ICWSM 2013).', 'http://www.mthimm.de/pub/2013/Preusse_2013.pdf')]
icon_hash = '57ec17198cf714f319c38eb6'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.link-dynamic-simplewiki.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 0280b1b..7cffa91 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/link-dynamic-simplewiki'
citation = [('J. Preusse et al., "Structural Dynamics of Knowledge Networks." Proc. Int. Conf. on the Web and Social Media (ICWSM 2013).', 'http://www.mthimm.de/pub/2013/Preusse_2013.pdf')]
icon_hash = '57ec17198cf714f319c38eb6'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.link-dynamic-simplewiki.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index da59075..0280b1b 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__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/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
index 7a68b90..da59075 100644
--- a/entries/wiki_link_dyn/__init__.py
+++ b/entries/wiki_link_dyn/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Wikipedia link dynamics (2011)"
-description = "Six networks of the evolving hyperlink structure among wikipedia articles, for simple English (en), German (de), Dutch (nl), Polish (pl), Italian (it), French (fr), taken in August 2011. Each edge is timestamped, and an edge (i,j) indicates that article i hyperlinks to j. The edge sign indicates the addition (+1) or deletion (-1) of that link at the specified time."
+description = """Six networks of the evolving hyperlink structure among wikipedia articles, for simple English (en), German (de), Dutch (nl), Polish (pl), Italian (it), French (fr), taken in August 2011. Each edge is timestamped, and an edge (i,j) indicates that article i hyperlinks to j. The edge sign indicates the addition (+1) or deletion (-1) of that link at the specified time.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Informational', 'Web graph', 'Unweighted', 'Timestamps']
url = 'http://konect.cc/networks/link-dynamic-simplewiki'
citation = [('J. Preusse et al., "Structural Dynamics of Knowledge Networks." Proc. Int. Conf. on the Web and Social Media (ICWSM 2013).', 'http://www.mthimm.de/pub/2013/Preusse_2013.pdf')]
Initial commit cc85872
diff --git a/entries/wiki_link_dyn/__init__.py b/entries/wiki_link_dyn/__init__.py
new file mode 100644
index 0000000..7a68b90
--- /dev/null
+++ b/entries/wiki_link_dyn/__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 = "Wikipedia link dynamics (2011)"
+description = "Six networks of the evolving hyperlink structure among wikipedia articles, for simple English (en), German (de), Dutch (nl), Polish (pl), Italian (it), French (fr), taken in August 2011. Each edge is timestamped, and an edge (i,j) indicates that article i hyperlinks to j. The edge sign indicates the addition (+1) or deletion (-1) of that link at the specified time."
+tags = ['Informational', 'Web graph', 'Unweighted', 'Timestamps']
+url = 'http://konect.cc/networks/link-dynamic-simplewiki'
+citation = [('J. Preusse et al., "Structural Dynamics of Knowledge Networks." Proc. Int. Conf. on the Web and Social Media (ICWSM 2013).', 'http://www.mthimm.de/pub/2013/Preusse_2013.pdf')]
+icon_hash = '57ec17198cf714f319c38eb6'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.link-dynamic-simplewiki.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=True)
+ yield alt, g