---
title: Create and Import Models
slug: bhdo-v1/create-and-import-models
createdAt: 2022-09-08T19:10:53.000Z
---

:::hint{type="info"}
**Note**: The Digital Twins feature is available for Belden Horizon Data Operations version 3.5.2 and later.
:::

You can create Digital Twins models by navigating to **Digital Twins** > **Models**.&#x20;

See [Use Digital Twins to Contextualize Data](docId:2_j6-UIyhg6M38j5JlOD1) to review how to leverage Digital Twins.&#x20;

# Step 1: Create Model

You have two options for creating the model. You can create a new model or import a model as a JSON file.&#x20;

## Create a  New Model

**To create a new model:**

1. Navigate to **Digital Twins**.&#x20;
   The *Models&#x20;*&#x70;ane appears.&#x20;
2. From the *Models&#x20;*&#x70;ane, click the **Create a model** tile.&#x20;
   The *Create a Model* dialog box appears

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/ik59Hi2M29nng4UXfiBHx_create-a-model.png" size="80" width="938" height="534" position="center" caption="The Create a Model tile" showCaption="true"}
3. Click the **Type** drop-down list and select **Select model type**.
4. Enter the name of the model in the **Name** field.
5. (Optional) Enter a short description of the model in the **Description** field.
6. Click **Add.**
   A new model tile appears in the *Models&#x20;*&#x70;ane.

## Import an Existing Model

You can import a model as a JSON file.

To import an existing model, click th&#x65;**&#x20;Import Model** icon, select the `<model name>.json` file, and click **Open**.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/vLaWiF-y2CaNqXxozTOBl_image.png" size="80" width="938" height="534" position="center" caption="Import Model icon" showCaption="true"}

# Model Versions

:::hint{type="info"}
Note: This feature is available for Belden Horizon Data Operations version 3.10.0 and later.&#x20;
:::

After creating the model, it is tagged as version 1, and any changes to the model update the model version.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/jPBv5O4fpRB8jFV_f7V7l_image.png" size="50" width="335" height="210" position="center" caption="Model version number" showCaption="true"}

## Implement Model Updates to Instances

If there are changes to the model that need to be implemented in associated instances, click **Upgrade Instances**.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/HxvDDinr4Y08J6ynScZYG_image.png "Upgrade Instances button")

Then, select the instances to upgrade and click **Upgrade**.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/Ph7D7YD9YRMInogh8Kmz2_image.png" size="60" width="568" height="397" position="center" caption="Model Changed dialog" showCaption="true"}

# Step 2: Configure Model

After creating the model, you can configure it appropriately for instances.&#x20;

:::hint{type="warning"}
**Important**: For Belden Horizon Data Operations version 3.5.5 and earlier, no changes are allowed to a model after creating an instance for the model. For Belden Horizon Data Operations version 3.10.0 and later, you have the option to update models with instances and select which instances to update as well. If an instance is updated based on changes made to the model, then it will be automatically disabled. You will need to manually enable the instance after updating it.&#x20;
:::

Click the **Model tile** (grid view) or **Model name** (table view) to view the model details.&#x20;

## Model Image

Click th&#x65;**&#x20;Upload image** icon to select an image for the model. The image will display for the model tile on the *Models* pane.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/EiZG8AWecSpT32AsaiCKR_image.png "Upload image icon")



## Static Attributes

Manage the metadata for the model from the *Static Attributes* tab.&#x20;

:::hint{type="info"}
**Note**: The ability to export and import static attributes is available for Belden Horizon Data Operations version 3.10.0 and later.&#x20;
:::

### Manually Add Static Attributes

**To add static attributes:**

1. Click the **Model tile** (grid view) or **Model name** (table view) to open the model details.&#x20;
2. From th&#x65;*&#x20;Static Attributes* tab, click the **Add item** icon.&#x20;

   ![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/e6409Fd7uZNGzSqT_gOZk_addstaticattribute.png "Add static attribute icon")
3. In the **Attribute Name** field, either select an item from the drop-down list or enter a custom attribute name.

   ![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/f2gSkCgA_MQ2-ro52IYAo_staticattributelist.png "Static Attribute drop-down list")
