Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
merge: the clash-rule count is seventeen, and dt-not-type is inexpressible here
FABIOTESSac652071819a
diff --cc CHANGELOG.mdindex 51af58b1,27d5899f..c05b38b4--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -152,93 -20,21 +152,108 @@@ All notable changes to Open Ontologiestrace. See docs/lean-certificates.md and decision 0002.### Fixed+- **An ASSERTED role edge skipped its `rdfs:domain` and `rdfs:range`, so an+ inconsistent ABox was reported consistent.** Domain and range are deliberately+ not GCIs: as `∃p.⊤ ⊑ D` and `⊤ ⊑ ∀p.R` they put a disjunction on every node,+ and hqdm.owl alone carries 525 of them, so they are held as role metadata and+ applied when an edge is created. Two places create an edge and only one+ consulted that metadata. `Tableau::create_successor` applied it; the ABox+ builder wrote asserted role assertions, and the inverse back-edges it+ materialises for them, straight into the edge map. Every other role-sensitive+ rule reads edges through `successors()` and so was unaffected, which is why+ exactly these two constraints were weaker on an asserted edge than on a+ generated one. The consequence was a false clean: an ontology whose only+ contradiction is that an asserted edge forces its subject into a class+ disjoint from one it already carries came back `consistent: true` with+ `undecided: false`, the strongest answer the checker can give. Both paths now+ go through one `Tableau::add_role_edge` primitive. It also applies the+ constraints stated on the role's INVERSE, which NEITHER path applied before:+ `a r b` entails `b r⁻ a`, so `r⁻`'s domain binds `b` and its range binds `a`,+ and a symmetric role is its own inverse and rides the same clause. Found by+ the model-certificate layer, which had been refusing to certify these+ completion graphs because they are not models of the range axiom;+ `tests/dl_model_certificate_test.rs` pinned the defect and now pins the+ repair.+- **GCIs did not reach an individual named only as the object of a role+ assertion.** The ABox builder gives the GCIs to every typed individual and+ `create_successor` gives them to every generated successor, but an IRI that+ appears only as an edge's object got a bare node carrying nothing but its own+ nominal. A GCI holds of every element of the domain, so that node was a hole+ the check could not see into, and an ABox whose only contradiction landed+ there was reported consistent. Same shape as the domain/range split, found in+ the sweep for it.+- **The CLIF export produced files that parse cleanly and yield NOTHING.**+ Every sentence was emitted as `(cl:comment '...' SENTENCE)`, the shape+ ISO/IEC 21838-2's BFO files use. Measured against both CLIF parsers that+ exist, that form is discarded: py-typedlogic returns an empty theory and+ Macleod has no production for it, and both do the same to BFO's own files. A+ file that is formally valid and practically empty is the assurance-laundering+ shape this project exists to attack, and it was in this project's own output.+ The default is now a standalone `(cl:comment '...')` phrase followed by a+ bare sentence, which py-typedlogic reads back at exactly the count the+ exporter reports (7, 161, 251, 107 and 705 sentences over five ontologies);+ `--clif-comments wrapped` keeps the old shape and the docs say what it costs.+- **CLIF comment strings were double-quoted, and quote style was bound to+ operator spelling so no flag combination could emit conforming CLIF.**+ ISO/IEC 24707 A.2.2.2 makes the single quote the string delimiter. The choice+ had been justified by matching the CLIF files ISO hosts for ISO/IEC 21838-2,+ and that corpus has been withdrawn by its own maintainers: BFO's release+ notes of 7 December 2025 say "Comment texts are surrounded by single, not+ double quotes". The ISO-hosted files carry 369 double-quoted `cl:comment`+ forms; BFO master carries 356 single-quoted and none double-quoted. Comment+ strings are now single-quoted in both dialects and the two settings are+ independent.+- **The CLIF text was unnamed.** All 227 COLORE texts are named, Macleod+ refuses an unnamed one with "Error in ontology: bad URI", and py-typedlogic+ otherwise reports the first comment as the theory's name. The text now+ carries the ontology's own `owl:Ontology` IRI where it declares one, written+ bare because Macleod's lexer has no double-quote token.+- **Two false claims in the first-order export docs.** They said a CLIF file in+ one dialect's spelling does not parse in the other's tools; py-typedlogic+ maps both spellings to identical results with identical sentence counts. They+ also implied Macleod reads the `colore` output; it reads neither, because it+ cannot lex an IRI in a symbol position at all. Both are corrected and the+ measurements are in docs/first-order-export.md.+- **A property characteristic overrode an explicit `owl:DatatypeProperty`+ declaration in the first-order export.** FOAF declares `foaf:msnChatID` as+ both `owl:DatatypeProperty` and `owl:InverseFunctionalProperty`, which OWL 2+ DL forbids and RDF-serialised vocabularies assert anyway. The characteristic+ won, so the property was exported as an object property throughout and every+ axiom about it used the wrong symbol. `OwlP2` is a disjoint sum, so `op:p`+ and `dp:p` are unrelated predicates and the difference is not cosmetic. The+ declaration now wins and a characteristic on a data property is dropped and+ named. Found by `tools/fol_differential.py` on its first real run.+- **The goal builder did not map `owl:Thing` and `owl:Nothing`, and did not+ consult the entity-kind classification.** A derived triple+ `X rdfs:subClassOf owl:Thing` became a subsumption under an atomic class+ symbol occurring in no axiom rather than under the translation's `top`, and a+ goal about a data property asked about `op:p` while the axioms spoke about+ `dp:p`. Fifty-two of FOAF's 181 claimed entailments came back as+ disagreements that were entirely this; the remaining six were the+ declaration-versus-characteristic defect above. Also found by the+ differential.+- **The differential exported from the store the reasoner had just materialised+ into**, so every conjecture was entailed by the theory already stating it and+ the run could not fail. A deliberately broken exporter still scored clean+ under it. The reasoner and the exporter now run against separate stores, the+ export loads the certificate's own `asserted.tsv` so the two see the same+ graph down to the blank node labels, and a triple-count mismatch aborts the+ run rather than reporting a differential that cannot fail.+ - **The refutation layer counted the OWL 2 RL rules that conclude `false` as+ sixteen, and there are seventeen.** The missing one is `dt-not-type`, from+ Table 8 of OWL 2 Profiles, and the undercount reached a consumer: `oo-refute+ check` told a caller whose refutation was rejected that "fifteen other OWL 2+ RL clash rules have no condition in this checker", one fewer than the truth.+ `lean/OOCert/Refute.lean` now carries the full list with the W3C table each+ rule comes from, so the number can be re-counted rather than trusted, and it+ states the split the number hides: of the sixteen this checker does not+ implement, fifteen are expressible here and simply absent, while+ `dt-not-type` cannot be stated at all, because `OOCert.Semantics` has no+ datatype value space and says so. That is the same ground on which+ `src/reason.rs` keeps the whole `dt-*` family out of the engine, and the+ reason is now written where the count is instead of being inferable from+ another file. Prose and one report string only; no theorem changed, and the+ checker still implements exactly `cax-dw`.- **`sh:sparql` ignored `sh:prefixes` and merged every `sh:declare` in theshapes graph into one prologue.** A prefix bound to two namespaces emittedtwo `PREFIX` lines, SPARQL took the last, and which one won was decided by