Commit 65fd4ce7 authored by ankraft's avatar ankraft
Browse files

Added new extend definition. Adapted test cases

parent 8da029f2
...@@ -53,7 +53,7 @@ DataTypeDef = ...@@ -53,7 +53,7 @@ DataTypeDef =
attribute unitOfMeasure { text }?, attribute unitOfMeasure { text }?,
attribute semanticURI { xsd:anyURI }?, attribute semanticURI { xsd:anyURI }?,
DocDef, DocDef,
(ExtendsDef | (StructType | ArrayType | SimpleType | EnumType)), (ExtendDef | (StructType | ArrayType | SimpleType | EnumType)),
ConstraintsDef? ConstraintsDef?
} }
StructType = element Struct { DataTypeDef+ } StructType = element Struct { DataTypeDef+ }
...@@ -116,8 +116,7 @@ ModuleClasses = ...@@ -116,8 +116,7 @@ ModuleClasses =
attribute optional { xsd:boolean }?, attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?, attribute semanticURI { xsd:anyURI }?,
DocDef, DocDef,
ExtendsDef, ExtendDef,
# TODO: singular
PropertiesDef?, PropertiesDef?,
Actions?, Actions?,
Data?, Data?,
...@@ -168,21 +167,25 @@ Events = ...@@ -168,21 +167,25 @@ Events =
Data? Data?
}+ }+
} }
ExtendsDef = ExtendDef =
# TODO: singular element Extend {
element extends {
# TODO: Uppercase , singular
attribute domain { xsd:Name }, attribute domain { xsd:Name },
attribute class { text }, attribute entity { xsd:Name },
element excludes { (element Exclude {
# TODO: Uppercase + "...s" -> Excludes attribute name { xsd:Name },
element exclude { attribute type { ExtendType }
attribute name { text }, }
attribute type { | element Include {
text attribute name { xsd:Name },
# TODO: add ExcludeTypes attribute type { ExtendType }
})?
}
}+
}?
}? }?
ExtendType =
"action"
| "datapoint"
| "event"
| "moduleclass"
| "product"
| "property"
| "device"
| "subdevice"
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
</optional> </optional>
<ref name="DocDef"/> <ref name="DocDef"/>
<choice> <choice>
<ref name="ExtendsDef" /> <ref name="ExtendDef" />
<choice> <choice>
<ref name="StructType" /> <ref name="StructType" />
<ref name="ArrayType" /> <ref name="ArrayType" />
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
</attribute> </attribute>
</optional> </optional>
<ref name="DocDef"/> <ref name="DocDef"/>
<ref name="ExtendsDef" /> <!-- TODO: singular --> <ref name="ExtendDef" />
<optional> <optional>
<ref name="PropertiesDef"/> <ref name="PropertiesDef"/>
</optional> </optional>
...@@ -471,30 +471,52 @@ ...@@ -471,30 +471,52 @@
</define> </define>
<define name="ExtendsDef"> <!-- TODO: singular --> <define name="ExtendDef">
<optional> <optional>
<element name="extends"> <!-- TODO: Uppercase , singular--> <element name="Extend">
<attribute name="domain"> <attribute name="domain">
<data type="Name"/> <data type="Name"/>
</attribute> </attribute>
<attribute name="class"/> <attribute name="entity">
<data type="Name"/>
</attribute>
<optional> <optional>
<element name="excludes"> <!-- TODO: Uppercase + "...s" -> Excludes--> <choice>
<oneOrMore> <element name="Exclude">
<element name="exclude"> <attribute name="name">
<attribute name="name"> <data type="Name"/>
<text/> </attribute>
</attribute> <attribute name="type">
<attribute name="type"> <ref name="ExtendType" />
<text/> <!-- TODO: add ExcludeTypes --> </attribute>
</attribute> </element>
</element> <element name="Include">
</oneOrMore> <attribute name="name">
</element> <data type="Name"/>
</attribute>
<attribute name="type">
<ref name="ExtendType" />
</attribute>
</element>
</choice>
</optional> </optional>
</element> </element>
</optional> </optional>
</define> </define>
<define name="ExtendType">
<choice>
<value>action</value>
<value>datapoint</value>
<value>event</value>
<value>moduleclass</value>
<value>product</value>
<value>property</value>
<value>device</value>
<value>subdevice</value>
</choice>
</define>
</grammar> </grammar>
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<xs:extension base="DocDef"> <xs:extension base="DocDef">
<xs:sequence> <xs:sequence>
<xs:choice> <xs:choice>
<xs:group ref="ExtendsDef"/> <xs:group ref="ExtendDef"/>
<xs:choice> <xs:choice>
<xs:element ref="Struct"/> <xs:element ref="Struct"/>
<xs:element ref="Array"/> <xs:element ref="Array"/>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
<xs:complexContent> <xs:complexContent>
<xs:extension base="DocDef"> <xs:extension base="DocDef">
<xs:sequence> <xs:sequence>
<xs:group ref="ExtendsDef"/> <xs:group ref="ExtendDef"/>
<xs:element minOccurs="0" ref="Properties"/> <xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="Actions"/> <xs:element minOccurs="0" ref="Actions"/>
<xs:element minOccurs="0" ref="Data"/> <xs:element minOccurs="0" ref="Data"/>
...@@ -363,31 +363,43 @@ ...@@ -363,31 +363,43 @@
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:group name="ExtendsDef"> <xs:group name="ExtendDef">
<xs:sequence> <xs:sequence>
<xs:element minOccurs="0" ref="extends"/> <xs:element minOccurs="0" ref="Extend"/>
</xs:sequence> </xs:sequence>
</xs:group> </xs:group>
<xs:element name="extends"> <xs:element name="Extend">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:choice minOccurs="0">
<xs:element minOccurs="0" ref="excludes"/> <xs:element ref="Exclude"/>
</xs:sequence> <xs:element ref="Include"/>
</xs:choice>
<xs:attribute name="domain" use="required" type="xs:Name"/> <xs:attribute name="domain" use="required" type="xs:Name"/>
<xs:attribute name="class" use="required"/> <xs:attribute name="entity" use="required" type="xs:Name"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="excludes"> <xs:element name="Exclude">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:attribute name="name" use="required" type="xs:Name"/>
<xs:element maxOccurs="unbounded" ref="exclude"/> <xs:attribute name="type" use="required" type="ExtendType"/>
</xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="exclude"> <xs:element name="Include">
<xs:complexType> <xs:complexType>
<xs:attribute name="name" use="required"/> <xs:attribute name="name" use="required" type="xs:Name"/>
<xs:attribute name="type" use="required"/> <xs:attribute name="type" use="required" type="ExtendType"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:simpleType name="ExtendType">
<xs:restriction base="xs:token">
<xs:enumeration value="action"/>
<xs:enumeration value="datapoint"/>
<xs:enumeration value="event"/>
<xs:enumeration value="moduleclass"/>
<xs:enumeration value="product"/>
<xs:enumeration value="property"/>
<xs:enumeration value="device"/>
<xs:enumeration value="subdevice"/>
</xs:restriction>
</xs:simpleType>
</xs:schema> </xs:schema>
...@@ -83,15 +83,15 @@ ...@@ -83,15 +83,15 @@
<!-- Inheriting ModuleClasses from the global generic ModuleClasses --> <!-- Inheriting ModuleClasses from the global generic ModuleClasses -->
<ModuleClass name="installationLocation"> <ModuleClass name="installationLocation">
<extends domain="example.based.on.echonetLite" class="installationLocation"/> <Extend domain="example.based.on.echonetLite" entity="installationLocation"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="measuredInstantaneousPowerConsumption"> <ModuleClass name="measuredInstantaneousPowerConsumption">
<extends domain="example.based.on.echonetLite" class="measuredInstantaneousPowerConsumption"/> <Extend domain="example.based.on.echonetLite" entity="measuredInstantaneousPowerConsumption"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="temperatureSensorDataPoints"> <ModuleClass name="temperatureSensorDataPoints">
<extends domain="example.based.on.echonetLite" class="temperatureSensorDataPoints"/> <Extend domain="example.based.on.echonetLite" entity="temperatureSensorDataPoints"/>
</ModuleClass> </ModuleClass>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
the change of name. --> the change of name. -->
<ModuleClass name="washingMachineOperationStatus"> <ModuleClass name="washingMachineOperationStatus">
<extends domain="example.based.on.echonetLite" class="operationStatus"/> <Extend domain="example.based.on.echonetLite" entity="operationStatus"/>
<!-- This Module extends the global one with an event. --> <!-- This Module extends the global one with an event. -->
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</Events> </Events>
</ModuleClass> </ModuleClass>
<ModuleClass name="power"> <ModuleClass name="power">
<extends class="BooleanState" domain="hgi.dal.core"/> <Extend entity="BooleanState" domain="hgi.dal.core"/>
</ModuleClass> </ModuleClass>
</ModuleClasses> </ModuleClasses>
</DeviceClass> </DeviceClass>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<Data> <Data>
<DataPoint name="TestDataPoint" writable="true"> <DataPoint name="TestDataPoint" writable="true">
<DataType> <DataType>
<extends domain="datatypes-test" class="temperatureType" /> <Extend domain="datatypes-test" entity="temperatureType" />
</DataType> </DataType>
</DataPoint> </DataPoint>
</Data> </Data>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</Properties> </Properties>
<ModuleClasses> <ModuleClasses>
<ModuleClass name="aModuleClass"> <ModuleClass name="aModuleClass">
<extends domain="hgi.dal.core" class="BooleanState"></extends> <Extend domain="hgi.dal.core" entity="BooleanState" />
</ModuleClass> </ModuleClass>
</ModuleClasses> </ModuleClasses>
</DeviceClass> </DeviceClass>
......
...@@ -12,19 +12,19 @@ ...@@ -12,19 +12,19 @@
<DeviceClass id="airConditioner"> <DeviceClass id="airConditioner">
<ModuleClasses> <ModuleClasses>
<ModuleClass name="operationStatus"> <ModuleClass name="operationStatus">
<extends domain="example1.SDT" class="operationStatus"/> <Extend domain="example1.SDT" entity="operationStatus"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="installationLocation"> <ModuleClass name="installationLocation">
<extends domain="example1.SDT" class="installationLocation"/> <Extend domain="example1.SDT" entity="installationLocation"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="measuredCumulativePowerConsumption"> <ModuleClass name="measuredCumulativePowerConsumption">
<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/> <Extend domain="example1.SDT" entity="measuredCumulativePowerConsumption"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="measuredCumulativePowerConsumption"> <ModuleClass name="measuredCumulativePowerConsumption">
<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/> <Extend domain="example1.SDT" entity="measuredCumulativePowerConsumption"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="onTimerSetting"> <ModuleClass name="onTimerSetting">
<extends domain="example1.SDT" class="onTimerSetting"/> <Extend domain="example1.SDT" entity="onTimerSetting"/>
</ModuleClass> </ModuleClass>
</ModuleClasses> </ModuleClasses>
</DeviceClass> </DeviceClass>
......
...@@ -12,22 +12,22 @@ ...@@ -12,22 +12,22 @@
<DeviceClass id="waschingMachine"> <DeviceClass id="waschingMachine">
<ModuleClasses> <ModuleClasses>
<ModuleClass name="operationStatus"> <ModuleClass name="operationStatus">
<extends domain="example1.SDT" class="operationStatus"/> <Extend domain="example1.SDT" entity="operationStatus"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="installationLocation"> <ModuleClass name="installationLocation">
<extends domain="example1.SDT" class="installationLocation"/> <Extend domain="example1.SDT" entity="installationLocation"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="measuredCumulativePowerConsumption"> <ModuleClass name="measuredCumulativePowerConsumption">
<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/> <Extend domain="example1.SDT" entity="measuredCumulativePowerConsumption"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="measuredCumulativePowerConsumption"> <ModuleClass name="measuredCumulativePowerConsumption">
<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/> <Extend domain="example1.SDT" entity="measuredCumulativePowerConsumption"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="onTimerSetting"> <ModuleClass name="onTimerSetting">
<extends domain="example1.SDT" class="onTimerSetting"/> <Extend domain="example1.SDT" entity="onTimerSetting"/>
</ModuleClass> </ModuleClass>
<ModuleClass name="statusDoor"> <ModuleClass name="statusDoor">
<extends domain="example1.SDT" class="statusDoor"/> <Extend domain="example1.SDT" entity="statusDoor"/>
</ModuleClass> </ModuleClass>
</ModuleClasses> </ModuleClasses>
</DeviceClass> </DeviceClass>
......
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- Test the extends element --> <!-- Test the extends element -->
<Domain id="extends-test" xmlns="http://homegatewayinitiative.org/xml/dal/4.0" xmlns:xi="http://www.w3.org/2001/XInclude"> <Domain id="extend-test" xmlns="http://homegatewayinitiative.org/xml/dal/4.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<ModuleClasses> <ModuleClasses>
<ModuleClass name="TestExtendsParent"> <ModuleClass name="TestExtendsParent">
<Data> <Data>
...@@ -18,11 +18,9 @@ ...@@ -18,11 +18,9 @@
</Data> </Data>
</ModuleClass> </ModuleClass>
<ModuleClass name="TestExtendsChild"> <ModuleClass name="TestExtendsChild">
<extends domain="extends-test" class="TestExtendsParent"> <Extend domain="extend-test" entity="TestExtendsParent">
<excludes> <Exclude name="TestExtendsDataPoint2" type="datapoint" />
<exclude name="TestExtendsDataPoint2" type="datapoint" /> </Extend>
</excludes>
</extends>
<Data> <Data>
<DataPoint name="TestExtendsDataPoint3" writable="true"> <DataPoint name="TestExtendsDataPoint3" writable="true">
<DataType> <DataType>
......
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
The proprietry interface for turning all switches of the extension block on and off. 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". The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
</Doc> </Doc>
<extends domain="hgi.dal.core" class="BooleanState"/> <Extend domain="hgi.dal.core" entity="BooleanState"/>
<Properties> <Properties>
<Property name="version" value="1.0.0"> <Property name="version" value="1.0.0">
<Doc>Version for this ModuleClass</Doc> <Doc>Version for this ModuleClass</Doc>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</Properties> </Properties>
<ModuleClasses> <ModuleClasses>
<ModuleClass name="power"> <ModuleClass name="power">
<extends domain="hgi.dal.core" class="BooleanState"/> <Extend domain="hgi.dal.core" entity="BooleanState"/>
</ModuleClass> </ModuleClass>
</ModuleClasses> </ModuleClasses>
</SubDevice> </SubDevice>
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
</Properties> </Properties>
<ModuleClasses> <ModuleClasses>
<ModuleClass name="power"> <ModuleClass name="power">
<extends domain="hgi.dal.core" class="BooleanState"/> <Extend domain="hgi.dal.core" entity="BooleanState"/>
</ModuleClass> </ModuleClass>
</ModuleClasses> </ModuleClasses>
</SubDevice> </SubDevice>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<Data> <Data>
<DataPoint name="TestDataPoint" writable="true" semanticURI="http://example.com/TestDataPoint.rdf"> <DataPoint name="TestDataPoint" writable="true" semanticURI="http://example.com/TestDataPoint.rdf">
<DataType> <DataType>
<extends domain="datatypes-test" class="temperatureType" /> <Extend domain="datatypes-test" entity="temperatureType" />
</DataType> </DataType>
</DataPoint> </DataPoint>
</Data> </Data>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment