Commit 8ac28e39 authored by ankraft's avatar ankraft

Merge branch 'WI-0081-Smart_Device_Template_4_0' into RDM-2019-0065-SDT_4_0_-_Documentation_changes

# Conflicts:
#	SDT/schema4.0/docs/SDT_UML.uxf
#	SDT/schema4.0/docs/images/SDT_UML_Basic_Elements.png
parents 7ff61ade 24da6924
......@@ -92,7 +92,7 @@
<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"
<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" />
......
This diff is collapsed.
namespace local = ""
default namespace xsl = "http://homegatewayinitiative.org/xml/dal/3.0"
default namespace xsl = "http://www.onem2m.org/xml/sdt/4.0"
namespace xi = "http://www.w3.org/2001/XInclude"
version = "1.0"
......
......@@ -11,45 +11,33 @@ start = Domain
Domain =
element Domain {
attribute xml:base { xsd:anyURI }?,
attribute id { xsd:ID },
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
element Imports { Domain+ }?,
element Modules {
element ModuleClass { ModuleDef }+
}?,
element Devices {
element Device {
attribute id { xsd:Name },
DocDef,
PropertiesDef?,
Modules?,
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
DocDef,
PropertiesDef?,
Modules?
}+
}?
}+
}?
element DataTypes { DataTypeDef+ }?,
ModuleClassesDef?,
DeviceClassesDef?,
ProductClassesDef?
}
PropertiesDef =
element Properties {
element Property {
attribute name { text },
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute value { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
SimpleType
}+
}
DataTypeDef =
element DataType {
attribute name { text }?,
attribute name { xsd:Name }?,
attribute unitOfMeasure { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
(StructType | ArrayType | SimpleType),
(ExtendDef? | (StructType | ArrayType | SimpleType | EnumType)),
ConstraintsDef?
}
StructType = element Struct { DataTypeDef+ }
......@@ -58,6 +46,7 @@ SimpleType =
element SimpleType {
attribute type { BasicType }
}
EnumType = element Enum { EnumValueDef+ }
BasicType =
"integer"
| "boolean"
......@@ -65,18 +54,27 @@ BasicType =
| "byte"
| "float"
| "array"
| "enum"
| "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 { text },
attribute name { xsd:Name },
attribute type { BasicType }?,
attribute value { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef
}+
}
......@@ -95,27 +93,60 @@ DocDef =
element caption { text }
})*
}?
ModuleDef =
attribute name { text },
attribute optional { xsd:boolean }?,
element extends {
attribute domain { xsd:IDREF },
attribute class { text }
}?,
DocDef,
PropertiesDef?,
Actions?,
Data?,
Events?
Modules =
element Modules {
element Module { ModuleDef }+
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 }?,
DocDef,
PropertiesDef?,
ModuleClassesDef?
}+
}
ModuleClassesDef =
element ModuleClasses {
element ModuleClass {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
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 DeviceClass { ExtendDef }?
}+
}
Actions =
element Actions {
element Action {
attribute name { text },
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef?,
ArgDef?
......@@ -124,7 +155,10 @@ Actions =
ArgDef =
element Args {
element Arg {
attribute name { text },
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute default { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
DataTypeDef
}+
......@@ -132,11 +166,13 @@ ArgDef =
Data =
element Data {
element DataPoint {
attribute name { text },
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
}+
......@@ -144,9 +180,31 @@ Data =
Events =
element Events {
element Event {
attribute name { text },
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
Data?
}+
}
ExtendDef =
element Extend {
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"
targetNamespace="http://homegatewayinitiative.org/xml/dal/3.0"
xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
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://homegatewayinitiative.org/xml/dal/2.0" typeId="DAL"/>
<namespace ns="http://www.onem2m.org/xml/sdt/4.0" typeId="DAL"/>
<namespace ns="http://www.w3.org/2001/XInclude" typeId="XINC"/>
<typeId id="DAL" uri="dal.rnc"/>
......
......@@ -112,18 +112,21 @@
This property indicates whether the door/cover is open or closed.
Washing machine setting
This property indicates the current stage of the washing cycle.
......@@ -139,6 +142,7 @@
Reservation ON/OFF
......
<?xml version="1.0" encoding="ISO-8859-1"?>
BooleanState is the preferred module for modelling a
functionality corresponding to an underlying binary state. This
module should be used to abstract away from the actual datatype
and values in question. Note that the module does not define whether
the execution mode is blocking or non-blocking.
Obtain the current associated state.
BooleanState is the preferred module for modelling a
functionality corresponding to an underlying binary state. This
module should be used to abstract away from the actual datatype
and values in question. Note that the module does not define whether
the execution mode is blocking or non-blocking.
Obtain the current associated state.
Set the associated state to the specified value.
The desired value of the associated state.
Set the associated state to the specified value.
The desired value of the associated state.
<?xml version="1.0" encoding="ISO-8859-1"?>
PowerSwitch
Telekom Innovation Laboratories
This device is intended as a demonstration of how to use the
abstract modules defined in the HGI Core domain. The
vendor has provided a proprietry module with two operations
on and off. This is clearly a candidate for the
module class BooleanState.
The proprietry interface for turning the switch on and off.
Actions for setting the state to on or off
and for querying the state.
Turn the switch on.
Turn the switch off.
Query the state of the switch. Returns the string "on"
or "off".
An event that indicates the new state of the switch.
This device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain. The vendor has provided a proprietry module with two operations on and off. This is clearly a candidate for the module class BooleanState.
Original value: PowerSwitch
Original value: Telekom Innovation Laboratories
The proprietry interface for turning the switch on and off. Actions for setting the state to on or offand for querying the state.
Turn the switch on.
Turn the switch off.
Query the state of the switch. Returns the string "on" or "off".
An event that indicates the new state of the switch.
......@@ -16,6 +16,9 @@
Obtain the current associated state.
......@@ -23,7 +26,12 @@
The desired value of the associated state.
The desired value of the associated state.
......@@ -32,6 +40,9 @@
......@@ -47,14 +58,29 @@
Multi Socket Electrical-Extension-Block
HGI
1.0
http://www.homegatewayinitative.org
1234.5
This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
Original value: Multi Socket Electrical-Extension-Block
Original value: HGI
Original value: 1.0
Original value: http://www.homegatewayinitative.org
Original value: 1234.5
......@@ -62,23 +88,84 @@
The proprietry interface for turning all switches of the extension block on and off.
The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
Version for this ModuleClass
Get the power consumption.
This is an example simple data type with a minimum-value constraint.
The value must be equal or greater 0.0
Steps are 0.1
This datapoint represents the firmware version of the extension block.
This datapoint is an array of strings with the names of the contained devices.
......@@ -93,11 +180,15 @@
PowerSwitch 1
HGI
This sub device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain.
This sub device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain.
......@@ -110,11 +201,21 @@
PowerSwitch 2
HGI
This sub device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain.
This sub device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain.
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@
document ... -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dal="http://homegatewayinitiative.org/xml/dal/2.0"
xmlns:dal="http://www.onem2m.org/xml/sdt/4.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
......
......@@ -3,13 +3,13 @@
<!-- Example SDT definition taken from EchonetLite https://github.com/ECHONET-Consortium -->
<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
<Domain xmlns="http://www.onem2m.org/xml/sdt/4.0"
xmlns:xi="http://www.w3.org/2001/XInclude"
id="example.based.on.echonetLite">
<!-- Various examples for module classes -->
<Modules>
<ModuleClasses>
<ModuleClass name="operationStatus">
<Data>
<DataPoint name="operationStatus" readable="true" writable="true">
......@@ -62,13 +62,13 @@
</DataPoint>
</Data>
</ModuleClass>
</Modules>
</ModuleClasses>
<!-- Very simple example for a washing machine definition -->
<Devices>
<Device id="SimpleWaschingMachine">
<DeviceClasses>
<DeviceClass id="SimpleWaschingMachine">
<Properties>
<Property name="Name" value="washing machine">
<SimpleType type="string" />
......@@ -78,28 +78,28 @@
</Property>
</Properties>
<Modules>
<ModuleClasses>
<!-- Inheriting ModuleClasses from the global generic ModuleClasses -->
<Module name="installationLocation">
<extends domain="example.based.on.echonetLite" class="installationLocation"/>
</Module>
<ModuleClass name="installationLocation">
<Extend domain="example.based.on.echonetLite" entity="installationLocation"/>
</ModuleClass>
<Module name="measuredInstantaneousPowerConsumption">
<extends domain="example.based.on.echonetLite" class="measuredInstantaneousPowerConsumption"/>
</Module>
<ModuleClass name="measuredInstantaneousPowerConsumption">
<Extend domain="example.based.on.echonetLite" entity="measuredInstantaneousPowerConsumption"/>
</ModuleClass>
<Module name="temperatureSensorDataPoints">
<extends domain="example.based.on.echonetLite" class="temperatureSensorDataPoints"/>
</Module>
<ModuleClass name="temperatureSensorDataPoints">
<Extend domain="example.based.on.echonetLite" entity="temperatureSensorDataPoints"/>
</ModuleClass>
<!-- The following Module inherits and extends a global generic ModuleClass with an event. Therefore, it is renamed to express
the change of name. -->
<Module name="washingMachineOperationStatus">
<extends domain="example.based.on.echonetLite" class="operationStatus"/>
<ModuleClass name="washingMachineOperationStatus">
<Extend domain="example.based.on.echonetLite" entity="operationStatus"/>
<!-- This Module extends the global one with an event. -->
......@@ -109,29 +109,32 @@
</Event>
</Events>
</Module>
</ModuleClass>