Skip to content

Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.

feat: hierarchy enforce pack + IES Common benchmark in README

FABIOTESSa827e449fd47
diff --git a/README.md b/README.md
index 3fc38a06..5058e29f 100644
--- a/README.md
+++ b/README.md
@@ -502,6 +502,65 @@ onto_load benchmark/generated/ies-building-extension.ttl
onto_align <other-ontology.ttl>
```
+### Hierarchy Enforcement — Automated Inference Improvement
+
+The `hierarchy` enforce pack detects flat spots in any ontology and suggests intermediate grouping classes. This is the same process used to deepen the building extension — now codified as a repeatable tool:
+
+```text
+onto_load my-ontology.ttl
+onto_enforce --pack hierarchy
+# → flags classes with >5 direct children
+# → reports max depth, avg depth, hierarchy density
+```
+
+Tested on IES Common (513 classes), the tool found 24 flat spots. A clean-room agent — with no prior context — proposed 38 intermediate grouping classes based solely on the domain meaning of the flagged children:
+
+```mermaid
+graph LR
+ subgraph Before["IES Common — before"]
+ EP1[EventParticipant] --> P1["Prosecutor"]
+ EP1 --> P2["Observer"]
+ EP1 --> P3["Driver"]
+ EP1 --> P4["Supplier"]
+ EP1 --> P5["WeaponLocation"]
+ EP1 --> P6["...52 direct children"]
+ end
+
+ subgraph After["IES Common — after hierarchy enforce"]
+ EP2[EventParticipant] --> R[RoleInEvent]
+ EP2 --> L[LocationInEvent]
+ EP2 --> A[AssetInEvent]
+ R --> LR2[LegalRole]
+ R --> IR[InvestigativeRole]
+ R --> CR[CommercialRole]
+ LR2 --> Q1["Prosecutor"]
+ LR2 --> Q2["Signatory"]
+ IR --> Q3["Observer"]
+ IR --> Q4["Investigator"]
+ CR --> Q5["Supplier"]
+ CR --> Q6["Negotiator"]
+ L --> Q7["WeaponLocation"]
+ L --> Q8["TargetLocation"]
+ A --> Q9["VehicleUsed"]
+ end
+
+ style EP1 fill:#e94560,color:#fff
+ style EP2 fill:#1a1a2e,color:#fff
+ style R fill:#16213e,color:#fff
+ style L fill:#16213e,color:#fff
+ style A fill:#16213e,color:#fff
+ style LR2 fill:#0f3460,color:#fff
+ style IR fill:#0f3460,color:#fff
+ style CR fill:#0f3460,color:#fff
+```
+
+| Metric | Before | After | Change |
+| --- | ---: | ---: | ---: |
+| Classes | 513 | 551 | +38 |
+| RDFS inferred | 3,094 | 3,422 | **+328 (+10.6%)** |
+
+The same tool, applied to any ontology, produces the same kind of improvement. The intermediate classes emerge from domain knowledge — not from reference to any other implementation.
+
### Further Reading
| Topic | Link |