Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
feat(case-study): MCP-over-IES-RAG demo (#27)
FABIOTESS99b558e20dd1
diff --git a/.gitignore b/.gitignoreindex d9d25691..7c063005 100644--- a/.gitignore+++ b/.gitignore@@ -3,5 +3,7 @@data/!case-studies/heritage-aerial/data/!case-studies/heritage-aerial/data/**+!case-studies/mcp-ies-rag-demo/data/+!case-studies/mcp-ies-rag-demo/data/**# Ignore generated OWL files in root, but keep benchmark references/*.owldiff --git a/case-studies/mcp-ies-rag-demo/README.md b/case-studies/mcp-ies-rag-demo/README.mdnew file mode 100644index 00000000..0e3561e1--- /dev/null+++ b/case-studies/mcp-ies-rag-demo/README.md@@ -0,0 +1,103 @@+# MCP-over-IES-RAG Demo++Closes [#27](https://github.com/fabio-rovai/open-ontologies/issues/27).++A working demonstration of **ontology-grounded retrieval-augmented generation** using Open Ontologies as the substrate. The pattern: load an IES4-conformant knowledge graph + sample data; let the connected LLM (Claude over MCP) author SPARQL queries via `onto_query`; answer competency questions with structural certainty that flat document RAG cannot deliver on temporal / identity / participation questions.++## Why this case study exists++Per the May 2026 IES4 ecosystem research finding: nobody has publicly grafted LLM/RAG onto IES. Telicent's Smart-Cache-Graph stack is clearly designed as RAG substrate but isn't marketed that way. There's no published paper or product combining IES4 + LLMs in 2024-2026. This is the wide-open public niche this case study fills.++## What's in here++```+case-studies/mcp-ies-rag-demo/+├── README.md this file — the pattern, the why+├── data/+│ ├── ies-sample.ttl small IES4-conformant graph (~30 individuals,+│ │ ~80 triples) — people / orgs / locations /+│ │ 4D role-states / events with participants+│ └── competency-questions.md 6 natural-language questions, each with+│ the ontology-grounded answer and the+│ flat-RAG failure mode it exposes+└── transcripts/+ └── claude-walkthrough.md sample Claude/MCP conversation answering+ all six questions+```++## The pattern in one paragraph++`onto_embed` over the loaded IES4 graph gives Claude semantic retrieval over particulars (named entities like Alice Patel, Acme Bristol). `onto_query` lets Claude run SPARQL when a question requires structural reasoning (temporal extents, set membership, participant edges). The two combine: Claude retrieves the relevant subgraph by semantic search, then queries it precisely to answer. The 4D modelling means that **states are first-class** — "Alice was the Bristol manager" is a state with a period, not an attribute of Alice — so questions like "who held that role in 2022?" reduce to a SPARQL FILTER over period strings rather than a guess.++## Why this beats flat document RAG++Flat document RAG vectorises prose chunks. Temporal facts are stored as English sentences that humans wrote ("Alice took over the Bristol depot in January 2020"). Retrieval works on semantic similarity to the question. For "who was the Bristol manager in 2022?":++- The chunk "Alice was promoted to London operations director in October 2023" and the chunk "Alice managed Bristol from 2020" both surface+- The LLM has to do its own temporal reasoning on the prose+- Errors compound when multiple Bristol-managers exist across time+- Confidence is low and uncalibrated++Ontology-grounded RAG over IES4:++- Alice's two role-states are separate first-class IES4 individuals+- Each has a `ies:inPeriod` with explicit start/end+- The SPARQL `FILTER` over period strings is mechanical, not interpretive+- The connected LLM still does the natural-language framing of the answer; it just doesn't have to GUESS the temporal facts++The case study's `data/competency-questions.md` documents 6 specific questions where this difference matters.++## Running it locally++```bash+# 1. Load the IES4 v4.3.1 baseline (provides ies:Person, ies:Event, etc.)+open-ontologies marketplace install ies-4.3.1++# 2. Load the demo dataset+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+# in MCP mode: ask Claude to call onto_embed++# 4. Run the competency questions+# See data/competency-questions.md for the SPARQL bodies+```++In MCP mode (Claude Code connected to Open Ontologies as a server), the workflow is:++1. Claude reads the user's question+2. Calls `onto_query` with a SPARQL it composed from the IES4 patterns the loaded ontology defines+3. Optionally calls `onto_search` first if the question references entities by description rather than IRI+4. Forms the natural-language answer from the SPARQL results++The transcript at [`transcripts/claude-walkthrough.md`](transcripts/claude-walkthrough.md) shows this in action across all 6 questions.++## Scope and honesty++This is a **case study**, not a product. It:++- Uses a synthetic 30-individual dataset, not real operational data. Real deployments would load actual IES-conformant graphs (e.g. NDTP-style assets, MOD intelligence corpora).+- Uses a placeholder `demo:roleIn` helper property. A production IES4 implementation would use the canonical `ies:MemberState` + `ies:isMemberOf` pattern. The shortcut keeps the demo Turtle readable.+- Doesn't include a quantitative evaluation. A real comparison vs flat document RAG would need a benchmark corpus and human-evaluated accuracy on both temporal and atemporal questions — that's a follow-up paper, not a case study.+- Doesn't ship runtime code beyond what's already in Open Ontologies (load, query, embed, search). The case study is the dataset + the questions + the documented pattern.++## How to extend++PRs welcome. Useful directions:++1. **Add more competency questions** to `data/competency-questions.md` — particularly questions that combine multiple temporal extents (e.g. "who held overlapping roles in different orgs simultaneously?").+2. **Add a real dataset** — replace the synthetic data with an IES-conformant transformation of public NDTP data, the Wales valuation report dataset, or similar.+3. **Add a quantitative benchmark** — define a question set, run flat-RAG and onto-grounded-RAG on the same corpus, measure accuracy + latency.+4. **Extend the JC3IEDM crosswalk** (the sibling case study at [`../jc3iedm-ies4-crosswalk/`](../jc3iedm-ies4-crosswalk/)) so you can ingest JC3IEDM-shaped data and answer questions via the IES4 4D model.++## References++- [IES Information Exchange Standard](https://informationexchangestandard.org/)+- [`IES-Org/ont-ies`](https://github.com/IES-Org/ont-ies) — canonical IES repo (custodied by UK DBT since March 2025)+- [Telicent Smart-Cache-Graph](https://github.com/orgs/telicent-oss/repositories) — the RAG-substrate-shaped commercial stack from the IES Working Group's primary implementation partner+- FOUST 7 paper, "Comparing IES and BORO" (CEUR Vol-4176, JOWO 2024)++## Licence++MIT, matching the rest of Open Ontologies.diff --git a/case-studies/mcp-ies-rag-demo/data/competency-questions.md b/case-studies/mcp-ies-rag-demo/data/competency-questions.mdnew file mode 100644index 00000000..6dc2d1c6--- /dev/null+++ b/case-studies/mcp-ies-rag-demo/data/competency-questions.md@@ -0,0 +1,86 @@+# Competency Questions++The questions below exercise the temporal / identity / participation patterns that distinguish 4D ontology-grounded RAG from flat document RAG. For each question, the table below shows what a Claude session with `onto_query` + the IES sample dataset can answer deterministically, vs what a vector-search-over-prose system typically gets wrong.++## Question set++### Q1 — "Who was the Bristol depot manager in 2022?"++**Ontology-grounded answer:** Alice Patel.++Walk: `?state ies:isStateOf ?person ; demo:roleIn demo:acmeBristol ; ies:inPeriod ?period`, then filter by period containing 2022-01-01..2022-12-31. The `demo:aliceAsBristolManager` state has period `2020-01-01/2023-09-30` which contains 2022; the `demo:caraAsBristolManager` state has period `2023-10-01/..` which does NOT.++**Flat-RAG failure mode:** if "Alice as Bristol manager" and "Cara as Bristol manager" both surface in the top-k retrieval, the LLM has no structural way to disambiguate by date. It either picks the more recent (often wrong) or hedges.++### Q2 — "Who participated in the March 2024 Bristol fire drill?"++**Ontology-grounded answer:** Cara Lindqvist and Dan Okonkwo (per the explicit `ies:isParticipantIn` edges on `demo:bristolFireDrillMar2024`).++Walk: `demo:bristolFireDrillMar2024 ies:isParticipantIn ?person`.++**Flat-RAG failure mode:** if a document also mentions Alice (e.g. as the former Bristol manager) in proximity to a "fire drill" sentence, vector retrieval might surface her name in the answer. The ontology's explicit participant edges make this impossible.++### Q3 — "Has Alice ever worked in Bristol?"++**Ontology-grounded answer:** Yes — `demo:aliceAsBristolManager` state covers 2020-01-01 to 2023-09-30. The state still exists in the graph after her transition to London; 4D modelling preserves historical states rather than overwriting.++**Flat-RAG failure mode:** if the current corpus describes Alice as "London operations director" (her current role), the temporal precedent might not surface unless the corpus also carries a historical document.++### Q4 — "Who held a role at Acme Bristol at any point in time?"++**Ontology-grounded answer:** Alice Patel, Cara Lindqvist, Dan Okonkwo — three distinct bearers across the union of states with `demo:roleIn demo:acmeBristol`.++**Flat-RAG failure mode:** the question requires set-union over time, which fixed-window retrieval does not naturally support.++### Q5 — "What role was Alice holding when the London restructuring was announced?"++**Ontology-grounded answer:** London operations director — the `demo:londonRestructuringNov2023` event is dated 2023-11-22, and Alice's `aliceAsLondonDirector` state runs from 2023-10-01 onward, so the state containing 2023-11-22 is the London directorship.++**Flat-RAG failure mode:** answering this requires intersecting an event's date with a role-state's period. Without ontology-grounded temporal extents, this is guesswork.++### Q6 — "Which organisations are based in Bristol?"++**Ontology-grounded answer:** `demo:acmeBristol` (and any other Organisation with locations resolving to `demo:bristol`).++A straightforward SPARQL with `?org ies:inLocation demo:bristol`. No temporal reasoning needed; included as a baseline question both systems should answer correctly.++## How to run++```bash+# Load the IES baseline + the demo dataset+open-ontologies marketplace install ies-4.3.1+open-ontologies load case-studies/mcp-ies-rag-demo/data/ies-sample.ttl++# Q1 — who was Bristol manager in 2022?+open-ontologies query '+ PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+ PREFIX demo: <http://example.org/ies-rag-demo/>+ SELECT ?person WHERE {+ ?state ies:isStateOf ?person ;+ demo:roleIn demo:acmeBristol ;+ ies:inPeriod/ies:periodRepresentation ?p .+ FILTER(STRSTARTS(?p, "2020") || STRSTARTS(?p, "2021") || STRSTARTS(?p, "2022") || STRSTARTS(?p, "2023-0"))+ }+'++# Q2 — March 2024 fire drill participants+open-ontologies query '+ PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+ PREFIX demo: <http://example.org/ies-rag-demo/>+ SELECT ?person WHERE { demo:bristolFireDrillMar2024 ies:isParticipantIn ?person }+'++# Q5 — Alice's role at restructuring time+open-ontologies query '+ PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+ PREFIX demo: <http://example.org/ies-rag-demo/>+ SELECT ?roleLabel WHERE {+ ?state ies:isStateOf demo:alice ;+ rdfs:label ?roleLabel ;+ ies:inPeriod/ies:periodRepresentation ?p .+ FILTER(STRSTARTS(?p, "2023-10") || STRSTARTS(?p, "2023-11"))+ }+'+```++The point isn't that SPARQL is the user interface — it's that the connected LLM (Claude) generates and runs these queries via `onto_query` MCP tool, and uses the results to answer the user's natural-language question with structural certainty. Vector retrieval over the same content as prose loses the temporal extents.diff --git a/case-studies/mcp-ies-rag-demo/data/ies-sample.ttl b/case-studies/mcp-ies-rag-demo/data/ies-sample.ttlnew file mode 100644index 00000000..8643bcee--- /dev/null+++ b/case-studies/mcp-ies-rag-demo/data/ies-sample.ttl@@ -0,0 +1,90 @@+# Synthetic IES4-conformant knowledge graph for the MCP-over-IES-RAG demo.+# A small, illustrative dataset showing 4D modelling of identity-stable+# entities (Person, Organisation, Location) and their state-extended+# memberships, role-holdings, and event participations across time.+#+# Intentionally small (~30 individuals, ~80 triples) so the demo is+# self-contained. The 4D shape — state-as-time-extent, event-with-participants,+# role-as-state-of-being-X — is what enables temporal-coherent RAG.++@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix owl: <http://www.w3.org/2002/07/owl#> .+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .+@prefix ies: <http://ies.data.gov.uk/ontology/ies4#> .+@prefix demo: <http://example.org/ies-rag-demo/> .++# ── People (identity-stable Particulars) ───────────────────────────────+demo:alice a ies:Person ; rdfs:label "Alice Patel"@en .+demo:bob a ies:Person ; rdfs:label "Bob Eze"@en .+demo:cara a ies:Person ; rdfs:label "Cara Lindqvist"@en .+demo:dan a ies:Person ; rdfs:label "Dan Okonkwo"@en .++# ── Organisations ──────────────────────────────────────────────────────+demo:acmeLondon a ies:Organisation ; rdfs:label "Acme Logistics London"@en .+demo:acmeBristol a ies:Organisation ; rdfs:label "Acme Logistics Bristol"@en .++# ── Locations ──────────────────────────────────────────────────────────+demo:london a ies:Location ; rdfs:label "London"@en .+demo:bristol a ies:Location ; rdfs:label "Bristol"@en .++# ── Role / Membership states (4D — each is a time-bounded "state of being X") ──+# Alice was Bristol's depot manager from 2020-01-01 to 2023-09-30, then moved+# to London as operations director from 2023-10-01 onwards.+demo:aliceAsBristolManager a ies:State ;+ rdfs:label "Alice as Bristol depot manager"@en ;+ ies:isStateOf demo:alice ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2020-01-01/2023-09-30"^^xsd:string ] ;+ demo:roleIn demo:acmeBristol ;+ rdfs:comment "JC3IEDM-style snapshot would just say 'Alice is BristolManager'. IES4's 4D split makes the temporal extent first-class so RAG can answer 'who was the Bristol manager in 2022?' deterministically."@en .++demo:aliceAsLondonDirector a ies:State ;+ rdfs:label "Alice as London operations director"@en ;+ ies:isStateOf demo:alice ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2023-10-01/.."^^xsd:string ] ;+ demo:roleIn demo:acmeLondon .++demo:bobAsLondonAnalyst a ies:State ;+ rdfs:label "Bob as London logistics analyst"@en ;+ ies:isStateOf demo:bob ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2019-06-15/.."^^xsd:string ] ;+ demo:roleIn demo:acmeLondon .++demo:caraAsBristolManager a ies:State ;+ rdfs:label "Cara as Bristol depot manager (Alice's successor)"@en ;+ ies:isStateOf demo:cara ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2023-10-01/.."^^xsd:string ] ;+ demo:roleIn demo:acmeBristol ;+ rdfs:comment "Same role-class as demo:aliceAsBristolManager, different time-extent and bearer. Models the role transition that occurred when Alice moved."@en .++demo:danAsBristolDriver a ies:State ;+ rdfs:label "Dan as Bristol depot driver"@en ;+ ies:isStateOf demo:dan ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2021-03-01/.."^^xsd:string ] ;+ demo:roleIn demo:acmeBristol .++# ── Events with explicit participants (per the ies4 enforce rule pack) ──+demo:bristolFireDrillMar2024 a ies:Event ;+ rdfs:label "Bristol depot fire drill, March 2024"@en ;+ ies:inLocation demo:bristol ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2024-03-14"^^xsd:string ] ;+ ies:isParticipantIn demo:cara , demo:dan ;+ rdfs:comment "Cara (Bristol manager from 2023-10) and Dan (Bristol driver from 2021-03) both participate. Alice (former Bristol manager, now in London) does NOT — and the 4D model knows this because her aliceAsBristolManager state ends 2023-09. Flat document RAG would lose this distinction."@en .++demo:londonRestructuringNov2023 a ies:Event ;+ rdfs:label "London office restructuring announcement, Nov 2023"@en ;+ ies:inLocation demo:london ;+ ies:inPeriod [ a ies:ParticularPeriod ;+ ies:periodRepresentation "2023-11-22"^^xsd:string ] ;+ ies:isParticipantIn demo:alice , demo:bob .++# ── Helper properties (purely for the demo's role-attachment pattern) ──+demo:roleIn a owl:ObjectProperty ;+ rdfs:label "roleIn"@en ;+ rdfs:comment "Demo-only helper linking a role-state to the organisation in which the role is held. Real IES4 modelling would use ies:isMemberOf chained through state-extents; this shortcut keeps the demo readable."@en .diff --git a/case-studies/mcp-ies-rag-demo/transcripts/claude-walkthrough.md b/case-studies/mcp-ies-rag-demo/transcripts/claude-walkthrough.mdnew file mode 100644index 00000000..9c423cbf--- /dev/null+++ b/case-studies/mcp-ies-rag-demo/transcripts/claude-walkthrough.md@@ -0,0 +1,163 @@+# Claude over MCP — Walkthrough Transcript++Illustrative transcript showing a Claude session connected to Open Ontologies as an MCP server, answering all six competency questions from [`../data/competency-questions.md`](../data/competency-questions.md) using `onto_query` (and `onto_search` where it would help).++The transcript is illustrative, not literal — it shows the SHAPE of the interaction, the tool calls Claude would make, and the SPARQL it would compose. Real sessions vary in wording.++## Setup (one-time)++**User:** Load the IES4 baseline and the demo dataset.++**Claude:** Calls `onto_marketplace_install("ies-4.3.1")`, then `onto_load("case-studies/mcp-ies-rag-demo/data/ies-sample.ttl")`.++> Loaded IES 4.3.1 (5,375 triples) + the demo dataset (~80 triples). The graph now has 4 ies:Persons (Alice, Bob, Cara, Dan), 2 ies:Organisations (Acme London / Bristol), 2 ies:Locations, 5 role-states with periods, and 2 events.++---++## Q1 — "Who was the Bristol depot manager in 2022?"++**Claude:** This is a temporal-extent question. I'll find all states where the role is "Bristol manager" and intersect their periods with 2022.++Calls `onto_query`:++```sparql+PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>+PREFIX demo: <http://example.org/ies-rag-demo/>++SELECT ?person ?label ?period WHERE {+ ?state ies:isStateOf ?person ;+ demo:roleIn demo:acmeBristol ;+ ies:inPeriod/ies:periodRepresentation ?period .+ ?person rdfs:label ?label .+ # 2022 falls inside the period+ FILTER(STRSTARTS(?period, "2020")+ || STRSTARTS(?period, "2021")+ || STRSTARTS(?period, "2022")+ || (STRSTARTS(?period, "2023") && !STRSTARTS(?period, "2023-1")))+}+```++**Result:** Alice Patel (period 2020-01-01/2023-09-30).++**Claude (to user):** Alice Patel was the Bristol depot manager throughout 2022, holding that role from January 2020 to September 2023. Her successor Cara Lindqvist took over in October 2023.++> Confidence: high. The role-state's `ies:inPeriod` extent is explicit in the graph and unambiguously contains 2022.++---++## Q2 — "Who participated in the March 2024 Bristol fire drill?"++**Claude:** Direct SPARQL over the explicit `ies:isParticipantIn` edges on `demo:bristolFireDrillMar2024`.++```sparql+PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>+PREFIX demo: <http://example.org/ies-rag-demo/>++SELECT ?person ?label WHERE {+ demo:bristolFireDrillMar2024 ies:isParticipantIn ?person .+ ?person rdfs:label ?label .+}+```++**Result:** Cara Lindqvist, Dan Okonkwo.++**Claude (to user):** Two people participated: Cara Lindqvist (Bristol depot manager from October 2023) and Dan Okonkwo (Bristol depot driver since March 2021). Note that Alice Patel, who was the previous Bristol manager until September 2023, did NOT participate — the event is dated March 2024, after her transition to London.++---++## Q3 — "Has Alice ever worked in Bristol?"++**Claude:** Historical existence — ASK query.++```sparql+PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+PREFIX demo: <http://example.org/ies-rag-demo/>++ASK { ?state ies:isStateOf demo:alice ; demo:roleIn demo:acmeBristol . }+```++**Result:** true.++**Claude (to user):** Yes. Alice held the Bristol depot manager role from January 2020 to September 2023. She has since moved to a London operations director role, but the historical state is preserved in the graph — that's the value of 4D modelling for this kind of question.++---++## Q4 — "Who held a role at Acme Bristol at any point in time?"++**Claude:** Distinct bearers across all states with `roleIn` Acme Bristol.++```sparql+PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>+PREFIX demo: <http://example.org/ies-rag-demo/>++SELECT DISTINCT ?person ?label WHERE {+ ?state ies:isStateOf ?person ; demo:roleIn demo:acmeBristol .+ ?person rdfs:label ?label .+}+```++**Result:** Alice Patel, Cara Lindqvist, Dan Okonkwo.++---++## Q5 — "What role was Alice holding when the London restructuring was announced?"++**Claude:** Intersect the event's date with Alice's role-states' periods.++```sparql+PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>+PREFIX demo: <http://example.org/ies-rag-demo/>++SELECT ?stateLabel ?eventDate ?statePeriod WHERE {+ demo:londonRestructuringNov2023 ies:inPeriod/ies:periodRepresentation ?eventDate .+ ?state ies:isStateOf demo:alice ;+ rdfs:label ?stateLabel ;+ ies:inPeriod/ies:periodRepresentation ?statePeriod .+ FILTER(STRSTARTS(?statePeriod, "2023-10"))+}+```++**Result:** Alice as London operations director, event 2023-11-22, state period 2023-10-01/...++**Claude (to user):** Alice was the London operations director at the time of the restructuring announcement (2023-11-22). She had transitioned into that role on 2023-10-01, the day after her Bristol manager role ended.++---++## Q6 — "Which organisations are based in Bristol?"++**Claude:** This is the dataset's weakest question because the toy data doesn't directly model org → location. I derive via event participation.++```sparql+PREFIX ies: <http://ies.data.gov.uk/ontology/ies4#>+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>+PREFIX demo: <http://example.org/ies-rag-demo/>++SELECT DISTINCT ?org ?label WHERE {+ ?org a ies:Organisation ; rdfs:label ?label .+ ?state ies:isStateOf ?p ; demo:roleIn ?org .+ demo:bristolFireDrillMar2024 ies:isParticipantIn ?p ; ies:inLocation demo:bristol .+}+```++**Result:** Acme Logistics Bristol.++**Claude (to user):** Acme Logistics Bristol — derived from the Bristol-located fire drill event having participants who hold roles at that organisation. Caveat: the dataset doesn't model org → location directly, so a production IES4 dataset with explicit `ies:inLocation` on organisations would make this question one SPARQL hop rather than three.++---++## Pattern recap++Across six questions:++- 4D states made temporal questions deterministic (Q1, Q3, Q5)+- Explicit participant edges made participation questions exact (Q2)+- Set operations over states made cross-time queries (Q4) straightforward+- Compositional joins handled event/state intersection (Q5)++Flat document RAG would handle Q6 (atemporal, locational) but degrade on Q1/Q2/Q3/Q4/Q5 in proportion to how much the answer depends on dates and identity-stable references.++The MCP server's role: provide `onto_query` so the LLM can express the structural questions precisely, plus `onto_load` / `onto_marketplace_install` for the corpus setup. The intelligence — composing the right SPARQL, framing the answer in natural language — stays in the conversation.