Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
create_relationget_relationlist_relationstraverse_relationssupersede_relationtombstone_relation
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKRelationsget_relation

get_relation

Read one relation, including its symmetry flag and its place in the supersession chain.

PURPOSE

Read one relation by id, optionally following its supersession chain.

GET/v1/relations/:idBearer API keystable
async fn get_relation(&self, relation_id: &str, query: &GetRelationQuery) -> Result<RelationDetail, BrainHttpError>
Handshake credentialstable
async fn get_relation(&self, request: &RelationGetRequest) -> Result<RelationGetResponse>

Parameters

ParameterTypeRequired
relation_idstringrequired

The relation to read.

follow_supersessionbooleanoptional

Follow the chain to its head. Defaults to true — so the id you get back may not be the one you asked for.

Returns

FieldTypePresence
relation_id / relation_type / from_entity / to_entity—always

The edge.

confidencefloatalways

Confidence in [0, 1].

valid_from_unix_nanos / valid_to_unix_nanos64-bit integeralways

The interval it holds over.

is_symmetricbooleanalways

Whether the schema declares the type symmetric — in which case the reverse direction holds without a second relation.

version / supersedes / superseded_by / chain_root—always

Position in the chain. Store chainRoot when you mean the relationship rather than one version of it.

propertiesstring

The opaque blob, when set.

The wire RelationView additionally exposes flags, extractedAtUnixNanos and tombstonedAtUnixNanos, which the HTTP RelationDetail omits.

On the wire

Entity ids are UUID bytes, properties is a propertiesBlob, and evidence is a single reference rather than an array. Every request carries a requestId plus an optional actAs.

See also
list_relationssupersede_relation

Was this page helpful?

create_relation

Assert a typed, directed, time-bounded edge between two entities — and the cardinality rule that can reject it.

list_relations

List an entity's relations in either direction — one HTTP verb, two wire verbs.

On this page

ParametersReturnsOn the wire
Suggest an editOpen in Playground