Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
562f118
feat(startup): reject MCP calls until startup loading is done; built-…
Nov 10, 2026
dcb8054
feat(ontologies): bundled W3C vocabularies as fallback, workflow onto…
Nov 10, 2026
fda3d6b
feat(reasoning): rdf-reasoner-konclude 0.9.1; repair and weakening on…
Nov 10, 2026
b1160a2
docs: 1.8.0 changelog draft and README updates
Nov 10, 2026
acdb637
fix(mcp): explainEntailment resolves prefixed names through the names…
Nov 10, 2026
2059830
test(e2e): PMDCO user story, diagnose-repair-apply loop, PMDco repair…
Nov 10, 2026
c07b0fb
fix(repair): deletion repairs carry kind "delete"; drop the manual no…
Nov 10, 2026
14c6a6f
test: enable tests that were skipped or gated for the old reasoner an…
Nov 10, 2026
7a19e45
fix(reasoning): name IRIs in text as prefixed names or full IRIs, nev…
Nov 10, 2026
f6ab4d4
test: fix a type error in the reasoning test's namespace mock
Nov 10, 2026
22c1641
docs: README performance numbers on reasoner 0.9.1, notes for agents,…
Nov 10, 2026
4c8f735
docs(mcp): describe urn:vg:data as the data graph (TBox and ABox) in …
Nov 10, 2026
4ad0daa
chore(release): 1.8.0
Nov 10, 2026
ec835f7
chore: lower the typecheck ratchet baseline from 190 to 4
Nov 10, 2026
d40e498
chore(deps): npm audit fix
Nov 10, 2026
34b07fb
docs(solutions): learnings from the 1.8.0 release prep (explain pipel…
Nov 10, 2026
90fc6aa
chore(deps): rdf-reasoner-konclude 0.9.3; spike tests for the no-copy…
Nov 11, 2026
12b2d7d
perf(reasoner): worker-side phase timings in the reasoning stage meta…
Nov 11, 2026
e4869a0
test(reasoner): gate suite for the no-copy chain (oneOf/unionOf, blan…
Nov 11, 2026
34fd069
refactor(reasoner): reason over the real store, no reasoningBase copy…
Nov 11, 2026
eab7524
test(reasoner): inferred graph count stays exact after the package cl…
Nov 11, 2026
ed62833
bench(reasoner): preflight against a stale pre-bundled reasoner; peak…
Nov 11, 2026
c0d235a
perf(canvas): inferred triples tagged per quad; runReasoning returns …
Nov 11, 2026
7f3f30f
perf(canvas): index elements by IRI once per loaded link batch in Rea…
Nov 11, 2026
6f1d264
perf(canvas): create elements in chunks sized to the load, request da…
Nov 11, 2026
fbd88fe
perf(canvas): refresh inferred subjects in chunks; bench: whole-span …
Nov 11, 2026
22cbecf
docs: LUBM-1 numbers re-measured on a valid TBox; changelog for the n…
Nov 11, 2026
84b4526
docs(solutions): measurement pitfalls, no-copy reasoner chain, canvas…
Nov 11, 2026
2458777
bench: memory at four stages of a LUBM-1 session (RSS per process type)
Nov 11, 2026
4564736
docs: final benchmark numbers on the finished code; GALEN benchmark i…
Nov 11, 2026
186903f
perf(canvas): mount authoring decorators only for hovered, selected o…
Nov 11, 2026
7983cac
bench: DOM nodes, listeners and renderer RSS in the canvas-link scali…
Nov 11, 2026
3801cd7
fix(canvas): hover tracking for lazily mounted authoring decorators; …
Nov 11, 2026
cfa7a61
docs: final LUBM-1 numbers with lazy authoring decorators; condensed …
Nov 11, 2026
de659da
perf(canvas): entity card uses shared CSS classes and one fewer DOM node
Nov 11, 2026
e2c8118
perf(canvas): bare-path links above 300 links unless selected
Nov 11, 2026
620e171
docs: benchmark docs list timings only; memory figures removed
Nov 11, 2026
faefdb1
docs(claude): canvas and template memory rule; bench: EXTRA_CSS hook,…
Nov 11, 2026
c6542bc
test(canvas): footprint guard spec on the URL load path; layout and U…
Nov 11, 2026
4f7252a
Merge branch 'refactor/reasoner-real-store' into release/1.8.0
Nov 11, 2026
3db97e4
docs: relation labels show only on selection above 300 links; footpri…
Nov 11, 2026
f885006
docs: fold the unreleased changelog into 1.8.0
Nov 11, 2026
e93147e
docs: release notes for v1.8.0; changelog consistency
Nov 11, 2026
fbc8dd0
ci: run e2e on ubuntu-24.04 (Playwright 1.59 does not support 26.04)
Nov 11, 2026
a023462
test: read tracked fixtures instead of git-ignored bench copies; e2e …
Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
# End-to-end functional specs (reasoning / SHACL / SPARQL / MCP relay).
# Demo recording specs are excluded by playwright.config.ts (testIgnore).
e2e:
runs-on: ubuntu-latest
# Pinned: ubuntu-latest is 26.04, which Playwright 1.59 does not support (browser install fails).
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -66,6 +67,8 @@ jobs:
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Bench inputs (git-ignored copies served from public/)
run: cp src/__tests__/fixtures/pmdco.ttl public/bench-pmdco.ttl
- name: Build
run: npm run build
- name: Run e2e
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ _research_workspace/
# Benchmark ontology files (temporary, not for production)
public/bench-*.owl*
public/bench-*.ttl

# graphify output
graphify-out/
2 changes: 1 addition & 1 deletion .tsc-baseline.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"maxErrors": 190
"maxErrors": 4
}
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# Changelog

## [1.8.0] — 2026-11-11

Reasoning moves to rdf-reasoner-konclude 0.9.x (pinned 0.9.3): results change (see *Upgrade notes*), and repair suggestions are now computed by the reasoner. Startup is stricter: MCP tools answer only once startup loading has finished. Large graphs reason and render faster: `runReasoning` returns when the reasoner is done (LUBM-1: 126 s to 12 s), and the canvas finishes loading sooner.

### Upgrade notes

- **Inferred counts change with the reasoner (0.8.0 to 0.9.x).** Pizza (`bench-pizza.owl`): 137 inferred triples with 0.8.0, 165 with 0.9.1 and 170 with 0.9.3. PMDco classification: two direct edges that 0.8.0 lost are back (`PMD_0020243 ⊑ PMD_0023003`, `PMD_0080022 ⊑ PMD_0023003`). GALEN is unchanged (1,386). Re-measure any figure you published with 1.7.x.
- **Fewer unsound `rdf:type` assertions after materialization** (only ones the reasoner does not entail: a `someValuesFrom` filler typed from its owner, `hasSelf`, `hasValue` and `minCardinality` rules applied to `subClassOf`), and more types where the class hierarchy used to be incomplete.
- Texts, justifications and repair suggestions changed shape; see *Breaking changes*.

### Breaking changes

- **MCP tool calls are rejected until startup loading has finished.** Ontology autoload, `?rdfUrl=` data and the startup shapes load after the page opens, and a tool call during that window read a half-loaded graph. Calls now return `success: false` ("…still loading…") until `window.__startupComplete()` is `true` (a 120 s safety valve lifts the block if a start never completes). Scripts and agents that call a tool right after the page opens must wait for that flag or retry; the demo, relay and benchmark drivers in this repository were updated to wait (only the benchmark script has been run since).
- **An empty SHACL shapes URL in the settings now means "use the built-in ontology-quality shapes"** (it used to mean "do not load shapes"). The built-in shapes are the fallback only when neither `?shaclShapes=` nor the configured URL names shapes. Turn SHACL off with the SHACL toggle.
- **`explainDiagnostics` no longer returns laconic explanations.** The `laconicJustifications` field and the "Precise culprit (laconic — superfluous parts removed)" lines in `repairBrief` are gone. `justifications` still lists the whole axioms that cause each clash.
- *Why:* laconic explanations show which part of an axiom causes a clash (for example `A ⊑ B` inside `A ⊑ B ⊓ C`). The app used them for two things only: hints to the old weakening code, and extra wording in the agent-facing repair brief. The hints are obsolete, because the reasoner's `weaken()` now splits conjuncts itself and verifies each weaker axiom. The wording was never shown in the UI. Computing them was the most expensive step of the call: 180.5 s of 232 s for PMDCO plus one disjoint-class clash (node, real reasoner), and `explainDiagnostics` took about 513 s in the browser.
- *Impact:* agents that read `laconicJustifications` or the "Precise culprit" lines should read `justifications` instead. Repair suggestions are unaffected: they work on whole axioms, and weakenings still offer the dropped-conjunct alternatives. `rdf-reasoner-konclude` still provides `explainInconsistencyLaconic` for direct use.
- **`explainDiagnostics` justifications come from the reasoner's repair search.** Declarations (`C a owl:Class`) are not part of a justification, and the number of justifications can exceed `maxJustifications`. Repairs are one minimal verified set (a deletion set, as before), and weakenings are offered only when removing the culprit alone restores consistency, i.e. with a single independent clash.
- **Text in results names IRIs as prefixed names or full IRIs, never as bare local names.** The clash message of `runReasoning`, SHACL error text, repair rationales and weakening notes, the repair brief, SHACL repair text and the `explainEntailment` summary used the part after the last `#` or `/`, which is not unique across namespaces and cannot be passed back to a tool. They now use a prefix from the namespace map (`inc:frank`, `rdf:type`) or the full IRI when no prefix is registered. Structured fields were already full IRIs. The canvas still shows an `rdfs:label` in place of the name where the ontology has one. Agents that parse these texts need to adapt.

### Reasoning

- **rdf-reasoner-konclude 0.9.x, pinned to 0.9.3 (no caret).** 0.9.1 completes class hierarchies again, removes the unsound type post-processing, fixes the blank-node ids it returned, and removes an intermittent slow role realization (same output, up to 8× CPU on the Roberts ontology). LUBM-1 with data takes 11.4–11.7 s in the browser benchmark (see *Changes*).
- **Repair and weakening run on the reasoner.** `repair()`, `weaken()` and `assessEdit()` find and verify the repair sets; Ontosphere maps them onto the existing `RepairSuggestion` shape (ranking: smallest set first, then assertions before schema axioms). The panel and the `explainDiagnostics` tool share one worker command. The old greedy hitting set, minimality search, weakening enumerator and `verifyRepair` command are removed; SHACL repair suggestions are unchanged.
- **One explain per graph state.** The worker caches the whole-axiom justifications per input generation (any write to the store invalidates them) and hands them to `repair()` as a seed, so `runReasoning`, `explainDiagnostics` and the panel do not explain again.
- **`explainDiagnostics` is about four times faster on a large inconsistent ontology.** PMDCO plus one disjoint-class clash, headless Chromium: 513 s before, 128 s now. The gains come from reasoner 0.9.1 (`repair()` takes the justifications that were already computed instead of explaining again), no laconic pass, no classification of an inconsistent ontology, and one explain per graph state (cached, invalidated on every write to the store). Most of what remains is the first consistency check and explain inside `runReasoning` (99 s).
- **`explainDiagnostics` does not compute `unsatisfiableClasses` for an inconsistent ontology.** In an inconsistent ontology every class is unsatisfiable, so the list says nothing, and the classification took 52 s on PMDCO in the browser. The field is empty, the output carries `unsatisfiableClassesSkipped: "ontology-inconsistent"`, and the UI shows a toast ("Unsatisfiable classes not computed"). Consistent ontologies are unchanged.
- **Deletion repairs carry `kind: "delete"`**, as the tool description always said (weakenings carry `kind: "weaken"`). Before, a deletion had no `kind`.
- **`explainDiagnostics({ includeTimings: true })`** adds `timingsMs` (wall time of each stage and of each reasoner call) for diagnosing slow runs.
- **A stalled or crashed reasoner is a failed run.** SHACL is skipped, the result status is `error`, and the MCP tool `runReasoning` returns `success: false`.

### Startup and loading

- **`window.__startupComplete()`** reports whether startup loading has finished.
- **Shapes:** `?shaclShapes=` wins, then the configured shapes URL, then the built-in shapes (written only into an empty shapes graph).
- **`?workflowCatalog=off`** skips the startup load of the PyodideSemanticWorkflow catalog, for headless runs and evaluations.
- **The PyodideSemanticWorkflow ontology joins `urn:vg:ontologies` when a workflow is first dropped on the canvas**, not at startup, so it is not reasoning input for sessions that never use a workflow.
- **Bundled W3C vocabularies are a fallback.** `rdf`, `rdfs`, `owl` and `prov` are fetched from w3.org first; if that fails (blocked, offline) the copies shipped in `public/w3-vocabularies/` are used.

### Changes

- **README performance numbers re-measured on valid inputs with reasoner 0.9.3** (8 cores, headless Chromium; see *Performance*): reasoning-demo 1.1 s, Pizza 1.3–1.4 s, PMDCO 14.8–15.3 s, GALEN 3.9–4.0 s, LUBM-1 with data 11.4–11.7 s. The earlier LUBM-1 and GALEN figures loaded an OWL/XML TBox the RDF parser cannot read, so no inference took place and they measured only the canvas; the README's 2.6 s for PMDCO is not reproduced. Pizza reports 170 inferred triples with 0.9.3 (165 with 0.9.1; the change comes from the package version, the no-copy path was checked equal on the same package). The Konclude WASM table (native against WASM, in Node) is copied from the reasoner repository and still carries its 0.8.0 numbers.
- **`runReasoning` returns when the reasoner result is in.** The inferred triples reach the canvas afterwards, in chunks. LUBM-1 with data: 126 s to 11.4–11.7 s (reasoner 8.6–8.8 s); the canvas then settles in about 85–90 s (it was about 125 s).
- **Canvas loads are faster and shorter-blocking.** Elements are created in chunks, the inferred refresh runs in chunks, Reactodia's per-link element scan is replaced by an index, and the authoring decorators (inline Edit/Delete) are mounted only for the hovered, selected or edited element instead of for all elements. At 8,000 individuals the load settles in 19 s instead of 31 s and the longest single task drops from 4.9 s to 3.1 s.
- **Large canvases: relation labels show only on selection.** Above 300 links, links that are not selected are drawn as a bare line with arrowhead (no label, no per-link type subscription); selecting a link brings back its label and the full template, and links stay clickable. About 30 to 24.5 DOM nodes and 0.34 to 0.26 MB renderer memory per individual (1 element + 2 links; headless Chromium, no layout). Entity cards use shared CSS classes instead of per-node inline styles (one DOM node fewer per card). The threshold is `LEAN_LINKS_THRESHOLD` in `src/templates/RdfLinkTemplate.tsx`.
- **The halo's delete button (×) is gone.** It duplicated the entity's inline Delete; the Delete key and the inline buttons work as before.
- **The reasoner reads the real store** (rdf-reasoner-konclude 0.9.3, pinned): no copy, no write-back, inferences unchanged. About 1.4 s less on LUBM-1.

### Bug fixes

- **Dataset and Turtle export no longer drop literals that differ only by language or datatype.** The export de-duplicated quads by the literal's text alone, so `"chair"`, `"chair"@en` and `"chair"^^xsd:token` on the same subject and predicate collapsed into one. Exporting PMDco (commit 3b98aad) lost 7 triples this way, among them the labels of `PMD_0000964`, `PMD_0001003`, `IAO_0000112`, `IAO_0000115`, `dc:source` and `rdfs:label`. The same key was used for inferred quads. Loading was never affected.
- **Reasoning no longer reports success when the reasoner stalls.** A stalled or crashed run is now a failed run: SHACL is skipped, the result status is `error`, and the MCP tool `runReasoning` returns `success: false`.
- **`explainEntailment` resolves prefixed names like every other tool.** It took only full IRIs and answered "NOT entailed" (with `success: true`) for anything else, so `inc:frank` from a `queryGraph` row looked like an unentailed fact. Prefixed names now go through the namespace map, full IRIs pass unchanged, and an unknown prefix or a bare name is an error.
- **Validation reports carry a node id.** A SHACL violation without a focus node is attributed to its shape.
- **Blank-node values after reasoning** (`sh:class` on `x p [ a SubOfTarget ]`) conform again. The cause was inferred blank nodes coming back from the reasoner under another name; fixed in rdf-reasoner-konclude 0.9.1.

### Tests and tooling

- New browser tests: the PMDCO chemical-composition user story (data, ontology and shapes through URL parameters, reasoning, the `some_silicon` violation and its fix), the diagnose, repair, apply and re-check loop, and startup from URL parameters. Previously skipped tests are enabled (`owl:oneOf` realization, the import and TriG round trip on PMDco); the PMDco repair check at scale runs by default.
- The demo, relay and benchmark drivers wait for `window.__startupComplete()` before their first tool call. `scripts/bench-paper-table2.mjs` gains `--only` and `--fresh-browser`.
- `e2e/canvas-footprint.spec.ts` guards DOM nodes and listeners per element. Benchmark and profiling scripts (`scripts/bench-reasoner-phases.mjs`, `bench-canvas-links.mjs`, `profile-*.mjs`; the first refuses to run on a stale Vite pre-bundle), tests for the no-copy chain, graph counts and per-quad inferred tagging, and write-ups in `docs/solutions/` (measurement pitfalls, the live-store reasoner chain, canvas load performance).

## [1.7.7] — 2026-10-16

### Reasoning
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cff-version: 1.2.0
message: "If you use this software, please cite it using the metadata below."
title: "Ontosphere"
version: "1.5.0"
version: "1.8.0"
abstract: >
Ontosphere is a browser-based RDF/ontology knowledge graph editor. It loads RDF
from local files, remote URLs, or SPARQL/Fuseki endpoints; lets users author
Expand All @@ -25,7 +25,7 @@ authors:
repository-code: "https://github.com/ThHanke/ontosphere"
url: "https://thhanke.github.io/ontosphere/"
license: Apache-2.0
date-released: "2026-06-16"
date-released: "2026-11-11"
keywords:
- rdf
- ontology
Expand Down
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

After adding or changing any user-facing feature, always check whether `README.md` needs updating. Ask: does this change affect setup, UI behaviour, URL parameters, MCP tools, or AI integration? If yes, update the relevant README section and keep the Table of Contents in sync.

## Canvas and template memory

Every element and link on the canvas costs DOM nodes, listeners and renderer memory (LUBM-1: 17,174 elements, several GB). Any change to the element or link templates (`src/templates/`), to Reactodia decorations, overlays or the `@reactodia/workspace` patch must be investigated for its memory cost before it is merged:

- Measure with `node scripts/bench-canvas-links.mjs 100 300 1000` (dev server on :8091; add `EXTRA_CSS='...'` to try a style change without editing code). It prints DOM nodes, listeners and renderer RSS per size; the cost per element is the slope between sizes. Reference (measured 2026-11-11, one individual = 1 element plus 2 links): about 31 DOM nodes and 0.34 MB renderer memory per individual before the card/link changes, about 24.5 nodes and 0.26 MB now (unselected links above 300 links render as a bare path without label, see `RdfLinkTemplate.tsx`), and about 840 listeners at any size. `e2e/canvas-footprint.spec.ts` guards it (budget 38 nodes per individual at 90 individuals). Large-graph checks: `scripts/profile-memory-stages.mjs` (LUBM-1 by stage), `scripts/profile-layout-memory.mjs` (layout step), `scripts/profile-url-memory.mjs <url>` (a startup URL).
- Listeners must not grow with the element count. Anything mounted per element (portals, React roots, buttons that show only on hover or selection) must be mounted lazily: a portal container gets React's whole delegated listener set (about 138 listeners), so 17k of them cost 2.4M listeners. See `docs/solutions/performance-issues/canvas-large-load-dom-size-and-chunking-2026-11-11.md`.
- Restart the Vite dev server with `--force` after changing a dependency or a patch before measuring.

## Demo videos

See [docs/demo-scripts/HOWTO.md](docs/demo-scripts/HOWTO.md) when recording or creating demo videos.
Expand Down
Loading
Loading