---
question: Does the engine load every ontologies Turtle file?
kind: overview
---

# Ontologies

An ontology is the schema of the knowledge graph: OWL classes and properties, written in Turtle. A module keeps its ontologies under `ontologies/`, and the engine loads every `*.ttl` there into the schema graph when it starts. `onto2py` turns the Turtle into Python classes that pipelines use to write data, and each Nexus workspace picks the ontologies it shows.

![Ontology dashboard](/abi/Screenshot_Ontology.png)

*The Ontology dashboard: the workspace vocabulary by type, and its ontologies grouped by module.*

<!-- matrix -->

There is no `abi new ontology` command and no REST endpoint that writes an ontology file. You write Turtle in a module, or import a file in Nexus to browse it.

## Key concepts

- **Module ontology.** A `.ttl` file under a module's `ontologies/` folder. `modules/` holds the shared classes and properties, `processes/` one BFO process per file, and `queries/` SPARQL templates that become agent tools. `abi new module <name> --in-engine` scaffolds all three. Only in-engine modules carry ontologies.
- **Schema graph.** The engine loads module ontologies into the named graph `http://ontology.naas.ai/graph/schema`. Data written by pipelines goes into other graphs.
- **Seven buckets.** Every class traces to a BFO bucket (what, when, who, where, how we know, how it is, why) through an `abi:` class. `onto2py` refuses a class that does not. See [Create an ontology](/user-guide/build/knowledge-graph/creating-an-ontology#the-seven-buckets).
- **Generated classes.** `onto2py` writes a Pydantic model per class next to the Turtle file, with an `rdf()` method that returns the triples. You run it and commit the result; the engine does not.
- **Workspace catalog.** Nexus lists each module ontology that declares `a owl:Ontology`. A workspace owner or admin chooses which ones the workspace uses, in Settings › Ontologies.
- **Reference ontology.** A file imported on the Nexus Ontology screen. It is listed for browsing, kept in the browser, and not loaded into the triple store.

```text
ontologies/*.ttl ──(engine start)──▶ schema graph ──▶ workspace catalog ──▶ Settings › Ontologies
        │
        └──(onto2py)──▶ *.py models ──▶ pipelines write data graphs
```
