...
 
Commits (130)
.DS_Store
/.project
.*.html
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SDT</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
This diff is collapsed.
# Smart Device Template
Repository for the Smart Device Template (SDT).
Repository and documentation 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)
The Smart Device Template is available 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 the Smart Device Template format must comply with the aforementioned license. Models defined by using the Smart Device Template can be published under different licenses.
## Quick Introduction
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.
![](SDT/schema4.0/docs/images/SDT_simplified.png)
[Read the full Introduction.](SDT/schema3.0/docs/Introduction.md)
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/schema4.0/docs/Introduction.md)
## Quick Links
- ['domain.xsd' Version 3.0](SDT/schema3.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) ([Umlet source](SDT/schema4.0/docs/SDT_UML.uxf)) : This UML diagram describes the various components of the SDT and their relations.
- ['domain.xsd' Version 4.0](SDT/schema4.0/src/domain.xsd) : This is the XSD schema file that defines the SDT XML Schema.
## Content
## Documentation
You can find further Information here:
- [Introduction to the SDT](SDT/schema3.0/docs/Introduction.md)
- [SDT Components](SDT/schema3.0/docs/SDT_Components.md)
- [SDT Build System](SDT/schema3.0/docs/SDT%20Build%20System.md)
- [Examples](SDT/schema3.0/docs/Examples.md)
- [Links & References](SDT/schema3.0/docs/Links.md)
- [Changelog](SDT/schema3.0/docs/Changelog.md)
- [Introduction to the SDT](SDT/schema4.0/docs/Introduction.md)
- [SDT Components](SDT/schema4.0/docs/SDT_Components.md)
- [JSON Serialization](SDT/schema4.0/docs/SDT_JSON.md)
- [Examples](SDT/schema4.0/docs/Examples.md)
- [SDT Build System](SDT/schema4.0/docs/SDT%20Build%20System.md)
## Further Readings
- [Links & References](SDT/schema4.0/docs/Links.md)
- [FAQ](SDT/schema4.0/docs/FAQ.md)
- [Changelog](SDT/schema4.0/docs/Changelog.md)
- [SDT Build System Components and Licenses](SDT/schema4.0/docs/SDT%20Build%20System%20Components%20and%20Licenses.md)
- [LICENSE](LICENSE)
......@@ -185,7 +185,7 @@ The advantage of identifying a subset of generic *ModuleClasses*, described belo
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.
The relationship between a *ModuleClass* and a *Module* is very similar to the specification of a superclass and a class in an object oriented programming language.
**ModuleClass**
......
<?xml version="1.0" encoding="UTF-8" ?>
<!-- SDT - Smart Device Template Build File -->
<!-- -->
<!-- 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://www.onem2m.org/xml/sdt/4.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>
/.Introduction.md.html
/.SDT_Components.md.html
/.SDT_JSON.md.html
# Changelog
## Changes in 4.0
- Renamed ``<Device>`` to ``<DeviceClass``>.
- Removed ``<Module>`` to simplify the SDT model.
- Introduced ``<ProductClass`` for concrete model definition of real products.
- Introduced complex ``<EnumType>`` data type. Removed ``enum`` data type from ``BasicTypes``.
- Added ``void`` from ``BasicTypes``.
- Introduced inheritance / extending of ``<DataType>``.
- Added support for defining ``<DataType>`` on ``<Domain>`` level.
- Changed ``<Extend>`` mechanism. Now one can explicitly include or exclude certain sub-components from the parent.
- Added support of ``semanticURL`` attribute for all components.
- Added ``optional`` attribute to ``<Arg>``.
- Added ``default`` attribute to ``<Arg>``.
- Added ``default`` attribute to ``<DataPoint``.
- Unified all component identifiers, names etc to XSD type ``name``.
- Introduced JSON serialization guidelines.
- Changed case of ``<Imports>`` element.
- Added more test cases and example templates to the [test](../test) directory.
- Changed the license to [3-Clause BSD License](https://opensource.org/licenses/BSD-3-Clause).
## 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
This diff is collapsed.
# Frequently Asked Questions
1. [General](#general)
1. [What is the SDT?](#WhatistheSDT)
2. [What is oneM2M?](#echonetExampleMC)
2. [Working with the SDT](#working)
1. [What is the SDT?](#build)
2. [How to validate own templates](#validate)
3. [Are there tools to work with the SDT?](#tools)
<a name="general"></a>
## General
<a name="WhatistheSDT"></a>
### What is the SDT?
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.
<a name="WhatisoneM2M"></a>
### What is oneM2M?
oneM2M is a global organization that creates requirements, architecture, API specifications, security solutions and interoperability for Machine-to-Machine and IoT technologies.
The purpose and goal of oneM2M is to develop technical specifications which address the need for a common M2M Service Layer that can be readily embedded within various hardware and software, and relied upon to connect the myriad of devices in the field with M2M application servers worldwide. A critical objective of oneM2M is to attract and actively involve organizations from M2M-related business domains such as: telematics and intelligent transportation, healthcare, utilities, industrial automation, smart homes, etc. Initially, oneM2M shall prepare, approve and maintain the necessary set of Technical Specifications and Technical Reports for:
- Use cases and requirements for a common set of Service Layer capabilities;
Service Layer aspects with high level and detailed service architecture, in light of an access independent view of end-to-end services;
- Protocols/APIs/standard objects based on this architecture (open interfaces & protocols);
- Security and privacy aspects (authentication, encryption, integrity verification);
- Reachability and discovery of applications;
- Interoperability, including test and conformance specifications;
- Collection of data for charging records (to be used for billing and statistical purposes);
- Identification and naming of devices and applications;
- Information models and data management (including store and subscribe/notify functionality);
- Management aspects (including remote management of entities); and
- Common use cases, terminal/module aspects, including Service Layer interfaces/APIs between:
- Application and Service Layers;
- Service Layer and communication functions
[http://www.onem2m.org](http://www.onem2m.org)
<a name="working"></a>
## Working with the SDT
<a name="working"></a>
### How to build the SDT
Please follow the instructions for the [SDT Build System](SDT/schema4.0/docs/SDT%20Build%20System.md).
In short:
- In a terminal, go to the directoy *SDT/schema4.0*
- Run the command:
```sh
$ ant
```
<a name="validate"></a>
### How to validate own templates
Please follow the instructions for the [SDT Build System](SDT/schema4.0/docs/SDT%20Build%20System.md).
In short:
- Copy your template to the directory *SDT/schema4.0/test*
- In a terminal, go to the directoy *SDT/schema4.0*
- Run the command:
```sh
$ ant validate
```
<a name="tools"></a>
### Are there tools to work with the SDT?
You can use the SDTTool to read and convert templates in SDT format to various output formats, e.g. XSD, SVG, markdown, Java code, etc.
[https://github.com/Homegateway/SDTTool](https://github.com/Homegateway/SDTTool)
This diff is collapsed.
# Links & References
## Smart Device Template
- **SDT Repository** : [https://git.onem2m.org/MAS/SDT](https://git.onem2m.org/MAS/SDT)
## Further Information
- **TR-0039 Introduction to IPE and SDT** : [http://www.onem2m.org/tr-0039/ipe-and-sdt](http://www.onem2m.org/tr-0039/ipe-and-sdt)
- **The oneM2M Smart Device Template (SDT)** (BrightTALK) : [https://www.brighttalk.com/webcast/11949/340004/the-onem2m-smart-device-template-sdt](https://www.brighttalk.com/webcast/11949/340004/the-onem2m-smart-device-template-sdt)
## Organisations
- **oneM2M** : [http://www.onem2m.org](http://www.onem2m.org)
- **HGI** : [http://www.homegatewayinitiative.org](http://www.homegatewayinitiative.org)
## Tools
- **SDTTool** : [https://github.com/Homegateway/SDTTool](https://github.com/Homegateway/SDTTool)
SDTTool is a utility to read and convert SDT definitions.
- **RELAX NG** : [http://relaxng.org](http://relaxng.org)
- **RELAX NG Tutorial** : [http://relaxng.org/tutorial-20011203.html](http://relaxng.org/tutorial-20011203.html)
- **UMLet** : [http://www.umlet.com](http://www.umlet.com)
A free UML drawing tool used to draw the UML file.
- **Apache Ant** : [http://ant.apache.org](http://ant.apache.org)
Build tool
# SDT Build System Components and Licenses
The following third-party libraries and components are used in the build system for the Smart Device Template.
## Table of Contents
1. [trang.jar](#trang)
2. [Ant-Contrib Tasks](#antcontrib)
3. [antSetLogLevel.JAR](#antSetLogLevel)
<a name="trang"/></a>
## trang.jar
[https://relaxng.org/jclark/trang.html](https://relaxng.org/jclark/trang.html)
[https://github.com/relaxng/jing-trang](https://github.com/relaxng/jing-trang)
*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.
<a name="antcontrib"/></a>
## 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.
<a name="antSetLogLevel"/></a>
## 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 templates and contributions.
The files referenced in this document point to version **4.0** of the SDT.
## Table of Contents
1. [Directory Structure and Important Files](#Structure)
2. [Installation](#Installation)
3. [Building](#Building)
1. [Building the Schema](#BuildingSchema)
2. [Validating SDT Templates](#BuildingValidate)
4. [Editing the Schema](#Editing)
<a name="Structure"/></a>
## 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 you want to make changes to the SDT!** See also [Editing the Schema](#Editing) below.
- [domain.xsd](../src/domain.xsd) : The actual 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 XML files with SDT definitions that should be validated whether they conform to the SDT schema.
This could be example definitions or new templates and contributions. If you want to validate your newly created template put it into this directory and follow the steps descripted in [Validating SDT Templates](#BuildingValidate) below.
- [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 changes to these files.
- [SDT/schema4.0/etc/](../etc), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Only the following files should be changed if necessray. See the section [Editing the Schema](#Editing) below.
- [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.
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml) : This file contains the header for the schema file.
- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns) : This file defines the target namespace for the schema.
- [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).
<a name="Installation"/></a>
## Installation
### Prerequisites
- Java
- Ant (at least version 1.8). See [http://ant.apache.org](http://ant.apache.org).
### Installing SDT
- Clone the SDT repository from oneM2M's GitLab:
$ git clone https://git.onem2m.org/MAS/SDT.git
<a name="Building"/></a>
## How to Use the Build System
After cloning the repository go to the directory *SDT/schema4.0* and run commands depending on what you want to achieve.
<a name="BuildingSchema"/></a>
### Building 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/schema4.0
$ ant
<a name="BuildingValidate"/></a>
### Validating SDT Templates
You can use the build system to validate new SDT definitions or changes made to existing ones by running the following command:
$ cd SDT/schema4.0
$ ant validate
The output after a successful validation should look similar 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
<a name="Editing"/></a>
## Editing the Schema
As mentioned above, the actual schema definition is defined in the file [src/domain.rng](../src/domain.rng) and converted to the XML schema definition [src/domain.xsd](../src/domain.xsd) during the build process.
**All changes to the schema must only be made to [src/domain.rng](../src/domain.rng), NOT [src/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 EDIT THESE FILES ONLY IF NECESSARY.
- [SDT/schema4.0/build.xml](../build.xml)
e.g. change the *ant* target "validate" when you want to set another directory for the files for validation.
- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc)
The important parameter to update when changing the namespace or the version number is:
default namespace xsl = "http://www.onem2m.org/xml/sdt/4.0"
- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns)
This file must be updated when changing the namespace or the version number:
targetNamespace="http://www.onem2m.org/xml/sdt/4.0"
xmlns="http://www.onem2m.org/xml/sdt/4.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml)
Upate the namespace when changing the namespace or the version number:
<namespace ns="http://www.onem2m.org/xml/sdt/4.0" typeId="DAL"/>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# UML Diagram of the SDT 4.0
The source for the diagrams below can be found [here (SDT_UML.uxf)](SDT_UML.uxf).
## Key
![](images/SDT_UML_Key.png)
## Basic Elements
![](images/SDT_UML_Basic_Elements.png)
## Data Types
![](images/SDT_UML_DataType.png)
## Extend
![](images/SDT_UML_Extend.png)
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xi="http://www.w3.org/2001/XInclude"
targetNamespace="http://www.w3.org/2001/XInclude"
finalDefault="extension">
<xs:annotation>
<xs:documentation>
Not normative, but may be useful.
See the REC http://www.w3.org/TR/XInclude for definitive
information about this namespace.
</xs:documentation>
</xs:annotation>
<xs:element name="include" type="xi:includeType" />
<xs:complexType name="includeType" mixed="true">
<xs:choice minOccurs='0' maxOccurs='unbounded' >
<xs:element ref='xi:fallback' />
<xs:any namespace='##other' processContents='lax' />
<xs:any namespace='##local' processContents='lax' />
</xs:choice>
<xs:attribute name="href" use="optional" type="xs:anyURI"/>
<xs:attribute name="parse" use="optional" default="xml"
type="xi:parseType" />
<xs:attribute name="xpointer" use="optional" type="xs:string"/>
<xs:attribute name="encoding" use="optional" type="xs:string"/>
<xs:attribute name="accept" use="optional" type="xs:string"/>
<xs:attribute name="accept-language" use="optional" type="xs:string"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:simpleType name="parseType">
<xs:restriction base="xs:token">
<xs:enumeration value="xml"/>
<xs:enumeration value="text"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="fallback" type="xi:fallbackType" />
<xs:complexType name="fallbackType" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="xi:include"/>
<xs:any namespace="##other" processContents="lax"/>
<xs:any namespace="##local" processContents="lax"/>
</xs:choice>
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>
</xs:schema>
<?xml version='1.0'?>
<!-- XML Schema schema for XML Schemas: Part 2: Datatypes -->
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
<!ENTITY % s ''>
<!ENTITY % p ''>
]>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema-datatypes"
version="$Id: XMLSchema-datatypes.xsd,v 1.5 2001/03/16 20:53:32 ht Exp $">
<annotation>
<documentation>Note this schema is NOT a normative schema - -
It contains types derived from all the builtin simple type definitions
with the same local name but in a distinct namespace, for use
by applications which do no wish to import the full XMLSchema
schema. Since derivation is not symmetric, unexpected results may
follow from mixing references to these definitions with references
to the definitions in the XMLSchema namespace. For example,
although dt:positiveInteger is derived from xs:integer, the converse
does not hold.</documentation>
</annotation>
<simpleType name="string">
<restriction base="string"/>
</simpleType>
<simpleType name="boolean">
<restriction base="boolean"/>
</simpleType>
<simpleType name="float">
<restriction base="float"/>
</simpleType>
<simpleType name="double">
<restriction base="double"/>
</simpleType>
<simpleType name="decimal">
<restriction base="decimal"/>
</simpleType>
<simpleType name="dateTime">
<restriction base="dateTime"/>
</simpleType>
<simpleType name="duration">
<restriction base="duration"/>
</simpleType>
<simpleType name="hexBinary">
<restriction base="hexBinary"/>
</simpleType>
<simpleType name="base64Binary">
<restriction base="base64Binary"/>
</simpleType>
<simpleType name="anyURI">
<restriction base="anyURI"/>
</simpleType>
<simpleType name="ID">
<restriction base="ID"/>
</simpleType>
<simpleType name="IDREF">
<restriction base="IDREF"/>
</simpleType>
<simpleType name="ENTITY">
<restriction base="ENTITY"/>
</simpleType>
<simpleType name="NOTATION">
<restriction base="NOTATION"/>
</simpleType>
<simpleType name="normalizedString">
<restriction base="normalizedString"/>
</simpleType>
<simpleType name="token">
<restriction base="token"/>
</simpleType>
<simpleType name="language">
<restriction base="language"/>
</simpleType>
<simpleType name="IDREFS">
<restriction base="IDREFS"/>
</simpleType>
<simpleType name="ENTITIES">
<restriction base="ENTITIES"/>
</simpleType>
<simpleType name="NMTOKEN">
<restriction base="NMTOKEN"/>
</simpleType>
<simpleType name="NMTOKENS">
<restriction base="NMTOKENS"/>
</simpleType>
<simpleType name="Name">
<restriction base="Name"/>
</simpleType>
<simpleType name="QName">
<restriction base="QName"/>
</simpleType>
<simpleType name="NCName">
<restriction base="NCName"/>
</simpleType>
<simpleType name="integer">
<restriction base="integer"/>
</simpleType>
<simpleType name="nonNegativeInteger">
<restriction base="nonNegativeInteger"/>
</simpleType>
<simpleType name="positiveInteger">
<restriction base="positiveInteger"/>
</simpleType>
<simpleType name="nonPositiveInteger">
<restriction base="nonPositiveInteger"/>
</simpleType>
<simpleType name="negativeInteger">
<restriction base="negativeInteger"/>
</simpleType>
<simpleType name="byte">
<restriction base="byte"/>
</simpleType>
<simpleType name="int">
<restriction base="int"/>
</simpleType>
<simpleType name="long">
<restriction base="long"/>
</simpleType>
<simpleType name="short">
<restriction base="short"/>
</simpleType>
<simpleType name="unsignedByte">
<restriction base="unsignedByte"/>
</simpleType>
<simpleType name="unsignedInt">
<restriction base="unsignedInt"/>
</simpleType>
<simpleType name="unsignedLong">
<restriction base="unsignedLong"/>
</simpleType>
<simpleType name="unsignedShort">
<restriction base="unsignedShort"/>
</simpleType>
<simpleType name="date">
<restriction base="date"/>
</simpleType>
<simpleType name="time">
<restriction base="time"/>
</simpleType>
<simpleType name="gYearMonth">
<restriction base="gYearMonth"/>
</simpleType>
<simpleType name="gYear">
<restriction base="gYear"/>
</simpleType>
<simpleType name="gMonthDay">
<restriction base="gMonthDay"/>
</simpleType>
<simpleType name="gDay">
<restriction base="gDay"/>
</simpleType>
<simpleType name="gMonth">
<restriction base="gMonth"/>
</simpleType>
</schema>
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?>
<project name="anttasks" default="build">
<!-- ant-contribs -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${path.libs}/ant/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- Set the log level -->
<taskdef name="setloglevel"
classname="de.berkom.ehome.tools.ant.setloglevel.SetLogLevel"
classpath="${path.libs}/ant/antSetLogLevel.jar"/>
</project>
<?xml version="1.0" encoding="UTF-8" ?>
<project name="imported" default="build">
<!-- TODOs
* genjar integration
* if no manifest is available include a defalt one from etc?
-->
<property name="path.libs" location="${basedir}/lib" />
<!-- Load various tasks -->
<import file="anttasks.xml" />
<!-- Unset the _mainbuild property -->
<var name="_mainbuild" unset="true" />
<!-- Load the properties -->
<import file="properties.xml" />
<!-- Load all the actual tasks -->
<import file="tasks/all.xml" />
<import file="tasks/allforced.xml" />
<import file="tasks/build.xml" />
<import file="tasks/buildjar.xml" />
<import file="tasks/clean.xml" />
<import file="tasks/collect.xml" />
<import file="tasks/compile.xml" />
<import file="tasks/compilenative.xml" />
<import file="tasks/doc.xml" />
<import file="tasks/eclipse.xml" />
<import file="tasks/_addPrivateLibs.xml" />
<import file="tasks/_buildNative.xml" />
<import file="tasks/_checkDependentProjects.xml" />
<import file="tasks/_cleanDependentProjects.xml" />
<import file="tasks/_getBuildNumber.xml" />
<import file="tasks/_handleProjectProperties.xml" />
<import file="tasks/_includeExternalResourcesInJar.xml" />
<!-- <import file="tasks/_importManifest.xml" /> -->
<import file="tasks/_prepare.xml" />
<import file="tasks/_preparebuild.xml" />
<import file="tasks/_setClassPath.xml" />
</project>
namespace local = ""
default namespace xsl = "http://www.onem2m.org/xml/sdt/4.0"
namespace xi = "http://www.w3.org/2001/XInclude"
version = "1.0"
include "domain.rnc"
xinclude = element xi:include {
attribute href { xsd:anyURI },
attribute parse { text }
}
Imports = element Imports { xinclude* }?
# Default Properties for the Ant make system
#
#
# Default libraries.
# Update accordingly if another library becomes the system's default library
#
default.lib.cdc.foundation.1.1=cdc/foundation/1.1/classes.zip
default.lib.osgi.core.2.0=osgi/framework/2.0/osgi.jar
default.lib.osgi.cmpn.2.0=osgi/framework/2.0/osgi.jar
default.lib.osgi.core.3.0=osgi/framework/3.0/osgi.jar
default.lib.osgi.cmpn.3.0=osgi/framework/3.0/osgi.jar
default.lib.osgi.core.4.0=osgi/core/4.0/osgi.core.jar
default.lib.osgi.core.4.1=osgi/core/4.1/osgi.core.jar
default.lib.osgi.core.4.2=osgi/core/4.2/osgi.core.jar
default.lib.osgi.core=osgi/core/4.2/osgi.core.jar
default.lib.osgi.cmpn.4.0=osgi/cmpn/4.0/osgi.compendium.jar
default.lib.osgi.cmpn.4.1=osgi/cmpn/4.1/osgi.cmpn.jar
default.lib.osgi.cmpn.4.2=osgi/cmpn/4.2/osgi.cmpn.jar
default.lib.osgi.cmpn=osgi/cmpn/4.2/osgi.cmpn.jar
default.lib.osgi.dmt.1.0=osgi/info/1.0/dmt.jar
default.lib.osgi.dmt.2.0=osgi/info/2.0/org.osgi.impl.service.dmt.jar
default.lib.osgi.dmt=osgi/info/2.0/org.osgi.impl.service.dmt.jar
default.lib.mail.1.4.prosyst=javax/mail/1.4-prosyst/mail.jar
default.lib.mail=javax/mail/1.4-prosyst/mail.jar
default.lib.activation.1.1.prosyst=javax/activation/1.1-prosyst/activation.jar
default.lib.activation=javax/activation/1.1-prosyst/activation.jar
default.lib.j2ee.1.3.1=javax/j2ee/1.3.1/j2ee.jar
default.lib.j2ee=javax/j2ee/1.3.1/j2ee.jar
# - Servlet APIs ---------------------------------------------------------------
#
# With the addition of the SIP-Servlet API, and it's dependency on newer
# version of the Servlet API, I thought names matching the Sun package
# structure would be clearer. Kept the old definition as well.
default.lib.servlet.2.3.1=javax/servlet/2.3.1/servlet.jar
default.lib.servlet=javax/servlet/2.3.1/servlet.jar
default.lib.javax.servlet.2.3.1=javax/servlet/2.3.1/servlet.jar
default.lib.javax.servlet.2.4=javax/servlet/2.4/servlet.jar
default.lib.javax.servlet.2.5=javax/servlet/2.5/servlet.jar
default.lib.javax.servlet.3.0.1=javax/servlet/3.0.1/servlet.jar
default.lib.javax.servlet=javax/servlet/2.3.1/servlet.jar
default.lib.javax.sip.servlet.1.1=javax/servlet/sip/1.1/sip-servlet.jar
default.lib.javax.sip.servlet=javax/servlet/sip/1.1/sip-servlet.jar
# ------------------------------------------------------------------------------
default.lib.log4j=apache/log4j/1.2.4/log4j-1.2.4.jar
default.lib.jgraph=jgraph/5.12.0.4/jgraph.jar
default.lib.thinlet.20031012=thinlet/20031012/thinlet.jar
default.lib.thinlet.20050328=thinlet/20050328/thinlet.jar
default.lib.thinlet.20070222=thinlet/20070222/thinlet.jar
default.lib.thinlet=thinlet/20070222/thinlet.jar
default.lib.id3tag=id3tag/id3t.jar
default.lib.xmlrpc=prosyst/xmlrpc/xmlrpc.jar
# - CDC/Foundation Extensions -------------------------------------------------
default.lib.cdc.foundationx.j9jsse=cdc/foundationx/j9jsse/2.4/j9jsse.jar
# -----------------------------------------------------------------------------
# Note: We should not require dependencies on the ProSyst HTTPS Handler!
default.lib.httpshdlr=prosyst/httpshdlr.jar
default.lib.ksoap2=ksoap2/ksoap2-j2se-full-2.1.0.jar
default.lib.kxml=ksoap2/kxml2-2.3.0.jar
# -----------------------------------------------------------------------------
default.lib.xmlrpc=xmlrpc/xmlrpc-1.1.1.jar
# -----------------------------------------------------------------------------
#
# Default version number
# (I'm wondering whether anybody will set this in his build properties)
#
version=1.0.0
#
# The default Manifest file.
# This might change if we adopt the bnd tool
#
manifest=etc/Manifest.mf
#
# Add a build number to the resulting jar file.
# The file "build.number" in the root directory of each project contains the latest build number.
# Default: The value "none" means that no build number is appended.
#
buildnumber=none
#
# Set the loglevel.
# Possible loglevel: debug,verbose,info (the ant default), warning, error
# Default is warning, which is rather quiet.
#
loglevel=warning
#
# Enable lint (all recommend warnings)
# Possible values: true, false
# Default: false
#
uselint=false
# - domain.rng
# -
# - Version 4.0
# -
# - This work is released by the MAS Working Group of oneM2M, December 2018.
# - The work is created and released under the 3-Clause BSD License.
# - See the license text at [https://opensource.org/licenses/BSD-3-Clause for
# - full details.
start = Domain
Domain =
element Domain {
attribute xml:base { xsd:anyURI }?,
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
element Imports { Domain+ }?,
element DataTypes { DataTypeDef+ }?,
ModuleClassesDef?,
DeviceClassesDef?,
ProductClassesDef?
}
PropertiesDef =
element Properties {
element Property {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute value { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
SimpleType
}+
}
DataTypeDef =
element DataType {
attribute name { xsd:Name }?,
attribute unitOfMeasure { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
(ExtendDef? | (StructType | ArrayType | SimpleType | EnumType)),
ConstraintsDef?
}
StructType = element Struct { DataTypeDef+ }
ArrayType = element Array { DataTypeDef }
SimpleType =
element SimpleType {
attribute type { BasicType }
}
EnumType = element Enum { EnumValueDef+ }
BasicType =
"integer"
| "boolean"
| "string"
| "byte"
| "float"
| "array"
| "date"
| "time"
| "datetime"
| "blob"
| "uri"
| "void"
EnumValueDef =
element EnumValue {
attribute name { xsd:Name },
attribute value { text },
attribute type { BasicType }?,
attribute semanticURI { xsd:anyURI }?,
DocDef
}
ConstraintsDef =
element Constraints {
element Constraint {
attribute name { xsd:Name },
attribute type { BasicType }?,
attribute value { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef
}+
}
DocText =
(text
| element em { text }
| element b { text }
| element tt { text })*
# <Doc> element is always optional
DocDef =
element Doc {
DocText
| (element p { DocText }
| element img {
attribute src { text },
element caption { text }
})*
}?
DeviceClassesDef =
element DeviceClasses {
element DeviceClass {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClassesDef?,
SubDevicesRef?
}+
}
SubDevicesRef =
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
attribute minOccurs { text }?,
attribute maxOccurs { text }?,
DocDef,
PropertiesDef?,
ModuleClassesDef?
}+
}
ModuleClassesDef =
element ModuleClasses {
element ModuleClass {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
attribute minOccurs { text }?,
attribute maxOccurs { text }?,
DocDef,
ExtendDef?,
PropertiesDef?,
Actions?,
Data?,
Events?
}+
}
ProductClassesDef =
element ProductClasses {
element ProductClass {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
ExtendDef?,
PropertiesDef?,
ModuleClassesDef?,
SubDevicesRef?,
element ExtendDevice { ExtendDef }?
}+
}
Actions =
element Actions {
element Action {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef?,
ArgDef?
}+
}
ArgDef =
element Args {
element Arg {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute default { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef
}+
}
Data =
element Data {
element DataPoint {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute writable { xsd:boolean }?,
attribute readable { xsd:boolean }?,
attribute eventable { xsd:boolean }?,
attribute default { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef
}+
}
Events =
element Events {
element Event {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
Data?
}+
}
ExtendDef = element Extend { ExtendBodyDef }
ExtendBodyDef =
attribute domain { xsd:Name },
attribute entity { xsd:Name },
(element Exclude {
attribute name { xsd:Name },
attribute type { ExtendType }
}+
| element Include {
attribute name { xsd:Name },
attribute type { ExtendType }
}+)?
ExtendType =
"action"
| "datapoint"
| "event"
| "moduleclass"
| "property"
| "device"
| "subdevice"
<?xml version="1.0" encoding="UTF-8" ?>
<project name="properties" default="build">
<!-- Set the default project name to the name of the directory -->
<propertyregex override="yes"
property="projectname"
input="${basedir}"
regexp=".*[/\\]([^/\\]*)"
select="\1" />
<!-- A couple of constants -->
<property name="path.base" location="${basedir}" />
<property name="path.libs" location="${path.base}/libs" />
<property name="path.etc" location="${path.base}/etc" />
<property name="path.genbase" location="${path.base}/gen" />
<property name="path.gen" location="${path.genbase}/projects/${projectname}" />
<property name="path.gen.classes" location="${path.gen}/classes" />
<property name="path.gen.etc" location="${path.gen}/etc" />
<property name="path.gen.docbase" location="${path.genbase}/docs" />
<property name="path.gen.documentation" location="${path.gen.docbase}/${projectname}" />
<property name="path.gen.collection" location="${path.genbase}/collection" />
<property name="path.gen.domain" location="${path.genbase}/domains" />
<property name="path.src" location="${basedir}/src" />
<property name="path.resources" location="${basedir}/resources" />
<property name="path.native" location="${basedir}/native" />
<property name="path.gen.native" location="${path.gen}/native" />
<property name="path.gen.classpathfile" location="${path.gen.etc}/_classpath" />
<property name="path.gen.includecmdfile" location="${path.gen.etc}/_jarinclude.xml" />
<property name="path.gen.importmanifestcmdfile" location="${path.gen.etc}/_manifestimport.xml" />
<property name="path.etc.localfile" location="${path.base}/etc/local.xml" />
<property name="path.eclipse.classpathfile" location="${basedir}/.classpath" />
<property name="path.eclipse.projectfile" location="${basedir}/.project" />
<property name="path.eclipse.settingsdir" location="${basedir}/.settings" />
<property name="path.eclipse.settingsfile" location="${path.eclipse.settingsdir}/org.eclipse.jdt.core.prefs" />
<!-- The following tasks only need to be executed when this file is not included from the main build file -->
<if><not>
<isset property="_mainbuild" />
</not>
<then>
<!-- Unset the java.target and java.source properties -->
<var name="java.target" unset="true" />
<var name="java.source" unset="true" />
<!-- Load project specific properties from local properties file -->
<loadproperties srcFile="properties" />
<!-- Load project specific properties from local properties file -->
<loadproperties srcFile="etc/default.properties" />
<!-- Set the start loglevel -->
<setloglevel level="${loglevel}" />
</then>
</if>
<!-- Define the path to additional Java jar files for the scriptdef and similar tasks -->
<path id="antscripting">
<fileset dir="${path.libs}/ant/scripting" includes="*.jar" />
</path>
<!-- set the default Java source and target formats to the local versions -->
<if><not>
<isset property="java.source" />
</not>
<then>
<var name="java.source" value="${ant.java.version}" />
</then>
</if>
<if><not>
<isset property="java.target" />
</not>
<then>
<var name="java.target" value="${ant.java.version}" />
</then>
</if>
<!-- load local properties, if the file exists -->
<available property="available.local" file="${path.etc.localfile}"/>
<if><isset property="available.local" />
<then>
<import file="${path.etc.localfile}" />
</then>
</if>
</project>
targetNamespace="http://www.onem2m.org/xml/sdt/4.0"
xmlns="http://www.onem2m.org/xml/sdt/4.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
<namespace ns="http://www.onem2m.org/xml/sdt/4.0" typeId="DAL"/>
<namespace ns="http://www.w3.org/2001/XInclude" typeId="XINC"/>