Vorto
Eclipse Vorto
VortoDescribe. Share. Integrate.
Info
Model
Info
Model
Info
Model
Info
Model
Eclipse Vorto
Device Payload Mapping
Alexander Edelmann
Vorto
Eclipse Vorto
Motivation for Payload Mappings
Devices sharing the same capability may not send the data in the standardized structure, expected by
the IoT platform.
Device
Capability A
Binary (Non – Standard)Device
Capability A
Device
Capability A
Device Data
Mapper
Capability
Domain Model
IoT Platform
Platform
Services
convert understand
Vorto
Eclipse Vorto
3
Device Payload Mapping with Eclipse Vorto
Transform device specific payload into Vorto-standardized data structures, complying to and described
as Vorto Information Models. Transformations are defined in Mapping Specification with the Vorto DSL.
Vorto
Payload
Mapping Engine
Vorto
Device
Mapping
Spec
Vorto
Info
Model
Target Platform Data
Complies to
JSON, XML, Binary, …
Target Platform
Mapper
Device
Map: ToMap:From
Describes Capabilities
Vorto
Eclipse Vorto
Eclipse Ditto Mapping Plugin
Vorto Payload Mapping Engine supports Eclipse Ditto as a Target Platform Mapper out-of-the-box:
Vorto Payload
Mapping Engine
Mapping
Spec
Vorto
Info
Model
Eclipse Ditto
Mapper
Eclipse Ditto Feature(s) Structure
JSON, XML, Binary, …
Complies to
References
Vorto
Eclipse Vorto
Example: Simple Mapping using built-in converters
Example that maps a device – specific JSON to standardized IPSO compliant data
Vorto Payload
Mapping Engine
{batteryinfo : “2322mV”}
batteryVoltage: {
“status” : {
“sensor_value” : 2322.0,
“sensor_units” : “mV”
}
}
from Voltage.status.sensor_value
to
source
with {xpath: "number:toFloat(string:substring(/batteryinfo,0,string:length(batteryinfo)-2))"}
Mapping
Spec
IPSO
Voltage
Vorto
Eclipse Vorto
Example: Mapping with custom converters
Example Mapping using custom converters that are registered as part of the mapping specification:
Vorto Payload
Mapping Engine
{clickType : “DOUBLE”}
button: {
“status” : {
“digital_input_count” : 2
}
}
from Button to functions
with { convert: “convert(value) { if value === ‘DOUBLE’) return 2 …}”}
from PushButton.status.digital_input_count to source with {xpath: “button:convert(/clickType)”}
Mapping
Spec
IPSO
Button
Custom (JS) Converter function
Vorto
Eclipse Vorto
Example: Mapping with custom converters
Example Mapping using custom converters that are registered as part of the mapping specification:
Vorto Payload
Mapping Engine
{clickType : “DOUBLE”}
button: {
“status” : {
“digital_input_count” : 2
}
}
from Button to functions
with { convert: “convert(value) { if value === ‘DOUBLE’) return 2 …}”}
from PushButton.status.digital_input_count to source with {xpath: “button:convert(/clickType)”}
Mapping
Spec
IPSO
Button
Using custom converter in rule
Vorto
Eclipse Vorto
Example: Mapping with Conditions
Control which mapping rule shall be applied with Mapping Conditions
Vorto Payload
Mapping Engine
{
header : “01”
val : “25”
}
temperature: {
“status” : {
“sensor_value” : 25
}
}
from Temperature.status.sensor_value to source with {condition: “xpath:eval(‘header’,this) == ’01’”, xpath: “/val”}
Mapping
Spec
IPSO
Temp
IPSO
Illum.
from Illuminance.status.sensor_value to source with {condition: “xpath:eval(‘header’,this) == ’02’”, xpath: “/val”}
Vorto
Eclipse Vorto
Example: Execution of a Payload Mapping Specification
1. Add Maven dependency
2. Code Snippet to map to Eclipse Ditto (Bosch IoT Things):
IPSO compliant Ditto Data:
Mapped
Result
Vorto
Eclipse Vorto
10
Plugging in custom target platform mapper
Target Platform Mapper
Execution
Vorto
Payload
Mapping Engine
Target Platform
Mapper
Data Normalization to
Vorto Information Model
Phase 1 Phase 2
Mapping
Spec
Info
Model
Vorto
Eclipse Vorto
Example
Vorto
Eclipse Vorto
Get Started with Payload Mappings
• Eclipse Vorto Toolset to create Vorto Information Models and Payload Mapping Specifications
• Payload Mapping Tutorial that maps AWS IoT Button to standardized Eclipse Ditto data
• Payload Mapping Documentation
Vorto
Eclipse Vorto
VortoDescribe. Share. Integrate.
Info
Model
Info
Model
Info
Model
Info
Model
Contact Details
Alexander.Edelmann@bosch-si.com
www.eclipse.org/vorto

