Datome Specific Keywords
Datome enhances the JSON-schema syntax with a custom set of keywords listed below:
authorized_groups
The list of URIs designating the roles or groups whose permissions must be validated before an action can be executed. If declared at the first level, it sets the user that can create an Asset. If set within a mutation, it sets the user to apply it.
changes
The mandatory keyword if a mutation block is declared. It must contain at least one type of change. The possible types are static, dynamic, transition, and event.
constraints
It’s an optional keyword that defines a list of restrictions for a relation. The keyword target is required. For the moment, the only possible constraint is Equal, expressed using the JSON-schema keywords {“ op: “eq”} and value. Example:
external_mutations
It’s a mandatory keyword that defines the list of possible actions that can affect an Asset belonging to a different Model from the one that is calling the external_mutation. The keywords target and model are mandatory. It has to be declared inside a mutation block.
identifier
It’s an optional keyword that sets a unique identifier for the Asset to be used instead of the UUID produced by the platform. The value is a URI pointing to one of the properties (i.e. “unique_name” in the example above). When a new Asset is created, the platform checks that the identifier was not previously used.
properties
A list of the Model’s characteristics.
label
It’s an optional field that serves as a non-unique identifier for the Asset and is used solely in the user interface without any associated logic. The value consists of a URI that points to one of the properties.
model
When declared, specifies the Model name on which the operation has to be performed.
mutation
It’s an optional keyword that defines the list of possible actions that can affect the Asset. If declared, it must contain the keyword changes. The nested keywords authorized_groups and external_mutation are optional.
relation
It’s a mandatory keyword that defines a one-to-one or one-to-many relation between two Models. The keyword constraints are optional.
search
It’s an optional keyword used for listing the values addressable in the Model search functions.
states
It’s a mandatory keyword that defines the list of states of an Asset. Each Model definition must contain at least one default_state, i.e. the state that will be assigned to an Asset at its creation. It represents the initial state of the Finite State Machine. Every other state must be defined using the “transition” keyword.
target
Specifies the URI of the properties, states, or event object to be used to satisfy the action requirement when declared.
transition
Defines the list of states that follow the default_state. The keywords “required_state”, and “target_state” are mandatory.
ui:order
An optional keyword. Sets the order in which the Model properties are displayed in the UI.
Last updated