Skip to main content

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.
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.