ontometer_corpus.registries¶
Which registry an ontology belongs to.
A corpus row's source_registry is the registry that row was fetched from.
For an ontology held by several registries, dedup keeps one latest copy, and
which registry that copy came from depends on registration dates: the newest
copy of FOAF sits on BioPortal, that of BFO on OKG. Grouping ontologies by
source_registry therefore credits them to registries that merely mirror
them.
The home registry is the answer used for any per-registry statistic. It is
OBOfor an ontology whose IRI is an OBO PURL, whichever registry the corpus got it from; otherwise- the first registry in :data:
REGISTRY_PRIORITYamong those holding a copy of it -- the same file, or the same ontology IRI (:func:iri_key).
The priority puts the curated, focused libraries before the portals and the portals before the general-purpose collections.
Attributes¶
REGISTRY_PRIORITY = ('OBO', 'LOV', 'BioPortal', 'AgroPortal', 'BiodivPortal', 'MatPortal', 'TechnoPortal', 'OntoPortal-Astro', 'Ontohub', 'OKG')
module-attribute
¶
Functions:¶
iri_key(iri)
¶
Match key for an ontology IRI: its scheme and trailing / or #
removed, so http://schema.org/ and https://schema.org are one
ontology.
is_obo_purl(iri)
¶
home_registry(ontology_iri, hosts)
¶
The home registry of an ontology held by the registries in hosts.
Source code in ontometer_corpus/registries.py
home_registry_sql(conn)
¶
SQL expression for a row's home registry: the column dedup writes, or
source_registry in a database dedup has not yet given one.
Source code in ontometer_corpus/registries.py
hosted_on(conn)
¶
Per corpus row id, every registry holding a copy of that ontology.
Copies are rows with the same file, or with the same ontology IRI. An IRI
that dedup marked shared_iri names several distinct ontologies, so
such a row is matched by its file only.
Source code in ontometer_corpus/registries.py
assign_home_registries(conn)
¶
Write corpus_registry.home_registry for every row. Returns how many
latest rows have a home registry other than their source_registry.