Commit 7ff516d8eb10d98ccc475f809cd13b4ecdb6347d

Authored by ankraft
1 parent c9402c98

Changed documentation according to HGI SHTF discussion.

1 1 # Introduction to the SDT
2 2  
3   -The Smart Device Template (SDT) is a template which is used to model the capabilities, actions and events of connected devices. The intent of the SDT is to be able to model any type of connected device using a well accepted and standardised format. The main application of SDT is to enable a uniformly structured Application Programmer’s Interface (API) to applications that need to interact with connected devices. Usually, these applications would communicate to devices using an Abstraction Layer as an intermediary logic. The Abstraction Layer „hides“ the technology-specific, native language format of devices of different technology type from the applications.
  3 +The SDT (Smart Device Template) is an initiative from HGI to find consensus amongst various SDOs and industry alliances to derive a common approach for device modelling. HGI and partners have the approach to agree on a set of automation commands, following a common syntax, which are sufficient to model most home appliance functions.
4 4  
5   -## The goal
  5 +At the time of writing, every software developed for home gateways or internet-of-things gateways needs to be capable of using various different protocols (ZigBee, UPnP, EchonetLite, DECT ULE, etc) to interact with a range of devices designed for the home environment. This adds extreme overheads in integrating, checking and updating code. The purpose of SDT is to describe devices and device services in a way which is independent of the LAN technology, in a format which is convenient and reliable for integration in modern code (Java, C/C++, ...).
6 6  
7   -Interoperability for smart-home and other IoT-related applications and Internet-of-Things devices and services is a key objective that is not currently easy to meet, because of the many types of technology specific device interfaces in wide deployment. There is no accepted standard.
  7 +The key goals of the SDT are: (1) keep it simple, especially for manufacturers to contribute device information; (2) modularity for functions and device types; (3) make it easy for developers to create unified APIs; (4) be independent of underlying home-area network technologies; (4) enable extendibility of the system in place without service interruption; (5) allow a pass-through mechanism to enable use of proprietary or technology-specific functions.
8 8  
9   -A major goal for service providers is that software developers should be able to write application software which would handle most of the commonly used functions for any device, irrespective of the device technology. Furthermore, software developers should not have to make major changes to the software in case a new device of similar function but of a different interface technology is used.
10   -If these goals were fully or even partly met, major advantages can be obtained:
  9 +In general a description of device (or complex appliance) behaviour can be made in many ways, with various kinds of constraints:
11 10  
12   -- Service Providers would be more able to deploy and support select new technology types of devices, because existing software application code could be more easily adapted to the new device technology.
13   -- Devices of multiple technology types could be deployed and supported by the same platform (e.g. a Home Gateway), and applications could more easily communicate with them simultaneously.
14   -- Devices of multiple technology types could be deployed by a service provider in different regions or homes, but common application code could be used to support applications. For example, a home automation application could support ECHONET devices in one set of homes, and ZigBee devices in another
15   -- Makers of software application code can more easily support multiple device technology types
16   -- Vendors using newer device technologies could more easily bring their products to new markets.
  11 +1. no constraints (e.g. using OWL 2.0 or even more "flexibly" RDF)
  12 +2. moderate constraints (e.g. using XML and a related extensible XSD template)
  13 +3. strict constraints (typical for a device certified to interoperate with a specific LAN protocol)
17 14  
18   -The interoperability benefits can potentially partially obtain even without a fully complete interoperability of the SDT. For example, the most common functions can be modeled with SDT, and more particular functions can be modeled with technology-specific, proprietary, or seldom-used aspects.
  15 +HGI chose to use the approach "moderate constraints" (XSD based) because for software development it offers ease of use and a good compromise. In particular, if there are few or no constraints on control parameters then few automatic checks can be made to detect if the software parameters are appropriate for each device integrated. XML and XSD languages were chosen because they are familiar to many developers, can be parsed with common software tools, and can still be created and interpreted by humans if necessary.
19 16  
20   -## How should SDT work?
  17 +HGI believes that Device information models based on XML and extensible XSD need some guidelines. If every possible feature of every existing LAN technology and appliance were allowed to be described in any formally correct way, then the results would be a modern Babel, no better than today's system of widely different and wildly competing automation protocols.
