ontometer_corpus.network.redeclarations¶
Class labels declared in many ontologies, and how far one parent unites them.
A label such as person or event that several ontologies each declare as a
class of their own is a candidate gap in the fabric: either one shared
abstraction already covers those declarations, or each ontology modelled the
concept again on its own. For every normalised label declared as an own class
in at least min_homes home ontologies, :func:redeclared_labels reports the
best cover: the largest share of those declarations that sit under one
common ancestor in the term DAG (a term covers itself). 1 means one class
already unites every declaration; 1/n means none does.
Matching is lexical, so one label is not proven to be one concept. Copy edges are left out of the ancestry unless the copied child is homed outside the corpus, as everywhere else: a copied hierarchy is not a shared abstraction.
Attributes¶
MIN_LABEL_LENGTH = 3
module-attribute
¶
ANCESTOR_CAP = 5000
module-attribute
¶
EXAMPLES = 4
module-attribute
¶
Functions:¶
norm_label(label)
¶
Lower case, underscores and runs of space folded to one space, punctuation dropped.
term_labels(labels, home)
¶
One normalised label per term, preferring the label its home ontology gives.
labels has columns onto, term, label; home maps term to
home ontology. Returns columns term, norm.
Source code in ontometer_corpus/network/redeclarations.py
redeclared_labels(terms, labels, edges, min_homes=3)
¶
Label groups declared as an own class in at least min_homes homes, with their cover.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
terms
|
DataFrame
|
one row per term, positioned by term id ( |
required |
labels
|
DataFrame
|
|
required |
edges
|
DataFrame
|
|
required |
min_homes
|
int
|
the smallest number of distinct home ontologies in a group. |
3
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per label, most homes first: |
DataFrame
|
|
DataFrame
|
declarations) and |