Open Ontologies
AI-native ontology engineering. Generate OWL/RDF directly, validate with MCP tools, iterate until clean, govern with a Terraform-style lifecycle.
Prerequisites
This skill requires the Open Ontologies MCP server to provide the onto_* tools.
Install: cargo install open-ontologies or download from GitHub releases
MCP config (add to .mcp.json or Claude settings):
{
"mcpServers": {
"open-ontologies": {
"command": "open-ontologies",
"args": ["serve"]
}
}
}
No credentials needed. All processing runs locally in an in-memory Oxigraph triple store. Network access is only used when you explicitly call onto_pull (fetch remote ontology) or onto_push (send to SPARQL endpoint) with a URL you provide. Monitor alerts (onto_monitor) are logged to stdout only.
Core Workflow
When building or modifying ontologies, follow this workflow. Decide which tools to call and in what order based on results -- this is not a fixed pipeline.
1. Generate
- Understand the domain requirements (natural language, competency questions, methodology constraints)
- Generate Turtle/OWL directly -- Claude knows OWL, RDF, BORO, 4D modeling natively
- For complex methodologies, ask for background documents or constraints
2. Validate and Load
- Call
onto_validate on the generated Turtle -- if it fails, fix syntax errors and re-validate
- Call
onto_load to load into the Oxigraph triple store
- Call
onto_stats to verify class count, property count, triple count match expectations
3. Verify
- Call
onto_lint to check for missing labels, comments, domains, ranges -- fix any issues found
- Call
onto_query with SPARQL to verify structure (expected classes, subclass hierarchies, competency questions)
- If a reference ontology exists, call
onto_diff to compare
4. Iterate
- If any step reveals problems, fix the Turtle and restart from step 2
- Continue until validation passes, stats match, lint is clean, and SPARQL queries return expected results
5. Persist
- Call
onto_save to write the final ontology to a .ttl file
- Call
onto_version to save a named snapshot for rollback
Ontology Lifecycle (Terraform-style)
For evolving ontologies in production:
- Plan --
onto_plan shows added/removed classes, blast radius, risk score. Check onto_lock for protected IRIs.
- Enforce --
onto_enforce with a rule pack (generic, boro, value_partition) checks design pattern compliance.
- Apply --
onto_apply with mode safe (clear + reload) or migrate (add owl:equivalentClass bridges).
- Monitor --
onto_monitor runs SPARQL watchers with threshold alerts. Use onto_monitor_clear if blocked.
- Drift --
onto_drift compares versions with rename detection and self-calibrating confidence.
Data Extension Workflow
When applying an ontology to external data:
onto_map -- generate mapping config from data schema + loaded ontology
onto_ingest -- parse structured data (CSV, JSON, NDJSON, XML, YAML, XLSX, Parquet) into RDF
onto_shacl -- validate against SHACL shapes (cardinality, datatypes, classes)
onto_reason -- run RDFS or OWL-RL inference, materializing inferred triples
- Or use
onto_extend to run the full pipeline: ingest, SHACL validate, reason in one call
Clinical Terminology Support
For healthcare ontologies:
onto_crosswalk -- look up mappings between ICD-10, SNOMED CT, and MeSH
onto_enrich -- add skos:exactMatch triples linking classes to clinical codes
onto_validate_clinical -- check class labels against clinical crosswalk terminology
Ontology Alignment
For aligning two ontologies:
onto_align -- detect alignment candidates (equivalentClass, exactMatch, subClassOf) using 6 weighted signals
onto_align_feedback -- accept/reject candidates to self-calibrate confidence weights
Tool Reference
| Tool |
When to use |
onto_validate |
After generating or modifying Turtle -- always validate first |
onto_load |
After validation passes -- loads into triple store |
onto_stats |
After loading -- sanity check on counts |
onto_lint |
After loading -- catches missing labels, domains, ranges |
onto_query |
Verify structure, answer competency questions |
onto_diff |
Compare against a reference or previous version |
onto_save |
Persist ontology to a file |
onto_convert |
Convert between formats (Turtle, N-Triples, RDF/XML, N-Quads, TriG) |
onto_clear |
Reset the store before loading a different ontology |
onto_pull |
Fetch ontology from a remote URL or SPARQL endpoint |
onto_push |
Push ontology to a SPARQL endpoint |
onto_import |
Resolve and load owl:imports chains |
onto_version |
Save a named snapshot before making changes |
onto_history |
List saved version snapshots |
onto_rollback |
Restore a previous version |
onto_ingest |
Parse structured data into RDF and load into store |
onto_map |
Generate mapping config from data schema + ontology |
onto_shacl |
Validate data against SHACL shapes |
onto_reason |
Run RDFS or OWL-RL inference |
onto_extend |
Full pipeline: ingest, SHACL validate, reason |
onto_plan |
Show added/removed classes, blast radius, risk score |
onto_apply |
Apply changes in safe or migrate mode |
onto_lock |
Protect production IRIs from removal |
onto_drift |
Compare versions with rename detection |
onto_enforce |
Design pattern checks: generic, boro, value_partition, or custom |
onto_monitor |
Run SPARQL watchers with threshold alerts |
onto_monitor_clear |
Clear blocked state after resolving alerts |
onto_crosswalk |
Look up clinical terminology mappings (ICD-10, SNOMED, MeSH) |
onto_enrich |
Add skos:exactMatch triples linking to clinical codes |
onto_validate_clinical |
Check class labels against clinical terminology |
onto_align |
Detect alignment candidates between two ontologies |
onto_align_feedback |
Accept/reject alignment candidates for self-calibrating weights |
onto_lineage |
View session lineage trail (plan, enforce, apply, monitor, drift) |
onto_lint_feedback |
Accept/dismiss lint issues to teach suppression |
onto_enforce_feedback |
Accept/dismiss enforce violations to teach suppression |
onto_unload |
Unload from memory. With name targets a specific cached entry; delete_cache=true also removes the on-disk file |
onto_recompile |
Re-parse the source. With name rebuilds a non-active cached entry without disturbing the active in-memory store |
onto_cache_status |
Inspect compile cache: active slot, all entries, effective [cache] config |
onto_cache_list |
List cached ontologies with metadata (is_active, in_memory, mtime, size) |
onto_cache_remove |
Remove a cached ontology by name (pass delete_file=false to keep the on-disk N-Triples) |
onto_repo_list |
List RDF/OWL files in configured [general] ontology_dirs directories |
onto_repo_load |
Load an ontology from a configured repo by bare name, relative path, or absolute path |
onto_status |
Server health / loaded triple count |
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_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) |
Usage Examples
Build a pizza ontology from scratch
Build me a pizza ontology with classes for Pizza, PizzaBase (ThinAndCrispy, DeepPan),
PizzaTopping (Mozzarella, Tomato, Pepperoni, Mushroom), and properties hasBase, hasTopping.
Include rdfs:labels and rdfs:comments on everything. Validate and run competency queries
to check I can ask "what toppings does a Margherita have?"
Load and query an existing ontology
Load the ontology from https://www.w3.org/TR/owl-guide/wine.rdf, show me stats,
lint it, and run a SPARQL query to find all subclasses of Wine.
Evolve an ontology safely
I need to add a new class "GlutenFreePizza" as a subclass of Pizza with a restriction
that hasBase only GlutenFreeBase. Plan the change, enforce against generic rules,
and apply in safe mode.
Ingest CSV data into a knowledge graph
I have a CSV of employees with columns: name, department, role, start_date.
Map it to the loaded HR ontology and ingest it. Then validate with SHACL shapes
and run inference to materialize department hierarchies.
Align two ontologies
Load schema.org and my company ontology. Run onto_align to find equivalentClass
and exactMatch candidates. I'll review and give feedback to calibrate the weights.
Key Principle
Dynamically decide the next tool call based on what the previous tool returned. If onto_validate fails, fix and retry. If onto_stats shows wrong counts, regenerate. If onto_lint finds missing labels, add them. The MCP tools are individual operations -- Claude is the orchestrator.
1---2name: open-ontologies3version: "0.5.1"4description: >5 AI-native ontology engineering using 50+ MCP tools backed by an in-memory Oxigraph triple store.6 Build, validate, query, and govern RDF/OWL ontologies with a generate-validate-iterate loop.7 Use when building ontologies, knowledge graphs, RDF data, SPARQL queries, BORO/4D modeling,8 SHACL validation, clinical terminology mapping, ingesting from CSV/JSON/Parquet/XLSX or9 SQL backbones (PostgreSQL, DuckDB), or Terraform-style ontology lifecycle management.10tags:11 - ontology12 - rdf13 - owl14 - sparql15 - knowledge-graph16 - semantic-web17 - mcp18 - oxigraph19 - shacl20 - boro21metadata:22 source: https://skillmd.com/skills/fabio-rovai/open-ontologies23 openclaw:24 requires:25 mcp:26 - name: open-ontologies27 description: >28 Oxigraph-backed MCP server providing all onto_* tools.29 Install: cargo install open-ontologies OR download binary from30 https://github.com/fabio-rovai/open-ontologies/releases31 config:32 command: open-ontologies33 args: ["serve"]34 bins:35 - open-ontologies36 network:37 - description: "onto_pull fetches ontologies from remote URLs or SPARQL endpoints (user-provided URLs only)"38 direction: outbound39 optional: true40 - description: "onto_push sends triples to a user-specified SPARQL endpoint"41 direction: outbound42 optional: true43 notes: >44 All processing is local by default. The in-memory Oxigraph triple store runs inside the45 MCP server process -- no database, no JVM, no external services required.46 Network access is only used by onto_pull and onto_push when the user explicitly provides47 a remote URL or SPARQL endpoint. onto_monitor alerts are logged locally to stdout;48 no external notification services are contacted. No credentials or API keys are needed49 for core functionality.50---5152# Open Ontologies5354AI-native ontology engineering. Generate OWL/RDF directly, validate with MCP tools, iterate until clean, govern with a Terraform-style lifecycle.5556## Prerequisites5758This skill requires the **Open Ontologies MCP server** to provide the `onto_*` tools.5960**Install:** `cargo install open-ontologies` or download from [GitHub releases](https://github.com/fabio-rovai/open-ontologies/releases)6162**MCP config** (add to `.mcp.json` or Claude settings):63```json64{65 "mcpServers": {66 "open-ontologies": {67 "command": "open-ontologies",68 "args": ["serve"]69 }70 }71}72```7374**No credentials needed.** All processing runs locally in an in-memory Oxigraph triple store. Network access is only used when you explicitly call `onto_pull` (fetch remote ontology) or `onto_push` (send to SPARQL endpoint) with a URL you provide. Monitor alerts (`onto_monitor`) are logged to stdout only.7576## Core Workflow7778When building or modifying ontologies, follow this workflow. Decide which tools to call and in what order based on results -- this is not a fixed pipeline.7980### 1. Generate8182- Understand the domain requirements (natural language, competency questions, methodology constraints)83- Generate Turtle/OWL directly -- Claude knows OWL, RDF, BORO, 4D modeling natively84- For complex methodologies, ask for background documents or constraints8586### 2. Validate and Load8788- Call `onto_validate` on the generated Turtle -- if it fails, fix syntax errors and re-validate89- Call `onto_load` to load into the Oxigraph triple store90- Call `onto_stats` to verify class count, property count, triple count match expectations9192### 3. Verify9394- Call `onto_lint` to check for missing labels, comments, domains, ranges -- fix any issues found95- Call `onto_query` with SPARQL to verify structure (expected classes, subclass hierarchies, competency questions)96- If a reference ontology exists, call `onto_diff` to compare9798### 4. Iterate99100- If any step reveals problems, fix the Turtle and restart from step 2101- Continue until validation passes, stats match, lint is clean, and SPARQL queries return expected results102103### 5. Persist104105- Call `onto_save` to write the final ontology to a .ttl file106- Call `onto_version` to save a named snapshot for rollback107108## Ontology Lifecycle (Terraform-style)109110For evolving ontologies in production:1111121. **Plan** -- `onto_plan` shows added/removed classes, blast radius, risk score. Check `onto_lock` for protected IRIs.1132. **Enforce** -- `onto_enforce` with a rule pack (`generic`, `boro`, `value_partition`) checks design pattern compliance.1143. **Apply** -- `onto_apply` with mode `safe` (clear + reload) or `migrate` (add owl:equivalentClass bridges).1154. **Monitor** -- `onto_monitor` runs SPARQL watchers with threshold alerts. Use `onto_monitor_clear` if blocked.1165. **Drift** -- `onto_drift` compares versions with rename detection and self-calibrating confidence.117118## Data Extension Workflow119120When applying an ontology to external data:1211221. `onto_map` -- generate mapping config from data schema + loaded ontology1232. `onto_ingest` -- parse structured data (CSV, JSON, NDJSON, XML, YAML, XLSX, Parquet) into RDF1243. `onto_shacl` -- validate against SHACL shapes (cardinality, datatypes, classes)1254. `onto_reason` -- run RDFS or OWL-RL inference, materializing inferred triples1265. Or use `onto_extend` to run the full pipeline: ingest, SHACL validate, reason in one call127128## Clinical Terminology Support129130For healthcare ontologies:131132- `onto_crosswalk` -- look up mappings between ICD-10, SNOMED CT, and MeSH133- `onto_enrich` -- add skos:exactMatch triples linking classes to clinical codes134- `onto_validate_clinical` -- check class labels against clinical crosswalk terminology135136## Ontology Alignment137138For aligning two ontologies:139140- `onto_align` -- detect alignment candidates (equivalentClass, exactMatch, subClassOf) using 6 weighted signals141- `onto_align_feedback` -- accept/reject candidates to self-calibrate confidence weights142143## Tool Reference144145| Tool | When to use |146| ---- | ----------- |147| `onto_validate` | After generating or modifying Turtle -- always validate first |148| `onto_load` | After validation passes -- loads into triple store |149| `onto_stats` | After loading -- sanity check on counts |150| `onto_lint` | After loading -- catches missing labels, domains, ranges |151| `onto_query` | Verify structure, answer competency questions |152| `onto_diff` | Compare against a reference or previous version |153| `onto_save` | Persist ontology to a file |154| `onto_convert` | Convert between formats (Turtle, N-Triples, RDF/XML, N-Quads, TriG) |155| `onto_clear` | Reset the store before loading a different ontology |156| `onto_pull` | Fetch ontology from a remote URL or SPARQL endpoint |157| `onto_push` | Push ontology to a SPARQL endpoint |158| `onto_import` | Resolve and load owl:imports chains |159| `onto_version` | Save a named snapshot before making changes |160| `onto_history` | List saved version snapshots |161| `onto_rollback` | Restore a previous version |162| `onto_ingest` | Parse structured data into RDF and load into store |163| `onto_map` | Generate mapping config from data schema + ontology |164| `onto_shacl` | Validate data against SHACL shapes |165| `onto_reason` | Run RDFS or OWL-RL inference |166| `onto_extend` | Full pipeline: ingest, SHACL validate, reason |167| `onto_plan` | Show added/removed classes, blast radius, risk score |168| `onto_apply` | Apply changes in safe or migrate mode |169| `onto_lock` | Protect production IRIs from removal |170| `onto_drift` | Compare versions with rename detection |171| `onto_enforce` | Design pattern checks: generic, boro, value_partition, or custom |172| `onto_monitor` | Run SPARQL watchers with threshold alerts |173| `onto_monitor_clear` | Clear blocked state after resolving alerts |174| `onto_crosswalk` | Look up clinical terminology mappings (ICD-10, SNOMED, MeSH) |175| `onto_enrich` | Add skos:exactMatch triples linking to clinical codes |176| `onto_validate_clinical` | Check class labels against clinical terminology |177| `onto_align` | Detect alignment candidates between two ontologies |178| `onto_align_feedback` | Accept/reject alignment candidates for self-calibrating weights |179| `onto_lineage` | View session lineage trail (plan, enforce, apply, monitor, drift) |180| `onto_lint_feedback` | Accept/dismiss lint issues to teach suppression |181| `onto_enforce_feedback` | Accept/dismiss enforce violations to teach suppression |182| `onto_unload` | Unload from memory. With `name` targets a specific cached entry; `delete_cache=true` also removes the on-disk file |183| `onto_recompile` | Re-parse the source. With `name` rebuilds a non-active cached entry without disturbing the active in-memory store |184| `onto_cache_status` | Inspect compile cache: active slot, all entries, effective `[cache]` config |185| `onto_cache_list` | List cached ontologies with metadata (`is_active`, `in_memory`, mtime, size) |186| `onto_cache_remove` | Remove a cached ontology by `name` (pass `delete_file=false` to keep the on-disk N-Triples) |187| `onto_repo_list` | List RDF/OWL files in configured `[general] ontology_dirs` directories |188| `onto_repo_load` | Load an ontology from a configured repo by bare name, relative path, or absolute path |189| `onto_status` | Server health / loaded triple count |190| `onto_marketplace` | Browse / install standard ontologies from the curated catalogue |191| `onto_dl_check` | Check `subClass ⊑ superClass` via DL tableaux |192| `onto_dl_explain` | Explain why a class is unsatisfiable (DL clash trace) |193| `onto_embed` | Generate text + Poincaré structural embeddings for all classes |194| `onto_search` | Natural-language query → most-similar classes |195| `onto_similarity` | Cosine + Poincaré distance between two IRIs |196| `onto_import_schema` | Introspect PostgreSQL or DuckDB schema → generate OWL classes/properties/cardinality |197| `onto_sql_ingest` | Run SQL `SELECT` against PostgreSQL or DuckDB → RDF (DuckDB enables federation over CSV/Parquet/JSON/HTTPFS/postgres-scanner via its extensions) |198199## Usage Examples200201### Build a pizza ontology from scratch202203```204Build me a pizza ontology with classes for Pizza, PizzaBase (ThinAndCrispy, DeepPan),205PizzaTopping (Mozzarella, Tomato, Pepperoni, Mushroom), and properties hasBase, hasTopping.206Include rdfs:labels and rdfs:comments on everything. Validate and run competency queries207to check I can ask "what toppings does a Margherita have?"208```209210### Load and query an existing ontology211212```213Load the ontology from https://www.w3.org/TR/owl-guide/wine.rdf, show me stats,214lint it, and run a SPARQL query to find all subclasses of Wine.215```216217### Evolve an ontology safely218219```220I need to add a new class "GlutenFreePizza" as a subclass of Pizza with a restriction221that hasBase only GlutenFreeBase. Plan the change, enforce against generic rules,222and apply in safe mode.223```224225### Ingest CSV data into a knowledge graph226227```228I have a CSV of employees with columns: name, department, role, start_date.229Map it to the loaded HR ontology and ingest it. Then validate with SHACL shapes230and run inference to materialize department hierarchies.231```232233### Align two ontologies234235```236Load schema.org and my company ontology. Run onto_align to find equivalentClass237and exactMatch candidates. I'll review and give feedback to calibrate the weights.238```239240## Key Principle241242Dynamically decide the next tool call based on what the previous tool returned. If `onto_validate` fails, fix and retry. If `onto_stats` shows wrong counts, regenerate. If `onto_lint` finds missing labels, add them. The MCP tools are individual operations -- Claude is the orchestrator.