Open Data Format (O-DF), an Open Group Internet of Things (IoT) Standard – JSON Mapping and Examples

 

Many XML generation and manipulation tools can convert XML messages into JavaScript Object Notation (JSON), and vice versa. There are also many frameworks that can do the needed conversions in “real-time”. This example shows Measurement Values for Refrigerator Power Consumption converted into JSON.

{     "XML": {         "version": 1.0,         "encoding": "UTF-8"     },     "Comment": " Example of a simple “odf” structure for a refrigerator. ",     "Objects": {         "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",         "xsi:noNamespaceSchemaLocation": "odf.xsd",         "Object": {             "type": "Refrigerator Assembly Product",             "id": "SmartFridge22334411",             "InfoItem": {                 "name": "Consumed Electrical Power Measure",                 "description": "Power consumption values with timestamp.",                 "value": [                     {                         "dateTime": "2001-10-26T15:33:21",                         "Text": 15.5                     }, {                         "dateTime": "2001-10-26T15:33:50",                         "Text": 15.7                     }, {                         "dateTime": "2001-10-26T15:34:15",                         "Text": 1.3                     }, {                         "dateTime": "2001-10-26T15:34:35",                         "Text": 1.5                     }, {                         "dateTime": "2001-10-26T15:34:52",                         "Text": 15.3                     }                 ]             }         }     } }