Skip to content

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

feat: add object property edges to graph and update branding

FABIOTESSfde6a890ee27
diff --git a/README.md b/README.md
index d59c4206..cdc579f9 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,8 @@
<!-- mcp-name: io.github.fabio-rovai/open-ontologies -->
-<!-- <p align="center">
- <img src="docs/assets/logo.png" alt="Open Ontologies" width="260">
-</p> -->
-
+<p align="center">
+ <img src="docs/assets/logo.png" alt="Open Ontologies" width="300">
+</p>
<h1 align="center">Open Ontologies</h1>
@@ -45,7 +44,7 @@ No JVM. No Protégé. No GUI required.
|---|---|
| ![Studio overview — 3D graph, property inspector, and AI chat panel](studio/docs/screenshots/studio-overview.png) | ![Close-up of the 3D force-directed Forest ontology graph](studio/docs/screenshots/studio-graph.png) |
-*Forest ontology built entirely in natural language. Claude called `onto_clear` → `onto_load` → `onto_reason` → `onto_save` automatically.*
+*Tissue ontology built in natural language. Gold edges show object property relationships (domain → range) connecting clusters; grey edges show subClassOf hierarchy. Spring-based force layout keeps related classes close.*
---
@@ -191,7 +190,7 @@ PATH=/opt/homebrew/bin:~/.cargo/bin:$PATH npm run tauri dev
| Feature | Description |
| --- | --- |
-| **3D Graph Canvas** | Live force-directed OWL class hierarchy (Three.js / WebGL). Drag to orbit, scroll to zoom, click to inspect, right-click to add, Delete to remove. |
+| **3D Graph Canvas** | Spring-based force-directed OWL graph (Three.js / WebGL). Grey edges = subClassOf hierarchy, gold edges = object property domain/range links. Drag to orbit, scroll to zoom, click to inspect, right-click to add, Delete to remove. |
| **AI Agent Chat** | Natural language ontology engineering via Claude Sonnet 4.6 + Agent SDK. Type instructions — Claude calls the right tools automatically. |
| **Property Inspector** | Protégé-style inline triple editor. Click to edit, hover to delete, `+ Add` for new triples. |
| **Lineage Panel** | Full audit trail from SQLite: plan · apply · enforce · drift · monitor · align, grouped by session. |
diff --git a/docs/assets/logo.png b/docs/assets/logo.png
index 5ced07f5..fa5c21c5 100644
Binary files a/docs/assets/logo.png and b/docs/assets/logo.png differ
diff --git a/studio/docs/screenshots/studio-graph.png b/studio/docs/screenshots/studio-graph.png
index 9ccdee17..252095d9 100644
Binary files a/studio/docs/screenshots/studio-graph.png and b/studio/docs/screenshots/studio-graph.png differ
diff --git a/studio/docs/screenshots/studio-overview.png b/studio/docs/screenshots/studio-overview.png
index 9d0f1beb..e20c43f7 100644
Binary files a/studio/docs/screenshots/studio-overview.png and b/studio/docs/screenshots/studio-overview.png differ
diff --git a/studio/src/components/GraphCanvas.tsx b/studio/src/components/GraphCanvas.tsx
index a79006b7..28f7f240 100644
--- a/studio/src/components/GraphCanvas.tsx
+++ b/studio/src/components/GraphCanvas.tsx
@@ -31,6 +31,8 @@ interface GraphNode {
interface GraphLink {
source: string;
target: string;
+ type?: 'subclass' | 'property';
+ label?: string;
}
// --- Helpers ---
@@ -83,6 +85,16 @@ SELECT ?sub ?parent WHERE {
FILTER(!isBlank(?sub) && !isBlank(?parent))
}`;
+const PROPERTY_EDGES_QUERY = `PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX owl: <http://www.w3.org/2002/07/owl#>
+SELECT ?prop ?propLabel ?domain ?range WHERE {
+ ?prop a owl:ObjectProperty .
+ ?prop rdfs:domain ?domain .
+ ?prop rdfs:range ?range .
+ OPTIONAL { ?prop rdfs:label ?propLabel }
+ FILTER(!isBlank(?domain) && !isBlank(?range))
+}`;
+
// --- Component ---
export function GraphCanvas({ onNodeSelect }: GraphCanvasProps) {
@@ -106,13 +118,15 @@ export function GraphCanvas({ onNodeSelect }: GraphCanvasProps) {
if (!g) return;
try {
- const [classesText, edgesText] = await Promise.all([
+ const [classesText, edgesText, propEdgesText] = await Promise.all([
mcp.sparqlQuery(CLASSES_QUERY),
mcp.sparqlQuery(EDGES_QUERY),
+ mcp.sparqlQuery(PROPERTY_EDGES_QUERY),
]);
const classBindings = parseSparqlResults(classesText);
const edgeBindings = parseSparqlResults(edgesText);
+ const propEdgeBindings = parseSparqlResults(propEdgesText);
const nodeMap = new Map<string, GraphNode>();
@@ -146,7 +160,22 @@ export function GraphCanvas({ onNodeSelect }: GraphCanvasProps) {
const eid = `${sid}→${pid}`;
if (nodeMap.has(sid) && nodeMap.has(pid) && !edgeSet.has(eid)) {
edgeSet.add(eid);
- links.push({ source: sid, target: pid });
+ links.push({ source: sid, target: pid, type: 'subclass' });
+ }
+ }
+
+ // Object property edges (domain → range)
+ for (const b of propEdgeBindings) {
+ const domainUri = b.domain?.value;
+ const rangeUri = b.range?.value;
+ if (!domainUri || !rangeUri) continue;
+ const did = shortUri(domainUri);
+ const rid = shortUri(rangeUri);
+ const propLabel = b.propLabel?.value || shortUri(b.prop?.value || '');
+ const eid = `${did}→${rid}:${propLabel}`;
+ if (nodeMap.has(did) && nodeMap.has(rid) && !edgeSet.has(eid)) {
+ edgeSet.add(eid);
+ links.push({ source: did, target: rid, type: 'property', label: propLabel });
}
}
@@ -172,12 +201,25 @@ export function GraphCanvas({ onNodeSelect }: GraphCanvasProps) {
})
.nodeOpacity(0.95)
.nodeResolution(16)
- .linkColor(() => '#585b70')
+ .linkColor((link: object) => {
+ const l = link as GraphLink;
+ return l.type === 'property' ? '#f9e2af' : '#585b70';
+ })
.linkOpacity(0.6)
- .linkWidth(1.5)
+ .linkWidth((link: object) => {
+ const l = link as GraphLink;
+ return l.type === 'property' ? 2 : 1.5;
+ })
.linkDirectionalArrowLength(6)
.linkDirectionalArrowRelPos(1)
- .linkDirectionalArrowColor(() => '#89b4fa')
+ .linkDirectionalArrowColor((link: object) => {
+ const l = link as GraphLink;
+ return l.type === 'property' ? '#f9e2af' : '#89b4fa';
+ })
+ .linkLabel((link: object) => {
+ const l = link as GraphLink;
+ return l.type === 'property' ? (l.label || '') : '';
+ })
.nodeThreeObject((node: object) => {
const n = node as GraphNode;
const group = new THREE.Group();