|
Equivalent WoT TD definition |
Thing |
|
Description |
In OPC UA Objects are used to represent systems, system components, real-world objects and software objects. Objects are defined using the Object NodeClass. In WoT Thing Description, a Thing represents real-world objects and software objects and their elements through interaction affordances (properties and actions). It is recommended for each UA Object defined under the UA Root to create an individual TD. The mechanism may also facilitate the creation of individual TDs for nested UA Object nodes, provided these nodes contain a reasonable number of nested UA Variables or Methods, or possess a self-contained context. By default, nested UA Objects are not directly transformed into TDs. Instead, their nested UA Variables and Methods are aggregated into a single TD representing the top-level UA Object. |
|
Example in OPC UA (as nodeset) |
<UAObject NodeId="ns=3;i=5001" BrowseName="3:PaintingRobot_1" ParentNodeId="ns=2;i=5002"> <DisplayName>Painting Robot</DisplayName> …. |
|
Transformed usage in a TD definition (as snippet) |
{ "@context":"https://www.w3.org/2022/wot/td/v1.1", "@type": ["Thing"], "title": "Painting Robot", "base": "opc.tcp://opcuademo.com:4840", "securityDefinitions": { "auto_sc": { "scheme": "auto" } }, "security": "auto_sc", …
Alternative:
{ "@context":"https://www.w3.org/2022/wot/td/v1.1", "@type": ["Thing", "uav:object"], "title": "Painting Robot", "uav:browseName": "3:PaintingRobot_1", "base": "opc.tcp://opcuademo.com:4840", "securityDefinitions": { "auto_sc": { "scheme": "auto" } }, "security": "auto_sc", … |
|
Equivalent WoT TD definition |
PropertyAffordance |
|
Description |
In OPC UA variables are used to represent values which may be simple or complex. Variables are defined by VariableTypes. Variables are always defined as Properties or DataVariables of other Nodes in the AddressSpace. Similarly, in a TD a property affordance represents a simple or complex value that can be read / written / observed. Not all discovered UA Variables are recommended to transformed as TD properties, especially Variables that are part of a UA Method (InputArguments, OutputArguments). It is recommended to transform only UA variables into TD properties, which represent a standalone data point (e.g., dynamic values such as sensor or status values, static values that are not part of an HasProperty relationship). If an UA Variable is part of a logical complex definition (e.g., latitude Variable is component of an UA Object with the name GPS), it is recommended to annotate the property with the uav:componentOf term to make clear, that the TD property is part of a parent object (e.g., GPS). This may be important to trigger the client to make an atomic read by readmultipleproperties of all members that belongs to an UA Object (e.g., latitude and longitude). |
|
Snippet example in OPC UA (e.g., as nodeset) |
<UAVariable DataType="Double" NodeId="ns=3;i=6125" BrowseName="3:ActualPosition" ParentNodeId="ns=3;i=5058"> <DisplayName>Actual Position</DisplayName> …. |
|
Transformed usage in a TD definition (as snippet) |
"properties": { "3:ActualPosition": { "title": "Actual Position", "type": "number", … Alternative:
"properties": { "3:ActualPosition": { "@type": ["uav:variable"], "title": "Actual Position", "type": "number", … |
|
Equivalent WoT TD definition |
ActionAffordance |
|
Description |
In OPC UA methods are “lightweight” functions, whose scope is bounded by an owning (see Note) Object, similar to the methods of a class in object-oriented programming or an owning ObjectType, similar to static methods of a class. Methods are invoked by a client, proceed to completion on server and return the result to the client. The lifetime of the Method’s invocation instance begins when the client calls the Method and ends when the result is returned. Similary, in a TD an action affordance is a function or an action that can be invoked on a Thing. A TD action must contain the uav:componentOf term to express in which object the UA method is defined. The input and output terms reflect the InputArguments and OutputArguments data structure of the corresponding UA Variables. Thereby, the argument definitions within the UA Variables are mapped to the JSON Schema type=object structure where each argument is a member of the type=object definition. |
|
Snippet example in OPC UA (e.g., as nodeset) |
<UAMethod NodeId="ns=1;s=RunCalibration" BrowseName="1:Calibrate" ParentNodeId ="ns=1;s=CalibrationObject"> <DisplayName>Run calibration</DisplayName> <References> <Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=CalibrationObject</Reference> <Reference ReferenceType="HasProperty">ns=1;s=RunCalibration_InputArguments</Reference> <Reference ReferenceType="HasProperty">ns=1;s=RunCalibration_OutputArguments</Reference> </References></UAMethod> ... <UAVariable NodeId="ns=1;s=RunCalibration_InputArguments" BrowseName="InputArguments" DataType="Argument" ValueRank="1" TypeDefinition="PropertyType"> <DisplayName>InputArguments</DisplayName> <Description>Input parameter for the Run calibration method.</Description> <Value> <ListOfExtensionObject xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd"> <ExtensionObject> <TypeId> <Identifier>i=297</Identifier> </TypeId> <Body> <Argument xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd"> <Name>CalibrationFactor</Name> <DataType> <Identifier>i=6</Identifier> <!-- Integer --> </DataType> <ValueRank>Scalar</ValueRank> <Description>Factor used to adjust the calibration process.</Description> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject> </Value> </UAVariable> … <UAVariable NodeId="ns=1;s=RunCalibration_OutputArguments" BrowseName="OutputArguments" DataType="Argument" ValueRank="1" TypeDefinition="PropertyType"> <DisplayName>OutputArguments</DisplayName> <Description>Output parameter of the Run calibration method.</Description> <Value> <ListOfExtensionObject xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd"> <ExtensionObject> <TypeId> <Identifier>i=297</Identifier> </TypeId> <Body> <Argument xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd"> <Name>CalibrationStatus</Name> <DataType> <Identifier>i=6</Identifier> <!-- Integer --> </DataType> <ValueRank>Scalar</ValueRank> <ArrayDimensions/> <Description>Status resulting from the calibration process.</Description> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject> </Value> </UAVariable> … |
|
Transformed usage in a TD definition (as snippet) |
"actions": { "1:Calibrate": { "title": "Run calibration", "uav:componentOf": ["ns=1;s=CalibrationObject"], "input": { "type": "object", "properties": { "CalibrationFactor": { "type": "integer", "description": "Factor used to adjust the calibration process." }}}, "output": { "type": "object", "properties": { "CalibrationStatus": { "type": "integer", "description": "Status resulting from the calibration process." }}}, "forms": [ { "href": "/?id=ns=1;s=RunCalibration", "contentType": "application/octet-stream" } ] …
|
|
Equivalent WoT TM definition |
tm:ThingModel |
|
Description |
ObjectType is a type definition of an object and its encompassing variables and methods. It is a template for an object. Therefore, an objectType definition can be mapped to a WoT Thing Model definition. A Thing Model is templates that can be used to instantiate Thing Description instances. The same restriction guideline is applied as defined in UA Object in Section . |
|
Snippet example in OPC UA (e.g., as nodeset) |
<UAObjectType NodeId=" ns=3;i=1002" BrowseName="3:PaintingRobotType">…
|
|
Transformed usage in a TD definition (as snippet) |
"@context":"https://www.w3.org/2022/wot/td/v1.1", "@type": ["tm:ThingModel"], …
Alternative:
{ "@context":"https://www.w3.org/2022/wot/td/v1.1", "@type": ["tm:ThingMode", "uav:objectType"], … |
|
Equivalent WoT TM definition |
PropertyAffordance |
|
Description |
VariableType is a type definition of a variable and its values. It is a template for a variable. Therefore, a variableType definition can be mapped to a propertyAffordance definition in a Thing Model. Herby, it applies the same guideline as defined for UA Variable (see Section ). |
|
Snippet example in OPC UA (e.g., as nodeset) |
<UAVariableType DataType="Double" NodeId="ns=3;i=6129" BrowseName="3:ActualPositionType" ParentNodeId="ns=3;i=5058"> …. |
|
Transformed usage in a TD definition (as snippet) |
"properties": { "3:ActualPositionType": { … Alternative:
"properties": { "3:ActualPositionType": { "@type": ["uav:variableType"], … |
|
Equivalent WoT TD definition |
Additional semantic annotations at property and action level |
|
Description |
A reference in OPC UA is used to define the relationship between two nodes. OPC UA defines several hierarchical and non-hierarchical references. In this specification version, a minimal set of references (e.g., HasComponent, HasTypeDefinition) can be used in a TD to represent the relationship between interaction affordances or between a Thing and its interaction affordances. Some references are defined by own terms (e.g., uav:componentOf") or can be part of @types definitions. Details about the reference types that are mapped within a TD are provided in Section 7.3. |
|
Snippet example in OPC UA (e.g., as nodeset) |
…<UAVariable DataType="Double" NodeId="ns=3;i=6125" BrowseName="3:ActualPosition"> <References> <Reference ReferenceType="HasComponent" IsForward="false">ns=3;i=5001</Reference></Reference> </UAVariable>… |
|
Transformed usage in a TD definition (as snippet) |
"properties": { "3:ActualPosition": { "title": "Actual Position", "uav:componentOf": ["ns=3;i=5001"], … |