ontometer_corpus.steps.ontology_dates¶
First-evidence dates: when each ontology in the entity network is first attested.
Per release family (ontometer_corpus.versions), the earliest date any of
these sources attests to:
d_registry— the earliest release date recorded for the family, or for any corpus row, in any registry, declaring the same ontology IRI;d_archive— the Internet Archive's first capture of the ontology IRI (CDX API;ontometer_corpus.dating.archive_candidates); Ontohub rows without an IRI use their repository page;d_wikidata— inception (P571) or publication date (P577) of the Wikidata item that Open Knowledge Graphs links to.
Every source is an upper bound on the birth date (see
ontometer_corpus.dating); birth is their minimum and birth_source
names the source that set it. The network sources are queried once and cached
in <corpus>/dating_cache.jsonl, which is tracked: the archive and
Wikidata can change their answers, so the cache is the record that makes the
table reproducible. With it, --offline rebuilds the same table without
the network.
Reads: <corpus>/corpus.db and $ONTOMETER_STORE/cache/entity_ontologies.parquet.
Writes: <corpus>/ontology_dates.parquet, one row per release family,
and appends new lookups to <corpus>/dating_cache.jsonl.
Runs after: ontometer-corpus entity-network.
Needs --store (or $ONTOMETER_STORE).
Usage
ontometer-corpus dates --store /path/to/ontologies ontometer-corpus dates --store /path/to/ontologies --offline
An online run that cannot finish its lookups writes nothing and exits 75;
rerun to resume. --offline --allow-uncached builds from the cache alone
and marks families with absent lookups lookups_complete = False.
Attributes¶
CDX_URL = 'https://web.archive.org/cdx/search/cdx'
module-attribute
¶
WIKIDATA_SPARQL = 'https://query.wikidata.org/sparql'
module-attribute
¶
USER_AGENT = 'ontometer-corpus (+https://github.com/growgraph/ontometer-corpus)'
module-attribute
¶
EXIT_INCOMPLETE = 75
module-attribute
¶
Classes¶
Functions:¶
build(paths, offline, workers, delay, allow_uncached=False)
¶
Write ontology_dates.parquet; False when archive lookups are incomplete.
Source code in ontometer_corpus/steps/ontology_dates.py
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 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
main(offline, workers, delay, allow_uncached, paths)
¶
First-evidence date of each ontology family.