ontometer_corpus.steps.entity_network¶
The term-level network: homes, edge authority, term-document table.
Terms are interned to integer ids, each namespace is given a home ontology,
and every asserted subclass edge is classified by authority (see
ontometer_corpus.network.entities).
<corpus>/corpus.db (one ontology per release family, its latest
release), <corpus>/network_nodes.parquet (to attach network node
ids), and for every ontology its structural sidecar under
$ONTOMETER_STORE/cache/structure/v<N>/ (subclass edges, declarations) and, where
ontometer-corpus entity-roles produced one, its role table under
$ONTOMETER_STORE/cache/roles/v<N>/ (class/instance usage, labels).
Runs after: ontometer-corpus process, then the network construction
(uv run ontometer-corpus network), and optionally
ontometer-corpus entity-roles. Without role tables it still runs, with roles
inferred from the sidecars alone (see below).
Needs --store (or $ONTOMETER_STORE).
Writes, under $ONTOMETER_STORE/cache/:
entity_ontologies.parquet one row per ontology (index ``onto``)
entity_terms.parquet term id, IRI, namespace, home ontology
entity_edges.parquet (onto, child, parent, kind) per asserted edge
entity_docs.parquet (onto, term, flags) — which terms each ontology
uses and in which roles (bit flags below)
entity_labels.parquet (onto, term, label)
Flag bits in entity_docs: 1 declared class, 2 declared individual, 4 declared property, 8 class role, 16 instance role. Where no role table exists (the file exceeded the role pass's size guard, or failed it), roles are inferred from the sidecar alone: declared classes and subclass endpoints are class roles, declared individuals instance roles.
Usage
ontometer-corpus entity-network --store /path/to/ontologies
Attributes¶
Classes¶
Interner
¶
Source code in ontometer_corpus/steps/entity_network.py
Functions:¶
build(paths)
¶
Source code in ontometer_corpus/steps/entity_network.py
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
main(paths)
¶
Term-level homes, edge authority and term-document table.