ontocast.tool.ontology_validation.unit_findings¶
Deterministic per-unit findings on a unit's ontology delta.
Everything here runs against the unit's net insert/delete delta
(:meth:~ontocast.onto.unit_states.UnitOntologyState.build_delta), never the
whole working graph: the working graph is snapshot + delta, so validating
it would test the shared catalog context against itself and attribute every
pre-existing third-party defect to this unit. Two facts-side rules are
deliberately absent for the same reason:
UNKNOWN_TERMis semantically inverted here — minting new terms in a writable namespace is the ontology renderer's entire job;- connectivity is not checked — a per-unit delta is by construction a few
terms connecting to the snapshot rather than to each other, and the
document-level
STRUCTURAL_CHECKnode already owns that concern where the context exists.
collect_ontology_unit_findings(*, inserts, deletes, snapshot_graph, merged_graph=None, fact_namespaces=(), policy=None)
¶
Assemble all deterministic findings for one unit's ontology delta.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inserts
|
RDFGraph
|
Net new triples this unit adds ( |
required |
deletes
|
RDFGraph
|
Snapshot triples this unit removes. |
required |
snapshot_graph
|
RDFGraph | None
|
The prompt ontology context; |
required |
merged_graph
|
RDFGraph | None
|
|
None
|
fact_namespaces
|
Sequence[str]
|
Facts/document namespaces; ontology terms minted there are mandatory findings. |
()
|
policy
|
ValidationPolicy | None
|
Deployment namespace exemptions; |
None
|
Returns:
| Type | Description |
|---|---|
list[OntologyUnitFinding]
|
Findings, mandatory first is not guaranteed — order follows the |
list[OntologyUnitFinding]
|
check sequence; callers filter on |
Source code in ontocast/tool/ontology_validation/unit_findings.py
count_fixes_targeting_snapshot(fixes, snapshot_graph, insert_subjects)
¶
Critic fixes aimed at catalog content this unit's delta never touched.
The ontology critic is shown snapshot + delta and can reject a unit
for pre-existing catalog defects the renderer cannot own. This counts the
proposed fixes whose incorrect_value names a snapshot-declared subject
absent from the unit's inserts — by full-IRI or prefixed-name substring
match, so it is a lower bound, recorded as telemetry rather than used for
control flow.