# Ontonomos

Ontonomos is a governed ontology platform. Everything it holds is typed by a LinkML schema (an *ontology*).
Data is read as instances of classes; every write is a named, policy-judged verb.
Schemas, verbs, policies and pipelines are themselves rows you read the same way.
One GraphQL endpoint serves it all; what you see and may do depends on who you are.
This guide is rendered for an anonymous caller; it lists only what is open to you.

## Sign in

GraphQL: `POST https://api.ontonomos.com/graphql` with `{"query": ..., "variables": ...}`.
To sign in, connect your MCP client to this instance's MCP server: add it to your MCP client, which opens the sign-in (a code sent to your email) and then sends the token as `Authorization: Bearer <token>` itself; a plain HTTP client has no way to mint a token here, so use the MCP client.

## Two gestures

- **Read:** `classInstances(ontology, class, where, select, limit)` lists a class's instances; `node(id)` reads one by its address.
- **Write:** `applyAction(action, params)` applies a verb by name. Add `dry_run: true` inside `params` to check a call without writing.

**What comes back.** `classInstances` returns `{ rows, nextCursor }` and you select only those two fields: `rows` is a list of JSON records (each row's own fields, plus its address as `__rid`; `select` narrows them), so there is nothing to sub-select inside a row, and `nextCursor` goes back as `cursor` for the next page (null at the end). `node` returns `{ key, class, id, record, kind }`, `record` being the row as JSON. `applyAction` returns JSON, so it takes no sub-selection at all: write `mutation { applyAction(action: ..., params: ...) }`. Do not introspect the schema to learn this.

A `where` names its conditions by type: `GET https://api.ontonomos.com/llms.txt?read=classInstances` lists every type with its parameter.

How to do a task is a Process row (`classInstances(ontology: "process_model_draft", class: "Process")`), e.g. `docs-explain-access` (ask who may read or edit something, and why) and `docs-my-access` (see what you can read and edit, and what grants it).

## References

- An **ontology** by schema name (`ontology: "verbs"`) or schema id URI (`https://ontonomos.com/schemas/infrastructure/actions/verbs`).
- A **class** by name plus its ontology (`ontology: "verbs", class: "ActionDefinition"`) or by class URI alone (`class: "https://ontonomos.com/schemas/infrastructure/actions/verbs/ActionDefinition"`).
- An **instance** by its address, `ontonomos.<ontology path>.<Class>.<identifier>`: the ontology's path, the class name and the row's identifier (its `id`, not its title or route), e.g. `node(id: "ontonomos.infrastructure/dashboards.Dashboard.urn:ontology-services:dashboard:overview")`. Every read returns this address with each row (`__rid` in `classInstances`, `key` in `node` and `connected`); pass it as is to `node` and `connected`. A reference parameter of a verb takes the row's `id`.
- A **search hit** by its `id`: the address of what `search` found, a row, an ontology or a class (a class is an element of its ontology's schema, `ontonomos.meta.schema_definition.<schema name>#/classes/<Class>`). Pass it as is to `node` and `connected`. The hit's `uri` is not an address.
- What points AT a row is not in the row: read it with `connected(ids: [<address>], direction: "in", depth: 1)`, e.g. `connected(ids: ["ontonomos.infrastructure/dashboards.Dashboard.urn:ontology-services:dashboard:overview"], direction: "in", depth: 1)`.
- To read part of a large row, use classInstances(ontology, class, where on its identifier, select: [...]).

## Reads

- `search(query: String!, limit: Int)`: Search visible ontologies, classes, and instances.
- `resolvedSchema(ontology: ID!, version: String, derivation: ID, class: String)`: The fully-resolved LinkML schema for an ontology — imports merged, induced slots inlined as attributes (incl. inherited), provenance set — materialized on demand by LinkML server-side and cached.
- `schemaDocument(ontology: ID!)`: The DECLARED schema document — what the author actually wrote, assembled from the store rows with imports NOT merged and nothing derived.
- `classInstances(ontology: ID, class: String!, where: JSON, search: SearchInput, sort: [SortInput!], select: [String!], sum: [String!], count: Boolean, limit: Int, cursor: Int, ownerScan: Int, provenance: ProvenanceInput)`: Query a CLASS's instances by name — the engine infers the access path from the ontology: a DataSource-bound class is read directly; an inline value-class (e.g. InsightCell) is unwound from its owner.
- `connected(ontology: ID, ids: [ID!]!, among: [ID!], depth: Int, cap: Int, direction: String, classes: [String!])`: Instances connected to the given root instances by references (outgoing + incoming), breadth-first to 'depth', capped at 'cap' nodes PER ROOT; the roots' graphs come back as one.
- `node(ontology: ID, id: ID!, reading: Reading)`: Refetch a single instance by its opaque global id (Relay node()).

## Verbs

Sign in to see the verbs you may apply.
