Docs menu · Reference

Adds a node to a graph or replaces it if the node id already exists. A node carries optional JSON properties, an optional declared object type (validated once the graph’s ontology is frozen), and an optional entity binding that links the node to a row in another primitive. Cross-branch bindings are rejected.

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

Examples

Add a node with an object type and properties.

CLI

$ strata graph create social
$ strata graph add-node social alice --object-type person --properties {"age":30}
$ strata graph get-node social alice

Wire

{"graph":"social","type":"graph_create"}
{"graph":"social","node_id":"alice","object_type":"person","properties":{"age":30},"type":"graph_add_node"}
{"graph":"social","node_id":"alice","type":"graph_get_node"}

Parameters

NameTypeRequiredDescription
bindingGraphEntityBindingnoOptional entity binding.
graphstringyesGraph name.
node_idstringyesNode id.
object_typestringnoOptional declared object type (validated once the ontology is frozen).
propertiesanynoOptional node properties.

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

Returns

MutationAck<GraphNodeWrite>.

Errors

Invocation

  • CLI: strata graph add-node
  • Wire type: graph_add_node

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