4. In the **Attribute Value** field, enter a value for the model.&#x20;
5. When done adding attributes, click **Save Model**.&#x20;
   For Belden Horizon Data Operations versions 3.10.0 and earlier, save individual attributes by clicking the **Save&#x20;**&#x69;con in each attribute row.&#x20;

   ![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/p2TrDRVm27Z5dcJWIr8vw_savemodel.png)

If you need to filter existing attributes, you can use the search field.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/qFXBUmDKeYFFXVzVTYmnf_image.png)

### Import Static Attributes

To import static attributes (Belden Horizon Data Operations version 3.10.0 and later), create a CSV file with the following headers:

- ModelName
- InstanceName
- Key
- Value

After creating the file, click the model tile, navigate to **Static Attributes**, and click the **Import Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/kT0ekLBfb1ZLgetUXhfKU_image.png "Import Attributes icon")

### Export Static Attributes

To export a CSV file of existing static attributes (Belden Horizon Data Operations version 3.10.0 and later), click the **Export Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/zG5hgkU1n0JGUQyaXOFfs_image.png "Export Attributes icon")

## Transformations

Use the *Transformation&#x20;*&#x74;ab to transform the data collected in Instances by converting raw JSON data to a desired format by defining the JSON-based schema.&#x20;

You can define schema IDs, which can be used to manipulate the payload and define a structure for the payload as the model inherits data.&#x20;

See [Use Digital Twins to Contextualize Data](docId:2_j6-UIyhg6M38j5JlOD1) to review how to format transformations.&#x20;

:::hint{type="info"}
**Notes**:&#x20;

- If you update a transformation and remove all elements from the schema, the entire NATS message will be included in any dynamic attribute that have the transformation selected for the *Schema ID*.&#x20;
- As of Belden Horizon Data Operations version 3.11.3, you can configure arrays in transformations.&#x20;
  For example:
  \{
  “key”: \[ $timestamp, $value, $metadata.\[0]]
  }
:::

### Arrays

As of Belden Horizon Data Operations version 3.11.3, you can configure arrays in transformations.&#x20;
For example:

```json
{
  "key": [
    "$timestamp",
    "$value",
    "$metadata",
    {
      "key2": "$timestamp",
      "key3": "$value",
      "key4": "$metadata"
    }
  ],
  "key5 new": "$timestamp"
}
```

### Configure Transformations

**To add a transformation schema:**

1. Click the **Model tile** (grid view) or **Model name** (table view) to open the model details.&#x20;
2. Click the **Transformation&#x20;**&#x74;ab.&#x20;
3. Click the **Add a Schem**a icon.&#x20;
   The *Add dialog&#x20;*&#x62;ox appears.

   ![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/JsXdYvx58Qpr8TVefhzLI_addtransformation.png "Add a schema icon")
4. Enter a name for the schema.&#x20;
5. In the code window, copy and paste the JSON-based schema.&#x20;
6. Click **Add**.&#x20;
7. When done adding attributes, click **Save Model**.&#x20;
   For Belden Horizon Data Operations versions 3.10.0 and earlier, save individual attributes by clicking the **Save&#x20;**&#x69;con in each attribute row.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/U3f_IzP7HAYNlUOLoI5wf_image.png "Save model button")

To edit or delete a schema, click the **Action menu** for the schema and select an option.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/K210Fa1cfGCmAq-u7u-iW_image.png "Action menu for data transformation schema")

## Dynamic Attributes

Manage variable data in the model from the *Dynamic Attributes* tab. You have the option of adding a schema ID, which can be used to map dynamic attributes one-to-one for data transformation.&#x20;

:::hint{type="info"}
**Note**:&#x20;

- For Belden Horizon Data Operations versions 3.3.1 to 3.10.0, there is a limit of 100 dynamic attributes. For versions 3.11.0 and later, the limit is 2000.&#x20;
- The ability to export and import dynamic attributes is available for Belden Horizon Data Operations version 3.11.0 and later.&#x20;
:::

