ontometer_corpus.rebuild¶
Rebuild every derived corpus table, from parse to the G(t) export.
Steps, in order: verify parse dedup term_coupling network structural_metrics ontology_metrics roles entity_network abstractness redeclarations panel_select panel_roles panel_measure dates growth validation growth_viz index.
verify checks the object store against objects.tsv by size and stops the run
if an object is missing (skipped when there is no index yet); index rewrites
objects.tsv from the rebuilt corpus.db. Both are offline.
Fetch is never run: a new crawl is a different corpus. Each step runs in its own
process (python -m ontometer_corpus <command>) with --corpus / --store
passed through. dates exits 75 when the web archive leaves lookups unanswered; the
lookups made so far are cached, so --from dates resumes, and --offline rebuilds
from the cache alone, failing if a lookup is missing.
--local rebuilds from the corpus directory and object store with no network at
all: every step runs in a bubblewrap sandbox without a network, and dates come from
the cache, a missing lookup counting as no evidence. Files that load a remote JSON-LD
context fail to read and are reported by their step. validation runs only with
--validation NORMS.tsv.
Attributes¶
STEPS = ('verify', 'parse', 'dedup', 'term_coupling', 'network', 'structural_metrics', 'ontology_metrics', 'roles', 'entity_network', 'abstractness', 'redeclarations', 'panel_select', 'panel_roles', 'panel_measure', 'dates', 'growth', 'validation', 'growth_viz', 'index')
module-attribute
¶
INCOMPLETE = 75
module-attribute
¶
Classes¶
Rebuild
¶
One rebuild run: the selected steps and how each is invoked.
Source code in ontometer_corpus/rebuild.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
Attributes¶
out = out
instance-attribute
¶
reparse = reparse
instance-attribute
¶
offline = offline
instance-attribute
¶
local = local
instance-attribute
¶
norms = norms
instance-attribute
¶
path_args = path_args
instance-attribute
¶
dry_run = dry_run
instance-attribute
¶
sandbox = [bwrap, '--dev-bind', '/', '/', '--unshare-net'] if local else []
instance-attribute
¶
Methods:¶
__init__(out, reparse, offline, local, norms, path_args, dry_run, bwrap)
¶
Source code in ontometer_corpus/rebuild.py
command(*args)
¶
run(*args)
¶
check(*args)
¶
step(name)
¶
Source code in ontometer_corpus/rebuild.py
Functions:¶
main(out, first, last, reparse, offline, local, norms, corpus, store, dry_run)
¶
Rebuild every derived corpus table, from parse to the G(t) export.