Open Data Format (O-DF), an Open Group Internet of Things (IoT) Standard – RESTful Use of the O-DF

 

Due to the hierarchical nature of O-DF structures, they CAN be used for performing RESTful, URL-based information discovery and queries. An example of how this can be done using the UNIX “wget” utility is shown in Issuing an HTTP GET Request, with a corresponding example response in Response using the O-DF. The response SHALL contain all compulsory attributes and sub-elements. It MAY also include other attributes and sub-elements.

Issuing an HTTP GET Request

wget http://dialog.hut.fi/qlm/Objects/

Issuing an HTTP GET Request illustrates issuing an HTTP GET Request to the URL “http://dialog.hut.fi/qlm/” for querying the available information about the data source “Objects”. (The URL “http://dialog.hut.fi/qlm/” is provided as an example of a valid URL of an O-MI node. The reader should not assume that a valid O-MI node would be continuously available at that address, nor that it would return the content shown in this standard.)

Response using the O-DF

<Objects>     <Object>         <id>Refrigerator123</id>     </Object>     <Object>         <id>HeatingController321</id>     </Object>     <Object>         <id>WeatherStation651</id>     </Object> </Objects>

Response using the O-DF shows an example response using the O-DF to request an Objects list, within the “Smart Home” domain.

The elements of the retrieved O-DF structure in Response using the O-DF can be used for drilling further down into the object hierarchy where, for instance, the following URL:

http://dialog.hut.fi/qlm/Objects/Refrigerator123/

would return the list of InfoItem sub-elements and possible sub-objects of the object “Refrigerator123” as shown in Result for a URL-Based Data Discovery Request using O-DF Semantics.

Result for a URL-Based Data Discovery Request using O-DF Semantics

<Object>     <id>Refrigerator123</id>     <InfoItem name=”PowerConsumption”/>     <InfoItem name=”RefrigeratorDoorOpenWarning”/>     <InfoItem name=”RefrigeratorProbeFault/> </Object>

Further drilling down in the O-DF structure can be done in similar ways, as for example:

  • <URL>/Objects/Refrigerator123/id/ returns all the ids of Refrigerator123.
  • <URL>/Objects/Refrigerator123/PowerConsumption/ returns the current power consumption value structure.
  • <URL>/Objects/Refrigerator123/PowerConsumption/value/ returns the “raw” power consumption value.
  • <URL>/qlm/Objects/Refrigerator123/PowerConsumption/MetaData/ returns the MetaData structure that corresponds to Refrigerator123’s PowerConsumption.
  • <URL>/qlm/Objects/Refrigerator123/PowerConsumption/name/ returns the PowerConsumption element including all its name sub-elements.
  • Etc.

More complex queries such as querying for values of several Objects and InfoItems in one go, or querying for historical values, requires the use of other kinds of querying mechanisms, such as those specified in the O-MI.