> ## Documentation Index
> Fetch the complete documentation index at: https://platform.atlan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Plan a SPARQL ontology query

> Resolve a bounded SPARQL SELECT query into a release-pinned logical plan.

# Plan a SPARQL ontology query

Use `ontology__get_query_plan` to resolve a read-only SPARQL 1.1 `SELECT`
query against one exact immutable ontology release.

* Required inputs: `release_id` and `query`.
* Optional inputs: `max_operations`, `include_definitions`, `session_id`, and
  Gateway's `rationale`.
* Limits: `query` is at most 65,536 bytes and `max_operations` is 1-256. The
  default operation limit is 128.
* Effect: read only.

The response identifies the exact release and manifest digest. It includes the
query mode, logical operations, resolved resources, unresolved terms, and
diagnostics. Set `include_definitions` to `true` only when the caller needs the
matching logical definitions in `resolved_resources`.

```json theme={null}
{
  "release_id": "ontology_release_01example",
  "query": "SELECT ?type WHERE { ?type a <http://www.w3.org/2002/07/owl#Class> . } LIMIT 25",
  "max_operations": 128,
  "include_definitions": false
}
```

The tool plans but does not evaluate the query. It never reads object
instances, resolves physical bindings, emits SQL, or calls a remote `SERVICE`.
Ontology-metadata queries return `is_executable: false` with a `planning_only`
diagnostic. Instance-data queries also return `requires_bindings: true`.

The exact release is the dataset. Queries that declare `FROM` or `FROM NAMED`,
non-`SELECT` operations, unsupported graph patterns, or plans outside the
bounds return an error instead of a partial executable result.
