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.

fix: build pipeline step 7 uses SPARQL depth check for targeted deepening

FABIOTESS64dbb2385bb6
diff --git a/studio/src-tauri/sidecars/agent/dist/index.js b/studio/src-tauri/sidecars/agent/dist/index.js
index 4b40a6d8..04b9d613 100644
--- a/studio/src-tauri/sidecars/agent/dist/index.js
+++ b/studio/src-tauri/sidecars/agent/dist/index.js
@@ -170,9 +170,12 @@ Call onto_stats after. Do NOT save yet — many more steps coming.`,
},
{
label: 'Step 7: Deepen — second pass on shallow areas',
- prompt: `Call onto_query to find ALL leaf classes. For any branch that is still less than 6 levels deep, add more subclasses. ` +
- `Also think: are there any major subtypes or categories I missed entirely? Add them now. ` +
- `Be ruthlessly exhaustive. Call onto_load with the additional Turtle. Call onto_stats after. Do NOT save yet.`,
+ prompt: `Run this SPARQL to measure depth per root branch:
+SELECT ?branch (MAX(?depth) AS ?maxDepth) WHERE { ?class rdfs:subClassOf+ ?branch . ?branch rdfs:subClassOf ?root . ?root a owl:Class . FILTER NOT EXISTS { ?root rdfs:subClassOf ?x . ?x a owl:Class } . { SELECT ?class (COUNT(?mid) AS ?depth) WHERE { ?class rdfs:subClassOf+ ?mid } GROUP BY ?class } } GROUP BY ?branch ORDER BY ?maxDepth LIMIT 20
+
+For any branch with maxDepth < 7, find its leaf classes and add 2-3 more levels of subclasses below them (chain: A subClassOf B subClassOf C).
+Also: are there any major subtypes or categories missing entirely? Add them now as deep chains, not flat siblings.
+Call onto_load with the Turtle. Call onto_stats after. Do NOT save yet.`,
},
{
label: 'Step 8: Object properties — structural relationships',
diff --git a/studio/src-tauri/sidecars/agent/index.ts b/studio/src-tauri/sidecars/agent/index.ts
index 204754ee..b65cbac2 100644
--- a/studio/src-tauri/sidecars/agent/index.ts
+++ b/studio/src-tauri/sidecars/agent/index.ts
@@ -189,9 +189,12 @@ Call onto_stats after. Do NOT save yet — many more steps coming.`,
},
{
label: 'Step 7: Deepen — second pass on shallow areas',
- prompt: `Call onto_query to find ALL leaf classes. For any branch that is still less than 6 levels deep, add more subclasses. ` +
- `Also think: are there any major subtypes or categories I missed entirely? Add them now. ` +
- `Be ruthlessly exhaustive. Call onto_load with the additional Turtle. Call onto_stats after. Do NOT save yet.`,
+ prompt: `Run this SPARQL to measure depth per root branch:
+SELECT ?branch (MAX(?depth) AS ?maxDepth) WHERE { ?class rdfs:subClassOf+ ?branch . ?branch rdfs:subClassOf ?root . ?root a owl:Class . FILTER NOT EXISTS { ?root rdfs:subClassOf ?x . ?x a owl:Class } . { SELECT ?class (COUNT(?mid) AS ?depth) WHERE { ?class rdfs:subClassOf+ ?mid } GROUP BY ?class } } GROUP BY ?branch ORDER BY ?maxDepth LIMIT 20
+
+For any branch with maxDepth < 7, find its leaf classes and add 2-3 more levels of subclasses below them (chain: A subClassOf B subClassOf C).
+Also: are there any major subtypes or categories missing entirely? Add them now as deep chains, not flat siblings.
+Call onto_load with the Turtle. Call onto_stats after. Do NOT save yet.`,
},
{
label: 'Step 8: Object properties — structural relationships',