ontometer_corpus.network.entities¶
Term-level ownership and edge authority across the corpus.
The ontology network resolves reuse by namespace; entity-level metrics need the finer question of who is entitled to assert what about a term.
Home. A term's home is the ontology that owns its namespace. Every ontology that declares terms in a namespace claims it, and claims collide: a file that copies GO terms into itself (MIREOT, or a baked import closure) declares them just as GO does. Collisions are settled in order by
- the ontology whose own IRI names the namespace (
…/obo/go.owlowns…/obo/GO_and OBO sub-namespaces such as…/obo/go/subsets#;http://xmlns.com/foaf/0.1/owns…/foaf/0.1/), the one declaring most if several do. A narrow exception lets a dominant SKOS concept scheme win only when that named claimant declares nothing in the namespace; - otherwise a dominant declarer: the claimant declaring at least
DOMINANCEtimes as many terms in the namespace as any other claimant. An ontology whose file declares no IRI still owns its ID prefix when copiers hold only a small share of its terms.
A namespace with no claimant, contested with no dominant claimant, or classified
as a representation language or metadata/identifier infrastructure
(reference_kind) is homed outside the corpus. That is the right answer for namespaces that are no
ontology's (ORCID iDs and DOIs declared as individuals, licence URLs) and for
vocabularies outside the corpus that several files copy from (DBpedia
resources): giving them to the largest copier would credit it with every use.
Registry provenance plays no part: a copier listed by the "right" registry
would otherwise beat the real owner listed elsewhere.
Edge authority. A subclass edge (c, p) asserted in ontology O is
- own when
Oisc's home — the ontology is speaking about its own class. Ifpis homed elsewhere this is a foreign specialisation:Obuilds under someone else's class, the signal thatpis general enough to be reused. - bridge when
pis homed inObutcis not —Ofiles a foreign class under one of its own (typical of alignment modules). - copy otherwise —
Orepeats an edge between terms it owns neither end of, which is what an import closure looks like on disk. Copies are never counted as reuse.
Attributes¶
EDGE_OWN_INTERNAL = 0
module-attribute
¶
EDGE_OWN_FOREIGN = 1
module-attribute
¶
EDGE_BRIDGE = 2
module-attribute
¶
EDGE_COPY = 3
module-attribute
¶
EDGE_KIND_NAMES = ('own_internal', 'own_foreign', 'bridge', 'copy')
module-attribute
¶
EXTERNAL = -1
module-attribute
¶
DOMINANCE = 10
module-attribute
¶
Classes¶
Claimant
dataclass
¶
One ontology's claim on a namespace.
Source code in ontometer_corpus/network/entities.py
NamespaceOwnerRecord
dataclass
¶
One corpus row participating in namespace-home resolution.
Source code in ontometer_corpus/network/entities.py
Attributes¶
owner
instance-attribute
¶
ontology_iri
instance-attribute
¶
source_registry
instance-attribute
¶
own_namespaces
instance-attribute
¶
declarations
instance-attribute
¶
skos_concepts
instance-attribute
¶
Methods:¶
__init__(owner, ontology_iri, source_registry, own_namespaces, declarations, skos_concepts)
¶
Functions:¶
iri_names_namespace(ontology_iri, ns)
¶
Whether an ontology's own IRI identifies ns as its namespace.
Besides an exact match, an OBO ontology (…/obo/ro.owl) names its ID
prefix (…/obo/RO_) and every namespace under its PURL folder
(…/obo/ro/subsets#, …/obo/ro#). A missing IRI may arrive as None
or, from a pandas column, as NaN.
Source code in ontometer_corpus/network/entities.py
curating_registry(ns)
¶
The registry that curates namespace ns: "OBO" for OBO PURL prefixes, else "LOV".
Used to break exact ties between copies of one ontology from several registries (dedup Pass D); it plays no part in namespace ownership.
Source code in ontometer_corpus/network/entities.py
pick_home(ns, claimants)
¶
The home ontology of namespace ns among its claimants, or EXTERNAL.
Source code in ontometer_corpus/network/entities.py
resolve_namespace_owners(records)
¶
Resolve namespace keys to corpus-row owners using :func:pick_home.
This is the single ownership authority for dependency edges and term-level reuse measures. A result omits unresolved namespaces, which consumers should treat as external.
Source code in ontometer_corpus/network/entities.py
classify_edges(onto, home_child, home_parent)
¶
Edge-authority code per (child, parent) edge asserted in onto.