21 18  
22   -The basic concept is that a manufacturer, organisation or global SDO would define its preferred Smart Device Template, in XML, specified by and based on an XSD. Using that XSD, manufacturers or indeed hobbyists could "describe" existing or new devices by means of XML files, specifying the capabilities and the parameters needed to control the devices.
  19 +Therefore HGI proposes to recommend a certain structure (template) for the information model(s), but to allow extensions. Naturally, the more industry consensus is achieved for a single recommended template, the greater the utility for software developers (and users).
23 20  
24   -Assuming that the XML files conform to the specified XSD and to some guidelines described in this document, software developers could readily create APIs able to "parse" the XML-descriptions of devices and (assuming the underlying LAN technology of the device is supported by the software/hardware environment in the gateway) operate the equipment.
  21 +The SDT approach is to define re-usable basic functions (or services), labelled "ModuleClass" in the figure below, which can represent the typical functions found in many home automation systems, such as "on/off", "dim a lamp", "receive events from binary sensor", "read data from sensor", etc. Each ModuleClass is composed of a (small) number of actions, datapoint read/write operations, or asynchronous events. For example, an "on/off" ModuleClass would consist perhaps of just one Action, but a "ReadKeypad" Action might have a number of possible events, each with some data value and (usually) a sequence-ID or timestamp start/stop to indicate when and how long each key was pressed.
  22 +
