agentleFS
fabio-rovaifabio-rovai/open-ontologies/skills/ontology-engineering/SKILL.md

ontology-engineering

Skill548 starsChanged 2 months agoMITView on GitHub

Build, validate, and govern RDF/OWL ontologies using the Open Ontologies MCP server. Use when the user asks to create, modify, query, or manage ontologies, knowledge graphs, or RDF data.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. chimezie/semantic-web-reasoner-skill★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 3 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When building or modifying ontologies, follow this workflow.

    line 12
  2. Very specific:

    Call onto_validate on the generated Turtle -- if it fails, fix syntax errors and re-validate

    line 21
  3. Very specific:

    Call onto_load to load into the Oxigraph triple store.

    line 22
  4. Very specific:

    Call onto_stats to verify class count, property count, triple count match expectations

    line 23
  5. Very specific:

    Call onto_lint to check for missing labels, comments, domains, ranges -- fix any issues found

    line 27
  6. Very specific:

    Call onto_query with SPARQL to verify structure (expected classes, subclass hierarchies, competency questions)

    line 28
  7. Very specific:

    If a reference ontology exists, call onto_diff to compare

    line 29
  8. Distinctive:

    If any step reveals problems, fix the Turtle and restart from step 2

    line 33
  9. Very specific:

    Call onto_save to write the final ontology to a .ttl file

    line 38
  10. Very specific:

    Call onto_version to save a named snapshot for rollback

    line 39
  11. Distinctive:

    When applying an ontology to external data:

    line 67
  12. Very specific:

    After loading, generate embeddings to enable natural-language search.

    line 85
  13. Very specific:

    When embeddings exist, onto_align automatically uses them as a 7th alignment signal, catching semantically equivalent classes whose labels …

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Ontology Engineering Workflow

You have access to the Open Ontologies MCP server, which provides 122 tools for AI-native ontology engineering backed by an in-memory Oxigraph triple store. 114 of them are advertised in a default build, and the other 8 require an optional Cargo feature and return an error without it: four need embeddings, two need plugins, and two need postgres or duckdb.

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 -- you know OWL, RDF, BORO, 4D modeling natively

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. For repos that mount a folder of .ttl files via [general] ontology_dirs, prefer onto_repo_load so the same compile-cache / TTL-eviction path is exercised. Use onto_repo_list to discover candidate files.
  • 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

Cache and Multi-Ontology Loading

The server keeps a single active ontology in memory plus an on-disk N-Triples compile cache for everything it has parsed. Switch between several ontologies without paying re-parse costs:

  • onto_repo_list — enumerate .ttl / .owl / .nt / .rdf / .nq / .trig / .jsonld files configured under [general] ontology_dirs. Container-friendly: mount a host folder of TTL files and discover them at runtime without hardcoded paths.
  • onto_repo_load — load by bare file stem, relative path, or absolute path inside a configured repo dir. Reuses the same compile-cache / TTL-eviction path as onto_load.
  • onto_cache_status / onto_cache_list — inspect what is cached, what is currently active, and the effective [cache] configuration (TTL, auto_refresh, dir).
  • onto_cache_remove — drop a cached entry by name (pass delete_file=false to keep the on-disk N-Triples for a later reload).
  • onto_unload — drop the active ontology (or a specific cached entry by name) from memory; the on-disk cache is preserved unless delete_cache=true.
  • onto_recompile — force a re-parse from source, ignoring the cache. Without name, recompiles the active ontology and reloads it; with name, rebuilds a non-active entry without disturbing the active in-memory store.

Ontology Lifecycle (Terraform-style)

For evolving ontologies in production:

  1. Plan — onto_plan shows added/removed classes, blast radius, risk score. Check onto_lock for protected IRIs.
  2. Enforce — onto_enforce with a rule pack (generic, boro, value_partition, hierarchy) checks design pattern compliance.
  3. Apply — onto_apply with mode safe (clear + reload) or migrate (add equivalentClass bridges).
  4. Monitor — onto_monitor runs SPARQL watchers with threshold alerts. Use onto_monitor_clear if blocked.
  5. Drift — onto_drift compares versions with rename detection and self-calibrating confidence.
  6. Lineage — onto_lineage shows the full plan → enforce → apply → monitor → drift trail for the current session.

Data Extension Workflow

