domain.xsd 9.73 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?xml version="1.0" encoding="UTF-8"?>
<!--
  - 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.
-->
12 13
<xs:schema targetNamespace="http://homegatewayinitiative.org/xml/dal/4.0" 
	   xmlns="http://homegatewayinitiative.org/xml/dal/4.0" 
14 15 16 17 18 19 20 21 22
	   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	  
 elementFormDefault="qualified">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
  <xs:element name="Domain">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element minOccurs="0" ref="Imports"/>
23
        <xs:element minOccurs="0" ref="DataTypes"/>
24 25
        <xs:element minOccurs="0" ref="ModuleClasses"/>
        <xs:element minOccurs="0" ref="DeviceClasses"/>
26 27 28 29 30 31 32 33 34 35 36 37
      </xs:sequence>
      <xs:attribute ref="xml:base"/>
      <xs:attribute name="id" use="required" type="xs:ID"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Imports">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Domain"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
38 39 40 41 42 43 44
  <xs:element name="DataTypes">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="DataType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
45
  <xs:element name="DeviceClasses">
46 47
    <xs:complexType>
      <xs:sequence>
48
        <xs:element maxOccurs="unbounded" ref="DeviceClass"/>
49 50 51
      </xs:sequence>
    </xs:complexType>
  </xs:element>
52
  <xs:element name="DeviceClass">
53 54 55 56
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element minOccurs="0" ref="Properties"/>
57
        <xs:element minOccurs="0" ref="ModuleClasses"/>
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
        <xs:element minOccurs="0" ref="SubDevices"/>
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:Name"/>
    </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:sequence>
        <xs:group ref="DocDef"/>
        <xs:element minOccurs="0" ref="Properties"/>
75
        <xs:element minOccurs="0" ref="ModuleClasses"/>
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:Name"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Properties">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Property"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Property">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element ref="SimpleType"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
      <xs:attribute name="value"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataType">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:choice>
          <xs:element ref="Struct"/>
          <xs:element ref="Array"/>
          <xs:element ref="SimpleType"/>
106
          <xs:element ref="EnumType"/>
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
        </xs:choice>
        <xs:element minOccurs="0" ref="Constraints"/>
      </xs:sequence>
      <xs:attribute name="name"/>
      <xs:attribute name="unitOfMeasure"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Struct">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="DataType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Array">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="DataType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="SimpleType">
    <xs:complexType>
      <xs:attribute name="type" use="required" type="BasicType"/>
    </xs:complexType>
  </xs:element>
133 134 135 136 137 138 139
  <xs:element name="EnumType">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="EnumValue"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
140 141 142 143 144 145 146 147 148 149 150 151 152
  <xs:simpleType name="BasicType">
    <xs:restriction base="xs:token">
      <xs:enumeration value="integer"/>
      <xs:enumeration value="boolean"/>
      <xs:enumeration value="string"/>
      <xs:enumeration value="byte"/>
      <xs:enumeration value="float"/>
      <xs:enumeration value="array"/>
      <xs:enumeration value="date"/>
      <xs:enumeration value="time"/>
      <xs:enumeration value="datetime"/>
      <xs:enumeration value="blob"/>
      <xs:enumeration value="uri"/>
153
      <xs:enumeration value="void"/>
154 155
    </xs:restriction>
  </xs:simpleType>
156 157 158 159 160 161 162 163
  <xs:element name="EnumValue">
    <xs:complexType>
      <xs:group ref="DocDef"/>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="value" use="required"/>
      <xs:attribute name="type" type="BasicType"/>
    </xs:complexType>
  </xs:element>
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
  <xs:element name="Constraints">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Constraint"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Constraint">
    <xs:complexType>
      <xs:group ref="DocDef"/>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="type" type="BasicType"/>
      <xs:attribute name="value"/>
    </xs:complexType>
  </xs:element>
  <xs:group name="DocText">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="em"/>
        <xs:element ref="b"/>
        <xs:element ref="tt"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>
  <xs:element name="em" type="xs:string"/>
  <xs:element name="b" type="xs:string"/>
  <xs:element name="tt" type="xs:string"/>
  <!-- <Doc> element is always optional -->
  <xs:group name="DocDef">
    <xs:sequence>
      <xs:element minOccurs="0" ref="Doc"/>
    </xs:sequence>
  </xs:group>
  <xs:element name="Doc">
    <xs:complexType mixed="true">
      <xs:choice>
        <xs:group ref="DocText"/>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="p"/>
          <xs:element ref="img"/>
        </xs:choice>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="p">
    <xs:complexType mixed="true">
      <xs:group ref="DocText"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="img">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="caption"/>
      </xs:sequence>
      <xs:attribute name="src" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="caption" type="xs:string"/>
222
  <xs:element name="ModuleClasses">
223
    <xs:complexType>
224 225 226
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ModuleClass"/>
      </xs:sequence>
227 228
    </xs:complexType>
  </xs:element>
229
  <xs:element name="ModuleClass">
230 231
    <xs:complexType>
      <xs:sequence>
232 233 234 235 236 237
        <xs:element minOccurs="0" ref="extends"/>
        <xs:group ref="DocDef"/>
        <xs:element minOccurs="0" ref="Properties"/>
        <xs:element minOccurs="0" ref="Actions"/>
        <xs:element minOccurs="0" ref="Data"/>
        <xs:element minOccurs="0" ref="Events"/>
238
      </xs:sequence>
239 240 241 242 243 244 245 246
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="extends">
    <xs:complexType>
      <xs:attribute name="domain" use="required" type="xs:IDREF"/>
      <xs:attribute name="class" use="required"/>
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
    </xs:complexType>
  </xs:element>
  <xs:element name="Actions">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Action"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Action">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element minOccurs="0" ref="DataType"/>
        <xs:element minOccurs="0" ref="Args"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Args">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Arg"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Arg">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element ref="DataType"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Data">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="DataPoint"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataPoint">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element ref="DataType"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
      <xs:attribute name="writable" type="xs:boolean"/>
      <xs:attribute name="readable" type="xs:boolean"/>
      <xs:attribute name="eventable" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Events">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Event"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Event">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element minOccurs="0" ref="Data"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
</xs:schema>