25 23  
26   -The key to making software reliably interoperate with various technologies is to define in the SDT a finite and convenient to use number of functions (which is the decision of the SDO which are commonly used and can therefore be reliably re-used in software for one type of device or another.
  24 +<center>![SmartHome Device Template (XSD) for a generic device (simplification)](images/SDT_simplified.png)</center>
  25 +<center>**SmartHome Device Template (XSD) for a generic device (simplification)</center>**
27 26  
28   -For the convenience of users and developers, it would also be possible to collect the device descriptions of common "modules" (types of) appliances so that the operations of "a generic air-conditioner" could be agreed and re-used often, adapting descriptions of special models with just some special features added as local extensions. Agreeing on the definition of "a generic XYZ appliance" is rather time-consuming, so such "repository" may not become standardised, however the basic approach has huge benefits even if such an archive (also known as a "hierarchical ontology") is never formally agreed.
  27 +The SDT represents the device models introduced in the above figure by using an XSD schema to allow formal checking of compliance for XML device descriptions of specific appliances. The modularity goal in the XSD schema is achieved with re-usable XSD fragments ("ModuleClass" in the figure).
29 28  
30   -The sections below explain this in more detail.
  29 +Complex devices or appliances can then be described by an appropriate set or collection of the agreed XSD fragments (ModuleClasses), as indicated in the figure, which also shows an optional DeviceInfo XSD fragment to allow noting of static information such as device manufacturer name, device firmware version, etc etc.
31 30  
32   -## How does the SDT approach simplify software development?
  31 +HGI has discussed with many SDOs to validate these concepts. SDT is designed to take into account the list of "services" compiled by the SAREF project (https://sites.google.com/site/smartappliancesproject/home).
33 32  
34   -Simplification is achieved in software development by first developing methods to handle common or general functions, then treating necessary "uncommon" functions as extensions; treating each functionality as an individual special case does not scale. Identifying the general functions is often called "abstracting".
  33 +The SDT supports the use of a set of templates for generic devices or appliances (e.g. for a dimmable lamp, a basic washing machine, etc, which would be specific instances of the "Device" object , which form the basis of APIs used by application developers. These templates can also be referenced by manufacturers creating XML documents to describe their specific products. For example, the SDT enables specification of a generic washing machine template, with on/off, set-wash-temperature, pause and a few other commands, which could be referenced by a manufacturer as the schema for a XML description of a basic model washing machine. The SDT allows for vendor-specific additional commands (ModuleClasses) to suit specific product types.
35 34  
36   -There are four major levels of progressively greater abstraction in the signaling and software along the path between a sensor (or actuator) and a software application installed in the cloud:
  35 +The interoperability benefits can potentially partially obtain even without a fully complete interoperability of the SDT. For example, the most common functions can be modeled with SDT, and more particular functions can be modeled with technology-specific, proprietary, or seldom-used aspects.
37 36  
38   -1. a LAN protocol can provide a common set of signaling methods for all compatible sensors/actuators/devices (abstraction at the LAN-controller)
39   -2. a local gateway software can provide common functions to operate diverse kinds of LAN-controllers (abstraction in the local gateway)
40   -3. an IoT platform in the WAN can interoperate with a number of WAN protocols supported by different kinds of gateways (abstraction at the IoT platform)
41   -4. software in the Cloud can interact with diverse IoT platforms and other software applications (abstraction in the Cloud)
  37 +Various details about the recommended structure for SDTs are described in the next sections. The key point to keep in mind is that HGI sought a compromise between, at the one extreme, complete flexibility (which could describe any device, of any complexity) and, at the other extreme, a rigid structure which could be 100% validated and lead to validated software APIs.
42 38  
43   -The concept of the SDT was created in order to make life easier for the software developer working particularly at the second level, creating software for local gateways to interact with devices connected by various kinds of (wireless) LAN technologies/protocols. The same information written into XML instantiations of the SDT do describe sensors or appliances can also be very valuable, however, to applications in the Cloud, helping to interpret the data.
44 39  
45   -Currently every software developed for home gateways or internet-of-things gateways needs to be capable of using various different protocols (ZigBee, UPnP, EchonetLite, DECT ULE, etc) to interact with a range of devices designed for the home environment. This adds extreme overheads in integrating, checking and updating code. The purpose of SDT is to describe devices and device services in a way which is independent of the LAN technology, in a format which is convenient and reliable for integration in modern code (Java, C/C++, ...).
  40 +## Definitions
46 41  
47   -In general a description of device (or complex appliance) behaviour can be made in many ways, with various kinds of constraints:
  42 +This section provides an overview about the SDT 3.0 definitions and element hierarchy. Terms to be described in detail in this section are:
48 43  
49   -1. no constraints (e.g. using OWL 2.0 or even more "flexibly" RDF)
50   -2. moderate constraints (e.g. using XML and a related extensible XSD template)
51   -3. strict constraints (typical for a device certified to interoperate with a specific LAN protocol)
  44 +| Term | Definition |
  45 +|------|------------|
  46 +|Domain | Unique name, or "wrapper" which acts like a namespace, set by the organization creating the SDT, allowing reference to a package of definitions for the contained ModuleClasses and device definitions. Can be referenced when extending ModuleClasses. It has two possible uses: to select the scope of a technology domain, or to set the scope of a use case domain (like Home, SmartGrid, etc) |
  47 +| Device | Physical, addressable, identifiable appliance/sensor/actuator. |
  48 +| Sub-Device | A device (usually one of several) which may be embedded in a Device and/or is addressed via another Device. |
  49 +| ModuleClass | Specification of a single service with one or more service methods, the involved abstracted data model and related events. The expectation is that each separate service which may be used in many kinds of Devices (like PowerON/OFF, Open/Close, ...) will be described by a ModuleClass which can be re-used in many Device definitions. |
  50 +| Module | Instantiation of a ModuleClass for a specific Device or SubDevice|
52 51  
53   -HGI chose to use the approach "moderate constraints" (XSD based) because for software development it offers ease of use and a good compromise. In particular, if there are few or no constraints on control parameters then few automatic checks can be made to detect if the software parameters are appropriate for each device integrated. XML and XSD languages were chosen because they are familiar to many developers, can be parsed with common software tools, and can still be created and interpreted by humans if necessary.
  52 +<center>**Definitions of SDT Elements.**</center>
54 53  
55   -HGI believes that Device information models based on XML and extensible XSD need some guidelines. If every possible feature of every existing LAN technology and appliance were allowed to be described in any formally correct way, then the results would be a modern Babel, no better than today's system of widely different and wildly competing automation protocols.
  54 +A major decision, facilitating validation of code and signalling, was to describe services (functionality) of devices in terms of ModuleClasses made up of combinations of three kinds of elements:
  55 +
  56 +1. DataPoints which are aspects of the Device that can be read/written,
  57 +2. Actions which consist of more complex sequences of operations;
  58 +3. Events which can be signalled ("published") by devices asynchronously.
56 59  
57   -Therefore HGI proposes to recommend a certain structure (template) for the information model(s), but to allow extensions. Naturally, the more industry consensus is achieved for a single recommended template, the greater the utility for software developers (and users).
  60 +This ModuleClass structure is shown in the figure below and is a major part of the SDT which is illustrated in detail in the following figure:
  61 +
  62 +<center>![UML description of device functionality in terms of Actions, DataPoints and Events](images/MC.Action.DataPoint.Event.png)</center>
  63 +<center>**UML description of device functionality in terms of Actions, DataPoints and Events**</center>
58 64  
59   -## Related aspects which are out of scope of the SDT
  65 +## How should SDT work?
60 66  
61   -Not directly part of this work is a related but separate aspect of every gateway software development: a "device abstraction layer" which can translate between (1) software APIs written based on a particular SDT and (2) the "commands" expected by several different LAN protocols and their hardware controllers.
  67 +The basic concept is that a manufacturer, organisation or global SDO would define its preferred Smart Device Template, in XML, specified by and based on an XSD. Using that XSD, manufacturers or indeed hobbyists could "describe" existing or new devices by means of XML files, specifying the capabilities and the parameters needed to control the devices.
62 68  
63   -Programmers developing a "device abstraction layer" for software in a gateway need to create run-time representations of all the recognized devices, their operations and their actual states. This internal "information model" needs to be updated in real time as the devices and the users interact. Programmers may be tempted to use the SDT structure to organize their real-time information model, adding additional information elements for the current state of each device, for some kind of "history" of commands sent/acknowledged, the user etc. This is an efficient approach BUT it must be clear that the real-time state information and history of events, etc, can NOT be represented in a pre-defined SDT not in an XML giving specific details for a device.
  69 +Assuming that the XML files conform to the specified XSD and to some guidelines described in this document, software developers could readily create APIs able to "parse" the XML-descriptions of devices and (assuming the underlying LAN technology of the device is supported by the software/hardware environment in the gateway) operate the equipment.
  70 +
  71 +The key to making software reliably interoperate with various technologies is to define in the SDT a finite and convenient to use number of functions (which is the decision of the SDO which are commonly used and can therefore be reliably re-used in software for one type of device or another.
  72 +
  73 +For the convenience of users and developers, it would also be possible to collect the device descriptions of common "modules" (types of) appliances so that the operations of "a generic air-conditioner" could be agreed and re-used often, adapting descriptions of special models with just some special features added as local extensions. Agreeing on the definition of "a generic XYZ appliance" is rather time-consuming, so such "repository" may not become standardised, however the basic approach has huge benefits even if such an archive (also known as a "hierarchical ontology") is never formally agreed.
  74 +
  75 +## Related aspects which are out of scope of the SDT
64 76  
65 77 The SDT defines the structure of all compliant XML descriptions. Each XML description of a specific device is definable at the time of manufacture of the device and can therefore only contain "static" information: (a) manufacturer data in the form of documentation elements and properties, (b) device capability information detailing the firmware operations and types/meanings of input/output variables.
  78 +
  79 +NOT directly part of this work is a related but separate aspect of every gateway software development: a "device abstraction layer" which can translate between (1) software APIs written based on a particular SDT and (2) the "commands" expected by several different LAN protocols and their hardware controllers.
  80 +
  81 +Programmers developing a "device abstraction layer" for software in a gateway need to create run-time representations of all the recognized devices, their operations and their actual states. This internal "information model" needs to be updated in real time as the devices and the users interact. Programmers may be tempted to use the SDT structure to organize their real-time information model, adding additional information elements for the current state of each device, for some kind of "history" of commands sent/acknowledged, the user etc.
  82 +
  83 +The above is an efficient approach BUT it must be clear that the real-time state information and history of events, etc, can NOT be represented in a pre-defined SDT and in the XML giving specific details for a device.
... ...
... ... @@ -3,7 +3,7 @@
3 3 [Domain](#Domain)
4 4 [Device](#Device) | [SubDevice](#SubDevice)
5 5 [Property](#Property)
6   -[ModuleClass](#ModuleClass)
  6 +[Module and ModuleClass](#ModuleClass)
7 7 &nbsp;&nbsp;&nbsp;[Action](#Action)
8 8 &nbsp;&nbsp;&nbsp;[DataPoint](#DataPoint)
9 9 &nbsp;&nbsp;&nbsp;[Event](#Event)
... ... @@ -17,28 +17,10 @@
17 17  
18 18 ---
19 19  
20   -In this document an overview about the SDT 3.0 definitions and component hierarchy is given.
21   -
22   -Various details about recommended structure for SDTs are described in the next sections. The key point to keep in mind is that HGI sought a compromise between, at the one extreme, complete flexibility (which could describe any device, of any complexity) and, at the other extreme, a rigid structure which could be 100% validated and lead to validated software APIs.
23   -
24   -A major decision, facilitating validation of code and signalling, was to describe services (functionality) of devices in terms of ModuleClasses made up of combinations of three kinds of elements:
25   -
26   -1. DataPoints which can be read/written,
27   -2. Actions which consist of more complex sequences of operations;
28   -3. Events which can be signalled ("published") by devices asynchronously.
29   -
30   -This structure shown in the following figure.
31   -
32   -![](images/MC.Action.DataPoint.png)
33   -
34 20  
35 21 ## SDT Overview
36 22  
37   -The following UML diagram presents an overview of the structure (elements) of every SDT which is conformant with these guidelines. As implied in the above descriptions, there can be many different choices of the details of a SDT, each one optimized for a particular market segment and the types of devices used in that market segment. Obviously an unnecessary proliferation is counter-productive, but as long as each SDT conforms to the structure shown below then it will be possible with little or modest effort for software applications to be adapted accordingly.
38   -
39   -The reader must keep in mind that the UML diagram below is in a sense the meta-format for different possible Smart Device Templates (XSDs) for device descriptions (XMLs) of real devices - sorry about that.
40   -
41   -The followng UML diagram presents an overview about the SDT components.
  23 +The following UML diagram presents an overview of the structure (elements) of every SDT which is conformant with these guidelines. As implied in the above descriptions, there can be many different choices of the details of a SDT, each one optimized for a particular market segment and the types of devices used in that market segment. Obviously an unnecessary proliferation is counter-productive, but as long as each SDT conforms to the structure shown below then it will be possible with little or modest effort for software to be adapted accordingly.
42 24  
43 25 ![](images/SDT_UML_Basic_Elements.png)
44 26  
... ... @@ -46,11 +28,6 @@ The key to the diagram elements of the UML diagrams above and the snippets in th
46 28  
47 29 ![](images/SDT_UML_Key.png)
48 30  
49   -The syntax used in the diagram to model an XML Schema Definition (XSD) as an UML diagram follows the following approaches:
50   -
51   -- [Design XML schemas using UML](http://www.ibm.com/developerworks/library/x-umlschem/)
52   -- [UML For W3C XML Schema Design](http://www.xml.com/pub/a/2002/08/07/wxs_uml.html)
53   -
54 31  
55 32 ## Components
56 33  
... ... @@ -79,12 +56,10 @@ It can also be used to collect all specified [ModuleClasses](#ModuleClasses)
79 56 xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
80 57 id="org.homegatewayinitiative">
81 58 <Doc>Some documentation</Doc>
82   -
83 59 <Imports>
84 60 <!-- Import other SDTs via XInclude's include mechanism -->
85 61 <xi:include href="./dal-core.xml" parse="xml" />
86 62 </Imports>
87   -
88 63 <Modules>
89 64 <!-- List of Domain global Modules goes here -->
90 65 </Modules>
... ... @@ -166,7 +141,7 @@ An example for a compound device is a connected power-strip where each of the s
166 141 ---
167 142  
168 143 <a name="Property"/></a>
169   -### Property
  144 +### Property : Element of a *Device* or *ModuleClass*
170 145  
171 146 ![](images/Property.png)
172 147  
... ... @@ -194,7 +169,7 @@ Since the *Properties* are highly varied, depending on industry segment, no atte
194 169 ---
195 170  
196 171 <a name="ModuleClass"/></a>
197   -### Module, ModuleClass
  172 +### Module and ModuleClass
198 173  
199 174 ![](images/ModuleClass.png)
200 175  
... ... @@ -202,7 +177,7 @@ Since the *Properties* are highly varied, depending on industry segment, no atte
202 177  
203 178 *Module* elements are basically constraints or templates for how to model functionality of real things/appliances/devices within the [Domain](#Domain). There could be an infinite number of possible functionalities, however it is recommended to identify a not-too-large selection of them as generic examples (called *"*ModuleClasses*, see below) and allow for additional proprietary extensions. In a particular [Domain](#Domain) there will be one *Module* for each of the agreed *ModuleClasses* plus additional ones for each extension of a *ModuleClass*.
204 179  
205   -The advantage of identifying a subset of generic *ModuleClasses* is that any suitable high-level software would then be able to "parse" the generic functionality for all compliant appliances, even if the proprietary parts could not be interpreted by the software.
  180 +The advantage of identifying a subset of generic *ModuleClasses*, described below, is that any suitable high-level software would then be able to "parse" the generic functionality for all compliant appliances, even if the proprietary parts could not be interpreted by the software.
206 181  
207 182 Every [Device](#Device) can then be described by a collection of *Modules* (functionality). In the simplest examples, where there are no extensions needed, each *ModuleClass* has exactly one "child" Module ... in such cases the software developer can consider the two terms to be the same.
208 183  
... ... @@ -225,7 +200,7 @@ Typical *ModuleClasses* might be equivalent to &quot;power ON/OFF&quot;, &quot;Open/Close&quot;, &quot;Pa
225 200 The element has the following attributes:
226 201 - **domain** : Identifier / Reference of the [Domain](#Domain) of the extended *ModuleClass*. Required for this element.
227 202 - **class** : Name of the *ModuleClass* in the [Domain](#Domain) that is extended. Required for this element.
228   -- **[Properties](#Property)** : Further meta-data (or properties) about the *SubDevice*. Optional.
  203 +- **[Properties](#Property)** : Further meta-data (or properties) about the *Module* or *ModuleClass*. Optional.
229 204 - **[Actions](#Action)** : A list of *Action* components, each defining a single action. Optional.
230 205 - **[Data](#DataPoint)** : A list of *DataPoint* components. Optional.
231 206 - **[Events](#Event)** : A list of *Event* components. Optional.
... ... @@ -247,8 +222,52 @@ The element has the following attributes:
247 222  
248 223 ---
249 224  
  225 +<a name="DataPoint"/></a>
  226 +### DataPoint : Element of *ModuleClass* and *Event*
  227 +
  228 +![](images/DataPoint.png)
  229 +
  230 +A *DataPoint* element represents an aspect of a device which can be read/written to, and forms part of a device’s data model. Manipulating *DataPoints* is the most common way of controlling devices. Each *DataPoint* has an associated *type* (e.g. simple integer/real numbers, string of text, struct, or arrays thereof) which facillitates data integrity. Note that all RESTful systems (e.g. CoAP) use only *DataPoint* operations, so the mapping of a data models using an SDT into RESTful applications is easy.
  231 +
  232 +However, *DataPoints* are not the only way of controlling devices, so further [Actions](#Action) and [Events](#Event) are described below.
  233 +
  234 +Though *DataPoints* only refer to single data points of a physical device it is possible to describe hierarchies by model the path to the data point in the hierarchy by a path-like structure like to the pathname of a UNIX file system. Here, the root node of the hierarchy is a slash (/ 0x2F) and the segments or nodes along the path are also separated by slashes. The actual datapoint is the last leaf at the path.
  235 +
  236 +In EBNF:
  237 +
  238 + name = dataPointName | "/" path ;
  239 + path = segment "/" path | dataPointName ;
  240 + segment = string ;
  241 + dataPointName = string ;
  242 + string = (* character string excluding the character "/" *) ;
  243 +
  244 +
  245 +#### Attributes
  246 +- **name** : The name (and possible path in a hierarchical data model) of the *DataPoint*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
  247 +- **optional**: Boolean that indicates whether a *DataPoint* is optional or mandatory. Optional, the default is *false*.
  248 +- **writable** : Boolean value that indicates whether this *DataPoint* is writable by an application. Optional. Default: true.
  249 +- **readable** : Boolean value that indicates whether this *DataPoint* is readable by an application. Optional. Default: true.
  250 +- **eventable** : Boolean value that indicates whether an internal or external change of this *DataPoint* raises an event. Optional. Default: false.
  251 +
  252 +#### Elements
  253 +- **[Doc](#Documentation)** : Documentation for the *DataPoint*. Optional.
  254 +- **[DataType](#DataType)** : The type of the *DataPoint*. It must comply to the *DataType* definition. Required.
  255 +
  256 +#### Example
  257 +
  258 + <Data>
  259 + <DataPoint name="attributeName" writable="false">
  260 + <Doc>Some documentation for the DataPoint</Doc>
  261 + <DataType>
  262 + <SimpleType type="string" />
  263 + </DataType
  264 + </DataPoint>
  265 + </Data>
  266 +
  267 +---
  268 +
250 269 <a name="Action"/></a>
251   -### Action
  270 +### Action : Element of *ModuleClass*
252 271  
253 272 ![](images/Action.png)
254 273  
... ... @@ -265,6 +284,7 @@ Note that systems which rely on RESTful operations need to carry out such comple
265 284 - **[DataType](#DataType)** : The return type of the *Action*. It must comply to the *DataType* definition. Optional. If no *DataType* is specified the *Action* does not return a value.
266 285 - **Args** : Zero or more occurances of [argument](#Arg) definitions for an *Action*. Optional.
267 286  
  287 +<a name="ActionExample"/></a>
268 288 #### Example
269 289 The following are two examples for actions implementing a getter and a setter for boolean values.
270 290  
... ... @@ -286,7 +306,7 @@ The following are two examples for actions implementing a getter and a setter fo
286 306  
287 307 ---
288 308 <a name="Arg"/></a>
289   -### Arg
  309 +### Arg : Element of *Action*
290 310  
291 311 ![](images/Arg.png)
292 312  
... ... @@ -301,54 +321,13 @@ The *Arg* has the following attributes and elements:
301 321 - **[Doc](#Documentation)** : Documentation for the *argument*. Optional.
302 322 - **[DataType](#DataType)** : The return type of the *argument*. It must comply to the *DataType* definition. Required.
303 323  
304   ----
305   -
306   -<a name="Data"/></a>
307   -### DataPoint
308   -
309   -![](images/DataPoint.png)
310   -
311   -A *DataPoint* element represents an aspect of a device which can be read/written to, and forms part of a device’s data model. Manipulating *DataPoints* is the most common way of controlling devices. Each *DataPoint* has an associated *type* (e.g. simple integer/real numbers, string of text, struct, or arrays thereof) which facillitates data integrity. Note that all RESTful systems (e.g. CoAP) only use *DataPoint* operations, so the mapping of a data models using an SDT into RESTful applications is easy.
312   -
313   -However, *DataPoints* are not the only way of controlling devices, so further "Actions" and "Events are described below.
314   -
315   -Though *DataPoints* only refer to single data points of a physical device it is possible to describe hierarchies by model the path to the data point in the hierarchy by a path-like structure like to the pathname of a UNIX file system. Here, the root node of the hierarchy is a slash (/ 0x2F) and the segments or nodes along the path are also separated by slashes. The actual datapoint is the last leaf at the path.
316   -
317   -In EBNF:
318   -
319   - name = dataPointName | "/" path ;
320   - path = segment "/" path | dataPointName ;
321   - segment = string ;
322   - dataPointName = string ;
323   - string = (* character string excluding the character "/" *) ;
324   -
325   -
326   -#### Attributes
327   -- **name** : The name (and possible path in a hierarchical data model) of the *DataPoint*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
328   -- **optional**: Boolean that indicates whether a *DataPoint* is optional or mandatory. Optional, the default is *false*.
329   -- **writable** : Boolean value that indicates whether this *DataPoint* is writable by an application. Optional. Default: true.
330   -- **readable** : Boolean value that indicates whether this *DataPoint* is readable by an application. Optional. Default: true.
331   -- **eventable** : Boolean value that indicates whether an internal or external change of this *DataPoint* raises an event. Optional. Default: false.
332   -
333   -#### Elements
334   -- **[Doc](#Documentation)** : Documentation for the *DataPoint*. Optional.
335   -- **[DataType](#DataType)** : The type of the *DataPoint*. It must comply to the *DataType* definition. Required.
336   -
337 324 #### Example
338   -
339   - <Data>
340   - <DataPoint name="attributeName" writable="false">
341   - <Doc>Some documentation for the DataPoint</Doc>
342   - <DataType>
343   - <SimpleType type="string" />
344   - </DataType
345   - </DataPoint>
346   - </Data>
  325 +See [example above](#ActionExample).
347 326  
348 327 ---
349 328  
350 329 <a name="Event"/></a>
351   -### Event
  330 +### Event : Element of *ModuleClass*
352 331  
353 332 ![](images/Event.png)
354 333  
... ... @@ -378,26 +357,20 @@ In EBNF:
378 357 ---
379 358  
380 359 <a name="Data_Types"/></a>
381   -### Data Types
  360 +### DataType
382 361 The data type can be simple integers or string text, or rather complex, as shown below:
383 362  
384 363 ![](images/SDT_UML_DataType.png)
385 364  
386 365 The various elements are described in the sections below.
387 366  
388   ----
389   -
390   -<a name="DataType"/></a>
391   -### DataType
392   -
393 367 ![](images/DataType.png)
394   -![](images/TypeChoice.png)
395 368  
396 369 The *DataType* element is a "container" for the various aspects of a type.
397 370  
398 371 #### Attributes
399 372 - **name** : The name of the *DataType*. The name must be set for the [Struct](#Struct) types to distinguish individual fields in that structure. It can be used in other cases. Optional.
400   -- **unitOfMeasure** : This is the option to label the data with the units of measurement. A "Temperature" measurement is meaningless until the units Kelvin, Celcius, Fahrenheit etc are known. Because of the extreme variety of units, a string field is the default annotation method, although of course a SDO could decide to reference a standardized list of units. Optional.
  373 +- **unitOfMeasure** : Before considering the type of data in detail, there is the option to label the data with the units of measurement. A "Temperature" measurement is meaningless until the units Kelvin, Celcius, Fahrenheit etc are known. Because of the extreme variety of units, a string field is the default annotation method, although of course a SDO could decide to reference a standardized list of units. Optional.
401 374  
402 375 #### Elements
403 376 - **[Doc](#Documentation)** : Documentation for the *DataType* Element. Optional.
... ... @@ -426,12 +399,20 @@ The *Constraint* element is an optional element allowing the manufacturer to pro
426 399  
427 400 ---
428 401  
  402 +### TypeChoice : Construct of *DataType*
  403 +
  404 + ![](images/TypeChoice.png)
  405 +
  406 +The *TypeChoice* construct is required for syntactic reasons in the UML diagram and the choice from the enumerated list simply designates the complexity of the following DataType.
  407 +
  408 +---
  409 +
429 410 <a name="SimpleType"/></a>
430   -### SimpleType
  411 +### SimpleType : Element of *TypeChoice*
431 412  
432 413 ![](images/SimpleType.png)
433 414  
434   -The "SimpleType" element is required in order for software to understand the format of the associated data, e.g. are the bytes an integer or real value? The selection choosen is based on practical experience to include some specific types which are slightly more complex:
  415 +The *SimpleType* element is required in order for software to understand the format of the associated data, e.g. are the bytes an integer or real value? The selection choosen by HGI is based on practical experience to include some specific types which are slightly more complex:
435 416  
436 417 1. the (technically redundant) options of *date* and *time* - to avoid problems which can arise interpreting a *datetime* value;
437 418 2. *url* because it is expected to become extremely common to provide links to other data sources;
... ... @@ -454,7 +435,7 @@ If not stated otherwise datatypes should comply to the equivalent datatypes defi
454 435 ---
455 436  
456 437 <a name="StructType"/></a>
457   -### StructType
  438 +### StructType : Element of *TypeChoice*
458 439  
459 440 ![](images/Struct.png)
460 441  
... ... @@ -467,7 +448,7 @@ The *StructType* element can be used to represent an ordered list of diverse Dat
467 448 ---
468 449  
469 450 <a name="ArrayType"/></a>
470   -### ArrayType
  451 +### ArrayType : Element of *TypeChoice*
471 452  
472 453 ![](images/Array.png)
473 454  
... ... @@ -479,8 +460,11 @@ The *ArrayType* element is provided for defining lists of data; the definition i
479 460 ---
480 461  
481 462 <a name="Documentation"/></a>
482   -# Documentation
483   -The *Doc* documentation element is optionally available in most components of the SDT. Its purpose is to provide a short documentation for the respective element. The documentation language *should* be English.
  463 +### Doc : Element for all Documentation
  464 +
  465 +![](images/Doc.png)
  466 +
  467 +*Doc* elements (optional for all the above Elements) are very important to help understand the software-readable information for specific devices and services. They contain the human-readable information. Many automation protocols describe every possible operation in a comprehensive specification, however SDT is designed to include the relevant information at the "point of use" for the software developer, inside the SDT (and XML files based on it).
484 468  
485 469 The text inside the *Doc* element can be structure using a very limited subset of HTML elements. The possible structuring is defined in EBNF as follows:
486 470  
... ...