ontocast.tool.facts_validation.term_verdict¶
Whether a predicate or class IRI is acceptable, decided without messages.
Classes¶
TermVerdict
¶
Bases: BaseModel
A term judged unacceptable.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
TermVerdictKind
|
The reason. |
term |
str
|
The IRI judged. |
vocabulary_title |
str | None
|
The well-known vocabulary's name, for
|
Source code in ontocast/tool/facts_validation/term_verdict.py
TermVerdictKind
¶
Bases: StrEnum
Why a term is not acceptable.
Source code in ontocast/tool/facts_validation/term_verdict.py
Attributes¶
CLOSED_NAMESPACE_MISSING = 'closed_namespace_missing'
class-attribute
instance-attribute
¶
NON_CATALOG_STRICT = 'non_catalog_strict'
class-attribute
instance-attribute
¶
PLACEHOLDER_NAMESPACE = 'placeholder_namespace'
class-attribute
instance-attribute
¶
WELL_KNOWN_MISSING = 'well_known_missing'
class-attribute
instance-attribute
¶
Functions:¶
term_verdict(text, *, catalog_terms, known_terms, fallback_terms, declared_namespaces, catalog_namespaces, standard_namespaces, vocabulary)
¶
Judge one predicate or class IRI against the catalog.
Placeholder namespaces are rejected first. A catalog, known or fallback term passes, and so does a term of a well-known vocabulary that has it. A term the vocabulary lacks is rejected even with an empty catalog; the remaining verdicts need a catalog and leave standard namespaces alone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The IRI. |
required |
catalog_terms
|
Set[str]
|
Terms of the retrieved catalog. |
required |
known_terms
|
Set[str]
|
Terms of the whole catalog. |
required |
fallback_terms
|
Set[str]
|
Sanctioned fallback vocabulary that always passes. |
required |
declared_namespaces
|
Set[str]
|
Namespaces the catalog closes. |
required |
catalog_namespaces
|
Set[str]
|
Namespaces the catalog declares or borrows from. |
required |
standard_namespaces
|
tuple[str, ...]
|
Namespace prefixes of standard vocabularies. |
required |
vocabulary
|
Literal['strict', 'open']
|
|
required |
Returns:
| Type | Description |
|---|---|
TermVerdict | None
|
The verdict, or |