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.

Correct the claims the docs made about the engine, and stop dropping node constraints

FABIOTESS55abe976c6e2
diff --git a/.cargo/audit.toml b/.cargo/audit.toml
index 0a17bff9..3fbded7f 100644
--- a/.cargo/audit.toml
+++ b/.cargo/audit.toml
@@ -3,12 +3,26 @@ ignore = [
# rand unsoundness with custom logger — transitive dep from tokenizers, rmcp, tract-onnx
# We don't use rand::rng() directly or custom loggers. Waiting on upstream fixes.
"RUSTSEC-2026-0097",
- # quick-xml < 0.41 advisories. Our direct quick-xml is bumped to 0.41, but a
- # 0.37.x copy is still pulled transitively by oxigraph 0.5.9 (latest) via
- # oxrdfxml / sparesults. There is no oxigraph release on 0.41 yet, so this is
- # unfixable by version bump until upstream updates. We do not parse untrusted
- # XML through the oxigraph RDF/XML path in a way that exposes this. Revisit on
- # the next oxigraph release.
+ # quick-xml denial of service advisories, both patched in 0.41.0. This
+ # project's direct dependency is still quick-xml 0.37 (see Cargo.toml), and
+ # Cargo.lock resolves exactly one quick-xml, version 0.37.5, shared by that
+ # direct dependency, calamine 0.30.1, and oxigraph's oxrdfxml 0.2.3 and
+ # sparesults 0.3.3. Bumping the direct pin on its own would not clear the
+ # advisory, because every published oxrdfxml and sparesults release still
+ # requires quick-xml "0.37", so the 0.37.5 lockfile entry stays until
+ # upstream oxigraph moves. calamine is the one dependency here that can
+ # move now, because calamine 0.36 requires quick-xml "0.41".
+ # Our own call site is Ingest::parse_xml in src/ingest.rs, which uses a
+ # plain quick_xml Reader and never constructs an NsReader or calls
+ # attributes(), so it falls outside the affected code paths of both
+ # advisories. The oxigraph RDF/XML path falls inside them, because oxrdfxml
+ # parses with NsReader and iterates start tag attributes, and that path is
+ # reachable from third-party input: src/marketplace.rs accepts the "rdfxml"
+ # format for community packs fetched over HTTP, and src/server.rs loads
+ # that fetched content into the store. The risk accepted here is
+ # availability only, and the HTTP transport binds 127.0.0.1 by default.
+ # Remove these entries once oxrdfxml and sparesults publish releases built
+ # on quick-xml 0.41 or later.
"RUSTSEC-2026-0194",
"RUSTSEC-2026-0195",
# rkyv 0.7.46 out-of-bounds reads on archives containing Rc/Arc.
@@ -20,7 +34,8 @@ ignore = [
# rust_decimal -> duckdb -> open-ontologies. cargo audit reads Cargo.lock,
# which records optional dependencies the compiler never sees.
# Unfixable by version bump: the advisory requires >= 0.8.17, but
- # rust_decimal pins rkyv 0.7.46 exactly and has not migrated to the 0.8
+ # rust_decimal requires rkyv "0.7.46", which Cargo reads as at least 0.7.46
+ # and below 0.8.0, and it has not migrated to the 0.8
# line (it carries a separate rkyv-0_8 dev-dependency). Remove this entry
# once rust_decimal ships a release depending on rkyv 0.8.
"RUSTSEC-2026-0235",
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index 3cfbf268..f4440699 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -21,7 +21,7 @@ jobs:
- name: Install Python deps
run: pip install matplotlib
- name: Build Open Ontologies
- run: cargo build --release
+ run: cargo build --release --features embeddings
- name: Download reasoner JARs
run: bash benchmark/reasoner/setup_jars.sh
- name: Run Pizza correctness
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index da3ee90e..5f92dce5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -183,7 +183,7 @@ jobs:
# `python/` (open-ontologies-lite) has its own test suite and its own release
# workflow, and until now nothing ran the tests. `python-release.yml` goes
# straight from `uv build` to `pypa/gh-action-pypi-publish` on a `py-v*` tag,
- # so every wheel published to PyPI so far was published without its 15 tests
+ # so every wheel published to PyPI so far was published without its tests
# having executed once. Same shape of gap as #67, one subpackage over.
#
# Kept in CI rather than bolted onto the release workflow: a test that only
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 09db53c0..e39555f2 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -51,7 +51,7 @@ jobs:
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends "${missing[@]}"
- name: Build
- run: cargo build --release --target ${{ matrix.target }}
+ run: cargo build --release --features embeddings,plugins --target ${{ matrix.target }}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
diff --git a/.mcp/server.json b/.mcp/server.json
index 5efd33b4..c96a0cb0 100644
--- a/.mcp/server.json
+++ b/.mcp/server.json
@@ -2,7 +2,7 @@
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.fabio-rovai/open-ontologies",
"title": "Open Ontologies",
- "description": "AI-native ontology engineering MCP server — validate, query, diff, lint, version, and govern RDF/OWL ontologies with 39 tools and 5 workflow prompts via Oxigraph triple store",
+ "description": "AI-native ontology engineering MCP server: validate, query, diff, lint, version, and govern RDF/OWL ontologies with 109 tools and 6 workflow prompts via an Oxigraph triple store. All 109 tools ship in a default build; 8 need an optional Cargo feature (embeddings, plugins, postgres or duckdb).",
"version": "0.1.9",
"packages": [
{
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78497bbb..c45ac029 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -97,8 +97,11 @@ All notable changes to Open Ontologies are documented here.
predicate it inspects. A second complement now covers the shape node, with a
whitelist of the predicates the validator reads there (the target forms,
`sh:property`, `sh:sparql`) plus the annotation predicates, which are never
- constraints, so any other `sh:` predicate lands in `skipped_constraints` and
- the verdict becomes null. The shape is bound as a query variable and matched
+ constraints, so any other `sh:` predicate on a shape the `sh:targetClass`
+ discovery query returns lands in `skipped_constraints` and the verdict becomes
+ null. A shape whose only target is `sh:targetNode`, `sh:targetSubjectsOf` or
+ `sh:targetObjectsOf` is not returned by that query, so its node-level
+ constraints are still dropped without a record. The shape is bound as a query variable and matched
to the discovered shape, not spliced into the query text: a shape written
`[] a sh:NodeShape` is a blank node, and a blank-node label inside a SPARQL
query is a wildcard, not a name. The complement runs once per shape rather
@@ -958,14 +961,15 @@ results produced with 1.1.0 or earlier are not directly comparable.
## 1.1.0 — 2026-07-27
### Added
-- `claimcheck` module: compiled per-claim ontology-consistency verification.
+- `claimcheck` module (library only; no MCP tool and no CLI subcommand calls it): compiled per-claim ontology-consistency verification.
Token-bitset engine (0.3 µs median per claim, 11M claims/s batched), sound
two-hop disjointness join with witness extraction, three-valued verdicts
(`Rejected` / `Undetermined` / `Consistent`), reasoner-backed residual tier
(`ResidualOracle`) with verdict learn-back, closed-world vocabulary checks,
and an assumed-disjointness WARN tier for zero-disjointness ontologies.
- Correctness audited against HermiT: 0 disagreements over 78,884 exhaustive
- class pairs (13 ontologies) and 793 adversarial structural claims.
+ Correctness audited against HermiT: 0 unsound rejections over 78,884
+ exhaustive class pairs (13 ontologies) and 793 adversarial structural
+ claims. The join is sound but incomplete, so this is not full agreement.
- Offline compile tooling (`benchmark/reasoner/`): `CompileOntology` with six
sound disjointness-propagation rules (restriction, functional, union,
data-value, counting, dueling-universal idioms), `DisjointnessMatrix`,
@@ -1146,7 +1150,7 @@ results produced with 1.1.0 or earlier are not directly comparable.
- Terraform-style lifecycle: plan, apply, lock, drift, enforce, monitor, lineage
- Data pipeline: ingest, map, SHACL validate, reason, extend
- Clinical crosswalks (ICD-10, SNOMED, MeSH)
-- OWL2-DL SHOIQ tableaux reasoner with parallel classification
+- SHIQ tableaux reasoner with parallel classification
- Design pattern enforcement (generic, BORO, value_partition)
- Version snapshots and rollback
- Core ontology tools: validate, load, save, query, stats, diff, lint, convert, clear, pull, push, import
diff --git a/CLAUDE.md b/CLAUDE.md
index 02b59d73..da01b7c5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -181,7 +181,7 @@ When exploring or aligning ontologies using semantic embeddings:
### Setup
-1. Ensure the embedding model is downloaded (`open-ontologies init`)
+1. Confirm the server was built with `--features embeddings`, then run `open-ontologies init` to download the model. On a default build, every tool in this section returns `Compiled without embeddings feature`.
2. Call `onto_load` to load the ontology
3. Call `onto_embed` to generate text + structural embeddings for all classes
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 92450af8..c96bbf25 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -16,7 +16,7 @@ Thanks for your interest in contributing! This document explains how to get star
**Requirements:**
- Rust 1.85+ (edition 2024)
- For PostgreSQL schema import: `libpq-dev`
-- For embeddings: models are downloaded automatically via `open-ontologies init`
+- For embeddings: build with `--features embeddings`, then run `open-ontologies init`, which downloads a 448 MB ONNX model and a 16 MB tokenizer
**Build:**
```bash
@@ -52,7 +52,7 @@ The codebase is organized into domain modules under `src/`:
| `ontology.rs` | Core RDF operations (validate, load, diff, lint) |
| `state.rs` | SQLite state database (versions, feedback, locks) |
| `config.rs` | TOML configuration loading |
-| `tableaux.rs` | OWL2-DL SHOIQ tableaux reasoner |
+| `tableaux.rs` | SHIQ tableaux reasoner |
| `align.rs` | Cross-ontology alignment (7 weighted signals) |
| `reason.rs` | RDFS/OWL-RL inference |
| `ingest.rs` | Data format parsing (CSV, JSON, XLSX, Parquet, etc.) |
diff --git a/Dockerfile b/Dockerfile
index 20ad1ecc..43f69f8e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,7 +10,7 @@ ENV CARGO_INCREMENTAL=0 CARGO_PROFILE_RELEASE_DEBUG=0
WORKDIR /build
COPY . .
-RUN cargo build --release && strip target/release/open-ontologies
+RUN cargo build --release --features embeddings,plugins,sql && strip target/release/open-ontologies
# Collect every shared library the binary transitively needs (direct plus
# recursive NEEDED deps) into /deps, preserving absolute paths. This replaces a
diff --git a/README.md b/README.md
index f3105e0d..72a54d1b 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,7 @@
---
-Open Ontologies is a **Rust MCP server** and **desktop Studio** for AI-native ontology engineering. It exposes **70+ tools** that let Claude build, validate, query, diff, lint, version, reason over, align, plan, certify, and govern RDF/OWL ontologies using an in-memory Oxigraph triple store — with a full three-layer Dynamics → Causal → Planner architecture, a marketplace of 33 standard ontologies, clinical crosswalks, semantic embeddings, and a full lineage audit trail.
+Open Ontologies is a **Rust MCP server** and **desktop Studio** for AI-native ontology engineering. It exposes **109 tools** that let Claude build, validate, query, diff, lint, version, reason over, align, plan, certify, and govern RDF/OWL ontologies using an in-memory Oxigraph triple store, alongside a three-layer Dynamics → Causal → Planner architecture, a marketplace of 33 standard ontologies, clinical crosswalks, semantic embeddings, and a lineage audit trail. A default build advertises all 109 tools. Eight of them need an optional Cargo feature and return an error without it: four need `embeddings`, two need `plugins`, and two need `postgres` or `duckdb`. The published binaries and the GHCR image are built with the default feature set, so they do not carry those eight. Build from source with `cargo build --release --features embeddings,plugins,sql` to get them.
The **Studio** wraps the engine in a visual desktop environment: virtualized ontology tree with hierarchy lines, breadcrumb navigation, and connection explorer; AI chat panel with `/build` (IES-level deep) and `/sketch` (quick prototype) commands; Protégé-style property inspector; and lineage viewer.
@@ -84,7 +84,7 @@ cargo run --example three_layer_pipeline
Walks Dynamics register → PDDL compile → Fast-Downward-shaped sas_plan parse → orchestrator-side IRI bind → sandbox validate → CIVeX certify → apply with OWL-RL ramification → final state inspection. Every layer through its public API, no external dependencies (Python, DoWhy, Fast Downward) required.
-Zero new external Rust dependencies; everything optional gates behind Cargo features. Full test suite (160+ tests) green on default build; `cargo clippy --lib --tests --examples -- -D warnings` clean across both default and `causal-pywhy` configurations.
+Zero new external Rust dependencies; everything optional gates behind Cargo features. The default build compiles and runs 930 tests, out of 1,061 in the repository; the remaining 131 are gated behind optional Cargo features; `cargo clippy --lib --tests --examples -- -D warnings` clean across both default and `causal-pywhy` configurations.
---
@@ -121,7 +121,7 @@ docker run -i ghcr.io/fabio-rovai/open-ontologies serve
```bash
git clone https://github.com/fabio-rovai/open-ontologies.git
-cd open-ontologies && cargo build --release
+cd open-ontologies && cargo build --release --features embeddings,plugins,sql
./target/release/open-ontologies init
```
@@ -273,10 +273,10 @@ The v2 deep builder changed the equation — a single `/build` command now produ
The Studio launches three processes that communicate locally:
1. **Tauri 2 shell** — native window (macOS/Linux/Windows) with a WebKit webview
-2. **Engine sidecar** — the same Rust binary, running as an HTTP MCP server on `localhost:8080`
-3. **Agent sidecar** — Node.js process running Claude via the Agent SDK, connected to the engine over MCP
+2. **Engine sidecar**: the same Rust binary, running as an HTTP MCP server on `localhost:8137`, configurable with `OPEN_ONTOLOGIES_STUDIO_PORT`
+3. **Agent sidecar**: a Node.js process that connects a model to the engine over MCP. The Anthropic path calls the raw `@anthropic-ai/sdk` Messages API, not the Claude Agent SDK.
-When you type in the chat panel, your message goes to the Agent sidecar, which sends it to Claude. Claude decides which `onto_*` tools to call, the engine executes them, and the UI refreshes the graph. The entire loop — prompt to visual update — takes seconds.
+When you type in the chat panel, your message goes to the Agent sidecar, which sends it to whichever provider is configured. The model decides which `onto_*` tools to call, the engine executes them, and the UI refreshes the graph. The whole loop, from prompt to visual update, takes seconds.
### Install and run
@@ -300,7 +300,7 @@ The first launch compiles the Tauri shell (~2 min). Subsequent launches start in
| Feature | Description |
| --- | --- |
| **Virtualized Tree** | Ontology explorer that handles 1,500+ classes without lag. Hierarchy connector lines, collapsible branches, type-filtered legend (Class/Property/Individual), search with auto-expand, breadcrumb path navigation, and a connections panel showing domain/range relationships as clickable pills. Only visible rows are in the DOM — constant memory regardless of ontology size. |
-| **AI Agent Chat** | Natural language ontology engineering via Claude Opus 4.8 + Agent SDK. Two build modes: `/build` runs a 13-step pipeline producing IES-level ontologies (500-1,500+ classes, 100-200+ properties), `/sketch` runs 3 steps for quick prototyping (~80 classes). Each tool call is shown in real time. |
+| **AI Agent Chat** | Natural language ontology engineering through a provider chosen at runtime. The Anthropic path defaults to `claude-opus-5` on the raw `@anthropic-ai/sdk`, and `ONTO_LLM_MODEL` overrides it. Two build modes: `/build` runs an 11-step pipeline producing IES-level ontologies, `/sketch` runs 5 steps for quick prototyping. Each tool call is shown in real time. |
| **Property Inspector** | Protege-style inline triple editor. Click any node to see its `rdfs:subClassOf`, `rdfs:label`, `rdfs:domain`, `rdfs:range` and all other triples. Edit in place, hover to delete, `+ Add` for new triples. Changes are immediately reflected in the graph. |
| **Lineage Panel** | Full audit trail from SQLite: every plan, apply, enforce, drift, monitor, and align event, grouped by session with timestamps. See exactly what Claude did and in what order. |
| **Named Save** | `⌘S` to save as `~/.open-ontologies/<name>.ttl`. Auto-saves to `studio-live.ttl` after every mutation so you never lose work. |
@@ -335,7 +335,7 @@ The benchmarks below are not a feature tour. Each one exists to answer a specifi
| **RQ6** | Can the SHACL-SPARQL governance rules an ontology ships actually be executed as written at national scale, or does the reference store force a workaround? | [`investment-fund-ontology`](case-studies/investment-fund-ontology/): 1.29M-triple US fund universe, 4 layer-3 rules, rdflib 7.6.0 A/B | **Store-specific.** rdflib finishes the anti-join (0.1s) and nested aggregate (0.8s) but times out (>300s) on both multi-way self-joins — exactly the cross-source reconciliation rules the ontology exists for. This repo's Oxigraph engine runs load + all four rules, unmodified, in 2.1s, reproducing the reference pipeline's published counts (73 / 0 / 214 / 2,148) exactly. The shapes also forced two validator fixes here: `sh:inversePath` support and `sh:severity` reporting. |
| **RQ7** | When the graph is register-scale (276k triples) rather than fund-universe-scale (1.29M), does the reference store still force the set-based workaround, and do the rule counts survive entity resolution? | [`insurance-register-ontology`](case-studies/insurance-register-ontology/): 276,683-triple EEA insurance register, 6 layer-3 rules, rdflib 7.6.0 A/B | **The workaround becomes speed, not survival.** At this scale rdflib completes all six rules (133.2s total, 97s of it in one double anti-join) against 2s to 9s for the Oxigraph engine; nothing times out. Counts match the reference pipeline exactly on R1-R4 (643 / 4 / 118 / 42). R5 falls from 227 to 20 and R6 rises from 283 to 291 because the graph runs the same rule text after entity resolution, which absorbs the legitimate branch shares and attributes 8 more zombie passports via the LEI join; both differences were verified set-based. The shapes forced two more validator fixes: `sh:pattern` and `sh:hasValue`. |
-| **RQ8** | When a published standard ships a validator but no RDF binding, does a green SHACL result mean the data is valid, or that nothing was checked? | [`dcat-us-binding`](case-studies/dcat-us-binding/): DCAT-US 3.0, the US federal metadata profile, 115 published examples from its live repository, pySHACL vs this engine | **It means nothing was checked, and the distinction is invisible without reporting reach.** The corpus as published expands to **76 triples, 1 predicate, 0 DCAT**, so the shapes GSA deleted select **0 focus nodes** and return `conforms=True`. Generating a JSON-LD context from the same JSON Schema that already carries the RDF terms (231 of 270 properties) lifts the corpus to **1,510 triples and 228 DCAT statements**, and the *same deleted shapes*, unchanged, then select **228 focus nodes and report 287 violations**. This is why `onto_shacl` reports `focus_nodes` next to the verdict. The run also cost us two defects here: `sh:class` and `sh:nodeKind` are not evaluated at all (287 of pySHACL's 316 findings invisible), and `sh:datatype` rejects `"1024"^^xsd:nonNegativeInteger` against `sh:datatype xsd:nonNegativeInteger`. |
+| **RQ8** | When a published standard ships a validator but no RDF binding, does a green SHACL result mean the data is valid, or that nothing was checked? | [`dcat-us-binding`](case-studies/dcat-us-binding/): DCAT-US 3.0, the US federal metadata profile, 115 published examples from its live repository, pySHACL vs this engine | **It means nothing was checked, and the distinction is invisible without reporting reach.** The corpus as published expands to **76 triples, 1 predicate, 0 DCAT**, so the shapes GSA deleted select **0 focus nodes** and return `conforms=True`. Generating a JSON-LD context from the same JSON Schema that already carries the RDF terms (231 of 270 properties) lifts the corpus to **1,510 triples and 228 DCAT statements**, and the *same deleted shapes*, unchanged, then select **228 focus nodes and report 287 violations**. This is why `onto_shacl` reports `focus_nodes` next to the verdict. The run also found two defects here, both since fixed. `sh:class` and `sh:nodeKind` written directly under `sh:property` were not evaluated at all, which made 287 of pySHACL's 316 findings invisible on that run; both are evaluated now, pinned by `tests/shacl_class_constraint_test.rs`. Where the two appear as members of an `sh:or` list, which is how most of these shapes write them, the disjunction is still recorded in `skipped_constraints` and the verdict is null rather than a pass. `sh:datatype` also rejected `"1024"^^xsd:nonNegativeInteger` against `sh:datatype xsd:nonNegativeInteger`; the store does not preserve that datatype IRI, so the constraint is now recorded as unevaluated instead of answered wrongly. The case-study table has not been re-measured since the fixes. |
RQ2 and RQ4 are the ones worth reading if you are deciding whether to trust this repo. Both are negative results about work done here.
@@ -384,7 +384,7 @@ The Studio provides two build commands for different use cases. Both take the sa
| Classes | 95 | **1,433** | 511 |
| Object properties | 15 | **218** | 162 |
| Datatype properties | 5 | **101** | 44 |
-| Individuals | 3 | **358** | 21 |
+| Individuals | 3 | **358** | 1 |
| Disjoints | 6 | **60+** | — |
| Max hierarchy depth | 5 | **11** | 8 |
| Build time | ~2 min | ~15 min | — (hand-built) |
@@ -447,14 +447,20 @@ The 29 general-purpose marketplace ontologies (the four IES entries are covered
Class and property counts are structural, not declaration-only: a term counts if it is typed (`owl:Class`, `rdfs:Class`, `owl:ObjectProperty`, `owl:DatatypeProperty`, `rdf:Property`) **or** used as one (`rdfs:subClassOf`/`subPropertyOf`/`domain`/`range` position). Vocabularies that never issue OWL type declarations, such as Schema.org, are therefore counted rather than reported as empty. Terms in the `rdf:`, `rdfs:` and `owl:` namespaces are excluded so a vocabulary is not credited with the meta-vocabulary it is written in. That exclusion is why OWL 2, RDF Schema and RDF Concepts report **0 properties**: every property they define is, by definition, in an excluded namespace. FIBO's marketplace entry is the metadata module only (48 triples), which declares no terms of its own.
-### Compiled Claim Verification — measured vs HermiT
+### Compiled Claim Verification (research benchmark, not an exposed tool)
-The `claimcheck` module compiles an ontology **once** (inferred hierarchy +
-disjointness, including pairs derived by sound propagation rules) into
-per-class token bitsets, then verifies candidate claims — the "is this set of
-triples consistent with the ontology?" question — with **no reasoning at query
-time**: two 64-bit ANDs per class pair, witness axiom extracted for the
-explanation.
+This is a benchmark of the `claimcheck` library module in `src/claimcheck.rs`. No
+MCP tool in `src/server.rs` and no CLI subcommand in `src/main.rs` calls it, so it
+cannot be reached from the server, the `open-ontologies` binary, or the Docker
+image. Its only caller in this repository is the Rust test
+`tests/claimcheck_pizza_bench.rs`, which runs after the offline compile step
+described below.
+
+The module compiles an ontology **once** (inferred hierarchy plus disjointness,
+including pairs derived by sound propagation rules) into per-class token bitsets,
+then answers the question "is this set of triples consistent with the ontology?"
+with **no reasoning at query time**: two 64-bit ANDs per class pair, with the
+witness axiom extracted for the explanation.
Same ontology (canonical `pizza.owl`), same task, same machine, verdicts
cross-checked against HermiT 1.4.3.456:
@@ -464,10 +470,25 @@ cross-checked against HermiT 1.4.3.456:
| HermiT (warm JVM, ontology pre-loaded) | 4,936 µs | — | ~200/s |
| **open-ontologies compiled check** | **0.3 µs** | **0.4 µs** | **3.1M/s (11.2M/s batched)** |
+Measured on Apple M3 Max over a rotation of four claims against the compiled
+Pizza ontology, so it reports warm-cache per-claim cost rather than the cost of
+a varied claim stream. No run artefact is committed. Reproduce by generating
+the compiled input from `benchmark/reasoner` with `java -cp ".:lib/*"
+CompileOntology /tmp/pizza_real.owl /tmp/pizza_compiled.json`, then running
+`cargo test --release --test claimcheck_pizza_bench -- --nocapture`. The test
+skips and passes when that input is absent, so a green test run is not
+evidence that the number was measured.
+
Correctness before speed:
-- **0 disagreements with HermiT** across 78,884 exhaustively-audited class
- pairs (13 ontologies) and 793 structurally adversarial claims.
+- **0 unsound rejections against HermiT** across 78,884 exhaustively-audited
+ class pairs (13 ontologies) and 793 structurally adversarial claims. The
+ compiled surface is sound but incomplete, so this measures soundness rather
+ than full agreement: 23 of the 78,884 pairs are left undecided and routed to
+ the residual tier. No run artefact is committed, and the ORE 2015 corpus and
+ reasoner jars are gitignored. Reproduce with `bash
+ benchmark/reasoner/setup_jars.sh`, then `python
+ benchmark/layer3-prototype/verify_join_soundness.py <ore2015-dir> 250`.
- **Sound by construction**: a `Rejected` verdict is backed by a derivable
contradiction and names the witnessing axiom. 100% contradiction recall on
both fully-audited ontologies.
@@ -477,9 +498,29 @@ Correctness before speed:
- Closed-world vocabulary checks catch hallucinated classes/properties that
open-world OWL semantics structurally cannot flag.
-Offline compile: one classification pass (~120 ms for Pizza) via any complete
-OWL reasoner; the shipped hot path is pure Rust with no JVM dependency.
-Reproduction scripts: [benchmark/layer3-prototype/](benchmark/layer3-prototype/).
+Offline compile: one classification pass (about 120 ms for Pizza) via any complete
+OWL reasoner. The Rust check needs no JVM, but the compile step that produces its
+input does. To run the benchmark from a clean checkout:
+
+```bash
+cd benchmark/reasoner
+./setup_jars.sh # the jars are gitignored, so fetch them first
+javac -cp "lib/*" CompileOntology.java
+java -cp ".:lib/*" CompileOntology <pizza.owl> /tmp/pizza_compiled.json
+cd ../..
+cargo test --release --test claimcheck_pizza_bench -- --nocapture
+```
+
+The test reads `/tmp/pizza_compiled.json` and skips when that file is absent, which
+is why `cargo test` on CI never exercises it. Its assertions use the
+`http://www.co-ode.org/ontologies/pizza/pizza.owl#` namespace, so the ontology
+passed to `CompileOntology` must carry those IRIs. The copy at
+`benchmark/reference/pizza-reference.owl` is namespaced under
+`https://raw.githubusercontent.com/owlcs/pizza-ontology/refs/heads/master/pizza.owl#`
+and fails the assertions.
+
+Verification harness for the parity and soundness sweeps:
+[benchmark/layer3-prototype/](benchmark/layer3-prototype/).
Design, measurements and envelope: [docs/layer3-compiled-reasoning.md](docs/layer3-compiled-reasoning.md).
Full benchmark methodology: [docs/benchmarks.md](docs/benchmarks.md)
@@ -508,7 +549,7 @@ The comparison below is the **complete** OAEI 2025 Anatomy field, reproduced fro
**Read this honestly.** Open Ontologies ranks **9th of 13** on F1. Its precision (0.960) is third in the field, but its recall (0.730) is second-from-bottom among non-baseline systems, and the resulting F1 sits **level with LogMapLt**, the deliberately lightweight lexical matcher, and 0.112 below the leader. The `StringEquiv` baseline reaches 0.766 by normalised string equality alone, so the margin this system earns over pure string matching is **+0.063 F1**. That is the number to beat, and it is not yet a competitive result.
-The gap is recall, and its cause is identifiable: this system carries **no domain background knowledge**. Anatomy is a track where UMLS and BioPortal lookups are what separate the 0.88+ band from the rest, and every system above Open Ontologies in the table either uses biomedical background knowledge, an LLM oracle, or both. Alignment here uses 7 weighted signals (label similarity, property/parent/instance/restriction/neighbourhood overlap, embedding similarity), stable 1-to-1 matching, and a label penalty when no structural evidence is available.
+The gap is recall, and its cause is identifiable: this system carries **no domain background knowledge**. Anatomy is a track where UMLS and BioPortal lookups are what separate the 0.88+ band from the rest, and every system above Open Ontologies in the table either uses biomedical background knowledge, an LLM oracle, or both. Alignment here was run from a build with `--features embeddings`, giving 7 weighted signals (label similarity, property/parent/instance/restriction/neighbourhood overlap, embedding similarity), stable 1-to-1 matching, and a label penalty when no structural evidence is available. A default build drops the embedding signal and runs on the first 6.
The defensible finding from this track is therefore **not** the headline F1. It is the ablation: stable 1-to-1 matching is what makes the difference, and the signal weights are nearly irrelevant once it is applied.
@@ -558,15 +599,25 @@ onto_marketplace install ies # Common — full ontology (511 classes, 20
| Metric | IES Common |
| --- | --- |
-| Classes | 511 |
+| Classes | 513 counted structurally, 511 declared with `rdfs:Class` |
| Object properties | 162 |
| Datatype properties | 44 |
| Total properties | 206 |
-| Triples loaded | 4,041 |
+| Triples loaded | 4,039 |
| + RDFS inferred | **+3,094 (+77%)** |
-| Fetch time | 911ms |
| RDFS reasoning | 63ms |
-| Lint issues | 0 |
+| Lint issues | 0 warnings or errors, 19 info-level missing-domain notices |
+
+Measured against the vendored copy at
+[case-studies/foundry-owl-crosswalk/vendor/ies-common.ttl](case-studies/foundry-owl-crosswalk/vendor/ies-common.ttl).
+Reproduce with `open-ontologies batch` over the lines `clear`, `load
+case-studies/foundry-owl-crosswalk/vendor/ies-common.ttl`, `stats`, `reason
+--profile rdfs`. The class count differs by rule: `onto_stats` counts a term
+that is typed as a class or used in a class position, which gives 513, while
+the count of explicit `rdfs:Class` declarations is 511. The IES presets are not
+part of `benchmark/marketplace_benchmark.py`, so
+`benchmark/marketplace_results.json` does not contain this row. Fetch time is
+omitted because it measured a network round trip rather than the engine.
IES is the second-largest ontology in the marketplace by class count (after Schema.org). RDFS reasoning produces the richest inference gain of any non-general ontology — State, ClassOfEntity, and Event subclasses all generating deep transitive chains.
@@ -808,6 +859,11 @@ graph LR
| Classes | 511 | 549 | +38 |
| RDFS inferred | 3,094 | 3,422 | **+328 (+10.6%)** |
+The 3,094 baseline is reproducible from the vendored ontology. The 549-class
+extended version is not committed, so the 3,422 figure and the delta cannot be
+rechecked from this repository. Commit the extended Turtle file, or state the
+before figure alone.
+
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
@@ -822,7 +878,7 @@ The same tool, applied to any ontology, produces the same kind of improvement. T
## Tools
-70+ tools organized by function — available as MCP tools (prefixed `onto_`) and CLI subcommands:
+109 tools organized by function, available as MCP tools (prefixed `onto_`) and CLI subcommands. A default build advertises all 109. Eight require an optional Cargo feature at call time: `embed`, `search`, `similarity` and `hnsw_build` need `embeddings`; `plugin_list` and `plugin_call` need `plugins`; `import-schema` and `sql-ingest` need `postgres` or `duckdb`.
| Category | Tools | Purpose |
| --- | --- | --- |
@@ -832,16 +888,16 @@ The same tool, applied to any ontology, produces the same kind of improvement. T
| **Marketplace** | `marketplace` | Browse and install 33 curated W3C/ISO/industry ontologies + open [community packs](community/README.md) |
| **Plugins** | `plugin_list` `plugin_call` | Discover and invoke sandboxed community WASM plugins (`--features plugins`, [details](docs/plugins.md)) |
| **Remote** | `pull` `push` `import` | Fetch/push ontologies, resolve owl:imports |
-| **Schema** | `import-schema` `sql-ingest` | Postgres + DuckDB → OWL + SQL → RDF ingest |
+| **Schema** | `import-schema` `sql-ingest` | Postgres + DuckDB → OWL + SQL → RDF ingest (`--features sql`, [details](docs/data-pipeline.md)) |
| **Data** | `map` `ingest` `shacl` `shacl_check` `vocab_check` `reason` `extend` | Structured data → RDF pipeline; `vocab_check` = closed-world check that generated data uses only ontology-declared terms (catches what open-world SHACL misses) |
| **Versioning** | `version` `history` `rollback` | Named snapshots and rollback |
| **Lifecycle** | `plan` `apply` `lock` `drift` `enforce` `monitor` `monitor-clear` `lineage` | Terraform-style change management with webhook alerts and [OpenCheir](https://github.com/fabio-rovai/opencheir) governance integration |
-| **Alignment** | `align` `align_feedback` `align_fuzzy` `align_flora` | Cross-ontology class matching with self-calibrating weights + fuzzy-logic adjudication and end-to-end signal-driven pipeline |
-| **HNSW** | `hnsw_build` | Persisted HNSW indices (cosine + Poincaré) over class embeddings |
+| **Alignment** | `align` `align_feedback` `align_fuzzy` `align_flora` | Cross-ontology class matching with self-calibrating weights + fuzzy-logic adjudication and end-to-end signal-driven pipeline. Without `--features embeddings` these run on 6 signals instead of 7 and cannot match across languages ([details](docs/alignment.md)) |
+| **HNSW** | `hnsw_build` | Persisted HNSW indices (cosine + Poincaré) over class embeddings (`--features embeddings`) |
| **Clinical** | `crosswalk` `enrich` `validate_clinical` | ICD-10 / SNOMED / MeSH crosswalks (93-row sample ships in `data/crosswalks.parquet`; run `python scripts/build_crosswalks.py` to rebuild or extend) |
| **Feedback** | `lint_feedback` `enforce_feedback` | Self-calibrating suppression |
-| **Embeddings** | `embed` `search` `similarity` | Dual-space semantic search (text + Poincaré structural) |
-| **Reasoning** | `reason` `dl_explain` `dl_check` `classify_el` | Native OWL2-DL SHOIQ tableaux + OWL-EL classification |
+| **Embeddings** | `embed` `search` `similarity` | Dual-space semantic search, text + Poincaré structural (`--features embeddings`, [details](docs/embeddings.md)) |
+| **Reasoning** | `reason` `dl_explain` `dl_check` `classify_el` | Native SHIQ tableaux, no nominals, plus OWL-EL classification |
| **Dynamics** | `action_register` `action_applicable` `action_apply` `action_list` `action_apply_concurrent` `invariant_register` `invariant_list` `invariant_remove` `invariant_check` `default_register` `default_apply` | Action schemas + concurrent atomic ticks + static causal laws + default values |
| **Causal** | `certify_action` | Four-verdict causal certificate (EXECUTE / REJECT / EXPERIMENT / ABSTAIN); optional `causal-pywhy` feature enables backdoor identification |
| **Planner** | `plan_compile_pddl` `plan_classical` `plan_validate` | Compile + validate on the server; solver (Fast Downward) is a client-side subprocess |
@@ -891,7 +947,7 @@ flowchart TD
REST["REST API\n/api/query · /api/update\n/api/save · /api/load · /api/lineage"]
end
- subgraph ToolGroups["70+ Tools"]
+ subgraph ToolGroups["109 Tools"]
direction LR
Core["Core\nvalidate · load · save · clear\nstats · query · diff · lint\nconvert · status"]
DataPipe["Data Pipeline\nmap · ingest · shacl\nreason · extend · import-schema"]
@@ -903,7 +959,7 @@ flowchart TD
subgraph Core2["Core Engine"]
GraphStore["Oxigraph Triple Store\nRDF/OWL in-memory\nSPARQL 1.1"]
SQLite["SQLite\nlineage events\nversion snapshots\nlint/enforce feedback\nembedding vectors"]
- Reasoner["OWL2-DL Reasoner\nSHOIQ tableaux\nRDFS · OWL-RL"]
+ Reasoner["DL Reasoner\nSHIQ tableaux\nRDFS · OWL-RL"]
Embedder["Embedding Engine\ntract-onnx (ONNX)\ntext + Poincaré structural"]
end
end
@@ -963,7 +1019,7 @@ flowchart TD
end
subgraph Agent["Agent Sidecar (Node.js)"]
- SDK["Claude Opus 4.8\nAgent SDK"]
+ SDK["Model provider\n@anthropic-ai/sdk or OpenAI-compatible"]
Proto["stdin/stdout JSON protocol"]
end
@@ -989,7 +1045,7 @@ flowchart TD
| --- | --- |
| UI reads use sessionless REST | No MCP session management needed for SPARQL queries or stats |
| UI writes use REST `/api/update` + `/api/save` | Avoids session lifecycle issues in the Tauri WebKit webview |
-| Agent writes go through MCP `tools/call` | The Agent SDK manages its own MCP session; Claude needs the full tool set |
+| Agent writes go through MCP `tools/call` | The sidecar's own MCP client (`studio/src-tauri/sidecars/agent/mcp.ts`) holds the session, and the model needs the full tool set |
| Shared `Arc<GraphStore>` | All MCP sessions and REST handlers share the same in-memory triple store |
| Agent sidecar over stdin/stdout | Keeps Node.js isolated; Tauri manages the full lifecycle |
@@ -1000,16 +1056,16 @@ flowchart TD
| Layer | Tech |
| --- | --- |
| Engine language | Rust (edition 2024) — single binary, no JVM |
-| Triple store | Oxigraph 0.4 — pure Rust RDF/SPARQL 1.1 engine |
+| Triple store | Oxigraph 0.5, a pure Rust RDF and SPARQL 1.1 engine |
| MCP protocol | rmcp — Streamable HTTP transport |
| State / lineage / feedback | SQLite (rusqlite) |
| Clinical crosswalks | Apache Arrow / Parquet |
-| Embeddings runtime | tract-onnx — pure Rust ONNX (optional) |
+| Embeddings runtime | tract-onnx, pure Rust ONNX, behind the `embeddings` Cargo feature and absent from the published binaries |
| Desktop shell | Tauri 2 |
| Frontend | React 19, Vite 7, TypeScript 5.8, Tailwind CSS 4 |
| Tree view | Virtualized DOM tree with virtual scroll (no canvas/WebGL dependencies) |
| UI state | Zustand 5 |
-| AI agent | Claude Opus 4.8 via Agent SDK (Node.js sidecar) |
+| AI agent | Node.js sidecar. `claude-opus-5` on the raw `@anthropic-ai/sdk` when `ANTHROPIC_API_KEY` is set, otherwise a local OpenAI-compatible endpoint (see `studio/src-tauri/sidecars/agent/providers/alias.ts`) |
---
@@ -1021,7 +1077,7 @@ flowchart TD
| Data Pipeline | [docs/data-pipeline.md](docs/data-pipeline.md) |
| Ontology Lifecycle | [docs/lifecycle.md](docs/lifecycle.md) |
| Schema Alignment | [docs/alignment.md](docs/alignment.md) |
-| OWL2-DL Reasoning | [docs/reasoning.md](docs/reasoning.md) |
+| SHIQ Reasoning | [docs/reasoning.md](docs/reasoning.md) |
| Semantic Embeddings | [docs/embeddings.md](docs/embeddings.md) |
| Clinical Crosswalks | [docs/clinical.md](docs/clinical.md) |
| IES Ecosystem | [docs/ies-ecosystem.md](docs/ies-ecosystem.md) |
diff --git a/README.zh-CN.md b/README.zh-CN.md
index efeecbc9..b3d54911 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -26,7 +26,7 @@
> 本文是英文 [README.md](README.md) 的中文版。英文版为准:当两者出现差异时,请以英文版为最新内容。
-Open Ontologies 是一个 **Rust 编写的 MCP 服务器**与**桌面版 Studio**,面向 AI 原生的本体工程。它提供 **70 多个工具**,让 Claude 能够基于内存中的 Oxigraph 三元组存储来构建、校验、查询、比对、检查、版本化、推理、对齐、规划、认证和治理 RDF/OWL 本体,并具备完整的 Dynamics → Causal → Planner 三层架构、33 个标准本体的市场、临床术语交叉映射、语义向量以及完整的血缘审计链路。
+Open Ontologies 是一个 **Rust 编写的 MCP 服务器**与**桌面版 Studio**,面向 AI 原生的本体工程。它提供 **109 个工具**,让 Claude 能够基于内存中的 Oxigraph 三元组存储来构建、校验、查询、比对、检查、版本化、推理、对齐、规划、认证和治理 RDF/OWL 本体,并具备完整的 Dynamics → Causal → Planner 三层架构、33 个标准本体的市场、临床术语交叉映射、语义向量以及完整的血缘审计链路。语义向量、Postgres 与 DuckDB 连接器、WASM 插件宿主都是编译期可选特性。预编译二进制与 GHCR 镜像均以默认特性集构建,不包含上述功能;如需启用,请从源码执行 `cargo build --release --features embeddings,plugins,sql`。默认构建会公开全部 109 个工具,其中 8 个需要启用可选的 Cargo feature 才能运行:4 个需要 `embeddings`,2 个需要 `plugins`,2 个需要 `postgres` 或 `duckdb`;未启用时这些工具会返回错误。
**Studio** 将引擎封装为可视化桌面环境:带层级连线的虚拟化本体树、面包屑导航与关系浏览器;支持 `/build`(IES 级深度建模)与 `/sketch`(快速原型)指令的 AI 对话面板;Protégé 风格的属性检查器;以及血缘查看器。
@@ -75,7 +75,7 @@ docker run -i ghcr.io/fabio-rovai/open-ontologies serve
```bash
git clone https://github.com/fabio-rovai/open-ontologies.git
-cd open-ontologies && cargo build --release
+cd open-ontologies && cargo build --release --features embeddings,plugins,sql
./target/release/open-ontologies init
```
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..fa8db332
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,64 @@
+# Security
+
+## Reporting a vulnerability
+
+Use GitHub's private vulnerability reporting on this repository: **Security ->
+Advisories -> Report a vulnerability**. That opens a private thread visible only
+to the maintainers, and it is the preferred route because it keeps the report
+out of public issues while it is being fixed.
+
+If private reporting is unavailable to you, open a public issue that says only
+that you have a security report and asks for a contact address. Do not put the
+details in it.
+
+Expect a first response within five working days. If a report is valid, the fix
+and the advisory are published together, and you are credited unless you ask not
+to be.
+
+## What this project is, for threat-modelling purposes
+
+Open Ontologies is a local engine. It runs as an MCP server over stdio, as a
+CLI, and optionally as an HTTP server. It has no LLM inside it, makes no
+outbound calls in a default build, and holds no credentials of its own.
+
+`serve-http` binds to `127.0.0.1` by default and takes an optional bearer token
+via `--token` or `OPEN_ONTOLOGIES_TOKEN`. There is no TLS in the binary. If you
+expose it beyond localhost, terminate TLS at a reverse proxy and set a token.
+Running it on `0.0.0.0` without a token gives anyone who can reach the port full
+read and write access to the loaded graphs, and that is the configuration most
+likely to hurt someone.
+
+The `plugins` feature runs community WASM modules in-process on wasmi with fuel
+metering. Fuel bounds runtime, it does not sandbox intent. Treat a plugin as
+code you are choosing to run.
+
+## In scope
+
+Anything that lets an attacker read or modify a graph they should not reach,
+escape the intended process boundary, execute code through a crafted input file
+or plugin, or cause unrecoverable denial of service through a small input.
+Parser and reasoner inputs are attacker-controlled in many deployments, so a
+crash or unbounded memory growth on a crafted Turtle, RDF/XML or SHACL file is a
+valid report.
+
+## Not vulnerabilities
+
+A reasoner verdict of `undetermined` when the budget is exhausted is the
+designed behaviour. It exists so an incomplete run is never reported as a
+proof, and returning it is the safe outcome rather than a failure.
+
+SHACL validation under open-world semantics not rejecting an unknown term is
+also designed, and it is a property of SHACL rather than of this
+implementation. Constraints the validator cannot execute suppress the verdict
+and are listed under `skipped_constraints` instead of being silently passed. If
+you find a case where an unexecuted constraint is reported as conforming, that
+one is a bug and we want to hear about it.
+
+Long reasoning times on a deliberately hard ontology are expected. Description
+logic satisfiability is intractable in the worst case, which is why the budget
+and the three-valued verdict exist.
+
+## Supported versions
+
+Fixes land on the latest minor release. There are no long-term support
+branches.
diff --git a/SKILL.md b/SKILL.md
index 513bac16..489f88c6 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -2,7 +2,7 @@
name: open-ontologies
version: "0.5.1"
description: >
- AI-native ontology engineering using 50+ MCP tools backed by an in-memory Oxigraph triple store.
+ AI-native ontology engineering using 109 MCP tools backed by an in-memory Oxigraph triple store.
Build, validate, query, and govern RDF/OWL ontologies with a generate-validate-iterate loop.
Use when building ontologies, knowledge graphs, RDF data, SPARQL queries, BORO/4D modeling,
SHACL validation, clinical terminology mapping, ingesting from CSV/JSON/Parquet/XLSX or
@@ -56,7 +56,7 @@ AI-native ontology engineering. Generate OWL/RDF directly, validate with MCP too
This skill requires the **Open Ontologies MCP server** to provide the `onto_*` tools.
-**Install:** `cargo install open-ontologies` or download from [GitHub releases](https://github.com/fabio-rovai/open-ontologies/releases)
+**Install:** `cargo install open-ontologies --features embeddings,plugins,sql`, or download from [GitHub releases](https://github.com/fabio-rovai/open-ontologies/releases), which ships the default feature set without embeddings, SQL or plugins
**MCP config** (add to `.mcp.json` or Claude settings):
```json
@@ -189,11 +189,11 @@ For aligning two ontologies:
| `onto_marketplace` | Browse / install standard ontologies from the curated catalogue |
| `onto_dl_check` | Check `subClass ⊑ superClass` via DL tableaux |
| `onto_dl_explain` | Explain why a class is unsatisfiable (DL clash trace) |
-| `onto_embed` | Generate text + Poincaré structural embeddings for all classes |
+| `onto_embed` | Generate text + Poincaré structural embeddings for all classes. Requires a build with `--features embeddings`; returns an error otherwise |
| `onto_search` | Natural-language query → most-similar classes |
| `onto_similarity` | Cosine + Poincaré distance between two IRIs |
-| `onto_import_schema` | Introspect PostgreSQL or DuckDB schema → generate OWL classes/properties/cardinality |
-| `onto_sql_ingest` | Run SQL `SELECT` against PostgreSQL or DuckDB → RDF (DuckDB enables federation over CSV/Parquet/JSON/HTTPFS/postgres-scanner via its extensions) |
+| `onto_import_schema` | Introspect PostgreSQL or DuckDB schema → generate OWL classes/properties/cardinality. Requires a build with `--features postgres` or `--features duckdb` |
+| `onto_sql_ingest` | Run SQL `SELECT` against PostgreSQL or DuckDB → RDF (DuckDB enables federation over CSV/Parquet/JSON/HTTPFS/postgres-scanner via its extensions). Requires a build with `--features postgres` or `--features duckdb` |
## Usage Examples
diff --git a/benchmark/reasoner/README.md b/benchmark/reasoner/README.md
index 56461d5b..dcb41967 100644
--- a/benchmark/reasoner/README.md
+++ b/benchmark/reasoner/README.md
@@ -22,7 +22,7 @@ pip install matplotlib
### Pizza Correctness
-Compares OWL2-DL classification of the Pizza ontology across all three reasoners:
+Compares classification of the Pizza ontology across all three reasoners. Note that `benchmark/reference/pizza-reference.owl` contains six `owl:hasValue` restrictions and two `owl:oneOf` enumerations, which this reasoner does not implement, so the `owl-dl` profile currently returns 143 of 144 classes undetermined and zero inferred subsumptions on it:
```bash
export OO_BIN=./target/release/open-ontologies
@@ -79,6 +79,8 @@ any Java reasoner should be made from this repository.** The reason our reasoner
does not complete is documented in [`regressions/`](regressions/): it does not
terminate on nominals, and LUBM emits one `owl:hasValue` per department.
-For a workload this engine *is* suited to, see the compiled claim-verification
-benchmark in [`docs/benchmarks.md`](../../docs/benchmarks.md), which is
-task-matched and audited against HermiT for agreement rather than speed alone.
+For a workload the compiled `claimcheck` module *is* suited to, see the
+claim-verification benchmark in [`docs/benchmarks.md`](../../docs/benchmarks.md),
+which is task-matched and audited against HermiT for agreement rather than speed
+alone. That module is a library benchmark. No MCP tool and no CLI subcommand
+calls it, so it is not part of the shipped server or binary.
diff --git a/benchmark/reasoner/regressions/README.md b/benchmark/reasoner/regressions/README.md
index 53e1bc1b..a0ba6412 100644
--- a/benchmark/reasoner/regressions/README.md
+++ b/benchmark/reasoner/regressions/README.md
@@ -7,7 +7,10 @@ found that triggers the behaviour.
**Found:** 2026-07-27, while repairing the LUBM benchmark harness.
-`owl:hasValue` introduces a nominal (`∃R.{o}`), the "O" in SHOIQ. Nominals
+`owl:hasValue` introduces a nominal (`∃R.{o}`), the "O" in SHOIQ. This
+reasoner has no nominal constructor: `Concept` in `src/tableaux.rs` has no such
+variant, and `parse_restriction` approximates `owl:hasValue` as `∃R.A` where `A`
+is an atomic concept named after the individual. Nominals
break the tree-model property that ordinary subset blocking relies on, and the
current tableaux implementation appears to have no nominal-aware blocking. Cost
per additional nominal-bearing class is multiplicative, not additive:
@@ -71,6 +74,8 @@ ontologies. The fix is the NI-rule of Motik, Shearer and Horrocks, *Optimizing
the Nominal Introduction Rule in (Hyper)Tableau Calculi*, which bounds root
individual creation at `n` per `≤n R⁻.A` restriction instead of generating them
freely. Separately, `update_blocking` implements ancestor **subset** blocking,
-while SHIQ and SHOIQ require **pairwise** blocking once inverse roles and number
+Pairwise blocking, the second prerequisite noted here, has since been
+implemented: see `is_pairwise_blocked` in `src/tableaux.rs`. The NI-rule is
+still outstanding.
restrictions are present (Horrocks and Sattler). Both are prerequisites for any
published performance claim on a real corpus.
diff --git a/case-studies/dcat-us-binding/README.md b/case-studies/dcat-us-binding/README.md
index 7fa6827e..2228b46e 100644
--- a/case-studies/dcat-us-binding/README.md
+++ b/case-studies/dcat-us-binding/README.md
@@ -62,24 +62,38 @@ shapes GSA deleted were not stale. They were pointed at a graph that did not exi
## What it forced in this engine
Both cross-checks were run through `open-ontologies batch` (`load` then `shacl`) against
-pySHACL on identical inputs. The two agree exactly on reach, 191 focus nodes each, and
-disagree on findings:
+pySHACL on identical inputs, on 20 August 2026. The two agree exactly on reach, 191 focus
+nodes each, and disagreed on findings as follows. The engine defects in the right-hand
+column were fixed on 24 August 2026 and the table has not been re-measured since, so read
+it as the state on the date of the run:
-| Measure | pySHACL | this engine |
+| Measure | pySHACL | this engine, 20 Aug 2026 |
| --- | --: | --: |
| `sh:class` results | 165 | **0** |
| `sh:nodeKind` results | 122 | **0** |
| `sh:maxCount` results | 27 | 27 |
| `sh:datatype` results | 2 | **8** |
-Two defects, both ours:
-
-1. **`sh:class` and `sh:nodeKind` are not evaluated.** 287 of pySHACL's 316 findings are
- invisible to the engine.
-2. **`sh:datatype` rejects a correctly typed literal for derived numeric types.**
- `"1024"^^xsd:nonNegativeInteger` fails `sh:datatype xsd:nonNegativeInteger`, while
- `xsd:integer`, `xsd:decimal` and `xsd:string` all pass. Eight-line repro in the
- standalone repository's `tests/test_engine_findings.py`.
+Two defects, both ours, both fixed on 24 August 2026:
+
+1. **`sh:class` and `sh:nodeKind` under `sh:property` were not evaluated.** 287 of
+ pySHACL's 316 findings were invisible to the engine on this run. Both are evaluated
+ now, in `src/shacl.rs`, pinned by `tests/shacl_class_constraint_test.rs`. Two limits
+ remain and both apply to these shapes. Written on the node shape itself rather than
+ under `sh:property`, neither constraint is evaluated; it is recorded in
+ `skipped_constraints` and the verdict is null. Written as members of an `sh:or` list,
+ which is the form 153 of the 154 `sh:class` occurrences and 153 of the 274
+ `sh:nodeKind` occurrences in the recovered shapes take, the whole disjunction is
+ recorded in `skipped_constraints` and the verdict is null. So the fix turns most of
+ this corpus from a false clean into an explicit undetermined rather than into 287
+ findings.
+2. **`sh:datatype` rejected a correctly typed literal for derived numeric types.**
+ `"1024"^^xsd:nonNegativeInteger` failed `sh:datatype xsd:nonNegativeInteger`, while
+ `xsd:integer`, `xsd:decimal` and `xsd:string` all passed. Eight-line repro in the
+ standalone repository's `tests/test_engine_findings.py`. The store does not preserve
+ these datatype IRIs, so the constraint is now recorded in `skipped_constraints` and
+ the verdict is null instead of a false violation. The underlying store defect and the
+ workaround are written up in `docs/UPSTREAM_ISSUES.md`.
A third defect belongs to rdflib 7.6.0, which raises `UnboundLocalError` from
`plugins/parsers/jsonld.py:242` on a scalar JSON-LD document rather than producing the
diff --git a/case-studies/mcp-ies-rag-demo/README.md b/case-studies/mcp-ies-rag-demo/README.md
index ee4b2f30..b41f9126 100644
--- a/case-studies/mcp-ies-rag-demo/README.md
+++ b/case-studies/mcp-ies-rag-demo/README.md
@@ -57,7 +57,7 @@ open-ontologies marketplace install ies-4.3.1
open-ontologies load case-studies/mcp-ies-rag-demo/data/ies-sample.ttl
# 3. (Optional) generate embeddings if you want to use onto_search
-open-ontologies init # downloads the embedding model the first time
+open-ontologies init # on a build with --features embeddings, downloads the model the first time
# in MCP mode: ask Claude to call onto_embed
# 4. Run the competency questions
diff --git a/docs/benchmarks.md b/docs/benchmarks.md
index 0e812e56..e04071e3 100644
--- a/docs/benchmarks.md
+++ b/docs/benchmarks.md
@@ -97,7 +97,10 @@ Anatomy 0.829 F1 (9th of 13 in the OAEI 2025 field), Conference 0.438 (below eve
The claim-verification benchmark measures the workload the `claimcheck` module
is built for: a fixed ontology, compiled once, against a stream of candidate
claims (small sets of type/relation assertions), each answered consistent /
-rejected / undetermined.
+rejected / undetermined. `claimcheck` is a library module. No MCP tool in
+`src/server.rs` and no CLI subcommand in `src/main.rs` calls it, so these figures
+describe a module measured on its own and not a capability of the shipped server
+or binary.
### Methodology
@@ -125,9 +128,15 @@ rejected / undetermined.
| HermiT, warm | 4,936 µs | — | ~200 claims/s |
| compiled token-bitset check | 0.3 µs | 0.4 µs | 3.1M/s seq, 11.2M/s batched |
+Latency and throughput come from `tests/claimcheck_pizza_bench.rs`, over a
+rotation of four claims against the compiled Pizza ontology. The results are
+printed, not committed. Reproduce by writing `/tmp/pizza_compiled.json` with
+`CompileOntology`, then `cargo test --release --test claimcheck_pizza_bench --
+--nocapture`. Without that input the test skips and still passes.
+
| Correctness | result |
| --- | --- |
-| agreement with HermiT, 78,884 audited pairs (13 ontologies) | 100% |
+| unsound rejections vs HermiT, 78,884 audited pairs (13 ontologies) | 0, with 23 pairs left to the residual tier |
| agreement on 793 structurally adversarial claims (8 ontologies) | 100%, 0 false negatives |
| contradiction recall, pizza.owl | 3,944/3,944 (100%) |
| contradiction recall, ore_ont_10230 | 232/232 (100%) |
@@ -157,6 +166,18 @@ make bench-ontoaxiom # Just OntoAxiom
make bench-reasoner # Just reasoner comparison
```
+The claim-verification benchmark has no `make` target. Run it directly:
+
+```bash
+cd benchmark/reasoner && ./setup_jars.sh
+javac -cp "lib/*" CompileOntology.java
+java -cp ".:lib/*" CompileOntology <pizza.owl> /tmp/pizza_compiled.json
+cd ../.. && cargo test --release --test claimcheck_pizza_bench -- --nocapture
+```
+
+The Rust test skips when `/tmp/pizza_compiled.json` is absent, and it asserts on
+the `http://www.co-ode.org/ontologies/pizza/pizza.owl#` namespace.
+
## Determinism and corrected results
Two subsystems in this repository were nondeterministic: tableaux classification
diff --git a/docs/embeddings.md b/docs/embeddings.md
index 366d0108..8c60183b 100644
--- a/docs/embeddings.md
+++ b/docs/embeddings.md
@@ -1,8 +1,8 @@
# Semantic Embeddings (Poincare Vector Store)
-Open Ontologies includes a built-in dual-space vector store for semantic search and alignment:
+Open Ontologies has a dual-space vector store for semantic search and alignment, available in builds compiled with the `embeddings` feature:
-- **Text embeddings** via ONNX model (bge-small-en-v1.5) — captures label/definition similarity
+- **Text embeddings** via a local ONNX model (`paraphrase-multilingual-MiniLM-L12-v2`, 384 dimensions) that captures label and definition similarity across languages
- **Structural embeddings** via Poincare ball — captures hierarchy position (root classes near center, leaves near boundary)
- **Product search** — combines both spaces for best results
@@ -10,7 +10,7 @@ Open Ontologies includes a built-in dual-space vector store for semantic search
onto_load → onto_embed → onto_search "domestic animal"
```
-The embedding model (~33MB) is downloaded on `open-ontologies init`. All inference runs locally via tract (pure Rust ONNX runtime) — no API keys or external services needed.
+This subsystem is a compile-time feature. Build with `cargo build --release --features embeddings`. The pre-built binaries and the GHCR image do not have it, and on those `onto_embed`, `onto_search`, `onto_similarity` and `onto_hnsw_build` return `Compiled without embeddings feature. Rebuild with --features embeddings`. On a build that has the feature, `open-ontologies init` downloads a 448 MB ONNX model and a 16 MB tokenizer into `~/.open-ontologies/models`. All inference then runs locally via tract, a pure Rust ONNX runtime, with no API keys and no external services.
## Tools
@@ -35,7 +35,7 @@ The structural (Poincare) half has one, and will keep having one: TurboQuant
scores inner products, and hyperbolic distance is not an inner product on the
ambient coordinates.
-| | `embeddings` (default) | `turbovec` |
+| | `embeddings` (the default index backend) | `turbovec` |
| --- | --- | --- |
| Algorithm | HNSW graph (`instant-distance`) | TurboQuant quantiser (`turbovec`, arXiv:2504.19874) |
| Entry point | `VecStore::search_cosine_hnsw` | `VecStore::search_cosine_turbo` |
diff --git a/docs/ies-ecosystem.md b/docs/ies-ecosystem.md
index 2c152949..5e77dab6 100644
--- a/docs/ies-ecosystem.md
+++ b/docs/ies-ecosystem.md
@@ -42,8 +42,8 @@ onto_lint
```
Expected output:
-- 513 classes, 206 object properties, 4,040 triples
-- 0 lint issues (IES v5 is well-formed)
+- 513 classes counted structurally (511 declared with `rdfs:Class`), 162 object properties and 44 datatype properties for 206 in total, 4,039 triples
+- 19 lint issues, all info-level `missing_domain` notices, and no warnings or errors
### Step 2: Reason
@@ -203,6 +203,6 @@ See [ies-alignment.md](ies-alignment.md) for the full IES:Building alignment wal
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| IES Top (ToLO) | ~22 | TBD | TBD | TBD | TBD | TBD |
| IES Core | ~131 | TBD | TBD | TBD | TBD | TBD |
-| **IES Common** | **513** | **206** | **4,040** | **+3,094** | **911ms** | **63ms** |
+| **IES Common** | **513** | **206** | **4,039** | **+3,094** | not measured | **63ms** |
-IES Common is the second-largest ontology in the marketplace by class count (after Schema.org's 1,009). RDFS reasoning adds 77% more triples — the richest inference gain of any non-general ontology, driven by the deep 4D State/Event/ClassOfEntity hierarchies.
+IES Common is the second-largest ontology in the marketplace by class count, after Schema.org, which the marketplace benchmark records at 1,032 classes. RDFS reasoning adds 77% more triples — the richest inference gain of any non-general ontology, driven by the deep 4D State/Event/ClassOfEntity hierarchies.
diff --git a/docs/interop-with-graph-platforms.md b/docs/interop-with-graph-platforms.md
index 55daf6b6..3efffbdc 100644
--- a/docs/interop-with-graph-platforms.md
+++ b/docs/interop-with-graph-platforms.md
@@ -15,7 +15,7 @@ entities and relationships, and assemble a graph. They are pipelines, written
in Python, with orchestration, storage, and retrieval included.
Open Ontologies **verifies and governs**: it is a single Rust binary with no
-model client inside it, exposing ~95 MCP tools over a formal store. Its job
+model client inside it, exposing 109 MCP tools over a formal store. Its job
starts where extraction ends.
```
diff --git a/docs/layer3-compiled-reasoning.md b/docs/layer3-compiled-reasoning.md
index 9db95122..8bca0ccc 100644
--- a/docs/layer3-compiled-reasoning.md
+++ b/docs/layer3-compiled-reasoning.md
@@ -2,6 +2,7 @@
**Module:** `src/claimcheck.rs` · **Compile step:** `benchmark/reasoner/CompileOntology.java`
**Verification harness:** `benchmark/layer3-prototype/` · **Status:** measured 2026-07-27
+**Exposure:** library module only. No MCP tool in `src/server.rs` and no CLI subcommand in `src/main.rs` calls it. The only caller in the repository is `tests/claimcheck_pizza_bench.rs`.
## The problem shape
@@ -118,7 +119,7 @@ stated, verdicts cross-checked against HermiT 1.4.3.456.
| --- | --- | --- |
| HermiT, warm JVM, amortised load | 4,936 µs | — |
| compiled, Oxigraph-probe variant | 35.4 µs | 61.5 µs |
-| **compiled, token bitsets** | **0.3 µs** | **0.4 µs** |
+| **compiled, token bitsets** | **0.3 µs** | **0.4 µs** (four-claim rotation, warm cache) |
Throughput: 3.1M claims/s single-threaded, 11.2M/s batched.
@@ -136,7 +137,7 @@ pair) and adversarial structural claims:
| | result |
| --- | --- |
| unsound rejections, 78,884 pairs, 13 ontologies | **0** |
-| agreement, 793 structural claims, 8 ontologies | **100%**, 0 false negatives |
+| agreement, 793 structural claims, 8 ontologies | **100%**, 0 false negatives (stdout only, no artefact committed) |
| contradiction recall, pizza.owl | **3,944/3,944 (100%)** |
| contradiction recall, ore_ont_10230 | **232/232 (100%)** |
| tier-2 residual, structural corpus aggregate | 4.9% of claims |
@@ -186,17 +187,23 @@ exhaustive-matrix audit is the stable metric.
## Reproduction
```
-# compile an ontology
-java -cp ".:lib/*" CompileOntology <ont.owl> compiled.json
+# from benchmark/reasoner: fetch the jars (gitignored) and build the compile step
+./setup_jars.sh
+javac -cp "lib/*" CompileOntology.java DisjointnessMatrix.java
+
+# compile an ontology. The Rust bench reads this exact path and no other.
+java -cp ".:lib/*" CompileOntology <ont.owl> /tmp/pizza_compiled.json
# exhaustive ground-truth matrix
java -cp ".:lib/*" DisjointnessMatrix <ont.owl> matrix.csv
-# parity + adversarial structural claims
+# from the repository root: parity and adversarial structural claims
python benchmark/layer3-prototype/structural_parity.py <ont.owl> 120
python benchmark/layer3-prototype/verify_join_soundness.py <corpus_dir> 250
-# Rust bench (loads compiled.json)
+# Rust bench. It skips when /tmp/pizza_compiled.json is absent, and its
+# assertions use the http://www.co-ode.org/ontologies/pizza/pizza.owl# namespace,
+# so the ontology compiled above must carry those IRIs.
cargo test --release --test claimcheck_pizza_bench -- --nocapture
```
@@ -213,7 +220,7 @@ R5 A ⊑ ∀R.(C…), B ⊑ ∀R.(D…), every Ci disjoint every Dj,
```
plus `DataExactCardinality(1, p, DataOneOf(v))` recognised as a pinned value
-for RD. Effect on the 12-ontology exhaustive audit: tier-2 residual fell from
+for RD. Effect on the 13-ontology exhaustive audit: tier-2 residual fell from
501 to **23 pairs of 78,884** (aggregate recall 99.83%), still **0 unsound**;
the diagnosed ontology went 96.1% → 99.9%. Pizza and ore_ont_10230 hold at
100%.
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 7d64cbd4..c645bc86 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -10,7 +10,7 @@ curl -LO https://github.com/fabio-rovai/open-ontologies/releases/latest/download
chmod +x open-ontologies-aarch64-apple-darwin
mv open-ontologies-aarch64-apple-darwin /usr/local/bin/open-ontologies
-# Initialize (creates ~/.open-ontologies, downloads embedding model)
+# Initialize (creates ~/.open-ontologies with a database and a default config)
open-ontologies init
```
@@ -42,7 +42,7 @@ Claude will call `onto_validate` -> `onto_load` -> `onto_stats` -> `onto_lint` a
## CLI mode
-Every MCP tool also works as a CLI subcommand:
+Most MCP tools also work as CLI subcommands. The embedding tools (`onto_embed`, `onto_search`, `onto_similarity`) are MCP only and have no CLI equivalent in any build.
```bash
# Validate a Turtle file
@@ -52,11 +52,11 @@ open-ontologies validate pizza.ttl
open-ontologies load pizza.ttl
open-ontologies query "SELECT ?class WHERE { ?class a owl:Class }" --pretty
-# Run OWL2-DL reasoning
+# Run SHIQ tableaux reasoning
open-ontologies reason --profile owl-dl
-# Semantic search (requires embeddings)
-open-ontologies init # downloads model if needed
+# Semantic search (requires a build with --features embeddings)
+open-ontologies init # on an embeddings build, downloads a 448 MB ONNX model and a 16 MB tokenizer
# then via MCP: onto_embed -> onto_search "domestic animal"
```
@@ -64,6 +64,6 @@ open-ontologies init # downloads model if needed
- [Data Pipeline](data-pipeline.md) -- ingest CSV/JSON/Parquet into your ontology
- [Ontology Lifecycle](lifecycle.md) -- plan, enforce, apply, monitor changes
-- [OWL2-DL Reasoning](reasoning.md) -- native Rust SHOIQ tableaux
+- [SHIQ Reasoning](reasoning.md) -- native Rust SHIQ tableaux, no nominals
- [Semantic Embeddings](embeddings.md) -- dual-space search (text + Poincare)
- [Benchmarks](benchmarks.md) -- performance numbers and comparisons
diff --git a/docs/reasoning.md b/docs/reasoning.md
index 28e65845..f5898735 100644
--- a/docs/reasoning.md
+++ b/docs/reasoning.md
@@ -1,6 +1,16 @@
-# OWL2-DL Reasoning
+# SHIQ Reasoning
-Native Rust SHOIQ tableaux reasoner — no JVM required.
+Native Rust SHIQ tableaux reasoner. No JVM is required.
+
+The implemented logic is SHIQ: ALC with transitive roles, role hierarchies,
+inverse roles and qualified number restrictions. Nominals are not implemented.
+The `Concept` enum has no nominal constructor, `owl:oneOf` is never parsed and
+falls through to an opaque atomic class, `owl:hasValue` is approximated as an
+existential restriction whose filler is an atomic concept named after the
+individual, and datatype ranges are skipped. An ontology that uses
+`owl:hasValue` returns undetermined classes rather than a classification. The
+measurements are in
+[benchmark/reasoner/regressions/README.md](../benchmark/reasoner/regressions/README.md).
| DL Feature | Symbol | OWL Construct |
| ---------- | ------ | ------------- |
@@ -17,6 +27,9 @@ Native Rust SHOIQ tableaux reasoner — no JVM required.
| Symmetric roles | Sym(R) | SymmetricProperty |
| Functional | Fun(R) | FunctionalProperty |
| ABox reasoning | a:C | NamedIndividual |
+| Nominals | {a} | oneOf: not implemented |
+| Nominal in a restriction | exists R.{a} | hasValue: approximated as an atomic concept |
+| Datatypes | d | Datatype ranges are skipped |
## Agent-Based Parallel Classification
@@ -25,11 +38,11 @@ Native Rust SHOIQ tableaux reasoner — no JVM required.
3. **Explanation Agent** — Traces clash derivations for unsatisfiable classes
4. **ABox Agent** — Individual consistency and type inference
-| Reasoner | Language | JVM | Parallel | SHOIQ |
+| Reasoner | Language | JVM | Parallel | Logic |
| -------- | -------- | --- | -------- | ----- |
-| **Open Ontologies** | Rust | No | Yes (rayon) | Yes |
-| HermiT | Java | Yes | No | Yes |
-| Pellet | Java | Yes | No | Yes |
+| **Open Ontologies** | Rust | No | Yes (rayon) | SHIQ |
+| HermiT | Java | Yes | No | SROIQ(D) |
+| Pellet | Java | Yes | No | SROIQ(D) |
## Reasoning Profiles
@@ -38,7 +51,7 @@ Native Rust SHOIQ tableaux reasoner — no JVM required.
| `rdfs` | Subclass closure, domain/range inference |
| `owl-rl` | + transitive/symmetric/inverse, sameAs, equivalentClass |
| `owl-rl-ext` | + someValuesFrom, allValuesFrom, hasValue, intersectionOf, unionOf |
-| `owl-dl` | Full SHOIQ tableaux: satisfiability, classification, ABox reasoning |
+| `owl-dl` | SHIQ tableaux: satisfiability, classification, ABox reasoning. Nominals are not implemented and datatype ranges are skipped |
## Tools
diff --git a/funding.json b/funding.json
index 1db30d1c..524f493f 100644
--- a/funding.json
+++ b/funding.json
@@ -14,7 +14,7 @@
{
"guid": "open-ontologies",
"name": "Open Ontologies",
- "description": "Open Ontologies is a Rust MCP (Model Context Protocol) server and desktop Studio for AI-native ontology engineering. It exposes 70+ tools that let an LLM client build, validate, query, diff, lint, version, reason over, align, plan, certify and govern RDF/OWL ontologies against an in-memory Oxigraph triple store. It ships as a single binary with no JVM and no Protege dependency, and covers OWL 2 profile checking, SHACL validation, SPARQL, OWL-RL reasoning, ontology diffing, a marketplace of 33 standard ontologies, IES (Information Exchange Standard) support for UK defence and government data, semantic embeddings, PDDL planning, and a full lineage audit trail. The design is deliberately MCP-native: the server provides validation, scaffolding and proof, while the connected model supplies the intelligence. There are no embedded LLM clients, no API keys and no provider lock-in, so the same engine runs offline and in air-gapped environments. Open Ontologies is the verification engine behind a public programme of register-integrity audits, where every published finding is re-checked by an independent path before release. Funding supports maintenance, cross-platform release engineering, the reasoning and planner layers, and continued free distribution.",
+ "description": "Open Ontologies is a Rust MCP (Model Context Protocol) server and desktop Studio for AI-native ontology engineering. It exposes 109 tools that let an LLM client build, validate, query, diff, lint, version, reason over, align, plan, certify and govern RDF/OWL ontologies against an in-memory Oxigraph triple store. All 109 ship in a default build, and 8 of them require an optional Cargo feature (embeddings, plugins, postgres or duckdb). It ships as a single binary with no JVM and no Protege dependency, and covers OWL 2 profile checking, SHACL validation, SPARQL, OWL-RL reasoning, ontology diffing, a marketplace of 33 standard ontologies, IES (Information Exchange Standard) support for UK defence and government data, semantic embeddings in builds compiled with the embeddings feature, PDDL planning, and a full lineage audit trail. The design is deliberately MCP-native: the server provides validation, scaffolding and proof, while the connected model supplies the intelligence. There are no embedded LLM clients, no API keys and no provider lock-in, so the same engine runs offline and in air-gapped environments. Open Ontologies is the verification engine behind a public programme of register-integrity audits, where every published finding is re-checked by an independent path before release. Funding supports maintenance, cross-platform release engineering, the reasoning and planner layers, and continued free distribution.",
"webpageUrl": {
"url": "https://github.com/fabio-rovai/open-ontologies"
},
diff --git a/python/README.md b/python/README.md
index dcdaa89d..ba2261f4 100644
--- a/python/README.md
+++ b/python/README.md
@@ -154,7 +154,7 @@ report["conforms"] # None, because nothing was examined
## Relationship to the Rust engine
-This is the **Python layer** of the project. For the full engine (three-layer Dynamics/Causal/Planner architecture, HNSW semantic search, OWL2-DL tableaux reasoning, PDDL planning, governance, 100 tools), use the [Rust build](https://github.com/fabio-rovai/open-ontologies). Same Oxigraph core; pick the weight class you need.
+This is the **Python layer** of the project. For the full engine (three-layer Dynamics/Causal/Planner architecture, HNSW semantic search, SHIQ tableaux reasoning, PDDL planning, governance, 109 tools), use the [Rust build](https://github.com/fabio-rovai/open-ontologies). HNSW semantic search there is a compile-time feature, so build with `--features embeddings`; the published binaries do not carry it. Same Oxigraph core; pick the weight class you need.
## License
diff --git a/skills/ontology-engineer.md b/skills/ontology-engineer.md
index 623b0f6b..ddb0e19b 100644
--- a/skills/ontology-engineer.md
+++ b/skills/ontology-engineer.md
@@ -5,7 +5,7 @@ description: Use when building, modifying, or validating ontologies. Orchestrate
# Ontology Engineer
-AI-native ontology engineering using OpenCheir's `onto_*` MCP tools (50+ tools).
+AI-native ontology engineering using the Open Ontologies `onto_*` MCP tools (109 tools, 8 of which require an optional Cargo feature).
## When to Use
@@ -83,7 +83,7 @@ onto_plan / onto_enforce / onto_apply / onto_monitor / onto_drift
3. **Always lint after loading** — `onto_lint` catches missing labels and domains
4. **Version before pushing** — `onto_version` before `onto_push` (enforcer rule)
5. **Iterate, don't declare done** — if any check fails, fix and re-run from Phase 3
-6. **Use embeddings for semantic search and alignment** — call `onto_embed` once after `onto_load`, then `onto_search` / `onto_similarity` work, and `onto_align` automatically uses embeddings as a 7th signal.
+6. **Use embeddings for semantic search and alignment.** On a build with `--features embeddings`, call `onto_embed` once after `onto_load`; then `onto_search` and `onto_similarity` work, and `onto_align` uses embeddings as a 7th signal. On a default build those three tools return an error and `onto_align` runs on 6 signals.
7. **Cache, don't re-parse** — when juggling several `.ttl` files, use `onto_cache_list` / `onto_repo_load` to leverage the on-disk N-Triples cache.
## Tool Quick Reference
diff --git a/skills/ontology-engineering/SKILL.md b/skills/ontology-engineering/SKILL.md
index cfdde2b6..14799238 100644
--- a/skills/ontology-engineering/SKILL.md
+++ b/skills/ontology-engineering/SKILL.md
@@ -5,7 +5,7 @@ description: Build, validate, and govern RDF/OWL ontologies using the Open Ontol
# Ontology Engineering Workflow
-You have access to the Open Ontologies MCP server, which provides 50+ tools for AI-native ontology engineering backed by an in-memory Oxigraph triple store.
+You have access to the Open Ontologies MCP server, which provides 109 tools for AI-native ontology engineering backed by an in-memory Oxigraph triple store. All 109 are available in a default build, but 8 require an optional Cargo feature and return an error without it: four need `embeddings`, two need `plugins`, and two need `postgres` or `duckdb`.
## Core Workflow
@@ -82,7 +82,7 @@ When applying an ontology to external data:
## Semantic Search and Embeddings
-After loading, generate embeddings to enable natural-language search:
+After loading, generate embeddings to enable natural-language search. This requires a server built with `--features embeddings`; on a default build the three tools below return `Compiled without embeddings feature`.
- `onto_embed` — generate text + Poincaré structural embeddings for every class. Honours `[embeddings] provider = "local" | "openai"` and the `OPEN_ONTOLOGIES_EMBEDDINGS_*` env vars.
- `onto_search` — natural-language query → most-similar classes (`mode: "text" | "structure" | "product"`).
diff --git a/src/classify_el.rs b/src/classify_el.rs
index 24ccf969..3502a07b 100644
--- a/src/classify_el.rs
+++ b/src/classify_el.rs
@@ -12,7 +12,7 @@
//! emits the **full classification table** — every materialised
//! `?sub rdfs:subClassOf ?super` pair, sorted, deduplicated.
//!
-//! For deep OWL-DL (SHOIQ), use `onto_dl_check` / `onto_dl_explain` which
+//! For deep SHIQ subsumption, use `onto_dl_check` / `onto_dl_explain` which
//! delegate to the tableaux reasoner.
use crate::graph::GraphStore;
diff --git a/src/server.rs b/src/server.rs
index 8f3bb3a3..b869c035 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -1216,7 +1216,7 @@ impl OpenOntologiesServer {
result.to_string()
}
- #[tool(name = "onto_shacl", description = "Validate the loaded ontology data against SHACL shapes. Checks cardinality (minCount/maxCount), datatypes, and class constraints. Returns a conformance report with violations.")]
+ #[tool(name = "onto_shacl", description = "Validate the loaded ontology data against SHACL shapes. Checks the core constraint components written under `sh:property`, including `sh:minCount`, `sh:maxCount`, `sh:datatype`, `sh:class`, `sh:nodeKind`, `sh:pattern`, `sh:in`, `sh:hasValue`, `sh:or` and `sh:not`, plus `sh:sparql`. A constraint it cannot execute is listed in `skipped_constraints` and the verdict is null rather than true. Returns a conformance report with violations, `focus_nodes` and `unmatched_shapes`.")]
async fn onto_shacl(&self, Parameters(input): Parameters<OntoShaclInput>) -> String {
use crate::shacl::ShaclValidator;
let shapes = if input.inline.unwrap_or(false) {
@@ -1398,7 +1398,7 @@ impl OpenOntologiesServer {
.unwrap_or_else(|e| Self::err_json(format!("serialization: {}", e)))
}
- #[tool(name = "onto_classify_el", description = "Classify the loaded ontology in the OWL-EL fragment (#30). Materialises OWL-RL-ext entailments in a sandbox copy of the graph and emits every distinct subsumption `?sub rdfs:subClassOf ?super` (transitive closure, deduplicated, owl:Thing-trivial pairs removed). For deep SHOIQ subsumption, use `onto_dl_check` / `onto_dl_explain`.")]
+ #[tool(name = "onto_classify_el", description = "Classify the loaded ontology in the OWL-EL fragment (#30). Materialises OWL-RL-ext entailments in a sandbox copy of the graph and emits every distinct subsumption `?sub rdfs:subClassOf ?super` (transitive closure, deduplicated, owl:Thing-trivial pairs removed). For deep SHIQ subsumption, use `onto_dl_check` / `onto_dl_explain`.")]
async fn onto_classify_el(&self) -> String {
match crate::classify_el::classify(&self.graph) {
Ok(r) => serde_json::to_string(&r)
@@ -1876,7 +1876,7 @@ impl OpenOntologiesServer {
body.to_string()
}
- #[tool(name = "onto_reason", description = "Run inference over the loaded ontology. Profiles: 'rdfs' (subclass, domain/range), 'owl-rl' (+ transitive/symmetric/inverse, sameAs, equivalentClass), 'owl-rl-ext' (+ someValuesFrom, allValuesFrom, hasValue, intersectionOf, unionOf), 'owl-dl' (Full OWL2-DL SHOIQ tableaux: satisfiability, classification, qualified number restrictions with node merging, inverse/symmetric roles, functional properties, parallel agent-based classification, explanation traces, ABox reasoning). Materializes inferred triples. Set `inference_graph` to keep them in a separate graph, where nothing downstream can read an inference as an assertion and a Turtle/RDF-XML save cannot publish one.")]
+ #[tool(name = "onto_reason", description = "Run inference over the loaded ontology. Profiles: 'rdfs' (subclass, domain/range), 'owl-rl' (+ transitive/symmetric/inverse, sameAs, equivalentClass), 'owl-rl-ext' (+ someValuesFrom, allValuesFrom, hasValue, intersectionOf, unionOf), 'owl-dl' (SHIQ tableaux: satisfiability, classification, qualified number restrictions with node merging, inverse/symmetric roles, functional properties, parallel agent-based classification, explanation traces, ABox reasoning. Nominals are not implemented: owl:oneOf is not read and owl:hasValue is approximated as an atomic concept, so an ontology that uses either returns undetermined classes rather than a classification. Datatype ranges are skipped). Materializes inferred triples. Set `inference_graph` to keep them in a separate graph, where nothing downstream can read an inference as an assertion and a Turtle/RDF-XML save cannot publish one.")]
async fn onto_reason(&self, Parameters(input): Parameters<OntoReasonInput>) -> String {
use crate::reason::Reasoner;
let profile = input.profile.as_deref().unwrap_or("rdfs");
@@ -2448,7 +2448,7 @@ impl OpenOntologiesServer {
}
}
- #[tool(name = "onto_embed", description = "Generate text + structural Poincaré embeddings for all classes in the loaded ontology. Requires the embedding model (run `open-ontologies init` to download). Embeddings enable semantic search via onto_search and improve alignment accuracy.")]
+ #[tool(name = "onto_embed", description = "Generate text + structural Poincaré embeddings for all classes in the loaded ontology. Requires a build with --features embeddings, plus the model (run `open-ontologies init` to download it). Embeddings enable semantic search via onto_search and improve alignment accuracy.")]
async fn onto_embed(&self, Parameters(input): Parameters<OntoEmbedInput>) -> String {
#[cfg(not(feature = "embeddings"))]
{ let _ = input; return r#"{"error":"Compiled without embeddings feature. Rebuild with --features embeddings"}"#.to_string(); }
@@ -2559,7 +2559,7 @@ impl OpenOntologiesServer {
} // cfg(feature = "embeddings")
}
- #[tool(name = "onto_hnsw_build", description = "Build (or rebuild) the HNSW cosine index over the loaded text embeddings with explicit `ef_construction` and `ef_search` parameters. Persists the index to SQLite by default so subsequent process restarts skip the rebuild. Use after onto_embed when you want to tune index quality vs. build/query time on larger ontologies. Default builder parameters are sensible for ontologies up to ~10k classes.")]
+ #[tool(name = "onto_hnsw_build", description = "Build (or rebuild) the HNSW cosine index over the loaded text embeddings with explicit `ef_construction` and `ef_search` parameters. Persists the index to SQLite by default so subsequent process restarts skip the rebuild. Use after onto_embed when you want to tune index quality vs. build/query time on larger ontologies. Default builder parameters are sensible for ontologies up to ~10k classes. Requires a build with --features embeddings.")]
async fn onto_hnsw_build(&self, Parameters(input): Parameters<OntoHnswBuildInput>) -> String {
#[cfg(not(feature = "embeddings"))]
{ let _ = input; return r#"{"error":"Compiled without embeddings feature. Rebuild with --features embeddings"}"#.to_string(); }
@@ -2858,6 +2858,6 @@ impl OpenOntologiesServer {
impl ServerHandler for OpenOntologiesServer {
fn get_info(&self) -> ServerInfo {
ServerInfo::new(ServerCapabilities::builder().enable_tools().enable_prompts().build())
- .with_instructions("Open Ontologies: AI-native ontology engine — RDF/OWL/SPARQL MCP server with 43 tools and 6 workflow prompts for ontology engineering, validation, comparison, alignment, data ingestion, and exploration.")
+ .with_instructions("Open Ontologies: AI-native ontology engine, an RDF/OWL/SPARQL MCP server with 109 tools and 6 workflow prompts for ontology engineering, validation, comparison, alignment, data ingestion, and exploration. All 109 tools are advertised in a default build; 8 of them require an optional Cargo feature (embeddings, plugins, postgres or duckdb) and return an error without it.")
}
}
diff --git a/src/shacl.rs b/src/shacl.rs
index 9b38d96c..1633e35c 100644
--- a/src/shacl.rs
+++ b/src/shacl.rs
@@ -13,7 +13,10 @@ use std::sync::Arc;
/// Supports the core constraints `sh:minCount`, `sh:maxCount`, `sh:datatype`,
/// `sh:class`, `sh:pattern`, `sh:hasValue`, `sh:in`, `sh:nodeKind`, `sh:or`,
/// `sh:not`, the inclusive and exclusive range bounds, and SPARQL-based
-/// constraints via `sh:sparql`.
+/// constraints via `sh:sparql`. Apart from `sh:or` and `sh:sparql`, those are
+/// read under `sh:property` only: the same predicate asserted directly on the
+/// node shape is not evaluated, and the whitelist at the node-shape complement
+/// below is what decides that.
///
/// All four target forms select focus nodes: `sh:targetClass` (including the
/// implicit class target), `sh:targetNode`, `sh:targetSubjectsOf` and
@@ -26,7 +29,12 @@ use std::sync::Arc;
/// not evaluated), or on the node shape itself (`sh:closed`, `sh:deactivated`).
/// A target that selects no nodes reaches the same null verdict by the other
/// route, `unmatched_shapes`. Reporting success for rules that were never run is
-/// the one failure mode this validator must not have.
+/// the one failure mode this validator must not have, and one case of it is
+/// open. The node-shape complement only inspects shapes returned by the
+/// `sh:targetClass` discovery query, so a shape whose only target is
+/// `sh:targetNode`, `sh:targetSubjectsOf` or `sh:targetObjectsOf` has its
+/// node-level constraints dropped with no `skipped_constraints` entry and the
+/// verdict comes back true.
pub struct ShaclValidator;
impl ShaclValidator {
@@ -187,9 +195,17 @@ impl ShaclValidator {
// undetermined. A constraint is by definition a predicate in the sh:
// namespace; a predicate from any other namespace on a shape node is
// an annotation or an axiom, never a constraint.
- let discovered: HashSet<&str> = shapes
+ // Every shape that selects focus nodes by any of the four target
+ // forms, not just the two the `sh:targetClass` query returns. Built
+ // from `targets` for that reason: reading `shapes` here filtered out
+ // any shape targeted only by `sh:targetNode`, `sh:targetSubjectsOf` or
+ // `sh:targetObjectsOf`, so a constraint on such a shape that this
+ // validator does not evaluate was dropped with no `skipped_constraints`
+ // entry and the run returned `conforms: true`. Pinned by
+ // `tests/shacl_node_target_skip_test.rs`.
+ let discovered: HashSet<&str> = targets
.iter()
- .filter_map(|s| s.get("shape").map(String::as_str))
+ .map(|(shape, _, _)| shape.as_str())
.collect();
let unknown_on_node = query_solutions(
&shapes_store,
diff --git a/src/tableaux.rs b/src/tableaux.rs
index 1c2dd788..cc823bb5 100644
--- a/src/tableaux.rs
+++ b/src/tableaux.rs
@@ -1,7 +1,11 @@
-//! OWL2-DL Tableaux Reasoner — SHOIQ with Agent-Based Classification
+//! SHIQ Tableaux Reasoner with Agent-Based Classification
//!
//! A native Rust implementation of a tableaux decision procedure for
-//! the SHOIQ Description Logic (the logical foundation of OWL2-DL).
+//! the SHIQ Description Logic: ALC extended with transitive roles, role
+//! hierarchies, inverse roles and qualified number restrictions. Nominals are
+//! not implemented, so this is a strict fragment of OWL 2 DL. `owl:oneOf` is
+//! not parsed, `owl:hasValue` is approximated as an atomic concept named after
+//! the individual, and datatype ranges are skipped.
//!
//! ## Description Logic Coverage
//!
@@ -81,7 +85,9 @@ const OWL_ON_CLASS: &str = "<http://www.w3.org/2002/07/owl#onClass>";
// ── Concept (Negation Normal Form) ──────────────────────────────────────
/// Description Logic concept in NNF (Negation Normal Form).
-/// All negations pushed to atomic level. Supports SHOIQ.
+/// All negations pushed to atomic level. Covers SHIQ. There is no nominal
+/// constructor in this enum, so `owl:oneOf` has no representation and
+/// `owl:hasValue` is carried as an atomic concept named after the individual.
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Concept {
Top,
@@ -1785,7 +1791,8 @@ impl Tableau {
false
}
- /// Subset blocking: node blocked by ancestor with ⊇ labels.
+ /// Applies pairwise ancestor blocking to every node. See
+ /// `is_pairwise_blocked` for the condition.
fn update_blocking(&mut self) {
let mut node_ids: Vec<u32> = self.nodes.keys().copied().collect();
// Sorted: HashMap iteration order is seeded per process, so an unsorted
@@ -1831,7 +1838,7 @@ impl Tableau {
/// Note `=`, not `⊆`. This replaces the previous implementation, which used
/// ancestor SUBSET blocking on the node label alone and ignored parents and
/// edge labels entirely. That was adequate for ALC but unsound for the
- /// SHOIQ this reasoner advertises.
+ /// SHIQ this reasoner implements.
///
/// This is deliberately the classical ancestor variant rather than HermiT's
/// "anywhere" blocking. Anywhere blocking yields smaller models but is a
@@ -2600,7 +2607,7 @@ impl DlReasoner {
let mut output = serde_json::json!({
"profile_used": "owl-dl",
"algorithm": "tableaux",
- "description_logic": "SHOIQ",
+ "description_logic": "SHIQ",
"consistent": consistent,
"tbox_consistent": tbox_consistent,
"named_classes": reasoner.named_classes.len(),
diff --git a/studio/README.md b/studio/README.md
index 2e19fc7d..8fd2970c 100644
--- a/studio/README.md
+++ b/studio/README.md
@@ -35,7 +35,7 @@ Natural language ontology engineering via a model provider chosen at runtime.
**How it works:**
- The agent runs as a Node.js sidecar process (`src-tauri/sidecars/agent/`), spawned by Tauri 3 seconds after the engine starts.
-- The sidecar connects a model to the Open Ontologies engine via its MCP endpoint (`http://localhost:<port>/mcp`, port 8137 by default, passed down from the Rust host), giving it access to the engine's full tool set: `src/server.rs` currently declares roughly 103 `onto_*` tools (`onto_load`, `onto_query`, `onto_validate`, `onto_lint`, `onto_reason`, `onto_enforce`, `onto_plan`, `onto_apply`, `onto_save`, `onto_diff`, `onto_align`, `onto_embed`, `onto_search`, and many more) -- check that file for the current count rather than trusting a number here, since it grows.
+- The sidecar connects a model to the Open Ontologies engine via its MCP endpoint (`http://localhost:<port>/mcp`, port 8137 by default, passed down from the Rust host), giving it access to the engine's whole tool set: `src/server.rs` declares 109 `onto_*` tools (`onto_load`, `onto_query`, `onto_validate`, `onto_lint`, `onto_reason`, `onto_enforce`, `onto_plan`, `onto_apply`, `onto_save`, `onto_diff`, `onto_align`, `onto_embed`, `onto_search`, and the rest). All 109 are advertised in a default build; 8 need an optional Cargo feature to run. Re-derive the count with `grep -c 'tool(name' src/server.rs` if this number looks stale.
- Provider selection (`providers/alias.ts`'s `selectProvider`) is a fallback chain, not a fixed SDK: `ONTO_PROVIDER=anthropic|openai|claude-cli` forces one; otherwise an explicit `ONTO_LLM_BASE_URL` selects an OpenAI-compatible endpoint; otherwise a present `ANTHROPIC_API_KEY` selects Anthropic; otherwise it falls back to a **local** OpenAI-compatible endpoint (`http://localhost:8081/v1` by default). This local fallback exists because an app launched from Finder has no shell environment, so an unconditional Anthropic default died with an authentication error before the first token.
- The Anthropic path (`providers/anthropic.ts`) calls the raw `@anthropic-ai/sdk` Messages API directly, not the separate Claude Agent SDK package. Its default model is `claude-opus-5` (`ONTO_LLM_MODEL` overrides it), used only when the fallback chain above actually selects Anthropic.
- The Tauri Rust backend communicates with the sidecar over stdin/stdout using a simple JSON protocol (`{ type: 'chat', message }` in, `{ type: 'text' | 'tool_call' | 'done' | 'error' }` out).
@@ -111,7 +111,7 @@ The live working file is `~/.open-ontologies/studio-live.ttl`. On startup the en
| Frontend | React 19, Vite 7, TypeScript 5.8, Tailwind CSS 4 |
| 3D graph | 3d-force-graph 1.79 (Three.js / WebGL) |
| State | Zustand 5 |
-| Engine | Rust, Axum 0.8, Oxigraph 0.4 (SPARQL), SQLite |
+| Engine | Rust, Axum 0.8, Oxigraph 0.5 (SPARQL), SQLite |
| MCP | rmcp 1 (Streamable HTTP transport) |
| AI agent | Node.js sidecar; `claude-opus-5` via `@anthropic-ai/sdk` when `ANTHROPIC_API_KEY` is set, otherwise a local OpenAI-compatible endpoint by default (see `providers/alias.ts`) |
diff --git a/studio/docs/plans/2026-03-14-studio-tauri-redesign.md b/studio/docs/plans/2026-03-14-studio-tauri-redesign.md
index 3a723c81..0d90301c 100644
--- a/studio/docs/plans/2026-03-14-studio-tauri-redesign.md
+++ b/studio/docs/plans/2026-03-14-studio-tauri-redesign.md
@@ -1,7 +1,7 @@
# Open Ontologies Studio — Tauri Redesign
**Date:** 2026-03-14
-**Status:** Approved
+**Status:** Approved, and superseded in implementation. This document describes a Claude Agent SDK subagent architecture. What shipped is a pluggable provider layer on the raw @anthropic-ai/sdk with a hand-written MCP client. See studio/README.md.
**Supersedes:** 2026-03-14-studio-architecture-redesign.md
## Problem
diff --git a/studio/docs/plans/2026-03-14-tauri-implementation-plan.md b/studio/docs/plans/2026-03-14-tauri-implementation-plan.md
index 88f07c3b..84ef1cf3 100644
--- a/studio/docs/plans/2026-03-14-tauri-implementation-plan.md
+++ b/studio/docs/plans/2026-03-14-tauri-implementation-plan.md
@@ -6,7 +6,7 @@
**Architecture:** Tauri spawns the engine binary (`open-ontologies serve-http --port 8080`) as a supervised sidecar. Frontend talks to engine via MCP HTTP for graph operations. Chat goes through a Node.js Agent SDK sidecar (stdin/stdout) that connects to the same engine. One engine instance, two clients (frontend + Agent SDK).
-**Tech Stack:** Tauri v2, React 19, Vite, TypeScript, Cytoscape.js, @anthropic-ai/claude-agent-sdk, @modelcontextprotocol/sdk, Tailwind CSS, Zustand
+**Tech Stack:** Tauri v2, React 19, Vite, TypeScript, Cytoscape.js, @anthropic-ai/sdk, @modelcontextprotocol/sdk, Tailwind CSS, Zustand
---
diff --git a/studio/src/hooks/useChat.ts b/studio/src/hooks/useChat.ts
index d3c5ecd5..ab1153d2 100644
--- a/studio/src/hooks/useChat.ts
+++ b/studio/src/hooks/useChat.ts
@@ -88,7 +88,7 @@ listen<string>('agent-message', (event) => {
try {
const data = JSON.parse(event.payload);
- // The agent's session id is a Claude SDK session, not an MCP session,
+ // The sidecar no longer emits a session id, and the graph store is shared
// and the graph store is shared across MCP sessions anyway. Adopting it
// as the proxy's MCP session poisoned every panel call after the first
// chat turn ("Session not found").
diff --git a/tests/owl2_conformance_test.rs b/tests/owl2_conformance_test.rs
index 00d2fef4..83f847b7 100644
--- a/tests/owl2_conformance_test.rs
+++ b/tests/owl2_conformance_test.rs
@@ -19,7 +19,7 @@
//! established DL reasoning benchmarks. Each test has a documented expected
//! result that matches the output of HermiT/Pellet/FaCT++ reference reasoners.
//!
-//! These serve as a validation oracle: if our SHOIQ tableaux produces the same
+//! These serve as a validation oracle: if our SHIQ tableaux produces the same
//! results as the reference reasoners, we have high confidence in correctness.
//!
//! Sources:
@@ -838,5 +838,5 @@ fn w3c_oracle_agent_metrics() {
> 0
);
assert!(agents["parallel_workers"].as_u64().unwrap() > 0);
- assert_eq!(parsed["description_logic"], "SHOIQ");
+ assert_eq!(parsed["description_logic"], "SHIQ");
}
diff --git a/tests/shacl_node_target_skip_test.rs b/tests/shacl_node_target_skip_test.rs
new file mode 100644
index 00000000..f3e6c767
--- /dev/null
+++ b/tests/shacl_node_target_skip_test.rs
@@ -0,0 +1,109 @@
+//! A node-level constraint must reach `skipped_constraints` whatever target form
+//! selected the shape.
+//!
+//! The node-shape complement builds its set of known shapes from the
+//! `sh:targetClass` discovery query alone. A shape whose only target is
+//! `sh:targetNode`, `sh:targetSubjectsOf` or `sh:targetObjectsOf` was therefore
+//! filtered out of that check, so an unimplemented constraint asserted directly
+//! on it was dropped with no record and the verdict came back `true`. Reporting
+//! success for a rule that was never run is the one failure mode this validator
+//! is built not to have, so it gets a test that fails before the fix.
+
+use open_ontologies::graph::GraphStore;
+use open_ontologies::shacl::ShaclValidator;
+use std::sync::Arc;
+
+const DATA: &str = r#"
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
+ @prefix ex: <http://example.org/> .
+
+ ex:Person a owl:Class .
+ ex:Address a owl:Class .
+
+ ex:alice a ex:Person ; ex:addr ex:notAnAddress .
+ ex:notAnAddress a ex:Person .
+"#;
+
+/// `sh:class` directly on the node shape is not evaluated by this validator, so
+/// it must be recorded. The only target here is `sh:targetNode`.
+const TARGET_NODE_SHAPES: &str = r#"
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
+ @prefix ex: <http://example.org/> .
+ ex:AliceShape a sh:NodeShape ;
+ sh:targetNode ex:alice ;
+ sh:class ex:Address .
+"#;
+
+const TARGET_SUBJECTS_OF_SHAPES: &str = r#"
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
+ @prefix ex: <http://example.org/> .
+ ex:AddrSubjectShape a sh:NodeShape ;
+ sh:targetSubjectsOf ex:addr ;
+ sh:class ex:Address .
+"#;
+
+const TARGET_OBJECTS_OF_SHAPES: &str = r#"
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
+ @prefix ex: <http://example.org/> .
+ ex:AddrObjectShape a sh:NodeShape ;
+ sh:targetObjectsOf ex:addr ;
+ sh:class ex:Address .
+"#;
+
+fn report(shapes: &str) -> serde_json::Value {
+ let graph = Arc::new(GraphStore::new());
+ graph.load_turtle(DATA, None).expect("load");
+ let json = ShaclValidator::validate(&graph, shapes).expect("validate");
+ serde_json::from_str(&json).expect("parse")
+}
+
+fn assert_recorded_and_suppressed(shapes: &str, label: &str) {
+ let r = report(shapes);
+
+ let skipped = r["skipped_constraints"]
+ .as_array()
+ .cloned()
+ .unwrap_or_default();
+ assert!(
+ skipped
+ .iter()
+ .any(|s| s["constraint"].as_str().unwrap_or_default().ends_with("#class")),
+ "{label}: node-level sh:class was dropped with no skipped_constraints entry: {r}"
+ );
+
+ assert!(
+ r["conforms"].is_null(),
+ "{label}: an unevaluated constraint must suppress the verdict, got {}: {r}",
+ r["conforms"]
+ );
+}
+
+#[test]
+fn a_target_node_shape_records_its_unevaluated_node_constraint() {
+ assert_recorded_and_suppressed(TARGET_NODE_SHAPES, "sh:targetNode");
+}
+
+#[test]
+fn a_target_subjects_of_shape_records_its_unevaluated_node_constraint() {
+ assert_recorded_and_suppressed(TARGET_SUBJECTS_OF_SHAPES, "sh:targetSubjectsOf");
+}
+
+#[test]
+fn a_target_objects_of_shape_records_its_unevaluated_node_constraint() {
+ assert_recorded_and_suppressed(TARGET_OBJECTS_OF_SHAPES, "sh:targetObjectsOf");
+}
+
+/// The control. A `sh:targetClass` shape already reached the complement before
+/// the fix, so this passes either way and catches a fix that works by
+/// disabling the check rather than widening it.
+#[test]
+fn a_target_class_shape_still_records_its_unevaluated_node_constraint() {
+ const SHAPES: &str = r#"
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
+ @prefix ex: <http://example.org/> .
+ ex:PersonShape a sh:NodeShape ;
+ sh:targetClass ex:Person ;
+ sh:class ex:Address .
+ "#;
+ assert_recorded_and_suppressed(SHAPES, "sh:targetClass");
+}
diff --git a/tests/tableaux_test.rs b/tests/tableaux_test.rs
index aa33312e..b7de57f9 100644
--- a/tests/tableaux_test.rs
+++ b/tests/tableaux_test.rs
@@ -949,7 +949,7 @@ fn test_dl_pizza_classification() {
#[test]
fn test_dl_description_logic_field() {
- // Verify output contains "description_logic": "SHOIQ"
+ // Verify output contains "description_logic": "SHIQ"
let store = Arc::new(GraphStore::new());
store
.load_turtle(
@@ -965,8 +965,8 @@ fn test_dl_description_logic_field() {
let result = Reasoner::run(&store, "owl-dl", false).unwrap();
let parsed: serde_json::Value = serde_json::from_str(&result).unwrap();
assert_eq!(
- parsed["description_logic"], "SHOIQ",
- "Output must report description_logic as SHOIQ"
+ parsed["description_logic"], "SHIQ",
+ "Output must report description_logic as SHIQ"
);
assert_eq!(parsed["algorithm"], "tableaux");
assert_eq!(parsed["profile_used"], "owl-dl");