Docs menu · Reference

Ingests a payload of nodes and edges in chunked commits: nodes first, then edges, so edges may reference nodes from the same payload. Node objects use the key node_id; edges use src, edge_type, dst, and optional weight (default 1.0) and properties. chunk_size bounds items per commit (default 512, clamped at 800). The acknowledgement reports inserted counts, the number of chunk commits, and the final chunk’s commit receipt.

Successful mutations return an acknowledgement that identifies the affected target, the mutation effect, and commit facts when the operation changed stored state.

Examples

Insert many nodes and edges in one commit.

CLI

$ strata graph create g
$ strata graph bulk-insert g --edges [{"dst":"b","edge_type":"knows","src":"a"}] --nodes [{"node_id":"a","object_type":"person"},{"node_id":"b","object_type":"person"}]
$ strata graph meta g

Wire

{"graph":"g","type":"graph_create"}
{"edges":[{"dst":"b","edge_type":"knows","src":"a"}],"graph":"g","nodes":[{"node_id":"a","object_type":"person"},{"node_id":"b","object_type":"person"}],"type":"graph_bulk_insert"}
{"graph":"g","type":"graph_get_meta"}

Parameters

NameTypeRequiredDescription
chunk_sizeintegernoOptional items-per-commit chunk size. Defaults to 512; values above 800 clamp so one chunk fits one storage commit.
edgesGraphBulkEdge[]noEdges to upsert; endpoints must exist or arrive in nodes.
graphstringyesGraph name.
nodesGraphBulkNode[]noNodes to upsert (committed before edges).

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

Returns

MutationAck<GraphBulkInsert>.

Errors

Invocation

  • CLI: strata graph bulk-insert
  • Wire type: graph_bulk_insert

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