Create Data Model Files

This section provides some content examples of domain configurations like metadata types, characteristics or services which can be imported to your DRIVR enviornment.

Download the Data Import Schema to verify that your file follows the correct format before uploading. This ensures DRIVR can process and apply your changes successfully.

The schema file also provides a complete overview of the data structure and the capabilities of the Data Import API. It serves as a reference for how your data should be structured, we’ll highlight the most relevant concepts below.

The following example demonstrates how to add multiple DRIVR entities at once using Characteristics and Services.

Other prototype entities can be created in a similar way.

characteristics:
  - code: temperature_sensor
    name: Temperature Sensor
    characteristicType: MEASUREMENT
    dataType: FLOAT
    description: Measures ambient temperature in Celsius
    symbol: °C
    boundaryMin: 0
    boundaryMax: 100
  - code: fan_speed_setting
    name: Fan Speed
    characteristicType: SETTING
    dataType: INTEGER
    description: Sets the speed of the fan
    symbol: RPM

services:
  - code: air_quality
    name: Air Quality Service

Some DRIVR entities can be linked together to define relationships or group functionality. For example, if you want to link one of the Characteristics created above to the Service created above, you can use the characteristicServiceLinks section in your YAML file:

characteristicServiceLinks:
  - characteristicCode: temperature_sensor
    serviceCode: air_quality

This establishes a link between the Temperature Sensor Characteristic and the Air Quality Service, allowing DRIVR to associate their functionality.

To create metadata for a DRIVR prototype, add a MetadataType as shown in the example below. After defining a metadata type, you can assign metadata values to specific entities using the metadataKeyValueStore section.

Keep in mind that metadata propagation might take a short time after upload. In the example below, we create a MetadataType for a Characteristic and then assign a specific value to it using the metadataKeyValueStore.

metadataTypes:
  - key: unit
    entityType: CHARACTERISTIC
    dataType: STRING

characteristics:
  - code: temperature_sensor
    name: Temperature Sensor
    characteristicType: MEASUREMENT
    dataType: FLOAT
    description: Measures ambient temperature in Celsius
    symbol: °C
    metadataKeyValueStore:
      - key: unit
        value: "Celsius"

This example defines a metadata key unit for characteristics and sets the value "Celsius" for the Temperature Sensor characteristic.