Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
get_schemavalidate_schemaupload_schemareplace_schemadrop_schemalist_schemaslist_extractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKSchemaget_schema

get_schema

Read the active schema document, or a specific version of it.

PURPOSE

Read the schema. Without a version, the current one. Nothing in the typed graph can be written outside what this declares.

GET/v1/schemaBearer API keystable
async fn get_schema(&self, query: &SchemaGetQuery) -> Result<Schema, BrainHttpError>
Handshake credentialstable
async fn get_schema(&self, request: &SchemaGetRequest) -> Result<SchemaGetResponse>

Parameters

ParameterTypeRequired
namespacestringoptional

Which schema namespace. Defaults to the caller's.

versionintegeroptional

A specific version. Omit for the current one.

Returns

FieldTypePresence
namespacestringalways

The namespace.

schema_versionintegeralways

Its version number.

schema_documentstringalways

The document itself.

uploaded_at_unix_nanos64-bit integeralways

When it landed.

validator_versionintegeralways

Which validator accepted it. A document that passed under an older validator is not guaranteed to pass under a newer one.

No schema is a valid state

A space with no active schema still accepts encode and recall — it just derives no statements, entities or relations. The wire encode response's hasActiveSchema is how you tell that apart from an extraction failure.

See also
upload_schemalist_schemas

Was this page helpful?

tombstone_relation

Retire a relation with no replacement. There is no retract equivalent — and here is why.

validate_schema

Check a schema document without storing it — with line, column and span for each error.

On this page

ParametersReturns
Suggest an editOpen in Playground