Ontology Editor Skill
Use this skill when you need to inspect or modify OWL ontology files in this project. Never edit OWL files directly—use these tools for all axiom, prefix, and metadata changes. The tools are provided by the OWL-MCP server and operate on OWL files by absolute file path.
When to Use
- Step 6 (Formalization) in the Ontology Builder workflow: add axioms, prefixes, and annotations to an OWL file after the user has approved the draft.
- Ontology navigation: find axioms, get all axioms, or read ontology metadata for an existing file.
- Ontology editing: add/remove axioms in OWL functional syntax; add prefix mappings; set the ontology IRI.
- Quality checking: scan for common modeling pitfalls (OOPS!-style checks).
Align with the project's INSTRUCTIONS.md: work top-down, get user approval before large edits, and keep changes in formal OWL (functional syntax recommended).
How the Server Works
- File path: Every tool takes
owl_file_path — an absolute path to the OWL file (e.g. C:\Users\...\ontology.owl or /path/to/ontology.owl). The server loads the file on first access and syncs in-memory state with disk on writes.
- Syntax: Axioms are strings in OWL functional syntax (e.g.
SubClassOf(:Dog :Animal), Declaration(Class(:Cat))).
Tools Overview
Axioms
| Tool |
Purpose |
| add_axiom |
Add one axiom (e.g. SubClassOf(:A :B)). Params: owl_file_path, axiom_str. |
| add_axioms |
Add multiple axioms in one call. Params: owl_file_path, axiom_strs (array). |
| remove_axiom |
Remove one axiom (exact match). Params: owl_file_path, axiom_str. |
| find_axioms |
Search axioms by regex pattern; optional labels, limit, custom annotation property. Params: owl_file_path, pattern, limit, include_labels, annotation_property (nullable). |
| get_all_axioms |
Return all axioms (up to limit); optional labels, custom annotation property. Params: owl_file_path, limit, include_labels, annotation_property (nullable). |
Prefixes, Metadata, and IRI Management
| Tool |
Purpose |
| add_prefix |
Add a prefix mapping (e.g. prefix ex: → http://example.org/). Params: owl_file_path, prefix, uri. |
| ontology_metadata |
Get ontology-level annotation axioms (metadata header). Params: owl_file_path. |
| get_labels_for_iri |
Get label(s) for a given IRI or CURIE; optional custom annotation property. Params: owl_file_path, iri, annotation_property (nullable). |
| set_ontology_iri |
Set or update the ontology IRI and optional version IRI. Pass iri: null to clear. Params: owl_file_path, iri (nullable), version_iri (nullable). |
Quality Checks
| Tool |
Purpose |
| test_pitfalls |
Scan for common modeling pitfalls (31 OOPS!-inspired checks). Returns a JSON report listing detected issues, severity, and affected elements. Optionally filter by pitfall IDs. Params: owl_file_path, pitfalls (nullable, comma-separated IDs e.g. "P04,P08,P11"). |
Available pitfall checks: P02 (synonym classes), P03 ("is" relationship), P04 (unconnected elements), P05 (wrong inverses), P06 (class hierarchy cycles), P07 (merged concepts), P08 (missing annotations), P10 (missing disjointness), P11 (missing domain/range), P12 (undeclared equivalent properties), P13 (missing inverses), P19 (multiple domains/ranges), P20 (misused annotations), P21 (miscellaneous class), P22 (inconsistent naming), P24 (recursive definitions), P25 (self-inverse), P26 (inverse of symmetric), P27 (wrong equivalent properties), P28 (wrong symmetric), P29 (wrong transitive), P30 (undeclared equivalent classes), P31 (wrong equivalent classes), P32 (duplicate labels), P33 (single-property chain), P34 (untyped class), P35 (untyped property), P36 (URI file extension), P38 (no ontology declaration), P39 (ambiguous namespace), P41 (no license).
Usage Tips
- Always use absolute paths: Pass the full absolute path in
owl_file_path to ensure the MCP server can resolve the file regardless of working directory.
- Finding content: Call
find_axioms with a regex pattern; set include_labels: true for human-readable labels appended as ## comments. Use annotation_property to override the default rdfs:label (e.g. for skos:prefLabel).
- Adding axioms: Use OWL functional syntax. Add one axiom per call with
add_axiom, or batch with add_axioms. Ensure required prefixes exist (e.g. owl, rdf, rdfs, xsd); add custom ones with add_prefix.
- Setting the ontology IRI: Use
set_ontology_iri to establish the ontology IRI and version IRI before adding axioms to a new file. Always pass full IRIs (e.g. "http://example.org/ontology/my-ontology/"), never CURIEs (e.g. "ex:"). CURIEs in the Ontology(...) header produce files that ROBOT cannot parse.
- Project workflow: After the user approves a draft (Step 5), use these tools to implement the change in the OWL file (Step 6), then run
test_pitfalls as part of automated review (Step 7).
- Imports: Add import axioms via
add_axiom using full IRIs in angle brackets: Import(<http://purl.obolibrary.org/obo/bfo.owl>). Never use CURIEs in Import(...) (e.g. Import(obo:bfo.owl) is invalid and will cause ROBOT parsing failures).
- Annotating the ontology itself: When the subject of an
AnnotationAssertion is the ontology (e.g. for rdfs:label, rdfs:comment, dcterms:license), use the full ontology IRI as the subject, not a bare CURIE. Example: AnnotationAssertion(rdfs:label <http://example.org/ontology/my-ontology/> "My Ontology"@en).
Tool Requirements
This skill requires the following tools (proxied from the owl-mcp MCP server):
- add_axiom, add_axioms, remove_axiom, find_axioms, get_all_axioms
- add_prefix, ontology_metadata, get_labels_for_iri
- set_ontology_iri, test_pitfalls
After learning this skill, call setup_tools(skills: ["ontology-editor"]) to activate these tools, then use call_tool(name: "<tool_name>", data: {...}) to invoke them.
CLI fallback (no MCP client needed): If the MCP tools are unavailable (e.g. the editor hasn't reloaded the capa server after capa install), invoke the same tools from the terminal with capa sh. Tool and parameter names are kebab-case, arrays repeat the flag, paths are absolute and quoted, and results print as JSON. Examples:
capa sh owl # list owl-mcp tools
capa sh owl set-ontology-iri --owl-file-path "C:/abs/ont.owl" --iri "http://example.org/ont/" --version-iri "http://example.org/ont/1.0"
capa sh owl add-prefix --owl-file-path "C:/abs/ont.owl" --prefix "ex" --uri "http://example.org/"
capa sh owl find-axioms --owl-file-path "C:/abs/ont.owl" --pattern "Dog" --include-labels true
capa sh owl test-pitfalls --owl-file-path "C:/abs/ont.owl"
The capa server must be running (capa start); capa restart clears stale in-memory ontology state.
1---2name: ontology-editor3description: Read, edit, and manage OWL ontologies with OWL-MCP (axioms, prefixes, metadata, pitfall scanning). Use whenever the user wants to add or remove axioms, search axioms, add prefixes, set the ontology IRI, inspect ontology metadata, scan for pitfalls, or formalize an ontology in OWL—e.g. "add this axiom", "find axioms for class X", "add prefix", "check for pitfalls". Align with Ontology Builder workflow (formalization step); use absolute paths for OWL files. Never edit OWL files by hand.4---56# Ontology Editor Skill78Use this skill when you need to **inspect or modify OWL ontology files** in this project. **Never edit OWL files directly**—use these tools for all axiom, prefix, and metadata changes. The tools are provided by the OWL-MCP server and operate on OWL files by **absolute file path**.910## When to Use1112- **Step 6 (Formalization)** in the Ontology Builder workflow: add axioms, prefixes, and annotations to an OWL file after the user has approved the draft.13- **Ontology navigation**: find axioms, get all axioms, or read ontology metadata for an existing file.14- **Ontology editing**: add/remove axioms in OWL functional syntax; add prefix mappings; set the ontology IRI.15- **Quality checking**: scan for common modeling pitfalls (OOPS!-style checks).1617Align with the project's INSTRUCTIONS.md: work top-down, get user approval before large edits, and keep changes in formal OWL (functional syntax recommended).1819## How the Server Works2021- **File path**: Every tool takes `owl_file_path` — an **absolute path** to the OWL file (e.g. `C:\Users\...\ontology.owl` or `/path/to/ontology.owl`). The server loads the file on first access and syncs in-memory state with disk on writes.22- **Syntax**: Axioms are strings in **OWL functional syntax** (e.g. `SubClassOf(:Dog :Animal)`, `Declaration(Class(:Cat))`).2324## Tools Overview2526### Axioms2728| Tool | Purpose |29|------|--------|30| **add_axiom** | Add one axiom (e.g. `SubClassOf(:A :B)`). Params: `owl_file_path`, `axiom_str`. |31| **add_axioms** | Add multiple axioms in one call. Params: `owl_file_path`, `axiom_strs` (array). |32| **remove_axiom** | Remove one axiom (exact match). Params: `owl_file_path`, `axiom_str`. |33| **find_axioms** | Search axioms by regex pattern; optional labels, limit, custom annotation property. Params: `owl_file_path`, `pattern`, `limit`, `include_labels`, `annotation_property` (nullable). |34| **get_all_axioms** | Return all axioms (up to limit); optional labels, custom annotation property. Params: `owl_file_path`, `limit`, `include_labels`, `annotation_property` (nullable). |3536### Prefixes, Metadata, and IRI Management3738| Tool | Purpose |39|------|--------|40| **add_prefix** | Add a prefix mapping (e.g. prefix `ex:` → `http://example.org/`). Params: `owl_file_path`, `prefix`, `uri`. |41| **ontology_metadata** | Get ontology-level annotation axioms (metadata header). Params: `owl_file_path`. |42| **get_labels_for_iri** | Get label(s) for a given IRI or CURIE; optional custom annotation property. Params: `owl_file_path`, `iri`, `annotation_property` (nullable). |43| **set_ontology_iri** | Set or update the ontology IRI and optional version IRI. Pass `iri: null` to clear. Params: `owl_file_path`, `iri` (nullable), `version_iri` (nullable). |4445### Quality Checks4647| Tool | Purpose |48|------|--------|49| **test_pitfalls** | Scan for common modeling pitfalls (31 OOPS!-inspired checks). Returns a JSON report listing detected issues, severity, and affected elements. Optionally filter by pitfall IDs. Params: `owl_file_path`, `pitfalls` (nullable, comma-separated IDs e.g. `"P04,P08,P11"`). |5051**Available pitfall checks:** P02 (synonym classes), P03 ("is" relationship), P04 (unconnected elements), P05 (wrong inverses), P06 (class hierarchy cycles), P07 (merged concepts), P08 (missing annotations), P10 (missing disjointness), P11 (missing domain/range), P12 (undeclared equivalent properties), P13 (missing inverses), P19 (multiple domains/ranges), P20 (misused annotations), P21 (miscellaneous class), P22 (inconsistent naming), P24 (recursive definitions), P25 (self-inverse), P26 (inverse of symmetric), P27 (wrong equivalent properties), P28 (wrong symmetric), P29 (wrong transitive), P30 (undeclared equivalent classes), P31 (wrong equivalent classes), P32 (duplicate labels), P33 (single-property chain), P34 (untyped class), P35 (untyped property), P36 (URI file extension), P38 (no ontology declaration), P39 (ambiguous namespace), P41 (no license).5253## Usage Tips54551. **Always use absolute paths**: Pass the full absolute path in `owl_file_path` to ensure the MCP server can resolve the file regardless of working directory.562. **Finding content**: Call `find_axioms` with a regex pattern; set `include_labels: true` for human-readable labels appended as `##` comments. Use `annotation_property` to override the default `rdfs:label` (e.g. for `skos:prefLabel`).573. **Adding axioms**: Use OWL functional syntax. Add one axiom per call with `add_axiom`, or batch with `add_axioms`. Ensure required prefixes exist (e.g. `owl`, `rdf`, `rdfs`, `xsd`); add custom ones with `add_prefix`.584. **Setting the ontology IRI**: Use `set_ontology_iri` to establish the ontology IRI and version IRI before adding axioms to a new file. **Always pass full IRIs** (e.g. `"http://example.org/ontology/my-ontology/"`), never CURIEs (e.g. `"ex:"`). CURIEs in the `Ontology(...)` header produce files that ROBOT cannot parse.595. **Project workflow**: After the user approves a draft (Step 5), use these tools to implement the change in the OWL file (Step 6), then run `test_pitfalls` as part of automated review (Step 7).606. **Imports**: Add import axioms via `add_axiom` using **full IRIs in angle brackets**: `Import(<http://purl.obolibrary.org/obo/bfo.owl>)`. Never use CURIEs in `Import(...)` (e.g. `Import(obo:bfo.owl)` is invalid and will cause ROBOT parsing failures).617. **Annotating the ontology itself**: When the subject of an `AnnotationAssertion` is the ontology (e.g. for `rdfs:label`, `rdfs:comment`, `dcterms:license`), use the **full ontology IRI** as the subject, not a bare CURIE. Example: `AnnotationAssertion(rdfs:label <http://example.org/ontology/my-ontology/> "My Ontology"@en)`.6263## Tool Requirements6465This skill requires the following tools (proxied from the `owl-mcp` MCP server):6667- add_axiom, add_axioms, remove_axiom, find_axioms, get_all_axioms68- add_prefix, ontology_metadata, get_labels_for_iri69- set_ontology_iri, test_pitfalls7071After learning this skill, call `setup_tools(skills: ["ontology-editor"])` to activate these tools, then use `call_tool(name: "<tool_name>", data: {...})` to invoke them.7273**CLI fallback (no MCP client needed):** If the MCP tools are unavailable (e.g. the editor hasn't reloaded the capa server after `capa install`), invoke the same tools from the terminal with `capa sh`. Tool and parameter names are kebab-case, arrays repeat the flag, paths are absolute and quoted, and results print as JSON. Examples:7475```bash76capa sh owl # list owl-mcp tools77capa sh owl set-ontology-iri --owl-file-path "C:/abs/ont.owl" --iri "http://example.org/ont/" --version-iri "http://example.org/ont/1.0"78capa sh owl add-prefix --owl-file-path "C:/abs/ont.owl" --prefix "ex" --uri "http://example.org/"79capa sh owl find-axioms --owl-file-path "C:/abs/ont.owl" --pattern "Dog" --include-labels true80capa sh owl test-pitfalls --owl-file-path "C:/abs/ont.owl"81```8283The capa server must be running (`capa start`); `capa restart` clears stale in-memory ontology state.