Information Models

What are Information Models

In the SMARTUNIFIER, an Information Model is defined as the data related to communication that a device or IT system can provide. Each device or IT system is represented by an Information Model. An Information Model is composed of elements known as Node Types, and these models are structured hierarchically like a tree. This means that elements within an Information Model can include additional elements. This hierarchical structure is essential for accurately modeling the data structure of devices in a way that reflects their real-world complexity.

Before starting the modeling process for the data structure of, for example, equipment or an IT system, it’s crucial to have a clear understanding of the overall use case. Generally, each piece of equipment or IT system that needs to be integrated will have its own Information Model. However, if there are multiple pieces of equipment or IT systems of the same type, a single Information Model can be used for all of them.

During the later stages of configuring a SMARTUNIFIER instance, the Information Model that is included in a Mapping, as well as the Mapping itself, can be applied to a Device Types. This allows for the creation of multiple instances from a single device type. Therefore, the Information Model serves as a blueprint for the data structure of a device or IT system and needs to be created only once. Understanding the reusability of the Information Model is crucial.

This concept emphasizes that once an Information Model is established, it can be effectively reused across different devices or IT systems of similar types, significantly streamlining the configuration process and enhancing efficiency.

Contextualization

Contextualization describes the process and functionality of connecting and combining correlated data, often across system boundaries. This context data can be stored and used internally within SMARTUNIFIER by utilizing Information Models to define the data structures, in combination with the InMemory Communication Channel. The context data can then be reused and mapped to other systems wherever the data is needed.

How to create a new Information Model

Follow the steps described below to create an Information Model:

  • Select the SMARTUNIFIER Information Model Perspective (1).

Information Model - Select IM in the side menu
  • You are presented with the following screen containing a list view of existing Information Models.

  • In order to add a new Information Model, select the “Add Model“ button at the top right corner (2).

Information Model - List View
  • On the following screen provide the following mandatory information: Group and Name (3).

  • The “Apply” button at the top right corner is enabled after all mandatory fields are filled in. Click the button to create a new Information Model (4).

  • The newly created Information Model is now visible as a node on the left side of the screen.

Information Model - Model Editor
  • After the root model node is created, a new Information Model can be built up using definition types.

  • Perform a right click on the root model node and select “Add Node” (5). Select a Definition Type from the dialog (6).

Information Model - Add Variable

Node Types

Basics

Based on the specific use case and the communication channels involved, it is important to select the appropriate Node Type. Node Types are key components of an Information Model and include various elements such as variables, properties, events, commands, and collections like arrays and lists.

Each Node Type is associated with a Data Type, which specifies whether it is a predefined data type (such as String, Integer, Boolean, etc.) or a custom data type.

Example of a Node of Type Variable:

Example Node Type with Data Type

Naming Restrictions

There are specific restrictions on the naming conventions for Node Types. For instance, Scala keywords are not permissible. Moreover, a Node Type name cannot begin with a number, and the underscore character “_” is the sole permitted separator.

If the name of the Node, for example, the name of a Variable, requires a specific naming convention that cannot be used as a Node Type name, it can be customized using the “Field Name” option within the corresponding Communication Channel. Supported Communication Channels with the option to set a custom field name include:

  • File Reader (CSV, JSON, XML)

  • File Tailer (CSV, JSON, XML)

  • File Writer (CSV, JSON, XML)

  • MQTT (CSV, JSON, XML)

  • SFTP File Writer (CSV, JSON, XML)

  • WebSocket Client (CSV, JSON, XML)

Hint

If you need to use a specific naming convention for a Node Type where restrictions apply and the Channel does not support custom field names, please contact the SMARTUNIFIER support team.

List of Scala Keywords Prohibited as Node Type Names in the Information Model:

Scala keywords

abstract

else

lazy

override

super

true

case

extends

match

package

this

try

catch

false

new

private

throw

type

class

final

null

protected

trait

val

def

finally

object

return

true

var

do

for

if

sealed

type

while

else

forSome

implicit

super

val

with

yield

Available Node Types

Data Types

There are two different types of Data Types that can be used in the Information Model:

Predefined Types

These are the standard (primitive) data types that are available in the SMARTUNIFIER. They include,

Type

Definition

Boolean

true or false

Byte

8 bit signed value (-27 to 27-1)

Int

32 bit signed value (-231 to 231-1)

String

Sequence of characters

Char

16 bit unsigned Unicode character (0 to 216-1)

Double

64 bit IEEE 754 double-precision float

Float

32 bit IEEE 754 single-precision float

Long

64 bit signed value (-263 to 263-1)

Short

16-bit signed integer

LocalDate

Immutable date-time object that represents a date, often viewed as year-month-day.

LocalDateTime

Immutable date-time object that represents a date-time, often viewed as year-month-day-hour-minute-second.

LocalTime

Immutable date-time object that represents a time, often viewed as hour-minute-second.

OffsetDateTime

Immutable representation of a date-time with an offset.

Data types like these can be applied to the following Node Types: Variables, Properties, Arrays, Lists.

Example - Variable with a Predefined Data Type:

  • Add a new Variable

  • Enter an ID (Name)

  • select a predefined data type e.g., “String” (1)

Information Model - Create a Variable width a Simple Data Type

Custom Types

Custom data types are user-defined data types that can be created and used in the Information Model. They can be applied to the following Node Types: Variables, Properties, Arrays, Lists, Events, Commands. They come in handy, for example, when a complex data structure is required.

The name of the Data Type is to be defined by the user. It is recommended to name custom data types in a way that reflects the data structure they represent.

Example - Variable with a Custom Data Type:

  • Add a new Variable

  • Enter an ID (Name) e.g., “MyFirstComplexVariable”

  • Enter a custom name for the Data Type e.g., “MyFirstComplexVariableType” (1)

Now another Variable can be added under the “MyFirstComplexVariable” - Variable:

  • Perform a right click on the Custom Variable - “MyFirstComplexVariable”

  • Select “Add Node” and choose Variable (2)

Information Model - Create a Variable width a Custom Data Type

Hint

Model Node Types with custom data types can be easily duplicated throughout the Information Model by selecting the same custom data type for a new model node type.

Structures Required by Channels

The structure of an Information Model is influenced by the Communication Channel used in the integration. Communication Channels can be classified into two types: data-driven and event-driven communication.

  • Event-driven involves integration triggered by an event within a system, such as the receipt of goods. This event activates a Rule within the Mapping of SMARTUNIFIER.

  • Data-driven, on the other hand, is initiated by a change in the data within a system.

  • Additionally, there is command-driven integration, where an event in one system immediately requires a response from another system. This differs from event-driven integration, which does not anticipate a direct reply.

Below, a table presents some examples of use cases along with the Information Model structures they require:

Use Cases

Description

Communication Channel

Information Model Structure

Data-driven

Retrieving data from OPC-UA Server

OPC-UA Client

Structure of Variables (Predefined and Custom Data Types) representing the data structure of the OPC-UA Server

Event-driven

Posting data on MQTT Broker

MQTT client

Using Events with a structure of Variables (both Predefined and Custom Data Types) to represent the data structure of, for example, a JSON message.

Command-driven

Executing a Select request on a database with parameters.

SQL Database

Using Commands with structures of variables under Parameters and Reply

Hint

The required structure for the Information Model corresponding to each Communication Channels is described in the specifc Channel Type documentation.

Importing Data Structures

Data structures can be imported by using extensions, which is especially convenient when dealing with complex structures that include many variables. The following import options are available: