ontology-architect
Skill78 starsChanged 8 days agoApache-2.0View on GitHub
Specializes in Programmatic Ontology Development (POD). Creates OWL 2 axioms, manages class hierarchies, generates ROBOT templates, runs reasoners. Uses ROBOT, oaklib, KGCL, OWLAPY, owlready2, and LinkML. Use when creating or modifying ontology axioms.
In this repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- explorations/AGENTS.mdAGENTS.md
- adhdSkill
- atom-reactivity-specialistSkill
- browser-qa-loopSkill
- closeoutSkill
- codex-findingsSkill
- crispenSkill
- effect-first-developmentSkill
- exploreSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- jsdoc-annotation-specialistSkill
- motion-evidence-reviewSkill
- onepassword-secret-refsSkill
- ontology-conceptualizerSkill
- ontology-curatorSkill
- ontology-foundational-auditorSkill
- ontology-mapperSkill
- ontology-requirementsSkill
- ontology-scoutSkill
- ontology-validatorSkill
- operator-handoffSkill
- orchestrateSkill
- plasma-sensitive-entrySkill
- portlessSkill
- qa-session-opsSkill
- quality-review-fix-loopSkill
- reflectSkill
- remote-development-agentsSkill
- schema-first-developmentSkill
- shadcnSkill
- sparql-expertSkill
- teachSkill
- turborepoSkill
- unslopSkill
- yeetSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 13 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Read these files from _shared/ before beginning work:
- Distinctive: line 58
Default to OWL 2 DL unless there is a clear scalability or deployment reason to choose a restricted profile.
- Distinctive: line 63
Every new ontology needs a Turtle header with metadata:
- Distinctive: line 88
Use one coherent annotation vocabulary strategy across ontology header, classes, and properties.
- Very specific: line 133
Language tags: Use A rdfs:label@en to add a language tag.
- Very specific: line 137
Pre-flight check: Before running robot template, verify that all column headers parse correctly and all CURIEs resolve against declared …
- Distinctive: line 165
When ROBOT templates and KGCL cannot express the needed axiom (qualified cardinality, role chains, nested class expressions).
- Distinctive: line 226
Test individuals belong in a separate test ontology/module.
- Distinctive: line 229
If reference individuals exceed about 50, split into a separate file and import it explicitly.
- Distinctive: line 235
Use it when the primary deliverable is a data model (JSON Schema, SHACL, Python dataclasses) rather than a rich OWL ontology.
- Distinctive: line 245
When starting from scratch with a schema-first approach:
- Distinctive: line 310
If the project uses the Ontology Development Kit (ODK), understand these conventions:
- Distinctive: line 323
When working in a non-ODK project, the ROBOT commands below apply directly.
- Very specific: line 392
Hand-editing Turtle: Never manually edit .ttl files.
- Very specific: line 394
Skipping the reasoner: Always run robot reason after structural changes.
- Very specific: line 396
Deleting terms: Never delete — deprecate with owl:deprecated true.
- Distinctive: line 398
Over-engineering tools: Don't use OWLAPY for simple SubClassOf.
- Very specific: line 400
Missing metadata: Every class needs rdfs:label and skos:definition at minimum.
- Distinctive: line 402
Skipping read-before-modify: Always read the existing ontology file before making changes.
- Distinctive: line 404
No backup before bulk: Create a checkpoint before running ROBOT template or batch KGCL application.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ontology Architect (POD)
Role Statement
You are responsible for the formalization phase — encoding the approved conceptual model as OWL 2 axioms using programmatic methods. You select the right tool for each operation (see tool decision tree), generate ROBOT templates for bulk creation, write KGCL patches for individual changes, and escalate to OWLAPY for complex axioms. You ALWAYS run the reasoner after structural changes. You NEVER hand-edit ontology files.
When to Activate
- User wants to create or modify ontology classes, properties, or axioms
- User mentions "add class", "define property", "create axiom", "formalize"
- User wants to formalize a conceptual model as OWL
- Pipeline A Step 4
Shared Reference Materials
Read these files from _shared/ before beginning work:
_shared/methodology-backbone.md— lifecycle phase context (Phase 4: Formalization)_shared/tool-decision-tree.md— when to use each tool_shared/axiom-patterns.md— OWL pattern catalog_shared/naming-conventions.md— naming and ID minting standards_shared/namespaces.json— canonical prefixes_shared/quality-checklist.md— validation requirements after changes
Core Workflow
Step 1: Select OWL 2 Profile
Full OWL 2 is highly expressive but unrestricted reasoning can be costly. Profiles trade expressivity for better reasoning guarantees and performance.
Reasoning strategy options:
- Incomplete but sound: Fast reasoners may miss some entailments.
- Complete but profile-restricted: Stay within EL/QL/RL for guaranteed behavior.
- Complete but potentially expensive: Full DL reasoning, slower on large ontologies.
| Criterion | Profile | Typical exclusions | Reasoner |
| >100K classes, mostly taxonomic | OWL 2 EL | No full negation, universal restrictions, qualified cardinality | ELK |
| OBDA over relational data | OWL 2 QL | Limited class constructors | Ontop-compatible QL tooling |
| Full expressivity needed | OWL 2 DL | None (most expressive decidable profile) | HermiT, Pellet/Openllet |
| Rule-engine style inference | OWL 2 RL | Restricted existential patterns in subclass axioms | Rule engines / RL-compatible reasoners |
Default to OWL 2 DL unless there is a clear scalability or deployment reason to choose a restricted profile.
Step 2: Create Ontology Header
Every new ontology needs a Turtle header with metadata:
@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 skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
<http://example.org/ontology> a owl:Ontology ;
owl:versionIRI <http://example.org/ontology/2024-01-01> ;
owl:versionInfo "2024-01-01" ;
dcterms:title "Example Ontology"@en ;
dcterms:description "Purpose and scope"@en ;
dcterms:creator "Ontology Team" ;
dcterms:created "2024-01-01"^^xsd:date ;
dcterms:rights "Copyright holder or organization" ;
dcterms:license <https://creativecommons.org/licenses/by/4.0/> ;
prov:wasAttributedTo <https://orcid.org/0000-0000-0000-0000> ;
prov:generatedAtTime "2024-01-01T00:00:00Z"^^xsd:dateTime .Metadata consistency rule:
- Use one coherent annotation vocabulary strategy across ontology header, classes, and properties.
- Required minimum for terms is defined in
_shared/naming-conventions.md; use the same conventions in generated templates and KGCL patches. - Include PROV-O fields when provenance tracking is required by the project.
Step 3: Bulk Term Creation via ROBOT Template
For adding >5 terms from the glossary, generate a ROBOT template TSV:
ID LABEL SC % DEFINITION DEFINITION SOURCE
ID A rdfs:label SC % A obo:IAO_0000115 A obo:IAO_0000119
EX:0001 piano EX:0000 A keyboard instrument that produces sound by striking strings glossary
EX:0002 violin EX:0000 A string instrument played with a bow glossaryExecute:
robot template --template instruments-template.tsv \
--input ontology.ttl \
--output ontology.ttlROBOT Template Pitfalls
These issues are learned through experience and not well-documented:
- Column header syntax is fragile: The second row defines semantics
(e.g.,
SC %,A rdfs:label). A typo or extra space causes silent failures, not errors. Double-check headers before running. - The
%placeholder in expressions:SC 'has part' some %must have exact quoting and spacing. This is where most template errors occur. - Merge vs replace:
--merge-beforeand--merge-aftercontrol whether template output merges with the input or replaces it. Getting this wrong can delete your entire ontology. Default behavior is merge. - IRI resolution: Template values must be full IRIs or CURIEs that resolve via the ontology's prefix declarations. Undeclared prefixes produce blank or invalid output with no error.
- Multi-value columns: To put multiple superclasses or annotations on
one term, use
SPLIT=|in the column header. Not obvious from docs. - Empty cells skip silently: Empty cells in required columns skip the row rather than raising an error. Terms can be partially created (label but no definition).
- Language tags: Use
A rdfs:label@ento add a language tag. Without it, labels are untagged string literals, causing issues with tools that filter by language.
Pre-flight check: Before running robot template, verify that all column
headers parse correctly and all CURIEs resolve against declared prefixes.
Step 4: Individual Changes via KGCL
For single additions, modifications, or reparenting. Important: For
changes to shared ontologies, write KGCL commands to a .kgcl file and
present for review BEFORE applying (Safety Rule #5).
# Add a class
uv run runoak -i ontology.ttl apply "create class EX:0001 'piano'"
# Add subclass relationship
uv run runoak -i ontology.ttl apply "create edge EX:0001 rdfs:subClassOf EX:0000"
# Add definition
uv run runoak -i ontology.ttl apply "create definition 'A keyboard instrument that produces sound by striking strings' for EX:0001"
# Rename
uv run runoak -i ontology.ttl apply "rename EX:0001 from 'Old Name' to 'New Name'"
# Batch changes from file
uv run runoak -i ontology.ttl apply --changes-input changes.kgclStep 5: Complex Axioms via OWLAPY or rdflib
When ROBOT templates and KGCL cannot express the needed axiom (qualified cardinality, role chains, nested class expressions).
Tool choice: Most OBO community practitioners use rdflib for programmatic OWL work in Python (triple-level manipulation). OWLAPY provides a higher-level OWL API but has a smaller community and requires a JVM. Use whichever fits your team's stack — examples of both follow.
OWLAPY example:
from owlapy.model import (
OWLClass, OWLObjectProperty,
OWLSubClassOfAxiom, OWLObjectSomeValuesFrom,
OWLObjectAllValuesFrom, OWLObjectIntersectionOf,
)
from owlapy.model import IRI
from owlapy.owlready2 import OWLOntologyManager_Owlready2
manager = OWLOntologyManager_Owlready2()
onto = manager.load_ontology(IRI.create("file:///path/to/ontology.owl"))
# Example: StringInstrument EquivalentTo Instrument and hasComponent some String
instrument = OWLClass(IRI.create("http://ex.org/#Instrument"))
string_cls = OWLClass(IRI.create("http://ex.org/#String"))
has_comp = OWLObjectProperty(IRI.create("http://ex.org/#hasComponent"))
restriction = OWLObjectSomeValuesFrom(has_comp, string_cls)
intersection = OWLObjectIntersectionOf([instrument, restriction])
# ... add as equivalent class axiom
manager.save_ontology(onto, IRI.create("file:///path/to/ontology.owl"))rdflib alternative (no JVM required):
from rdflib import Graph, Namespace, OWL, RDF, RDFS, URIRef, BNode
from rdflib.collection import Collection
g = Graph()
g.parse("ontology.ttl", format="turtle")
EX = Namespace("http://example.org/")
# Add existential restriction: StringInstrument SubClassOf hasComponent some String
restriction = BNode()
g.add((restriction, RDF.type, OWL.Restriction))
g.add((restriction, OWL.onProperty, EX.hasComponent))
g.add((restriction, OWL.someValuesFrom, EX.String))
g.add((EX.StringInstrument, RDFS.subClassOf, restriction))
g.serialize("ontology.ttl", format="turtle")Step 5.5: Individual Management
Handle individuals as A-box content with explicit module boundaries:
- Reference individuals (for example country codes, fixed enumerations) belong in a dedicated reference-individuals module.
- Test individuals belong in a separate test ontology/module.
- Production individuals belong in a knowledge graph dataset, not in the core ontology schema file.
- If reference individuals exceed about 50, split into a separate file and import it explicitly.
Step 6: Schema-First via LinkML (for data model schemas)
LinkML excels at defining data schemas that generate multiple artifact types. Use it when the primary deliverable is a data model (JSON Schema, SHACL, Python dataclasses) rather than a rich OWL ontology.
Best for: ABox validation schemas, data exchange formats, projects where domain experts review YAML rather than OWL.
Not ideal for: Rich TBox ontologies with complex axioms (qualified cardinality, role chains, nested class expressions). LinkML-generated OWL is relatively flat and typically needs enrichment with ROBOT or OWLAPY.
When starting from scratch with a schema-first approach:
id: https://example.org/music-ontology
name: music-ontology
prefixes:
linkml: https://w3id.org/linkml/
music: https://example.org/music-ontology/
classes:
Instrument:
description: A device used to produce music
attributes:
name:
range: string
required: true
instrument_family:
range: InstrumentFamilyGenerate artifacts:
uv run gen-owl schema.yaml > ontology.owl
uv run gen-shacl schema.yaml > shapes.ttl
uv run gen-python schema.yaml > models.pyStep 7: Verify (after structural changes)
Reasoning strategy depends on context:
| Context | Reasoner | Frequency | Time Budget |
| Active development | ELK | After each batch of changes | Seconds (10K classes) |
| Pre-commit / CI | ELK | Every commit | < 2 minutes |
| Pre-release validation | HermiT or Pellet | Before each release | Minutes to hours |
Important: ELK only supports OWL 2 EL. If your ontology uses qualified cardinality, universal restrictions, or class complements, ELK will silently ignore those axioms. Run HermiT at least before releases to catch what ELK misses.
# Fast classification (ELK — use during development and CI)
robot reason --reasoner ELK --input ontology.ttl --output classified.ttl
# Full DL classification (HermiT — use pre-release)
robot reason --reasoner HermiT --input ontology.ttl --output classified.ttl
# Quality report
robot report --input ontology.ttl --fail-on ERROR --output report.tsv
# SHACL validation (if shapes exist)
uv run pyshacl -s shapes/ontology-shapes.ttl -i rdfs ontology.ttl -f humanMaterialization decision: The ODK default is to include inferred axioms
in the release file (robot reason --output). If consumers will reason
independently, ship asserted-only and document this in the release notes.
Tool Commands
ODK Awareness
If the project uses the Ontology Development Kit (ODK), understand these conventions:
- Edit file: Work in
src/ontology/{name}-edit.owl— never touch release artifacts directly - Makefile pipeline:
sh run.sh makeruns the full build (merge, reason, report, release) reproducibly via Docker - Import management:
src/ontology/imports/{source}_terms.txtlists imported IRIs;make refresh-importsregenerates*_import.owlmodules - DOSDP patterns: YAML pattern files generate OWL from TSV data — more structured than raw ROBOT templates for pattern-based term creation
- Release:
make prepare_releaseproduces multi-format release artifacts
When working in a non-ODK project, the ROBOT commands below apply directly.
ROBOT operations
# Merge imports
robot merge --input edit-ontology.ttl --input imports/*.owl --output merged.ttl
# Convert formats
robot convert --input ontology.ttl --output ontology.owl
robot convert --input ontology.ttl --output ontology.json --format json-ld
# Annotate with version
robot annotate --input ontology.ttl \
--annotation owl:versionInfo "$(date +%Y-%m-%d)" \
--output ontology.ttloaklib operations
# Search before creating (always!)
uv run runoak -i sqlite:obo:bfo search "material entity"
# Get term info
uv run runoak -i ontology.ttl info EX:0001
# Visualize hierarchy
uv run runoak -i ontology.ttl tree --root EX:0000Outputs
This skill produces:
| Artifact | Location | Format | Description |
| Main ontology | ontologies/{name}/{name}.ttl | Turtle | The formalized OWL 2 ontology |
| SHACL shapes | ontologies/{name}/shapes/{name}-shapes.ttl | Turtle | Structural validation shapes |
| ROBOT templates | ontologies/{name}/{name}-template.tsv | TSV | Templates used for term creation |
| KGCL patches | ontologies/{name}/{name}-changes.kgcl | KGCL | Applied change log |
| Quality report | ontologies/{name}/{name}-report.tsv | TSV | Latest ROBOT report |
| Reference individuals (optional) | ontologies/{name}/{name}-reference-individuals.ttl | Turtle | A-box reference instances kept separate from schema |
Handoff
Receives from:
ontology-conceptualizer—ontologies/{name}/docs/glossary.csv,ontologies/{name}/docs/conceptual-model.yaml,ontologies/{name}/docs/bfo-alignment.md,ontologies/{name}/docs/property-design.yaml,ontologies/{name}/docs/axiom-plan.yaml, plus the auditor'swork/dispositions.index.yamlcarried forward unchanged (the unresolved/deferred remainder — never dropped at any handoff)ontology-requirements(indirect, via pipeline) —ontologies/{name}/tests/*.sparql,ontologies/{name}/tests/cq-test-manifest.yaml(CQ test suite to forward to validator)
Passes to: ontology-validator — ontologies/{name}/{name}.ttl,
ontologies/{name}/shapes/{name}-shapes.ttl, ontologies/{name}/tests/*.sparql,
ontologies/{name}/tests/cq-test-manifest.yaml,
plus work/dispositions.index.yaml (carried forward unchanged)
Handoff checklist:
- Ontology passes
robot reasonwith zero unsatisfiable classes - Ontology passes
robot reportwith zero ERRORs - All glossary terms are present in the ontology
- All axiom plan entries have been implemented
- SHACL shapes exist for core structural constraints
Anti-Patterns to Avoid
- Hand-editing Turtle: Never manually edit
.ttlfiles. Use ROBOT, oaklib, or Python tools. (Safety Rule #1) - Skipping the reasoner: Always run
robot reasonafter structural changes. (Safety Rule #2) - Deleting terms: Never delete — deprecate with
owl:deprecated true. (Safety Rule #4) - Over-engineering tools: Don't use OWLAPY for simple SubClassOf. Use ROBOT template or KGCL instead. (See tool decision tree)
- Missing metadata: Every class needs
rdfs:labelandskos:definitionat minimum. - Skipping read-before-modify: Always read the existing ontology file before making changes. (Safety Rule #9)
- No backup before bulk: Create a checkpoint before running ROBOT template or batch KGCL application. (Safety Rule #10)
Error Handling
| Error | Likely Cause | Recovery |
| Reasoner reports INCONSISTENT | Conflicting axioms (often disjointness + subclass) | Parse explanation, identify conflicting axioms, propose minimal fix |
| Unsatisfiable classes found | Over-constrained class (contradictory restrictions) | List unsatisfiable classes, trace disjointness axioms |
| ROBOT template fails | Column headers don't match expected format | Check ROBOT template documentation for column syntax |
| KGCL apply fails | Term not found or invalid KGCL syntax | Verify term exists with runoak info; check KGCL grammar |
| OWLAPY JVM bridge error | Java not installed or JVM not found | Ensure JDK is installed and JAVA_HOME is set |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

