Commit bef880c7 authored by ankraft's avatar ankraft
Browse files

Added Product

parent 9ba0983d
...@@ -16,25 +16,9 @@ Domain = ...@@ -16,25 +16,9 @@ Domain =
DocDef, DocDef,
element Imports { Domain+ }?, element Imports { Domain+ }?,
element DataTypes { DataTypeDef+ }?, element DataTypes { DataTypeDef+ }?,
ModuleClasses?, ModuleClassesDef?,
element DeviceClasses { DeviceClassesDef?,
element DeviceClass { ProductsDef?
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClasses?,
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClasses?
}+
}?
}+
}?
} }
PropertiesDef = PropertiesDef =
element Properties { element Properties {
...@@ -53,7 +37,7 @@ DataTypeDef = ...@@ -53,7 +37,7 @@ DataTypeDef =
attribute unitOfMeasure { text }?, attribute unitOfMeasure { text }?,
attribute semanticURI { xsd:anyURI }?, attribute semanticURI { xsd:anyURI }?,
DocDef, DocDef,
(ExtendDef | (StructType | ArrayType | SimpleType | EnumType)), (ExtendDef? | (StructType | ArrayType | SimpleType | EnumType)),
ConstraintsDef? ConstraintsDef?
} }
StructType = element Struct { DataTypeDef+ } StructType = element Struct { DataTypeDef+ }
...@@ -109,20 +93,54 @@ DocDef = ...@@ -109,20 +93,54 @@ DocDef =
element caption { text } element caption { text }
})* })*
}? }?
ModuleClasses = 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 ModuleClasses {
element ModuleClass { element ModuleClass {
attribute name { xsd:Name }, attribute name { xsd:Name },
attribute optional { xsd:boolean }?, attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?, attribute semanticURI { xsd:anyURI }?,
DocDef, DocDef,
ExtendDef, ExtendDef?,
PropertiesDef?, PropertiesDef?,
Actions?, Actions?,
Data?, Data?,
Events? Events?
}+ }+
} }
ProductsDef =
element Products {
element Product {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClassesDef?,
SubDevicesRef?,
element DeviceClass { ExtendDef },
ExtendDef?
}+
}
Actions = Actions =
element Actions { element Actions {
element Action { element Action {
...@@ -181,7 +199,7 @@ ExtendDef = ...@@ -181,7 +199,7 @@ ExtendDef =
attribute name { xsd:Name }, attribute name { xsd:Name },
attribute type { ExtendType } attribute type { ExtendType }
})? })?
}? }
ExtendType = ExtendType =
"action" "action"
| "datapoint" | "datapoint"
......
...@@ -49,53 +49,13 @@ ...@@ -49,53 +49,13 @@
</element> </element>
</optional> </optional>
<optional> <optional>
<ref name="ModuleClasses"/> <ref name="ModuleClassesDef"/>
</optional> </optional>
<optional> <optional>
<element name="DeviceClasses"> <ref name="DeviceClassesDef" />
<oneOrMore> </optional>
<element name="DeviceClass"> <optional>
<attribute name="id"> <ref name="ProductsDef" />
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
</optional>
<optional>
<ref name="ModuleClasses"/>
</optional>
<optional>
<element name="SubDevices">
<oneOrMore>
<element name="SubDevice">
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
</optional>
<optional>
<ref name="ModuleClasses"/>
</optional>
</element>
</oneOrMore>
</element>
</optional>
</element>
</oneOrMore>
</element>
</optional> </optional>
</element> </element>
</define> </define>
...@@ -150,7 +110,9 @@ ...@@ -150,7 +110,9 @@
</optional> </optional>
<ref name="DocDef"/> <ref name="DocDef"/>
<choice> <choice>
<ref name="ExtendDef" /> <optional>
<ref name="ExtendDef" />
</optional>
<choice> <choice>
<ref name="StructType" /> <ref name="StructType" />
<ref name="ArrayType" /> <ref name="ArrayType" />
...@@ -312,7 +274,60 @@ ...@@ -312,7 +274,60 @@
</define> </define>
<define name="ModuleClasses"> <define name="DeviceClassesDef">
<element name="DeviceClasses">
<oneOrMore>
<element name="DeviceClass">
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
</optional>
<optional>
<ref name="ModuleClassesDef"/>
</optional>
<optional>
<ref name="SubDevicesRef" />
</optional>
</element>
</oneOrMore>
</element>
</define>
<define name="SubDevicesRef">
<element name="SubDevices">
<oneOrMore>
<element name="SubDevice">
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
</optional>
<optional>
<ref name="ModuleClassesDef"/>
</optional>
</element>
</oneOrMore>
</element>
</define>
<define name="ModuleClassesDef">
<element name="ModuleClasses"> <element name="ModuleClasses">
<oneOrMore> <oneOrMore>
<element name="ModuleClass"> <element name="ModuleClass">
...@@ -330,7 +345,9 @@ ...@@ -330,7 +345,9 @@
</attribute> </attribute>
</optional> </optional>
<ref name="DocDef"/> <ref name="DocDef"/>
<ref name="ExtendDef" /> <optional>
<ref name="ExtendDef" />
</optional>
<optional> <optional>
<ref name="PropertiesDef"/> <ref name="PropertiesDef"/>
</optional> </optional>
...@@ -349,6 +366,40 @@ ...@@ -349,6 +366,40 @@
</define> </define>
<define name="ProductsDef">
<element name="Products">
<oneOrMore>
<element name="Product">
<attribute name="id">
<data type="Name"/>
</attribute>
<optional>
<attribute name="semanticURI">
<data type="anyURI"/>
</attribute>
</optional>
<ref name="DocDef"/>
<optional>
<ref name="PropertiesDef"/>
</optional>
<optional>
<ref name="ModuleClassesDef"/>
</optional>
<optional>
<ref name="SubDevicesRef" />
</optional>
<element name="DeviceClass">
<ref name="ExtendDef" />
</element>
<optional>
<ref name="ExtendDef" />
</optional>
</element>
</oneOrMore>
</element>
</define>
<define name="Actions"> <define name="Actions">
<element name="Actions"> <element name="Actions">
<oneOrMore> <oneOrMore>
...@@ -482,7 +533,6 @@ ...@@ -482,7 +533,6 @@
<define name="ExtendDef"> <define name="ExtendDef">
<optional>
<element name="Extend"> <element name="Extend">
<attribute name="domain"> <attribute name="domain">
<data type="Name"/> <data type="Name"/>
...@@ -511,7 +561,6 @@ ...@@ -511,7 +561,6 @@
</choice> </choice>
</optional> </optional>
</element> </element>
</optional>
</define> </define>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<xs:element minOccurs="0" ref="DataTypes"/> <xs:element minOccurs="0" ref="DataTypes"/>
<xs:element minOccurs="0" ref="ModuleClasses"/> <xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="DeviceClasses"/> <xs:element minOccurs="0" ref="DeviceClasses"/>
<xs:element minOccurs="0" ref="Products"/>
</xs:sequence> </xs:sequence>
<xs:attribute ref="xml:base"/> <xs:attribute ref="xml:base"/>
<xs:attribute name="id" use="required" type="xs:Name"/> <xs:attribute name="id" use="required" type="xs:Name"/>
...@@ -46,49 +47,6 @@ ...@@ -46,49 +47,6 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="DeviceClasses">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="DeviceClass"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DeviceClass">
<xs:complexType>
<xs:complexContent>
<xs:extension base="DocDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="SubDevices"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/>
<xs:attribute name="semanticURI" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="SubDevices">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="SubDevice"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SubDevice">
<xs:complexType>
<xs:complexContent>
<xs:extension base="DocDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/>
<xs:attribute name="semanticURI" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Properties"> <xs:element name="Properties">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
...@@ -117,7 +75,7 @@ ...@@ -117,7 +75,7 @@
<xs:extension base="DocDef"> <xs:extension base="DocDef">
<xs:sequence> <xs:sequence>
<xs:choice> <xs:choice>
<xs:group ref="ExtendDef"/> <xs:element minOccurs="0" ref="Extend"/>
<xs:choice> <xs:choice>
<xs:element ref="Struct"/> <xs:element ref="Struct"/>
<xs:element ref="Array"/> <xs:element ref="Array"/>
...@@ -250,6 +208,48 @@ ...@@ -250,6 +208,48 @@
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="caption" type="xs:string"/> <xs:element name="caption" type="xs:string"/>
<xs:element name="DeviceClasses">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="DeviceClass">
<xs:complexType>
<xs:complexContent>
<xs:extension base="DocDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="SubDevices"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/>
<xs:attribute name="semanticURI" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SubDevices">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="SubDevice"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SubDevice">
<xs:complexType>
<xs:complexContent>
<xs:extension base="DocDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/>
<xs:attribute name="semanticURI" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="ModuleClasses"> <xs:element name="ModuleClasses">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
...@@ -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="ExtendDef"/> <xs:element minOccurs="0" ref="Extend"/>
<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"/>
...@@ -275,6 +275,36 @@ ...@@ -275,6 +275,36 @@
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Products">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Product"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Product">
<xs:complexType>
<xs:complexContent>
<xs:extension base="DocDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="SubDevices"/>
<xs:element name="DeviceClass">
<xs:complexType>
<xs:sequence>
<xs:element ref="Extend"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" ref="Extend"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/>
<xs:attribute name="semanticURI" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Actions"> <xs:element name="Actions">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
...@@ -365,11 +395,6 @@ ...@@ -365,11 +395,6 @@
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:group name="ExtendDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Extend"/>
</xs:sequence>
</xs:group>
<xs:element name="Extend"> <xs:element name="Extend">
<xs:complexType> <xs:complexType>
<xs:choice minOccurs="0"> <xs:choice minOccurs="0">
......
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<Domain xmlns="http://homegatewayinitiative.org/xml/dal/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="deviceClass-test" > <Domain xmlns="http://homegatewayinitiative.org/xml/dal/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="deviceClass.test" >
<Imports> <Imports>
<xi:include href="./dal-core.xml" parse="xml"/> <xi:include href="./dal-core.xml" parse="xml"/>
</Imports> </Imports>
......
<?xml version="1.0" encoding="iso-8859-1"?>
<Domain xmlns="http://homegatewayinitiative.org/xml/dal/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="deviceClass-test" >
<Products>
<Product id="TestProduct" semanticURI="http://example.com/TestProduct.rdf">
<Doc>This is a test product</Doc>
<Properties>
<Property name="aProperty">
<SimpleType type="string"></SimpleType>
</Property>
</Properties>
<ModuleClasses>
<ModuleClass name="aModuleClass">
<Extend domain="hgi.dal.core" entity="BooleanState" />
</ModuleClass>
</ModuleClasses>
<SubDevices>
<SubDevice id="aSubDevice">
<ModuleClasses>
<ModuleClass name="aSubDeviceModuleClass">
<Extend domain="hgi.dal.core" entity="BooleanState"/>
</ModuleClass>
</ModuleClasses>
</SubDevice>
</SubDevices>
<DeviceClass>
<Extend domain="deviceClass.test" entity="Test" />
</DeviceClass>
</Product>
<!-- TODO: test <extends> element, but only when DeviceClas is optional
<Product id="AnotherTestProduct">
</Product> -->
</Products>
</Domain>
\ No newline at end of file
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