ontometer_corpus.steps.process¶
Corpus processing: seed, parse, deduplicate.
Runs after the fetch step (ontometer-corpus fetch), which writes the object
store and manifest.jsonl. Three phases over the corpus registry, each
idempotent and resume-safe, so running a subset of phases is a normal
operation:
Phase 0 seed manifest.jsonl -> corpus_registry + fetch_attempts
tables in <corpus>/corpus.db
Phase 1 parse raw files -> parse columns of corpus_registry (triple/
class/property counts, identity, imports, content hash,
namespaces) plus one structural sidecar per raw file hash
under <store>/cache/structure/v<N>/
Phase 2 dedup Pass 0 (file hash), Pass A (IRI + explicit version IRI),
and corroborated Pass B matches set is_duplicate /
canonical_entry_id; unversioned content-hash matches are
retained as possible distinct releases.
Pass C sets is_latest_version per release family; Pass D
keeps one latest row per ontology IRI across registries and
sets shared_iri where an IRI covers several ontologies.
Rows excluded from Pass B are logged to
<corpus>/dedup_exclusions.log
Phase 1 reads the raw files and Pass D the structural sidecars, so both need
--store; without it, dedup skips Pass D with a warning.
The dependency network is built downstream from corpus.db and the structural
sidecars — see ontometer-corpus network.
Usage
ontometer-corpus process ontometer-corpus process --phases parse --sequential ontometer-corpus process --corpus /tmp/run1 --store /path/to/store
Attributes¶
PHASES = ('seed', 'parse', 'dedup')
module-attribute
¶
Classes¶
Functions:¶
main(phases, sequential, batch_size, max_workers, reparse, paths)
¶
Seed, parse and deduplicate the ontology corpus.
Source code in ontometer_corpus/steps/process.py
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |