Commit bef880c7 authored by ankraft's avatar ankraft

Added Product

parent 9ba0983d
......@@ -16,25 +16,9 @@ Domain =
DocDef,
element Imports { Domain+ }?,
element DataTypes { DataTypeDef+ }?,
ModuleClasses?,
element DeviceClasses {
element DeviceClass {
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?
}+
}?
}+
}?
ModuleClassesDef?,
DeviceClassesDef?,
ProductsDef?
}
PropertiesDef =
element Properties {
......@@ -53,7 +37,7 @@ DataTypeDef =
attribute unitOfMeasure { text }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
(ExtendDef | (StructType | ArrayType | SimpleType | EnumType)),
(ExtendDef? | (StructType | ArrayType | SimpleType | EnumType)),
ConstraintsDef?
}
StructType = element Struct { DataTypeDef+ }
......@@ -109,20 +93,54 @@ DocDef =
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 ModuleClass {
attribute name { xsd:Name },
attribute optional { xsd:boolean }?,
attribute semanticURI { xsd:anyURI }?,
DocDef,
ExtendDef,
ExtendDef?,
PropertiesDef?,
Actions?,
Data?,
Events?
}+
}
ProductsDef =
element Products {
element Product {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClassesDef?,
SubDevicesRef?,
element DeviceClass { ExtendDef },
ExtendDef?
}+
}
Actions =
element Actions {
element Action {
......@@ -181,7 +199,7 @@ ExtendDef =
attribute name { xsd:Name },
attribute type { ExtendType }
})?
}?
}
ExtendType =
"action"
| "datapoint"
......
......@@ -49,53 +49,13 @@
</element>
</optional>
<optional>
<ref name="ModuleClasses"/>
<ref name="ModuleClassesDef"/>
</optional>
<optional>
<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="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>
<ref name="DeviceClassesDef" />
</optional>
<optional>
<ref name="ProductsDef" />
</optional>
</element>
</define>
......@@ -150,7 +110,9 @@
</optional>
<ref name="DocDef"/>
<choice>
<ref name="ExtendDef" />
<optional>
<ref name="ExtendDef" />
</optional>
<choice>
<ref name="StructType" />
<ref name="ArrayType" />
......@@ -312,7 +274,60 @@
</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">
<oneOrMore>
<element name="ModuleClass">
......@@ -330,7 +345,9 @@
</attribute>
</optional>
<ref name="DocDef"/>
<ref name="ExtendDef" />
<optional>
<ref name="ExtendDef" />
</optional>
<optional>
<ref name="PropertiesDef"/>
</optional>
......@@ -349,6 +366,40 @@
</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">
<element name="Actions">
<oneOrMore>
......@@ -482,7 +533,6 @@
<define name="ExtendDef">
<optional>
<element name="Extend">
<attribute name="domain">
<data type="Name"/>
......@@ -511,7 +561,6 @@
</choice>
</optional>
</element>
</optional>
</define>
......
......@@ -24,6 +24,7 @@
<xs:element minOccurs="0" ref="DataTypes"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="DeviceClasses"/>
<xs:element minOccurs="0" ref="Products"/>
</xs:sequence>
<xs:attribute ref="xml:base"/>
<xs:attribute name="id" use="required" type="xs:Name"/>
......@@ -46,49 +47,6 @@
</xs:sequence>
</xs:complexType>
</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:complexType>
<xs:sequence>
......@@ -117,7 +75,7 @@
<xs:extension base="DocDef">
<xs:sequence>
<xs:choice>
<xs:group ref="ExtendDef"/>
<xs:element minOccurs="0" ref="Extend"/>
<xs:choice>
<xs:element ref="Struct"/>
<xs:element ref="Array"/>
......@@ -250,6 +208,48 @@
</xs:complexType>
</xs:element>
<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:complexType>
<xs:sequence>
......@@ -262,7 +262,7 @@
<xs:complexContent>
<xs:extension base="DocDef">
<xs:sequence>
<xs:group ref="ExtendDef"/>
<xs:element minOccurs="0" ref="Extend"/>
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="Actions"/>
<xs:element minOccurs="0" ref="Data"/>
......@@ -275,6 +275,36 @@
</xs:complexContent>
</xs:complexType>
</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:complexType>
<xs:sequence>
......@@ -365,11 +395,6 @@
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:group name="ExtendDef">
<xs:sequence>
<xs:element minOccurs="0" ref="Extend"/>
</xs:sequence>
</xs:group>
<xs:element name="Extend">
<xs:complexType>
<xs:choice minOccurs="0">
......
<?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>
<xi:include href="./dal-core.xml" parse="xml"/>
</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