Eclipse Vorto - Device Payload Mapping

  • 1.
    Vorto Eclipse Vorto VortoDescribe. Share.Integrate. Info Model Info Model Info Model Info Model Eclipse Vorto Device Payload Mapping Alexander Edelmann
  • 2.
    Vorto Eclipse Vorto Motivation forPayload Mappings Devices sharing the same capability may not send the data in the standardized structure, expected by the IoT platform. Device Capability A Binary (Non – Standard)Device Capability A Device Capability A Device Data Mapper Capability Domain Model IoT Platform Platform Services convert understand
  • 3.
    Vorto Eclipse Vorto 3 Device PayloadMapping with Eclipse Vorto Transform device specific payload into Vorto-standardized data structures, complying to and described as Vorto Information Models. Transformations are defined in Mapping Specification with the Vorto DSL. Vorto Payload Mapping Engine Vorto Device Mapping Spec Vorto Info Model Target Platform Data Complies to JSON, XML, Binary, … Target Platform Mapper Device Map: ToMap:From Describes Capabilities
  • 4.
    Vorto Eclipse Vorto Eclipse DittoMapping Plugin Vorto Payload Mapping Engine supports Eclipse Ditto as a Target Platform Mapper out-of-the-box: Vorto Payload Mapping Engine Mapping Spec Vorto Info Model Eclipse Ditto Mapper Eclipse Ditto Feature(s) Structure JSON, XML, Binary, … Complies to References
  • 5.
    Vorto Eclipse Vorto Example: SimpleMapping using built-in converters Example that maps a device – specific JSON to standardized IPSO compliant data Vorto Payload Mapping Engine {batteryinfo : “2322mV”} batteryVoltage: { “status” : { “sensor_value” : 2322.0, “sensor_units” : “mV” } } from Voltage.status.sensor_value to source with {xpath: "number:toFloat(string:substring(/batteryinfo,0,string:length(batteryinfo)-2))"} Mapping Spec IPSO Voltage
  • 6.
    Vorto Eclipse Vorto Example: Mappingwith custom converters Example Mapping using custom converters that are registered as part of the mapping specification: Vorto Payload Mapping Engine {clickType : “DOUBLE”} button: { “status” : { “digital_input_count” : 2 } } from Button to functions with { convert: “convert(value) { if value === ‘DOUBLE’) return 2 …}”} from PushButton.status.digital_input_count to source with {xpath: “button:convert(/clickType)”} Mapping Spec IPSO Button Custom (JS) Converter function
  • 7.
    Vorto Eclipse Vorto Example: Mappingwith custom converters Example Mapping using custom converters that are registered as part of the mapping specification: Vorto Payload Mapping Engine {clickType : “DOUBLE”} button: { “status” : { “digital_input_count” : 2 } } from Button to functions with { convert: “convert(value) { if value === ‘DOUBLE’) return 2 …}”} from PushButton.status.digital_input_count to source with {xpath: “button:convert(/clickType)”} Mapping Spec IPSO Button Using custom converter in rule
  • 8.
    Vorto Eclipse Vorto Example: Mappingwith Conditions Control which mapping rule shall be applied with Mapping Conditions Vorto Payload Mapping Engine { header : “01” val : “25” } temperature: { “status” : { “sensor_value” : 25 } } from Temperature.status.sensor_value to source with {condition: “xpath:eval(‘header’,this) == ’01’”, xpath: “/val”} Mapping Spec IPSO Temp IPSO Illum. from Illuminance.status.sensor_value to source with {condition: “xpath:eval(‘header’,this) == ’02’”, xpath: “/val”}
  • 9.
    Vorto Eclipse Vorto Example: Executionof a Payload Mapping Specification 1. Add Maven dependency 2. Code Snippet to map to Eclipse Ditto (Bosch IoT Things): IPSO compliant Ditto Data: Mapped Result
  • 10.
    Vorto Eclipse Vorto 10 Plugging incustom target platform mapper Target Platform Mapper Execution Vorto Payload Mapping Engine Target Platform Mapper Data Normalization to Vorto Information Model Phase 1 Phase 2 Mapping Spec Info Model
  • 11.
  • 12.
    Vorto Eclipse Vorto Get Startedwith Payload Mappings • Eclipse Vorto Toolset to create Vorto Information Models and Payload Mapping Specifications • Payload Mapping Tutorial that maps AWS IoT Button to standardized Eclipse Ditto data • Payload Mapping Documentation
  • 13.
    Vorto Eclipse Vorto VortoDescribe. Share.Integrate. Info Model Info Model Info Model Info Model Contact Details Alexander.Edelmann@bosch-si.com www.eclipse.org/vorto