When applying an ontology to external data:

  1. onto_map — generate mapping config from data schema + loaded ontology
  2. onto_ingest — parse a structured file (CSV, JSON, NDJSON, XML, YAML, XLSX, Parquet) into RDF
  3. onto_sql_ingest — run a SQL query against PostgreSQL or DuckDB (via postgres://, duckdb:///path.duckdb, :memory:, or a *.duckdb file path) and ingest result rows. Use this when the source data lives in a database, or when you want to use DuckDB as a federation layer over remote Parquet/CSV/JSON via the httpfs, postgres_scanner, iceberg, etc. extensions.
  4. onto_import_schema — introspect a PostgreSQL or DuckDB schema and generate OWL classes/properties/cardinality from tables/columns/PKs/FKs.
  5. onto_shacl — validate against SHACL shapes
  6. onto_reason — run RDFS or OWL-RL inference
  7. Or use onto_extend to run the full file-based pipeline (ingest + SHACL + reason) in one call

Reasoning and DL Explanation

  • onto_reason — RDFS / OWL-RL forward-chaining materialisation
  • onto_dl_check — check subClass ⊑ superClass using DL tableaux
  • onto_dl_explain — return the clash trace explaining why a class is unsatisfiable

Semantic Search and Embeddings

After loading, generate embeddings to enable natural-language search. This requires a server built with --features embeddings; on a default build the three tools below return Compiled without embeddings feature.

  • onto_embed — generate text + Poincaré structural embeddings for every class. Honours [embeddings] provider = "local" | "openai" and the OPEN_ONTOLOGIES_EMBEDDINGS_* env vars.
  • onto_search — natural-language query → most-similar classes (mode: "text" | "structure" | "product").
  • onto_similarity — compute cosine + Poincaré distance between two specific IRIs.

When embeddings exist, onto_align automatically uses them as a 7th alignment signal, catching semantically equivalent classes whose labels differ.

Tool Reference

ToolWhen to use
onto_statusCheck that the server is running and how many triples are loaded
onto_validateAfter generating or modifying Turtle -- always validate first
onto_loadLoad Turtle/N-Triples/RDF-XML into the triple store
onto_statsSanity-check class / property / triple counts
onto_lintCatch missing labels, comments, domains, ranges
onto_queryVerify structure, answer competency questions
onto_diffCompare against a reference or previous version
onto_savePersist the active ontology to a file
onto_convertConvert between Turtle, N-Triples, RDF/XML, N-Quads, TriG
onto_clearReset the in-memory store
onto_pullFetch ontology from a remote URL or SPARQL endpoint
onto_pushPush triples to a SPARQL endpoint
onto_importResolve and load owl:imports chains
onto_marketplaceBrowse / install standard ontologies from the curated catalogue
onto_versionSave a named snapshot before making changes
onto_historyList saved snapshots
onto_rollbackRestore a previous snapshot
onto_unloadDrop the active (or named) ontology from memory
onto_recompileRe-parse the source, ignoring the on-disk compile cache
onto_cache_statusInspect compile cache: active slot, all entries, [cache] config
onto_cache_listLighter version of cache status — list cached ontologies with metadata
onto_cache_removeRemove a cached ontology by name
onto_repo_listEnumerate RDF/OWL files in configured [general] ontology_dirs
onto_repo_loadLoad by name / relative path / absolute path inside a configured repo dir
onto_ingestParse a file (CSV, JSON, NDJSON, XML, YAML, XLSX, Parquet) into RDF
onto_sql_ingestNEW — SQL SELECT against PostgreSQL or DuckDB → RDF (uses the same mapping format as onto_ingest). DuckDB acts as a federation layer over CSV/Parquet/JSON/HTTPFS/postgres scanner via its extensions.
onto_import_schemaIntrospect PostgreSQL or DuckDB schema → generate OWL
onto_mapAuto-generate mapping config from data schema + loaded ontology
onto_shaclValidate against SHACL shapes
onto_reasonRun RDFS or OWL-RL inference
onto_extendFile-based convenience: ingest + SHACL + reason
onto_dl_checkCheck subClass ⊑ superClass via DL tableaux
onto_dl_explainExplain why a class is unsatisfiable (DL clash trace)
onto_planShow added/removed classes, blast radius, risk score
onto_applyApply changes in safe or migrate mode
onto_lockProtect production IRIs from removal
onto_driftCompare versions with rename detection
onto_enforceDesign pattern checks (generic, boro, value_partition, hierarchy)
onto_monitorRun SPARQL watchers with threshold alerts
onto_monitor_clearClear blocked state after resolving alerts
onto_lineageView session lineage trail
onto_crosswalkLook up clinical terminology mappings (ICD-10, SNOMED, MeSH)
onto_enrichAdd skos:exactMatch triples linking classes to clinical codes
onto_validate_clinicalCheck class labels against clinical crosswalk terminology
onto_alignDetect alignment candidates between two ontologies (uses embeddings if loaded)
onto_align_feedbackAccept/reject alignment candidates for self-calibrating weights
onto_lint_feedbackAccept/dismiss a lint issue (teaches lint to suppress repeated false positives)
onto_enforce_feedbackAccept/dismiss an enforce violation (same self-calibration mechanism)
onto_embedGenerate text + Poincaré structural embeddings for all classes
onto_searchNatural-language query → most-similar classes (text / structure / product)
onto_similarityCosine + Poincaré distance between two IRIs

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 -- you are the orchestrator.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.