**To add a dynamic attribute:**

1. Click the **Add item** icon.&#x20;

   ![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/_cjypWjKq5L2Y8X_1iHu1_adddynamicattribute.png "Add Dynamic attribute icon")
2. In the **Name&#x20;**&#x66;ield, enter a name for the attribute.&#x20;
3. (Optional) Enter values for **Unit&#x20;**&#x61;nd **DataType**.&#x20;
4. (Optional) If you've created data transformation schemas, select one from the **SchemaID&#x20;**&#x66;ield.&#x20;

If you need to filter existing attributes, you can use the search field.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/HjuCOoSn2OB67GYvGfueR_image.png "Search field for dynamic attributes")

### Import Dynamic Attributes

To import dynamic attributes (Belden Horizon Data Operations version 3.10.0 and later), create a CSV file with the following headers:

- ModelName
- InstanceName (optional)
- Topic (optional)
- Name (optional)
- Unit (optional)
- DataType (optional)
- SchemaID (optional)

After creating the file, click the model tile, navigate to **Dynamic Attributes**, and click the **Import Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/Akxv79702U0PrNUdIgi-4_image.png "Import Attributes icon")

### Export Dynamic Attributes

To export a CSV file of existing dynamic attributes (Belden Horizon Data Operations version 3.10.0 and later), click the **Export Attributes** icon.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/W5r86KyQNwTsVIjOBayPX_image.png "Export Attributes icon")

## Hierarchy

Use the *Hierarchy&#x20;*&#x74;ab to create a custom data structure for the model.&#x20;

:::hint{type="info"}
**Notes**:&#x20;

- The Save button is available for Belden Horizon Data Operations version 3.5.2 and later.&#x20;
- The ability to rename nodes/items and import/export hierarchies is available for Belden Horizon Data Operations version 3.9.0 and later.&#x20;
:::

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/mNXnA9vXjupZaVfVYeDM0_image.png "Hierarchy tab")

To create a category for the hierarchy, click the **Action menu** icon for *root&#x20;*&#x61;nd select **Add Node**.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/itJH0E5rl0n-sG5PNuf2H_image.png "Add Node icon")

To add attributes to the hierarchy, do one of the following:&#x20;

- Drag and drop attributes from the left-hand list to the canvas under the appropriate category.&#x20;
- Click the **Action menu** for a category and select **Add item to Node**. Then, select the attribute to add.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/ZHlTH1E0MdfIzQHNkn7Rd_image.png "Add item to Node icon")

When done configuring the hierarchy, click **Save Model**. For Belden Horizon Data Operations versions 3.10.0 and earlier, click the **Save&#x20;**&#x69;con.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/JvH38ChKWN9uqlLwm4_cI_image.png "Add item to Node icon")

### Rename Nodes

To rename nodes and attributes added to nodes (for Belden Horizon Data Operations version 3.10.0 and later), click the **Rename Node** and **Rename Item&#x20;**&#x69;cons.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/9q-QBtjzBHcTZuGpUJrAF_image.png "Rename Node icon")

### Import Hierarchies

To import a CSV file of a hierarchy (Belden Horizon Data Operations version 3.10.0 and later), create a CSV file with the following headers:

- ID
- ModelID
- Position: Enter the position of the attribute in the hierarchy.&#x20;
- ParentID: If the attribute is under a node/category, enter the ParentID of the node. To get the ParentID, create a new node, export the hierarchy, and then refer to the **ParentID&#x20;**&#x63;olumn.&#x20;
- Name: The name of the attribute.&#x20;
- IsFolder: If it is an attribute, the value is **FALSE**. If it is a node, the value is **TRUE**.&#x20;
- AttributeID
- AttributeType

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/kN9_PsT-A7YCeSsQDRJ50_image.png "Import Hierarchy icon")

### Export Hierarchies

To export a CSV file of an existing hierarchy (Belden Horizon Data Operations version 3.10.0 and later), click the **Export hierarchy&#x20;**&#x69;con.&#x20;

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/YJXeuHIHzZVnIoDBWy4S__image.png "Export Hierarchy")

