Xentara v1.2.1
User Manual
Loading...
Searching...
No Matches
Structure of the Model File

The Root Node

At the root of the Xentara model file is a JSON object that represents the anonymous root node of the model:

{
"$schema": "https://docs.xentara.io/xentara/schema-xentara-model.json",
"children": [
...
]
}

Object Members
$schemaAn optional string value containing the URI of the JSON schema for Xentara model files. Xentara itself ignores this member, but some editors may use it to associate the model file with the correct JSON schema.
children

A JSON array containing the top level elements in the model. This member is named children because the top level elements are considered children of the anonymous root node.

Please remember that each element block requires two layers of {} due to the syntax restrictions of the JSON format.

Element Blocks

The individual elements within the model are each represented by a double nested JSON object. The outer object has a single member whose name is the type of element, and whose value is another JSON object that contains the actual properties of the element.

A data point, for example, will be represented by a block like this:

{
"@DataPoint": {
...
}
}

Note
The doubly nested JSON object is necessary because the members of JSON objects do not have a fixed order. By nesting the other properties of the element inside an inner block, Xentara can ensure that the type is already known before any of the properties are loaded. If the type was just another object member, a JSON editor would be allowed to move it to the end of the object block, and Xentara would have to look through the entire block for the type before being able to load any properties.

A model containing three data points will look like this:

{
"$schema": "https://docs.xentara.io/xentara/schema-xentara-model.json",
"children": [
{
"@DataPoint": {
...
}
},
{
"@DataPoint": {
...
}
},
{
"@DataPoint": {
...
}
}
]
}

Content of an Element Block

JSON objects representing Xentara model elements will always have two standard members:

{
"@DataPoint": {
"id": "ID",
"uuid": "56c48c42-4f3a-4234-b6c5-76e1986c0a88",
...
}
}

Object Members
idA string value containing the ID of the element. The ID is used to construct the element’s primary key.
uuidA string value containing the unique UUID of the element.

Each element type can have additional members. The actual JSON format for the individual element types can be found here:

JSON Schema File

A JSON schema file to validate model files is available here.