ontometer_corpus.paper.comparators¶
Reuse networks of other kinds, to set the corpus's reuse inequality against.
Part of the resource paper's analysis. Each comparator is a public dependency or link list in which a node, like an ontology, is built by one party and reused by others:
cran
CRAN packages; A -> B when A lists B under Depends, Imports or
LinkingTo.
debian
Debian binary packages of one release (main, amd64); A -> B when
A lists B under Depends or Pre-Depends (the first alternative of a
choice; a virtual package resolves to its first provider).
lod
The Linked Open Data cloud's datasets; A -> B when A declares links
to B.
Edges point from the user to the used, as in the corpus's reuse network, so a node's in-degree is how many others reuse it. Only edges between two listed nodes are kept, each once, without self-loops.
fetch downloads each source once into <dir>/raw/ and records its URL,
retrieval date, size and SHA-256 in <dir>/manifest.json; a file already
there is kept, so the comparison stays on one snapshot. load reads the raw
files only.
Usage
ontometer-corpus paper comparators fetch --dir DIR ontometer-corpus paper comparators summary --dir DIR
Attributes¶
DEBIAN_RELEASE = 'trixie'
module-attribute
¶
SOURCES = {'cran': ('https://cran.r-project.org/src/contrib/PACKAGES', 'cran-PACKAGES'), 'debian': (f'https://deb.debian.org/debian/dists/{DEBIAN_RELEASE}/main/binary-amd64/Packages.xz', f'debian-{DEBIAN_RELEASE}-Packages.xz'), 'lod': ('https://lod-cloud.net/lod-data.json', 'lod-data.json')}
module-attribute
¶
LABELS = {'cran': 'CRAN packages', 'debian': 'Debian packages', 'lod': 'LOD cloud datasets'}
module-attribute
¶
LOADERS = {'cran': load_cran, 'debian': load_debian, 'lod': load_lod}
module-attribute
¶
Classes¶
ReuseNetwork
dataclass
¶
Nodes and distinct user -> used edges between them.
Source code in ontometer_corpus/paper/comparators.py
Functions:¶
load_cran(path)
¶
Source code in ontometer_corpus/paper/comparators.py
load_debian(path)
¶
Source code in ontometer_corpus/paper/comparators.py
load_lod(path)
¶
Source code in ontometer_corpus/paper/comparators.py
load(directory)
¶
Every comparator whose raw file is in <directory>/raw.
Source code in ontometer_corpus/paper/comparators.py
main()
¶
fetch(directory)
¶
Download every source not yet in DIR/raw and record it in DIR/manifest.json.
Source code in ontometer_corpus/paper/comparators.py
summary(directory)
¶
Nodes, edges and the share never reused, per comparator.