Create Twin Models
The Twins from Model contain data about the real asset, concept or person, whereas the Digital Twin Model serves as the template or structure of Digital Twins from Model.
In line with our best practice, this page explains how to create Digital Twin Models and, in turn, how to create Digital Twins according to that same Model.
Create Digital Twin Models
Digital Twin Models are used to describe the template or structure of one or more Digital Twin from Model. You may therefore think of a Digital Twin Model as the parent of one or more Digital Twins from Model. Consider that:
- Digital Twin Models ensure standardisation: all Digital Twins have the same properties, Feeds and Values as their Model. Some exceptions apply to the Twin's settings, see here;
- Digital Twins can be grouped by Model: this simplifies operations like searching, filtering or deleting more than one Twin;
- Models only serve as a template for other Digital Twins: they don't share data or follow feeds. These functions are only performed by Twins from Model.
We use Findability and Visibility interchangeably
Create Twin Models with the IOTICS API
A Digital Twin Model can be created with the IOTICS API by creating a Digital Twin with Create Twin and specifying their property type = Model. The use of this property allows any Twin to be identified as a Twin Model.
{
"key": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"uriValue": {"value": "https://data.iotics.com/app#Model"}
}
Don't forget to check the Digital Twin's access permissions. You can update the hostAllowList
and hostMetadataAllowList
properties to enable or restrict access permissions for the Digital Twins according to Selective Sharing for Metadata and Data.
{
"key": "http://data.iotics.com/public#hostAllowList",
"uriValue": {"value": "http://data.iotics.com/public#all"},
},
{
"key": "http://data.iotics.com/public#hostMetadataAllowList",
"uriValue": {"value": "http://data.iotics.com/public#all"},
}
1. Create a Digital Twin
2. Add the Twin Model's special Property
When creating and updating Digital Twin Models, consider the following best practices:
- Could I make my code more efficient? When creating Twin Models with the IOTICS API, it may be easier to use the Upsert Twin API in order to create the Twin, create Feed(s), Values and adding metadata with a single call rather than using multiple APIs separately.
- Can I easily identify the Models from Twins from Model? It is good practice to add the word "Model" to the name (label property) of the Twin (e.g. Weather Forecast Model).
Create Digital Twins from Model
Create Twins from Model with the IOTICS API
In order to easily identify all the Digital Twins that have been created from a specific Model, add the following property to your new Digital Twins.
{
"key": "https://data.iotics.com/app#model",
"uriValue": {"value": model_twin_did},
}
Since the Twin Model serves as a template for the Twins from Model, you also need to make sure that the new Twins follow the same structure as their Model - this means the metadata properties of the Twin, Feed(s) and each of the Feed's Values need to match.
Exceptions: adapt Label, Comment, Type
Although the new Twins need to follow the structure of their Model in terms of metadata, some properties that require some modification:
- Each of the Twin's Label and potentially Comment property values should be unique, and therefore different from both their Model and any other Twin from that Model;
- The property
type: Model
that identifies a Twin Model needs to be replaced by the property model: model_twin_did that identifies the Twins from Model;
1. Search and describe the Twin Model
2. Create a Digital Twin
3. Add Twin's metadata, Feed(s) and Value(s) according to the Model
4. Add the "special" property for Twins from Model
5. Consider the exceptions
Updated 6 months ago