Skip to content
Snippets Groups Projects
Commit b2f490ce authored by ankraft's avatar ankraft
Browse files

Added a new directory to work on version 4.0 of SDT.

Changed the license to 3-clause BSD.
Changed various version numbers from 3.0 to 4.0.
parent d7bd559b
Branches MAS-2018-0047
No related tags found
1 merge request!2Added a new directory to work on version 4.0 of SDT.
Showing
with 1786 additions and 197 deletions
Apache License Copyright 2018, oneM2M Partners Type 1
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Definitions. 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
"License" shall mean the terms and conditions for use, reproduction, 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2014 HGI Home Gateway Initiative
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
Repository for the Smart Device Template (SDT). Repository for the Smart Device Template (SDT).
**Version 3.0** **Version 4.0**
Note that this project runs under Apache 2.0 license. Read the [LICENSE](LICENSE) in this repository, or refer to [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Note that this project runs under the 3-Clause BSD License. Read the [LICENSE](LICENSE) in this repository, or refer to [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause).
Any contributions made to this project must comply with the aforementioned license. Any contributions made to this project must comply with the aforementioned license.
...@@ -12,23 +12,23 @@ Any contributions made to this project must comply with the aforementioned licen ...@@ -12,23 +12,23 @@ Any contributions made to this project must comply with the aforementioned licen
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. 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.
[Read the full Introduction.](SDT/schema3.0/docs/Introduction.md) [Read the full Introduction.](SDT/schema4.0/docs/Introduction.md)
## Quick Links ## Quick Links
- ['domain.xsd' Version 3.0](SDT/schema3.0/src/domain.xsd) - ['domain.xsd' Version 4.0](SDT/schema4.0/src/domain.xsd)
- [UML Diagram of the SDT 3.0](SDT/schema3.0/docs/UML%20Diagram.md) ([source](SDT/schema3.0/docs/SDT_UML.uxf)) - [UML Diagram of the SDT 4.0](SDT/schema4.0/docs/UML%20Diagram.md) ([source](SDT/schema4.0/docs/SDT_UML.uxf))
## Content ## Content
You can find further Information here: You can find further Information here:
- [Introduction to the SDT](SDT/schema3.0/docs/Introduction.md) - [Introduction to the SDT](SDT/schema4.0/docs/Introduction.md)
- [SDT Components](SDT/schema3.0/docs/SDT_Components.md) - [SDT Components](SDT/schema4.0/docs/SDT_Components.md)
- [SDT Build System](SDT/schema3.0/docs/SDT%20Build%20System.md) - [SDT Build System](SDT/schema4.0/docs/SDT%20Build%20System.md)
- [Examples](SDT/schema3.0/docs/Examples.md) - [Examples](SDT/schema4.0/docs/Examples.md)
- [Links & References](SDT/schema3.0/docs/Links.md) - [Links & References](SDT/schema4.0/docs/Links.md)
- [Changelog](SDT/schema3.0/docs/Changelog.md) - [Changelog](SDT/schema4.0/docs/Changelog.md)
- [LICENSE](LICENSE) - [LICENSE](LICENSE)
<?xml version="1.0" encoding="UTF-8" ?>
<!-- - HGI Device Abstraction Layer - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!-- Extends the standard build with targets for: -->
<!-- - generate XML schema the from Relax NG (xml) description -->
<!-- - validate DAL documents against the XML Schema -->
<!-- - generate HTML documentation from DAL documents -->
<project name="importing" basedir="." default="schemas">
<import file="etc/common.xml"/>
<!-- Read the namespace declarations from a file (to get linebreaks) - - - -->
<loadfile property="schema.xmlns" srcFile="${basedir}/etc/schema.xmlns"/>
<!-- The RNG file the XML and RNC schemas are generaed from - - - - - - - -->
<property name="schema.name" value="domain"/>
<property name="schema.rng" value="${path.src}/${schema.name}.rng"/>
<!-- HTML - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!-- Generate HTML documentation from domain definitions in the test -->
<!-- directory. The module classes included via the extends tagged are -->
<!-- included in the documentation - so an xinclude capable XSL engine is -->
<!-- needed. -->
<!-- This needs Ant version 1.8+ and it must be augmented with an current -->
<!-- version of Xerces. Download the binray distribution and place the put -->
<!-- xml-apis.jar and xercesImpl.jar in the Ant lib directory. -->
<target name="html">
<mkdir dir="${path.genbase}" />
<xslt basedir="${basedir}/test" destdir="${basedir}/gen/html"
style="${basedir}/style/html.xsl">
<param name="destdir" expression="${basedir}/gen/html"/>
<sysproperty
key="org.apache.xerces.xni.parser.XMLParserConfiguration"
value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
</xslt>
</target>
<!-- Schemas - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!-- The schema is specified using Relax NG (xml) and trang is used to -->
<!-- generate the XML schema. The schema is also generated in Relay NG -->
<!-- compact syntax, which is used by some validating editors (e.g. emacs) -->
<!-- The resulting schemas need some additional patching before thy are -->
<!-- usable -->
<target name="schemas">
<java jar="${basedir}/lib/trang.jar" fork="true">
<arg value="${schema.rng}"/>
<arg value="${basedir}/etc/${schema.name}.rnc"/>
</java>
<!-- So that the editor does not complain about include directives, the -->
<!-- resulting schema is included in another schema, which includes the -->
<!-- necessary element definitions. To be able to do this the -->
<!-- definition for Imports must be deleted from this generated schema. -->
<replace file="${basedir}/etc/${schema.name}.rnc"
token="Imports = element Imports { Domain* }?" value=""/>
<java jar="${basedir}/lib/trang.jar" fork="true">
<arg value="${schema.rng}"/>
<arg value="${path.src}/${schema.name}.xsd"/>
</java>
<!-- Can't validate against the generated schema unless we add the -->
<!-- target and default namespaces ... -->
<replace file='${path.src}/domain.xsd'
token='xmlns:xs="http://www.w3.org/2001/XMLSchema"'
value='${schema.xmlns}'/>
<!-- In addition the xml:base tag, which is added automatically when -->
<!-- including a document, must also be permitted by out schema. -->
<!-- The schema generated from RNG is almost correct schema ... but -->
<!-- the schemaLocation is wrong. -->
<replace file='${path.src}/domain.xsd'
token="xml.xsd" value="http://www.w3.org/2001/03/xml.xsd"/>
</target>
<!-- Validate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!-- Check the Device Description conforms to the Device Abstraction -->
<!-- Schema. Note that we need to activate support for XML includes -->
<target name="validate" depends="">
<schemavalidate warn="true">
<fileset dir="${basedir}/test" includes="*.xml"/>
<attribute name="http://apache.org/xml/features/xinclude" value="true"/>
<schema namespace="http://homegatewayinitiative.org/xml/dal/3.0"
file="${path.src}/domain.xsd" />
<schema namespace="http://www.w3.org/2001/XInclude"
file="${basedir}/etc/XInclude.xsd" />
<schema namespace="http://www.w3.org/2001/XMLSchema"
file="${basedir}/etc/XMLSchema.xsd" />
</schemavalidate>
</target>
</project>
# Changelog
## Changes in 4.0
## Changes in 3.0
- Renamed ``<RootDevice>``to ``<Device>`` and ``<Device>`` to ``<SubDevice>``,
- Added complex data types: *Struct* and *Arrays*.
- Simplified the UML diagram. Split the UML diagram into two parts, one for the base elements and one for the data types.
- In the UML diagram: Moved ``<extends>`` into the UML ``<ModuleClass>`` element (easier to read).
- Added support to specify *Units of Measurement* to data types,
- Added ``<Doc>`` to ``<Domain>`` and other elements.
- ``<Doc>`` is now always the first part of an element.
- Changed ``<DeviceInfo>`` element to a list of ``<Characteristic>``.
- Added ``<Characteristic>`` list to ``<Modules>`` and ``<ModuleClasses>``.
- The ``<data>`` element in ``<Event>`` is now optional to support events without attached or associated data.
- In Actions: Added ``<Args>`` as a surrounding list around a list of ``<Arg>``.
- Added *Constraints* to ``<DataType>``.
- Added optional *name* attribute to ``<DataType>``. This mandatory for elements of a *struct*.
- Restructured the [RNG](SDT/schema3.0/src/domain.rng) file for better readability and maintainability.
- In the [RNG](SDT/schema3.0/src/domain.rng)/[XSD](SDT/schema3.0/src/domain.xsd): Changed cardinality of the occurrence of elements that are part of a list of elements (e.g. ``<SubDevices><SubDevice>…</SubDevice></SubDevices>`` from „zero or more“ to „one or more“ when the surrounding list element itself is optional (to avoid empty lists).
## Changes in 2.0.1
- Added missing "uri" data type.
## Changes in 2.0
- Introduced RootDevice to support hierarchical embedded devices.
- Added new data types (byte, float, array, enum, date, time, datetime, blob, uri)
- Added ``readable`` and ``eventable`` to data points.
- Added optional ``<SerialNumber>``, ``<VendorURL>`` and ``<FirmwareVersion>`` elements to DeviceInfo
- Added optional ``<Doc>`` element to Event
- Changed the optionality of the ``<DataPoint>``'s ``type`` attribute to "required".
- Added [UML diagram](SDT/schema2.0/docs/SDT_Components.md)
- Changed the namespace for the XSD from "hgi.org" to "homegatewayinitiative.org".
\ No newline at end of file
# Examples and Contributions
[A simple example](#simpleExample)
[Multi Socket Electrical-Extension-Block](#mseeb)
<a name="simpleExample"></a>
## A very simple SDT example
In the ideal case, a large organization or SDO would define a widely-applicable set of [ModuleClasses](SDT_Components.md#ModuleClass), each of which could be used as needed to compose the description of a complex device. In order to show the appoach, this section will create a few example ModuleClasses based on - or inspired by - featues in the Echonet Lite protocol. Please note that the examples shown in this document are very "cut down" and by no means represent a true representation of Echonet Lite.
The Echonet Consortium has standardized their specifications within IEC/ISO (IEC62394, ISO/IEC24767-1, ISO/IEC24767-2, IEC62480, ISO/IEC14543-4-1, ISO/IEC14543-4-2, IEC62457) and they provide a comprehensive collection of various types of home appliances relevant to SmartGrid applications as ECHONET Device objects (see [https://echonet.jp/spec_object_rf_en/](https://echonet.jp/spec_object_rf_en/) ).
For the example in this document, to show re-use of ModuleClass definitions, two complex devices are chosen which have some common features and hence could be expected to both use some of the same ModuleClasses: an air conditioner and a washing machine.
<table>
<tr><th>Funtionality</th><th>Air Conditioner</th><th>Washing Machine</th></tr>
<tr><td>operationStatus</td><td>operates on/off</td><td>operates on/off</td></tr>
<tr><td>measuredCumulativePowerConsumption</td><td>the cumulative power consumption</td><td>the cumulative power consumption</td></tr>
<tr><td>installationLocation</td><td>this sets/reads a string text describing the location (room) of the air-conditioner.</td><td>this sets/reads a string text describing the location (room) of the washing machine.</td></tr>
<tr><td>setTimer</td><td>(not applicable. there is no preset start for an air-conditioner)</td><td>This sets/reads use the on/off timer</td></tr>
</table>
Based on the simplified example above, the two appliances will need the ModuleClasses below:
- *air-conditioner*: operationStatus, measuredCumulativePowerConsumption, installationLocation;
- *washing-machine*: operationStatus, measuredCumulativePowerConsumption, and setTimer.
<ModuleClass name="operationStatus">
<Data>
<DataPoint name="operationStatus" writable="true">
<Doc>This property sets/reads the ON/OFF status.</Doc>
<DataType>
<SimpleType type="boolean"/>
</DataType>
</DataPoint>
</Data>
<Events>
<Event name="operationStatus">
</Event>
</Events>
</ModuleClass>
<ModuleClass name="measuredCumulativePowerConsumption">
<Data>
<DataPoint name="measuredCumulativePowerConsumption" writable="false">
<Doc>This indicates cumulative power consumption of the device in increments of 0.001kWh.</Doc>
<DataType>
<SimpleType type="integer"/>
</DataType>
</DataPoint>
</Data>
</ModuleClass>
<ModuleClass name="installationLocation">
<Data>
<DataPoint name="installationLocation" writable="true">
<Doc>This property indicates the installation location</Doc>
<DataType>
<SimpleType type="string"/>
</DataType>
</DataPoint>
</Data>
<Events>
<Event name="installationLocation"> </Event>
</Events>
</ModuleClass>
<ModuleClass name="onTimerSetting">
<DataPoint name="onTimer" writable="true">
<Doc>Timer value (HH:MM)</Doc>
<DataType>
<SimpleType type="time"/>
</DataType>
</DataPoint>
</ModuleClass>
The structure and the according SDT now looks like this:
<table>
<tr><td colspan="2" width="50%"><b>Example1.SDT</b></td></tr>
<tr><td> </td><td>Namespace information</td></tr>
<tr><td> </td><td>Modules (contains ModuleClasses)</td></tr>
<tr><td> </td><td>operationStatus<ul>
<li>measuredCumulativePowerConsumption</li>
<li>installationLocation</li>
<li>onTimerSetting</li></ul></td></tr>
</table>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Example1 SDT inspired by some Echonet Lite examples -->
<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
xmlns:xi="http://www.w3.org/2001/XInclude"
id="example1.SDT">
<Modules>
<!-- Various examples for module classes -->
<ModuleClass name="operationStatus">
<Data>
<DataPoint name="operationStatus" writable="true">
<Doc>This property sets the ON/OFF status.</Doc>
<DataType>
<SimpleType type="boolean"/>
</DataType>
</DataPoint>
</Data>
<Events>
<Event name="operationStatus">
</Event>
</Events>
</ModuleClass>
<ModuleClass name="installationLocation">
<Data>
<DataPoint name="installationLocation" writable="true">
<Doc>This property indicates the installation location</Doc>
<DataType>
<SimpleType type="string"/>
</DataType>
</DataPoint>
</Data>
<Events>
<Event name="installationLocation"> </Event>
</Events>
</ModuleClass>
<ModuleClass name="measuredCumulativePowerConsumption">
<Data>
<DataPoint name="measuredCumulativePowerConsumption" writable="false">
<Doc>This indicates cumulative power consumption of the device in increments of 0.001kWh.</Doc>
<DataType>
<SimpleType type="integer"/>
</DataType>
</DataPoint>
</Data>
</ModuleClass>
<ModuleClass name="onTimerSetting">
<DataPoint name="onTimer" writable="true">
<Doc>Timer value (HH:MM)</Doc>
<DataType>
<SimpleType type="time"/>
</DataType>
</DataPoint>
</ModuleClass>
</Modules>
</Domain>
---
<a name="mseeb"></a>
### Multi Socket Electrical-Extension-Block
This example is a specification for an imaginged device, a connected extension block with multiple power socket where each of the sockets are modeled as a
separate *SubDevice*.
[mseeb.xml](../test/mseeb.xml)
---
# Frequently Asked Questions
## What is the HGI?
tbd
## What is the SDT?
tbd
# Introduction to the SDT
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.
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++, ...).
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.
In general a description of device (or complex appliance) behaviour can be made in many ways, with various kinds of constraints:
1. no constraints (e.g. using OWL 2.0 or even more "flexibly" RDF)
2. moderate constraints (e.g. using XML and a related extensible XSD template)
3. strict constraints (typical for a device certified to interoperate with a specific LAN protocol)
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.
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.
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).
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.
![SmartHome Device Template (XSD) for a generic device (simplification)](images/SDT_simplified.png)
**SmartHome Device Template (XSD) for a generic device (simplification)**
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).
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.
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).
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.
The interoperability benefits can potentially partially be obtained 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.
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.
## Definitions
This section provides an overview about the SDT 4.0 definitions and element hierarchy. Terms to be described in detail in this section are:
| Term | Definition |
|------|------------|
|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) |
| Device | Physical, addressable, identifiable appliance/sensor/actuator. |
| Sub-Device | A device (usually one of several) which may be embedded in a Device and/or is addressed via another Device. |
| 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. |
| Module | Instantiation of a ModuleClass for a specific Device or SubDevice|
**Definitions of SDT Elements.**
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:
1. DataPoints which are aspects of the Device that can be read/written,
2. Actions which consist of more complex sequences of operations;
3. Events which can be signalled ("published") by devices asynchronously.
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:
![UML description of device functionality in terms of Actions, DataPoints and Events](images/MC.Action.DataPoint.Event.png)
**UML description of device functionality in terms of Actions, DataPoints and Events**
## How should SDT work?
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.
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.
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.
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.
## Related aspects which are out of scope of the SDT
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.
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.
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.
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.
---
Click [here](SDT_Components.md) for detailed documentation about SDT.
# Links & References
- **HGI** : [http://www.homegatewayinitiative.org](http://www.homegatewayinitiative.org)
## XML
- **RELAX NG** : [http://relaxng.org](http://relaxng.org)
- **RELAX NG Tutorial** : [http://relaxng.org/tutorial-20011203.html](http://relaxng.org/tutorial-20011203.html)
## Tools
- **UMLet** : [http://www.umlet.com](http://www.umlet.com)
The free UML drawing tool used to draw the UML file.
- **Apache Ant** : [http://ant.apache.org](http://ant.apache.org)
Build tool
# Build System Libraries and Licenses
The following libraries are used in the build system for the SDT.
## trang.jar
[http://www.thaiopensource.com/relaxng/trang-manual.html](http://www.thaiopensource.com/relaxng/trang-manual.html)
*Trang* takes as input a schema written in any of the following formats:
- RELAX NG (XML syntax)
- RELAX NG (compact syntax)
- XML 1.0 DTD
and produces as output a schema written in any of the following formats:
- RELAX NG (XML syntax)
- RELAX NG (compact syntax)
- XML 1.0 DTD
- W3C XML Schema
*Trang* can also infer a schema from one or more example XML documents.
### License
Copyright (c) 2002, 2003, 2008 Thai Open Source Software Center Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the Thai Open Source Software Center Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## Ant-Contrib Tasks
[http://ant-contrib.sourceforge.net](http://ant-contrib.sourceforge.net)
The *Ant-Contrib* project is a collection of tasks (and at one point maybe types and other tools) for Apache Ant.
### License
This Software is distributed under the Apache Software License.
## antSetLogLevel.jar
GUI dialog for Ant tasks.
Source: Deutsche Telekom
# SDT Build System
This document describes the SDT build system and how to build the SDT and validate new contributions.
The files referenced in this document point to version **4.0** of the SDT.
## Directory Structure and Important Files
- [SDT/schema4.0/](../..) : Base directory
- [SDT/schema4.0/src/](../src/) : Source files of the SDT.
- [domain.rng](../src/domain.rng) : RELAX NG file with the SDT schema definition. This is the source file that is converted to the actual schema definition *domain.xsd* during the build. See also [http://en.wikipedia.org/wiki/RELAX_NG](http://en.wikipedia.org/wiki/RELAX_NG).
**Only edit this file when one wants to make changes to the SDT!**
- [domain.xsd](../src/domain.xsd) : The SDT schema definition that is generated from *domain.rng*.
- [xml.xsd](../src/xml.xsd) : General schema definitions for the SDT
- [SDT/schema4.0/test/](../test/) : This directory contains all XML files with SDT definitions that should be validated whether they conform to the SDT schema. This could be example definitions or contributions.
- [SDT/schema4.0/build.xml](../build.xml) : This is the definition file for the ant build system.
- [SDT/schema4.0/etc/](../etc/), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make unnecessary changes to these files.
- [SDT/schema4.0/etc/](../etc), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make unnecessary changes to these files.
- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc) : This file contains various configuration parameter to convert the file [domain.rng](../src/domain.rng) to schema file. **The important parameter to change when changing the namespace or the version number is**:
default namespace xsl = "http://homegatewayinitiative.org/xml/dal/3.0"
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml) : This file contains the header for the schema file. **This must be changed when changing the namespace or the version number.**
- [SDT/schema4.0/lib/](../lib/) : Tasks for the ant-based build system. See also [SDT Build System Components and Licenses](SDT%20Build%20System%20Components%20and%20Licenses.md).
## Installation
- Install Java on your computer
- Download and install Apache ant from [http://ant.apache.org](http://ant.apache.org)
- Clone the SDT repository from GitHub:
$ git clone https://github.com/Homegateway/SmartDeviceTemplate.git
## How to Use the Build System
After cloning the repository go to the directory *SDT/schema* and run commands depending on what you want to achieve.
### Build the Schema
Running *ant* without any parameter builds the schema definition from the rng-definition [SDT/schema4.0/src/domain.rng](../src/domain.rng) and writes it to [SDT/schema4.0/src/domain.xsd](../src/domain.xsd)
$ cd SDT/schema
$ ant
### Validate SDT Definitions
You can use the build system to validate new SDT definitions or changes made to existing ones by running the following command:
$ cd SDT/schema
$ ant validate
The output after a successful validation should look like this:
>[schemavalidate] 2 file(s) have been successfully validated.
>BUILD SUCCESSFUL
>Total time: 1 second
Otherwise you most likely receive a stack trace or some other error messages. Search the output for the line *BUILD FAILED*. Above this line you will find some helpful hints for the filename and line number on which the error occurred (here: file *mseeb.xml* on line 66) and a reason:
>[schemavalidate] /Users/someone/Sources/git/SmartDeviceTemplate/SDT/schema/test/mseeb.xml:66:18: cvc-elt.1: Cannot find the declaration of element 'Domain'.
>BUILD FAILED
---
## Editing
As mentioned above, the actual schema definition is defined in the file [domain.rng](../src/domain.rng) and converted to the XML schema definition [domain.xsd](../src/domain.xsd) during the build process.
**All changes to the schema must therefore be made in [domain.rng](../src/domain.rng), NOT [domain.xsd](../src/domain.xsd) !**
You may need to make additional changes in the following files, e.g. when the name space or the version number need to be adjusted.
PLEASE ONLY EDIT THESE FILES IF NECESSARY.
- [SDT/schema4.0/build.xml](../build.xml)
e.g. in the *ant* target "validate"
- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc)
e.g. the entry "default namespace xsl"
- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns)
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml)
# SDT Components
[Domain](#Domain)
[Device](#Device) | [SubDevice](#SubDevice)
[Property](#Property)
[Module and ModuleClass](#ModuleClass)
&nbsp;&nbsp;&nbsp;[Action](#Action)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Arg](#Arg)
&nbsp;&nbsp;&nbsp;[DataPoint](#DataPoint)
&nbsp;&nbsp;&nbsp;[Event](#Event)
[Data Types](#Data_Types)
&nbsp;&nbsp;&nbsp;[DataType](#DataType)
&nbsp;&nbsp;&nbsp;[Constraint](#Constraint)
&nbsp;&nbsp;&nbsp;[SimpleType](#SimpleType)
&nbsp;&nbsp;&nbsp;[StructType](#StructType)
&nbsp;&nbsp;&nbsp;[ArrayType](#ArrayType)
[Doc](#Documentation)
---
## SDT Overview
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.
![](images/SDT_UML_Basic_Elements.png)
The key to the diagram elements of the UML diagrams above and the snippets in the following sections:
![](images/SDT_UML_Key.png)
<a name="Domain"></a>
The syntax used in the diagram to model an XML Schema Definition (XSD) as an UML diagram follows the following approaches:
- [Design XML schemas using UML](http://www.ibm.com/developerworks/library/x-umlschem/)
- [UML For W3C XML Schema Design](http://www.xml.com/pub/a/2002/08/07/wxs_uml.html)
### Domain
![](images/Domain.png)
The *Domain* element allows labeling of different SDT templates for different technologies and/or industry segments ("verticals"): for example eHealth and Building Management might prefer quite different detailed structures/templates. This also helps keep information in human-friendly and manageable blocks. It is assumed that there will be multiple "SDT Templates" and some of them may be completely proprietary.
It can also be used to collect all specified [ModuleClasses](#ModuleClasses)
and [Devices](#Devices) in one referencable logical group.
#### Attributes
- **id** : The identifier for that *Domain*. Required.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Domain*. Optional.
- **Imports** : XML import/include of other XML files. Optional.
- **[Module](#ModuleClass)** : A list of those *Module* components that are global to the whole domain. Optional.
- **[Devices](#Device)** : a List of *Devices* components. Optional.
#### Example
<Domain xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
id="org.homegatewayinitiative">
<Doc>Some documentation</Doc>
<Imports>
<!-- Import other SDTs via XInclude's include mechanism -->
<xi:include href="./dal-core.xml" parse="xml" />
</Imports>
<Modules>
<!-- List of Domain global Modules goes here -->
</Modules>
<Devices>
<!-- List of Devices goes here -->
</Devices>
</Domain>
---
<a name="Device"/></a>
### Device
![](images/Device.png)
The *Device* was initially thought of as the representation of "the basic things we are trying to model" and can still be considered so. However, after discussion with various SDOs, it was decided to add also "[sub-devices](#SubDevice)". That is, there is one level of hierarchy to allow modeling of e.g. a set of independent energy monitoring plugs in a single addressable power-extension-block. (Other SDOs might consider it more appropriate to use a recursive sub-sub-sub ... device definition). Note that all the different devices which one needs to model within a Domain are composed of one or more [Modules](#ModuleClass).
For each physical device on the network at least one *Device* **must** be defined. If the physical device is a simple device, i.e. it does not contain embedded devices, e.g. a light switch, it does not include further [SubDevices](#SubDevices). On the other hand, if the physical is a compound device, i.e. it does contain embedded devices that can be addressed separately, the *Device* **should** contain [SubDevices](SubDevices) for each of the identifiable embedded devices.
An example for a compound device is a connected power-strip where each of the sockets can be switched on and off individually. The power-strip itself can provide functions such as "all sockets off" and "overall power consumption".
*Devices* may define their own [ModuleClasses](#ModuleClass) or refer to predefined ModulesClasses of the same or another [Domain](Domain).
#### Attributes
- **id** : The identifier for that *Device*. The identifier must be unique at least in the scope of the domain, but the final scope is also influenced by implementing technologies. Required.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Device*. Optional.
- **[Properties](#Property)** : Further meta-data (or properties) about the *Device*. Optional.
- **[Modules](#ModuleClass)** : A list of *Module* components that are local to the *Device*. Optional.
- **[SubDevices](#SubDevice)** : A list of *SubDevice* components. Optional.
#### Example
<Device id="aDevice">
<Doc>Some documentation</Doc>
<Properties>
<!-- The list of Properties for the Device goes here-->
</Properties>
<Modules>
<!-- List of Modules local to the Device goes here-->
</Modules>
<SubDevices>
<!-- List of Sub-Devices of the Device goes here-->
</SubDevices>
</Device>
---
<a name="SubDevice"/></a>
### SubDevice
*SubDevices* are optional components of a [Device](#Device). They represent physical sub-devices and services inside another device (the *Device*).
*SubDevices* may define their own [ModuleClasses](#ModuleClass) or extend *ModuleClasses* of it's or another [Domain](#Domain).
![](images/SubDevice.png)
#### Attributes
- **id** : The identifier for that *SubDevice*. The identifier must be unique at least in the scope of the domain, but the final scope is also influenced by implementing technologies. Required.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *SubDevice*. Optional.
- **[Properties](#Property)** : Further meta-data (or properties) about the *SubDevice*. Optional.
- **[Modules](#ModuleClass)** : A list of *Module* components that are local to the *SubDevice*. Optional.
#### Example
<SubDevice id="aSubDevice">
<Doc>Some documentation</Doc>
<Properties>
<!-- The list of Properties for the Device goes here-->
</Properties>
<Modules>
<!-- List of Modules local to the Device goes here-->
</Modules>
</SubDevice>
---
<a name="Property"/></a>
### Property : Element of a *Device* or *ModuleClass*
![](images/Property.png)
*Property* elements are used to append to [Devices](#Device) and their [ModuleClass](ModuleClass) elements with arbitrary additional information. For [Devices](#Device) it would be very common for a manufacturer to want to add into the XML file which is describing the device such information as "Manufacturing Site", "Date of Manufacture", "Certification Code", "Energy Label Code", "compatible LAN technology", "URL for the device handbook", "physical limits of operation environments", etc.
Some of that information might in some devices be available by reading a specific device [DataPoint](#DataPoint), however even if it cannot be read from the device then at least it can be noted in the device's XML description. Examples for organizations that specify these kind of added "Property" information are [eCl@ss](http://www.eclass.eu) and [UNSPSC](http://www.unspsc.org) (United Nations Standard Products and Services Code).
Since the *Properties* are highly varied, depending on industry segment, no attempt is made in the SDT to constrain the options: however it is highly recommended to provide software-developer-friendly information in the [Doc](#Documentation) field of each Property.
#### Attributes
- **name**: Name or identifier of a *Property*.
- **optional**: Boolean that indicates whether a *Property* is optional or mandatory. Optional, the default is *false*.
- **value**: Text representation of value of a *Property*. Optional.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Property*. Optional.
- **DataType** : The data type of the property. This must be a [SimpleType](#SimpleType).
#### Example
<Property name="ManufacturedDate" value="2015.10.30 10:06">
<SimpleType type="datetime" />
</Property>
---
<a name="ModuleClass"/></a>
### Module and ModuleClass
![](images/ModuleClass.png)
**Module**
*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*.
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.
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.
The relationship between a *ModuleClass* and a *Module* is very similar to the specification of a class and an instantiated object in an object oriented programming language.
**ModuleClass**
The set of *ModuleClasses* is defined at the [Domain](#Domain) level. Each one describes some functionality (services). In principle there could be an infinite number of *ModuleClasses* (as noted above), for every kind of functionality found in UPnP, ZigBee and all the other automation protocols ... However that would not simplify the job of software developers at all! Therefore, HGI recommends that a finite and convenient number of prototypical *ModuleClasses* are re-used as much as possible (within a Domain at least).
Typical *ModuleClasses* might be equivalent to "power ON/OFF", "Open/Close", "PanUP/DOWN", "ReadTemperature", etc. Those examples make it apparent that various read/write usage of parameters, invoking of actions and waiting for events might be needed in the different *ModuleClasses*, and a guideline for those structures is explained below.
#### Attributes
- **name** : Name of the *Module* or *ModuleClass*. The name must be unique in the scope of the [Domain](#Domain). Required.
- **optional**: Boolean that indicates whether a *Module* or *ModuleClass* is optional or mandatory. Optional, the default is *false*.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Module* or *ModuleClass*. Optional.
- **extends** : Reference to a another *ModuleClass* or *Module* which is extended with this *ModuleClass*. Optional.
The element has the following attributes:
- **domain** : Identifier / Reference of the [Domain](#Domain) of the extended *ModuleClass*. Required for this element.
- **class** : Name of the *ModuleClass* in the [Domain](#Domain) that is extended. Required for this element.
- **[Properties](#Property)** : Further meta-data (or properties) about the *Module* or *ModuleClass*. Optional.
- **[Actions](#Action)** : A list of *Action* components, each defining a single action. Optional.
- **[Data](#DataPoint)** : A list of *DataPoint* components. Optional.
- **[Events](#Event)** : A list of *Event* components. Optional.
#### Example
<ModuleClass name="BooleanState">
<Doc>Some documentation</Doc>
<Actions>
<!-- List of Actions goes here-->
</Actions>
<Events>
<!-- List of Events goes here-->
</Events
<Data>
<!-- List of DataPoints goes here-->
</Data>
</ModuleClass>
---
<a name="DataPoint"/></a>
### DataPoint : Element of *ModuleClass* and *Event*
![](images/DataPoint.png)
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.
However, *DataPoints* are not the only way of controlling devices, so further [Actions](#Action) and [Events](#Event) are described below.
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.
In EBNF:
name = dataPointName | "/" path ;
path = segment "/" path | dataPointName ;
segment = string ;
dataPointName = string ;
string = (* character string excluding the character "/" *) ;
#### Attributes
- **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.
- **optional**: Boolean that indicates whether a *DataPoint* is optional or mandatory. Optional, the default is *false*.
- **writable** : Boolean value that indicates whether this *DataPoint* is writable by an application. Optional. Default: true.
- **readable** : Boolean value that indicates whether this *DataPoint* is readable by an application. Optional. Default: true.
- **eventable** : Boolean value that indicates whether an internal or external change of this *DataPoint* raises an event. Optional. Default: false.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *DataPoint*. Optional.
- **[DataType](#DataType)** : The type of the *DataPoint*. It must comply to the *DataType* definition. Required.
#### Example
<Data>
<DataPoint name="attributeName" writable="false">
<Doc>Some documentation for the DataPoint</Doc>
<DataType>
<SimpleType type="string" />
</DataType
</DataPoint>
</Data>
---
<a name="Action"/></a>
### Action : Element of *ModuleClass*
![](images/Action.png)
*Action* elements are an efficient way of describing arbitrary sequences of operations/methods; these are very common in automation. Typical example include "FactoryReset", and "AutoCalibrate". *Actions* preserve transaction integrity by putting together all the parameters ("args", see next section) with the method which checks and executes them, in one step.
Note that systems which rely on RESTful operations need to carry out such complex setup-parameters-then-do-action by first using (several) [DataPoint](#DataPoint) operations to "load" the parameters to the device and then do a [DataPoint](#DataPoint) operation to manipulate the "start operation NOW" action.
#### Attributes
- **name** : The name of the *Action*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
- **optional**: Boolean that indicates whether an *Action* is optional or mandatory. Optional, the default is *false*.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Action*. Optional.
- **[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.
- **Args** : Zero or more occurances of [argument](#Arg) definitions for an *Action*. Optional.
<a name="ActionExample"/></a>
#### Example
The following are two examples for actions implementing a getter and a setter for boolean values.
<Action name="get" type="boolean">
<Doc>Obtain the current associated state. Example of a getter.</Doc>
</Action>
<Action name="setTarget">
<Doc>Set the associated state to the specified value. Example of a setter.</Doc>
<Args>
<Arg name="value">
<Doc>The desired value of the associated state.</Doc>
<DataType>
<SimpleType type="boolean" />
</DataType>
</Arg>
</Args>
</Action>
---
<a name="Event"/></a>
### Event : Element of *ModuleClass*
![](images/Event.png)
*Event* elements are needed for automation protocols which "push" information, instead of relying on polling by the software application. A typical example would be a "SensorAlert" where a window sensor immediately transmits a change of its state from "closed" to "open", which could be used in a burglar alarm application, needs to be ready to accept such information immediately, and not wait for a regular polling of the device.
#### Attributes
- **name** : The name of the *Event*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
- **optional**: Boolean that indicates whether an *Event* is optional or mandatory. Optional, the default is *false*.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Event* Element. Optional.
- **[Data](#DataPoint)** : A list of *DataPoint* components for an event's payload. Optional.
#### Example
<Event name="stateChanged">
<Doc>Some documentation for the Event</Doc>
<Data>
<DataPoint name="state">
<DataType>
<SimpleType type="boolean" />
</DataType>
</DataPoint>
</Data>
</Event>
---
<a name="Arg"/></a>
### Arg : Element of *Action*
![](images/Arg.png)
The *Arg* element represents the parameter information which a device needs to carry out a required *Action*.
The *Arg* has the following attributes and elements:
#### Attributes
- **name** : The name of the *Arg* attribute. Required.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *argument*. Optional.
- **[DataType](#DataType)** : The return type of the *argument*. It must comply to the *DataType* definition. Required.
#### Example
See [example above](#ActionExample).
---
<a name="Data_Types"/></a>
### DataType
The data type can be simple integers or string text, or rather complex, as shown below:
![](images/SDT_UML_DataType.png)
The various elements are described in the sections below.
![](images/DataType.png)
The *DataType* element is a "container" for the various aspects of a type.
#### Attributes
- **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.
- **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.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *DataType* Element. Optional.
- **TypeChoice** : This element is actual an element from the following list of data types:
- **[SimpleType](#SimpleType)**
- **[Struct](#StructType)**
- **[Array](#ArrayType)**
- **[Constraint](#Constraint)** : A list of *Constraint* elements. Optional.
---
<a name="Constraint"/></a>
### Constraint : Element of DataType
![](images/Constraint.png)
The *Constraint* element is an optional element allowing the manufacturer to provide constraints on the permitted values of measured data or input parameters. It can significantly improve the reliability of software and validation of transmitted data.
#### Attributes
- **name** : The name or ID that identifies the *Constraint*. Required.
- **type** : The basic data type of the constraint. Note that this may be different from the type of the [DataType](#DataType) that this *Constraint* is assigned to. For example, a *Constraint* that specifies a maximum length of a string is of type *integer*. Optional.
- **value** : A pre-assigned value for the constraint, for example the maximum number of characters in a string. Optional.
#### Elements
- **[Doc](#Documentation)** : Documentation for the *Cosntraint* Element. Optional.
---
### TypeChoice : Construct of *DataType*
![](images/TypeChoice.png)
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.
---
<a name="SimpleType"/></a>
### SimpleType : Element of *TypeChoice*
![](images/SimpleType.png)
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:
1. the (technically redundant) options of *date* and *time* - to avoid problems which can arise interpreting a *datetime* value;
2. *url* because it is expected to become extremely common to provide links to other data sources;
3. the "blob" type to represent binary data of arbitrary structure.
If not stated otherwise datatypes should comply to the equivalent datatypes defined in [XML Schema Part 2: Datatypes Second Edition](http://www.w3.org/TR/xmlschema-2/#boolean):
- **boolean** : A boolean value as defined in [http://www.w3.org/TR/xmlschema-2/#boolean](http://www.w3.org/TR/xmlschema-2/#boolean) .
- **byte** : An integer datatype with the range of [0 - 255] as defined in [http://www.w3.org/TR/xmlschema-2/#unsignedByte](http://www.w3.org/TR/xmlschema-2/#unsignedByte) .
- **integer** : An integer value as defined in [http://www.w3.org/TR/xmlschema-2/#integer](http://www.w3.org/TR/xmlschema-2/#integer) .
- **float** : An IEEE single-precision 32-bit floating point type as defined in [http://www.w3.org/TR/xmlschema-2/#float](http://www.w3.org/TR/xmlschema-2/#float) .
- **string** : The string datatype represents character strings as defined in [http://www.w3.org/TR/xmlschema-2/#string](http://www.w3.org/TR/xmlschema-2/#string) .
- **enum** : A complete and orderd list of items in a collection. Items in an enumeration are separated by commas (, 0x2c) and must be of one of the datatypes defined here. Commas (, 0x2c) and backslashes (\ 0x5c) in enumaration items must be escaped by backslash.
- **date** : A date value as defined in [http://www.w3.org/TR/xmlschema-2/#date](http://www.w3.org/TR/xmlschema-2/#date) .
- **time** : A time value as defined in [http://www.w3.org/TR/xmlschema-2/#time](http://www.w3.org/TR/xmlschema-2/#time) .
- **datetime** : A time value as defined in [http://www.w3.org/TR/xmlschema-2/#dateTime](http://www.w3.org/TR/xmlschema-2/#dateTime) .
- **blob** : A blob value represents a binary object. The internal encoding is transparent and not defined here. The binary object must be encoded conforming to [http://www.w3.org/TR/xmlschema-2/#base64Binary](http://www.w3.org/TR/xmlschema-2/#base64Binary) .
- **uri** : A URI that represents a Uniform Resource Identifier Reference (URI) as defined by as defined in [RFC 2396](http://www.ietf.org/rfc/rfc2396.txt) and amended in [RFC 2732](http://www.ietf.org/rfc/rfc2732.txt) .
---
<a name="StructType"/></a>
### StructType : Element of *TypeChoice*
![](images/Struct.png)
The *StructType* element can be used to represent an ordered list of diverse DataTypes, which are represented by the *name* attribute of each [DataType](#DataType), and can be used recursively.
#### Elements
- **[DataType](#DataType)** : A list of DataTypes elements representing the elements of a structure.
---
<a name="ArrayType"/></a>
### ArrayType : Element of *TypeChoice*
![](images/Array.png)
The *ArrayType* element is provided for defining lists of data; the definition is recursive so that multi-dimensional arrays can be described. Note that a Constraint can be used to provide limits on Array size.
#### Elements
- **[DataType](#DataType)** : A single DataType element that specifies the data type for the elements of the array.
---
<a name="Documentation"/></a>
### Doc : Element for all Documentation
![](images/Doc.png)
*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).
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:
Doc = "<Doc>" docContent "</Doc" ;
docContent = docText | { paragraph | image } ;
docText = { text | emphasizedText | boldText | monotypeText } ;
emphasizedText = "<em>" text "</em>" ;
boldText = "<b>" text "</b>" ;
monotypeText = "<tt>" text "</tt>" ;
paragraph = "<p>" docText "</p>" ;
image = "<img src=" url ">" "<caption>" text "</caption>" "</img>" ;
url = "\"" (* valid URL *) "\"" ;
text = (* XML text element *) ;
The intended use for each element is:
- **emphasizedText** : Emphasize the included text, e.g. printing it in italics font.
- **boldText** : Print the included text in bold font.
- **monotypeText** : Print the included text in a monospaced fonttype, e.g. to emphasize source code.
- **paragraph** : Structure the text in paragraphs.
- **image** : Include an image in the text. The image is loaded from the specified URL and must include a caption text.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="13.3">
<help_text/>
<zoom_level>7</zoom_level>
<element>
<id>UMLNote</id>
<coordinates>
<x>21</x>
<y>427</y>
<w>217</w>
<h>182</h>
</coordinates>
<panel_attributes>bg=#FAF8C8
fontsize=12
/@ optional elementAttribute/
/@ optional elementAttribute = default value/
*@ mandatoryElementAttribute*
- mandatory element : Subclass (exact one)
/- optionalElement : SubClass (zero or one)/
/* optionalElement : SubClass (zero or many)/
"Depends" Relation
and Cardinality
Subclassing
Cardinalities:
0,1 : zero or one
1 : exact one
0..* : zero or many
1..* : at least one or many
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>105</x>
<y>497</y>
<w>77</w>
<h>28</h>
</coordinates>
<panel_attributes>lt=&lt;.
fontsize=10
m1=0..*
</panel_attributes>
<additional_attributes>90.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>105</x>
<y>525</y>
<w>77</w>
<h>21</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-
fontsize=10</panel_attributes>
<additional_attributes>90.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>651</x>
<y>770</y>
<w>105</w>
<h>154</h>
</coordinates>
<panel_attributes>&lt;&lt;enumeration&gt;&gt;
BasicType
--
boolean
byte
integer
float
string
enum
date
time
datetime
blob
uri</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>357</x>
<y>833</y>
<w>98</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.
m1= 0,1
</panel_attributes>
<additional_attributes>120.0;50.0;60.0;50.0;60.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>357</x>
<y>777</y>
<w>98</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.
m1= 0,1
</panel_attributes>
<additional_attributes>120.0;10.0;40.0;10.0;40.0;60.0;10.0;60.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>21</x>
<y>777</y>
<w>133</w>
<h>84</h>
</coordinates>
<panel_attributes>DataType
--
/@ name : text/
/@ unitOfMeasure : text/
/- Doc : Doc/
- TypeChoice
/* Constraints : Constraint/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>126</x>
<y>735</y>
<w>490</w>
<h>91</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.
m2=1..*
</panel_attributes>
<additional_attributes>10.0;60.0;10.0;20.0;680.0;20.0;680.0;100.0;640.0;100.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>126</x>
<y>735</y>
<w>490</w>
<h>133</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.
m2=1
</panel_attributes>
<additional_attributes>10.0;60.0;10.0;20.0;680.0;20.0;680.0;160.0;640.0;160.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>441</x>
<y>861</y>
<w>133</w>
<h>35</h>
</coordinates>
<panel_attributes>SimpleType
--
*@ type : BasicType*
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>567</x>
<y>875</y>
<w>98</w>
<h>35</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-
m1= 1
</panel_attributes>
<additional_attributes>120.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>441</x>
<y>917</y>
<w>133</w>
<h>70</h>
</coordinates>
<panel_attributes>Constraint
--
*@ name : text*
/@ type : BasicType/
/@ value : text/
/- Doc : Doc/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>147</x>
<y>847</y>
<w>308</w>
<h>98</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1=0..*
</panel_attributes>
<additional_attributes>420.0;110.0;340.0;110.0;340.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>567</x>
<y>917</y>
<w>147</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-
m1=1
</panel_attributes>
<additional_attributes>190.0;10.0;190.0;60.0;10.0;60.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>441</x>
<y>777</y>
<w>133</w>
<h>35</h>
</coordinates>
<panel_attributes>StructType
--
- DataType : DataType
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>441</x>
<y>819</y>
<w>133</w>
<h>35</h>
</coordinates>
<panel_attributes>ArrayType
--
- DataType : DataType
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>357</x>
<y>812</y>
<w>98</w>
<h>35</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.
m1= 0,1
</panel_attributes>
<additional_attributes>120.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>21</x>
<y>672</y>
<w>735</w>
<h>28</h>
</coordinates>
<panel_attributes>halign=center
SDT 3.0 - DataType
fontsize=24
bg=gray
lw=0.1</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>21</x>
<y>7</y>
<w>840</w>
<h>28</h>
</coordinates>
<panel_attributes>SDT 3.0 - Basic Elements
halign=center
fontsize=24
bg=gray
lw=0.1</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>259</x>
<y>126</y>
<w>154</w>
<h>133</h>
</coordinates>
<panel_attributes>ModuleClass
--
*@ name : text*
/@ optional : boolean = false/
/- Doc : Doc/
/- extends/
/ @domain : IDRF/
/ @class : text /
/* Properties : Property/
/* Actions : Action/
/* Data : DataPoint/
/* Events : Event/
fg=blue
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>497</x>
<y>126</y>
<w>154</w>
<h>77</h>
</coordinates>
<panel_attributes>Action
--
*@ name : text*
/@ optional : boolean = false/
/- Doc : Doc/
/- DataType : DataType/
/* Args : Arg/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>742</x>
<y>189</y>
<w>119</w>
<h>56</h>
</coordinates>
<panel_attributes>Arg
--
*@ name ; text*
/- Doc : Doc/
- DataType : DataType
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>644</x>
<y>189</y>
<w>112</w>
<h>28</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*</panel_attributes>
<additional_attributes>140.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>21</x>
<y>126</y>
<w>154</w>
<h>77</h>
</coordinates>
<panel_attributes>Domain
--
*@ id : ID*
/- Doc : Doc/
/* imports/
/* Modules : ModuleClass/
/* Devices : Device/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>126</y>
<w>105</w>
<h>63</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*</panel_attributes>
<additional_attributes>130.0;10.0;50.0;10.0;50.0;70.0;10.0;70.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>21</x>
<y>308</y>
<w>154</w>
<h>70</h>
</coordinates>
<panel_attributes>SubDevice
--
*@ id : Name*
/- Doc : Doc/
/* Properties : Property/
/* Modules : Module/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>182</y>
<w>49</w>
<h>63</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1=0..*
</panel_attributes>
<additional_attributes>10.0;60.0;50.0;60.0;50.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>315</y>
<w>105</w>
<h>49</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*</panel_attributes>
<additional_attributes>130.0;10.0;60.0;10.0;60.0;50.0;10.0;50.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>742</x>
<y>357</y>
<w>119</w>
<h>35</h>
</coordinates>
<panel_attributes>Doc
--
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>406</x>
<y>126</y>
<w>105</w>
<h>42</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*
</panel_attributes>
<additional_attributes>130.0;10.0;50.0;10.0;50.0;40.0;10.0;40.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>686</x>
<y>350</y>
<w>70</w>
<h>35</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1=0,1
</panel_attributes>
<additional_attributes>80.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>406</x>
<y>161</y>
<w>105</w>
<h>84</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*
</panel_attributes>
<additional_attributes>130.0;90.0;50.0;90.0;50.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>497</x>
<y>217</y>
<w>154</w>
<h>98</h>
</coordinates>
<panel_attributes>DataPoint
--
*@ name : text*
/@ optional : boolean = false/
/@ writable : boolean = true/
/@ readable : boolean = true/
/@ eventable : boolean = false/
/- Doc : Doc/
- DataType : DataType
fg=blue
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>497</x>
<y>329</y>
<w>154</w>
<h>63</h>
</coordinates>
<panel_attributes>Event
--
*@ name : text*
/@ optional : boolean = false/
/- Doc : Doc/
/* Data : DataPoint/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>406</x>
<y>231</y>
<w>105</w>
<h>126</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*
</panel_attributes>
<additional_attributes>130.0;150.0;80.0;150.0;80.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>259</x>
<y>280</y>
<w>154</w>
<h>21</h>
</coordinates>
<panel_attributes>Module
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>280</y>
<w>105</w>
<h>98</h>
</coordinates>
<panel_attributes>lt=&lt;.
</panel_attributes>
<additional_attributes>130.0;10.0;80.0;10.0;80.0;120.0;10.0;120.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>322</x>
<y>252</y>
<w>21</w>
<h>42</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-
</panel_attributes>
<additional_attributes>10.0;10.0;10.0;40.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>21</x>
<y>217</y>
<w>154</w>
<h>77</h>
</coordinates>
<panel_attributes>Device
--
*@ id : Name*
/- Doc : Doc/
/* Properties : Property/
/* Modules : Module/
/* SubDevices : SubDevice/
fg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>280</y>
<w>49</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1=0..*
</panel_attributes>
<additional_attributes>10.0;50.0;40.0;50.0;40.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>252</y>
<w>105</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1= 0..*
</panel_attributes>
<additional_attributes>130.0;50.0;80.0;50.0;80.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>168</x>
<y>266</y>
<w>105</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;.</panel_attributes>
<additional_attributes>130.0;80.0;60.0;80.0;60.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>259</x>
<y>315</y>
<w>154</w>
<h>77</h>
</coordinates>
<panel_attributes>Property
--
*@ name : text*
/@ optional : boolean = false/
/@ value : text/
/- Doc : Doc/
- DataType : SimpleType
fg=blue
transparency=80</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>644</x>
<y>217</y>
<w>56</w>
<h>147</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1=0..*
</panel_attributes>
<additional_attributes>10.0;10.0;60.0;10.0;60.0;190.0;10.0;190.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>406</x>
<y>245</y>
<w>49</w>
<h>98</h>
</coordinates>
<panel_attributes>lt=&lt;.
m1=0..*</panel_attributes>
<additional_attributes>10.0;110.0;50.0;110.0;50.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>231</x>
<y>777</y>
<w>133</w>
<h>70</h>
</coordinates>
<panel_attributes>&lt;&lt;enumeration&gt;&gt;
TypeChoice
--
SimpleType : SimpleType
Struct : StructType
Array : ArrayType
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>147</x>
<y>784</y>
<w>98</w>
<h>63</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-
m1= 1
</panel_attributes>
<additional_attributes>120.0;10.0;80.0;10.0;80.0;70.0;10.0;70.0</additional_attributes>
</element>
</diagram>
# UML Diagram of the SDT 4.0
The source for the diagrams below is [here](SDT_UML.uxf).
## Basic Elements
![](images/SDT_UML_Basic_Elements.png)
## Data Types
![](images/SDT_UML_DataType.png)
## Key
![](images/SDT_UML_Key.png)
SDT/schema4.0/docs/images/Action.png

4.93 KiB

SDT/schema4.0/docs/images/Arg.png

3.13 KiB

SDT/schema4.0/docs/images/Array.png

1.53 KiB

SDT/schema4.0/docs/images/Constraint.png

4.44 KiB

SDT/schema4.0/docs/images/DataPoint.png

6.48 KiB

SDT/schema4.0/docs/images/DataType.png

5.43 KiB

SDT/schema4.0/docs/images/Device.png

4.81 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment