History of linux
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/linux/__init__.py b/entries/linux/__init__.py
index 47590c3..86232b1 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -32,7 +32,7 @@ The network has the following properties:
tags = ['Technological', 'Software', 'Unweighted', 'Metadata']
url = 'https://www.kernel.org/'
citation = [('J. Kunegis, "Linux." KONECT, the Koblenz Network Collection (2016)', 'https://doi.org/10.1145/2487788.2488173')]
-icon_hash = '5840facf8cf714f319c4540e'
+date_added = '2020-08-11'
upstream_license = ("GPL-2.0", "https://www.kernel.org/pub/linux/kernel/COPYING")
upstream_prefix = 'https://www.kernel.org/pub/linux/kernel/v3.x'
files = [('linux-3.16.tar.xz', None, None)]
[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/linux/__init__.py b/entries/linux/__init__.py
index adf22e7..47590c3 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -27,7 +27,8 @@ description = """A directed network of the inclusions between the source code fi
The network has the following properties:
-- Nodes: `name`, the simplified path of the file(s), which identifies the node; `files`, the list of the paths, relative to the top directory of the source tree, of the source files whose simplified path is that of the node (empty only for `config.h`, which is generated during the build)."""
+- (Node) `name`: the simplified path of the file(s), which identifies the node.
+- (Node) `files`: the list of the paths, relative to the top directory of the source tree, of the source files whose simplified path is that of the node (empty only for `config.h`, which is generated during the build)."""
tags = ['Technological', 'Software', 'Unweighted', 'Metadata']
url = 'https://www.kernel.org/'
citation = [('J. Kunegis, "Linux." KONECT, the Koblenz Network Collection (2016)', 'https://doi.org/10.1145/2487788.2488173')]
[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/linux/__init__.py b/entries/linux/__init__.py
index 8b8853e..adf22e7 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -236,7 +236,6 @@ def include_edges(fobj):
@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] 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/linux/__init__.py b/entries/linux/__init__.py
index f154c40..8b8853e 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -23,7 +23,7 @@ import hashlib
import posixpath
title = "Linux source inclusions (v3.16)"
-description = """A directed network of the inclusions between the source code files of the Linux kernel, version 3.16 (released in August 2014), as extracted by J. Kunegis for KONECT and reproduced here from the kernel's source tarball. Each directed edge points from a C source or header file to a file it includes with an `#include` directive (repeated inclusions are counted once). The included files were located heuristically: an `#include` was resolved by looking for the file relative to the directory of the including file and its parent directories (and their `include` subdirectories), then relative to the top directory, then by a unique match of the file name anywhere in the tree; system headers (e.g. `sys/...` or `endian.h`) and the generated `linux/version.h` were ignored, as were includes that could not be resolved. The paths were then simplified by removing architecture-, platform- and API-specific directory components (e.g. `arch/<arch>/`, `include/`, `asm/`, `uapi/`, `linux/`, `mach-*/`), so that several files with the same simplified path, such as the variants of the same header for different architectures, are merged into one node. Only files that include or are included by some file are part of the network. Since a file and a file it includes can be mapped to the same node, 530 nodes have self-loops.
+description = """A directed network of the inclusions between the source code files of the Linux kernel, version 3.16 (released in August 2014), extracted from the kernel's source tarball following the method of J. Kunegis. Each directed edge points from a C source or header file to a file it includes with an `#include` directive (repeated inclusions are counted once). The included files were located heuristically: an `#include` was resolved by looking for the file relative to the directory of the including file and its parent directories (and their `include` subdirectories), then relative to the top directory, then by a unique match of the file name anywhere in the tree; system headers (e.g. `sys/...` or `endian.h`) and the generated `linux/version.h` were ignored, as were includes that could not be resolved. The paths were then simplified by removing architecture-, platform- and API-specific directory components (e.g. `arch/<arch>/`, `include/`, `asm/`, `uapi/`, `linux/`, `mach-*/`), so that several files with the same simplified path, such as the variants of the same header for different architectures, are merged into one node. Only files that include or are included by some file are part of the network. Since a file and a file it includes can be mapped to the same node, 530 nodes have self-loops.
The network has the following properties:
[pipeline] Fix KONECT entity files, seekable upstream files and archive formats 2f6e19f
- konect.py: each ent.<net>.<entity>.<attr> file becomes a vertex property on the side of the entity it describes (per-vertex or per-edge files), instead of all of them being written from vertex 0 into `meta` (which put e.g. the item names of bibsonomy and reuters on the wrong nodes); only leading "%" lines are comments. - open_upstream_file(..., seekable=True) returns a seekable file (via a temporary file) for readers that need one (openpyxl, scipy.io.loadmat, zipfile), replacing the per-entry BytesIO copies. - .xz files can be read again; .xz, .rar and .7z downloads are stored as they are, and "x.tar.xz:", "x.rar:" and "x.7z:" member access works (with py7zr or the 7z command); caches in the previous layouts are still read. - parsers.py: vprops_from_txt matches rows by name for graphs keyed by name; the Wikimedia dump readers (stub histories, SQL tables) are shared helpers; new read_doc (tables of Word documents via LibreOffice) and read_epanet (EPANET water network files) readers. - The entries' workarounds are removed (all parse identically).
diff --git a/entries/linux/__init__.py b/entries/linux/__init__.py
index 376b8b6..f154c40 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -18,19 +18,219 @@
from .. import *
+import collections
+import hashlib
+import posixpath
+
title = "Linux source inclusions (v3.16)"
-description = """A network of Linux (v3.16) source code file inclusion. Nodes represent source files and a directed edge indicates if one file includes another.[^icon]
-[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
-tags = ['Technological', 'Software', 'Unweighted']
-url = 'http://konect.cc/networks/linux'
-citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'https://doi.org/10.1145/2487788.2488173')]
+description = """A directed network of the inclusions between the source code files of the Linux kernel, version 3.16 (released in August 2014), as extracted by J. Kunegis for KONECT and reproduced here from the kernel's source tarball. Each directed edge points from a C source or header file to a file it includes with an `#include` directive (repeated inclusions are counted once). The included files were located heuristically: an `#include` was resolved by looking for the file relative to the directory of the including file and its parent directories (and their `include` subdirectories), then relative to the top directory, then by a unique match of the file name anywhere in the tree; system headers (e.g. `sys/...` or `endian.h`) and the generated `linux/version.h` were ignored, as were includes that could not be resolved. The paths were then simplified by removing architecture-, platform- and API-specific directory components (e.g. `arch/<arch>/`, `include/`, `asm/`, `uapi/`, `linux/`, `mach-*/`), so that several files with the same simplified path, such as the variants of the same header for different architectures, are merged into one node. Only files that include or are included by some file are part of the network. Since a file and a file it includes can be mapped to the same node, 530 nodes have self-loops.
+
+The network has the following properties:
+
+- Nodes: `name`, the simplified path of the file(s), which identifies the node; `files`, the list of the paths, relative to the top directory of the source tree, of the source files whose simplified path is that of the node (empty only for `config.h`, which is generated during the build)."""
+tags = ['Technological', 'Software', 'Unweighted', 'Metadata']
+url = 'https://www.kernel.org/'
+citation = [('J. Kunegis, "Linux." KONECT, the Koblenz Network Collection (2016)', 'https://doi.org/10.1145/2487788.2488173')]
icon_hash = '5840facf8cf714f319c4540e'
-upstream_prefix = 'http://konect.cc/files'
-files = [('download.tsv.linux.tar.bz2', None, 'konect')]
+upstream_license = ("GPL-2.0", "https://www.kernel.org/pub/linux/kernel/COPYING")
+upstream_prefix = 'https://www.kernel.org/pub/linux/kernel/v3.x'
+files = [('linux-3.16.tar.xz', None, None)]
+sha256sum = '4813ad7927a7d92e5339a873ab16201b242b2748934f12cb5df9ba2cfe1d77a0'
def fetch_upstream(force=False):
- return fetch_upstream_files(__name__.split(".")[-1], upstream_prefix, files,
- force)
+ # The tarball is checked against its checksum
+ name = __name__.split(".")[-1]
+ if not force:
+ try:
+ with open_upstream_file(name, "linux-3.16.tar.xz", "rb"):
+ return
+ except (FileNotFoundError, IOError):
+ pass
+ with open_url(f"{upstream_prefix}/linux-3.16.tar.xz") as f:
+ data = f.read()
+ if hashlib.sha256(data).hexdigest() != sha256sum:
+ raise RuntimeError("unexpected content for linux-3.16.tar.xz")
+ with open_upstream_file(name, "linux-3.16.tar.xz", "wb") as output:
+ output.write(data)
+
+# Reproduction of KONECT's extraction (konect-extr, extr/linux: mkall,
+# filter, mklinux)
+
+
+# KONECT's path filter (extr/linux/filter), applied to "file dep" lines
+FILTER = [
+ # Double dot
+ (r"/[^/ ]+/\.\./", "/"), (r"/[^/ ]+/\.\./", "/"), (r"/[^/ ]+/\.\./", "/"),
+ (r"/\.\./arm/", "/"), (r"/\.\./", "/"), (r"/\./", "/"),
+ # Remove combinations
+ (r"/mach-lantiq/falcon/", "/"), (r"/mach-lantiq/xway/", "/"),
+ (r"/drivers/dma/bestcomm/", "/"), (r"/dlm/cluster/", "/"),
+ (r"/clk/bcm/", "/"), (r"/soc/codecs/", "/"),
+ # Change combinations
+ (r"/([^ /]+)/\1", r"/\1"), (r"/([^ /]+)/\1/", r"/\1/"),
+ (r"/arch-[^ /]+/[^/ ]+/", "/"), (r"/arch/[^/ ]+/", "/"),
+ (r"/variant/[^/ ]+/", "/"), (r"/variants/[^/ ]+/", "/"),
+ (r"/platforms/[^/ ]+/", "/"), (r"/asm/[^/ ]+/", "/"),
+ (r"/staging/[^/ ]+/", "/"),
+ (r"/boot/compressed/sizes.h", "/include/linux/sizes.h"),
+ (r"/boot/libfdt.h", "/include/linux/libfdt.h"),
+ (r"/boot/zlib.h", "/include/linux/zlib.h"),
+ # Remove single directories
+ (r"/um/", "/"), (r"/arch/", "/"), (r"/uapi/", "/"), (r"/asm/", "/"),
+ (r"/asm-generic/", "/"), (r"/include/", "/"), (r"/uinclude/", "/"),
+ (r"/linux/", "/"), (r"/plat-[^ /]+/", "/"), (r"/plat/", "/"),
+ (r"/drivers/", "/"), (r"/dlmfs/", "/"), (r"/api/fs/", "/"),
+ (r"/lib-[^ /]+/", "/"), (r"/mach/", "/"), (r"/mach-[^ /]+/", "/"),
+ (r"/ath79/", "/"), (r"/variant/", "/"), (r"/cpu-[^ /]+/", "/"),
+ (r"/shared/", "/"), (r"/net/", "/"), (r"/proc-[^ /]+/", "/"),
+ (r"/unit-[^ /]+/", "/"), (r"/generated/", "/"), (r"/common-spar/", "/"),
+ (r"/cxgb./", "/"), (r"/arm/", "/"), (r"/tools/lib/", "/"),
+ (r"/tools/perf/", "/"),
+ # Change filenames
+ (r"_d\.h", ".h"),
+]
+FILTER = [(re.compile(a), b) for a, b in FILTER]
+
+def kfilter(s):
+ for a, b in FILTER:
+ s = a.sub(b, s)
+ return s
+
+# directories tried, in order, relative to the including file's directory
+# ("d") or to the top of the tree ("t")
+SEARCH = [("d", ""), ("d", "include/"), ("d", "core/include/"), ("d", "../"),
+ ("d", "../include/"), ("d", "../lib/"), ("d", "../util/"),
+ ("d", "../core/include/"), ("d", "../common-spar/include/"),
+ ("d", "../../"), ("d", "../../include/"), ("d", "../../lib/"),
+ ("d", "../../../"), ("d", "../../../include/"),
+ ("d", "../../../util/"), ("d", "../../../scsi/fnic/"),
+ ("t", "include/"), ("t", ""), ("t", "tools/include/"),
+ ("t", "tools/lib/"), ("t", "drivers/vhost/")]
+
+INC_Q = re.compile(r'\s*#\s*include\s+"([^"]*\.[ch])"')
+INC_A = re.compile(r'\s*#\s*include\s+<([^>]*\.[ch])>')
+
+def include_edges(fobj):
+ """Reproduce KONECT's extraction of #include dependencies from a Linux
+ source tarball (decompressed). Returns the list of (file, dep) pairs, with the paths as
+ written by KONECT's script (before filtering)."""
+ tf = tarfile.open(fileobj=fobj, mode="r|")
+ paths = {} # normalized path -> member type ('f', 'd', 'l')
+ links = {}
+ contents = {}
+ top = None
+ for m in tf:
+ name = m.name
+ if top is None:
+ top = name.split("/")[0]
+ if name == "pax_global_header":
+ continue
+ rel = "." + name[len(top):]
+ rel = rel.rstrip("/")
+ if m.isdir():
+ paths[rel] = "d"
+ elif m.issym():
+ paths[rel] = "l"
+ links[rel] = m.linkname
+ elif m.isfile():
+ paths[rel] = "f"
+ if re.search(r"\.[ch]$", rel):
+ contents[rel] = tf.extractfile(m).read()
+ def resolve(p, depth=0):
+ "Normalize a path, following symbolic links."
+ parts = p.split("/")
+ cur = parts[0]
+ for i, c in enumerate(parts[1:]):
+ if c == "..":
+ cur = posixpath.dirname(cur)
+ if cur == "":
+ return None
+ continue
+ if c == "." or c == "":
+ continue
+ nxt = cur + "/" + c
+ t = paths.get(nxt)
+ if t is None:
+ return None
+ if t == "l":
+ if depth > 10 or links[nxt].startswith("/"):
+ return None
+ nxt = resolve("./" + posixpath.normpath(posixpath.join(cur, links[nxt])),
+ depth + 1)
+ if nxt is None:
+ return None
+ elif t != "d" and i < len(parts) - 2:
+ return None
+ cur = nxt
+ return cur
+ def readable(p):
+ return resolve(p) is not None
+ by_base = collections.defaultdict(list)
+ for p in paths:
+ by_base[posixpath.basename(p)].append(p)
+ srcs = sorted(p for p in paths if re.search(r"\.[ch]$", p) and
+ paths[p] in ("f", "l"))
+ filtered_files = set(kfilter(p) for p in srcs) | {"./config.h"}
+ edges = []
+ for fname in srcs:
+ if paths[fname] == "l":
+ r = resolve(fname)
+ if r is None or r not in contents:
+ continue
+ data = contents[r]
+ else:
+ data = contents[fname]
+ lines = data.decode("latin1").split("\n")
+ deps = ([m.group(1) for m in map(INC_Q.match, lines) if m] +
+ [m.group(1) for m in map(INC_A.match, lines) if m])
+ dirn = posixpath.dirname(fname)
+ cache = {}
+ for dep in deps:
+ if dep == "linux/version.h":
+ continue
+ if re.match(r"(sys|netinet|elfutils)/", dep):
+ continue
+ if re.fullmatch(r"(endian|features|machine/endian).h", dep):
+ continue
+ file_dep = None
+ for base, d in SEARCH:
+ p = (dirn if base == "d" else ".") + "/" + d + dep
+ if readable(p):
+ file_dep = p
+ break
+ if file_dep is None:
+ dep_base = posixpath.basename(dep)
+ dep_san = re.sub(r"[.-]", "_", dep_base)
+ if dep_san in cache:
+ file_dep = cache[dep_san]
+ else:
+ if kfilter("./" + dep) in filtered_files:
+ file_dep = "./" + dep
+ elif kfilter(dirn + "/" + dep) in filtered_files:
+ file_dep = dirn + "/" + dep
+ else:
+ found = sorted(by_base.get(dep_base, []))
+ n = len(set(kfilter(p) for p in found))
+ if n == 0:
+ file_dep = ""
+ elif n == 1:
+ file_dep = found[0]
+ else:
+ # KONECT's script aborts the processing of
+ # the remaining includes of this file
+ break
+ cache[dep_san] = file_dep
+ if file_dep:
+ edges.append((fname, file_dep))
+ # the existing source files, and those of the edges, by simplified path
+ files = collections.defaultdict(set)
+ for p in srcs:
+ files[kfilter(p)].add(posixpath.normpath(p))
+ for e in edges:
+ for p in e:
+ if resolve(p) is not None:
+ files[kfilter(p)].add(posixpath.normpath(p))
+ return edges, files
@cache_network()
@coerce_props()
@@ -41,9 +241,22 @@ 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, "rb") as f:
+ edges, paths = include_edges(f)
+ g = Graph(directed=True)
+ g.vp.name = g.new_vp("string")
+ g.vp.files = g.new_vp("vector<string>")
+ vs = {}
+ elist = set()
+ for e in edges:
+ uv = []
+ for p in e:
+ k = kfilter(p)
+ if k not in vs:
+ v = vs[k] = g.add_vertex()
+ g.vp.name[v] = k[2:]
+ g.vp.files[v] = sorted(paths.get(k, []))
+ uv.append(int(vs[k]))
+ elist.add(tuple(uv))
+ g.add_edge_list(sorted(elist))
yield alt, g
Update copyright information 73a4f0d
diff --git a/entries/linux/__init__.py b/entries/linux/__init__.py
index 7b8dd63..376b8b6 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__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/linux/__init__.py b/entries/linux/__init__.py
index 1f0045e..7b8dd63 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__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/linux/__init__.py b/entries/linux/__init__.py
index 7d28d4f..1f0045e 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__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/linux/__init__.py b/entries/linux/__init__.py
index 6ff60aa..7d28d4f 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__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/linux/__init__.py b/entries/linux/__init__.py
index 32e49c5..6ff60aa 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -26,7 +26,6 @@ url = 'http://konect.cc/networks/linux'
citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'https://doi.org/10.1145/2487788.2488173')]
icon_hash = '5840facf8cf714f319c4540e'
upstream_prefix = 'http://konect.cc/files'
-orphan = True
files = [('download.tsv.linux.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Update citations to use DOIs e878874
diff --git a/entries/linux/__init__.py b/entries/linux/__init__.py
index c277872..32e49c5 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -23,7 +23,7 @@ description = """A network of Linux (v3.16) source code file inclusion. Nodes re
[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Technological', 'Software', 'Unweighted']
url = 'http://konect.cc/networks/linux'
-citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'http://konect.cc/networks/linux')]
+citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'https://doi.org/10.1145/2487788.2488173')]
icon_hash = '5840facf8cf714f319c4540e'
upstream_prefix = 'http://konect.cc/files'
orphan = True
Add support for 'orphan' datasets and tag konect entries e330b80
diff --git a/entries/linux/__init__.py b/entries/linux/__init__.py
index d7ce895..c277872 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -26,6 +26,7 @@ url = 'http://konect.cc/networks/linux'
citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'http://konect.cc/networks/linux')]
icon_hash = '5840facf8cf714f319c4540e'
upstream_prefix = 'http://konect.cc/files'
+orphan = True
files = [('download.tsv.linux.tar.bz2', None, 'konect')]
def fetch_upstream(force=False):
Change license from GPLv3 to AGPLv3 d754be5
diff --git a/entries/linux/__init__.py b/entries/linux/__init__.py
index cefa507..d7ce895 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__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/linux/__init__.py b/entries/linux/__init__.py
index 4b96ee7..cefa507 100644
--- a/entries/linux/__init__.py
+++ b/entries/linux/__init__.py
@@ -19,7 +19,8 @@
from .. import *
title = "Linux source inclusions (v3.16)"
-description = "A network of Linux (v3.16) source code file inclusion. Nodes represent source files and a directed edge indicates if one file includes another."
+description = """A network of Linux (v3.16) source code file inclusion. Nodes represent source files and a directed edge indicates if one file includes another.[^icon]
+[^icon]: Description obtained from the [ICON](https://icon.colorado.edu) project."""
tags = ['Technological', 'Software', 'Unweighted']
url = 'http://konect.cc/networks/linux'
citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'http://konect.cc/networks/linux')]
Initial commit cc85872
diff --git a/entries/linux/__init__.py b/entries/linux/__init__.py
new file mode 100644
index 0000000..4b96ee7
--- /dev/null
+++ b/entries/linux/__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 = "Linux source inclusions (v3.16)"
+description = "A network of Linux (v3.16) source code file inclusion. Nodes represent source files and a directed edge indicates if one file includes another."
+tags = ['Technological', 'Software', 'Unweighted']
+url = 'http://konect.cc/networks/linux'
+citation = [('J. Kunegis, “Linux." KONECT, the Koblenz Network Collection (2016)', 'http://konect.cc/networks/linux')]
+icon_hash = '5840facf8cf714f319c4540e'
+upstream_prefix = 'http://konect.cc/files'
+files = [('download.tsv.linux.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