ontocast.tool.ontology_validation.label_repair¶
LLM-free labels for newly minted ontology terms.
A minted term the model left unlabelled almost always has a readable local
name (ResearchProject, hasHTTPHeader). Its label is that name split
into words, so deriving it costs nothing and spares the critic a call whose
only fix would be the label. An opaque local name (Q42, a hash) carries no
words; it is left unlabelled and the missing_label finding still fires.
Attributes¶
__all__ = ['derive_missing_labels', 'label_from_local_name']
module-attribute
¶
Classes¶
Functions:¶
derive_missing_labels(inserts, snapshot_graph, known_terms=frozenset())
¶
The rdfs:label triples the delta's unlabelled minted terms are missing.
Covers every class or property the delta declares that has no label in the
delta or the snapshot and whose local name has words. A term of a
well-known vocabulary or of the catalog (known_terms) is never minted
here: an axiom on it is a reuse, and its labels are its owner's.
Returns:
| Type | Description |
|---|---|
RDFGraph
|
A graph of the label triples to insert, empty when none is missing. |
Source code in ontocast/tool/ontology_validation/label_repair.py
label_from_local_name(local)
¶
A readable label for a local name, or None when it has no words.
Acronyms keep their capitals, other words are lower-cased, and a name that
starts with a capital (a class) keeps a capital first letter:
ResearchProject gives "Research project", hasHTTPHeader gives
"has HTTP header".