Docs menu · Reference

Returns a deterministic representative sample of nodes from a graph: the total live node count and up to count nodes (default 10), evenly strided over the ordered node ids. Latest state only.

Paginated responses use opaque cursors. Clients should pass the returned cursor back to the same command shape and must not parse cursor contents.

Examples

A representative sample of nodes plus the total count.

CLI

$ strata graph create g
$ strata graph add-node g a
$ strata graph add-node g b
$ strata graph sample g

Wire

{"graph":"g","type":"graph_create"}
{"graph":"g","node_id":"a","type":"graph_add_node"}
{"graph":"g","node_id":"b","type":"graph_add_node"}
{"graph":"g","type":"graph_sample"}

Parameters

NameTypeRequiredDescription
countintegernoOptional sample count. Defaults to 10.
graphstringyesGraph name.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

SamplePage<GraphNodeDataOutput>.

Errors

Invocation

  • CLI: strata graph sample
  • Wire type: graph_sample

agents: this page as markdown → /docs/reference/graph/sample.md