graph

ontology.define_object_type

Define a graph object type.

strata graph ontology define-object-type

wire graph_define_object_type

Declares an object type in the graph's ontology: a name plus property definitions (`value_type`, `required`). While the ontology is a draft, redefining a type replaces it freely. After `graph.ontology.freeze`, the ontology is immutable and this command fails with `failed_precondition.engine.graph_ontology_frozen`.

Successful mutations return an acknowledgement of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.

To see the complete help for this command, run:

strata graph ontology define-object-type --help

Example

Define an object (node) type.

strata graph create gstrata graph ontology define-object-type g personstrata graph ontology summary g

Parameters

NameTypeRequiredDescription
graphstringyesGraph name.
namestringyesObject type name.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
propertiesobjectnoDeclared properties by name.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

MutationAck<GraphOntologyWrite>

  • dataobject
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

← All 31 Graph commands

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