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
| Name | Type | Required | Description |
|---|---|---|---|
count | integer | no | Optional sample count. Defaults to 10. |
graph | string | yes | Graph name. |
Plus the optional scope: branch and space (default to the session branch and the "default" space).
Returns
SamplePage<GraphNodeDataOutput>.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinvalid_argument.engine.product_spaceinvalid_argument.engine.graph_namenot_found.engine.graph
Invocation
- CLI:
strata graph sample - Wire type:
graph_sample