domain.xsd 11.7 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
	   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>
20 21 22 23 24 25 26 27 28
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <xs:element minOccurs="0" ref="Imports"/>
            <xs:element minOccurs="0" ref="DataTypes"/>
            <xs:element minOccurs="0" ref="ModuleClasses"/>
            <xs:element minOccurs="0" ref="DeviceClasses"/>
          </xs:sequence>
          <xs:attribute ref="xml:base"/>
ankraft's avatar
ankraft committed
29
          <xs:attribute name="id" use="required" type="xs:Name"/>
30 31
        </xs:extension>
      </xs:complexContent>
32 33 34 35 36 37 38 39 40
    </xs:complexType>
  </xs:element>
  <xs:element name="Imports">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Domain"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
41 42 43 44 45 46 47
  <xs:element name="DataTypes">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="DataType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
48
  <xs:element name="DeviceClasses">
49 50
    <xs:complexType>
      <xs:sequence>
51
        <xs:element maxOccurs="unbounded" ref="DeviceClass"/>
52 53 54
      </xs:sequence>
    </xs:complexType>
  </xs:element>
55
  <xs:element name="DeviceClass">
56
    <xs:complexType>
57 58 59 60 61 62 63 64 65 66
      <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:extension>
      </xs:complexContent>
67 68 69 70 71 72 73 74 75 76 77
    </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>
78 79 80 81 82 83 84 85 86
      <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:extension>
      </xs:complexContent>
87 88 89 90 91 92 93 94 95 96 97
    </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>
98 99 100 101 102 103 104 105 106 107
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <xs:element ref="SimpleType"/>
          </xs:sequence>
          <xs:attribute name="name" use="required"/>
          <xs:attribute name="optional" type="xs:boolean"/>
          <xs:attribute name="value"/>
        </xs:extension>
      </xs:complexContent>
108 109 110 111
    </xs:complexType>
  </xs:element>
  <xs:element name="DataType">
    <xs:complexType>
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <xs:choice>
              <xs:group ref="ExtendsDef"/>
              <xs:choice>
                <xs:element ref="Struct"/>
                <xs:element ref="Array"/>
                <xs:element ref="SimpleType"/>
                <xs:element ref="EnumType"/>
              </xs:choice>
            </xs:choice>
            <xs:element minOccurs="0" ref="Constraints"/>
          </xs:sequence>
          <xs:attribute name="name"/>
          <xs:attribute name="unitOfMeasure"/>
        </xs:extension>
      </xs:complexContent>
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
    </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>
151 152 153 154 155 156 157
  <xs:element name="EnumType">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="EnumValue"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
158 159 160 161 162 163 164 165 166 167 168 169 170
  <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"/>
171
      <xs:enumeration value="void"/>
172 173
    </xs:restriction>
  </xs:simpleType>
174 175
  <xs:element name="EnumValue">
    <xs:complexType>
176 177 178 179 180 181 182
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:attribute name="name" use="required"/>
          <xs:attribute name="value" use="required"/>
          <xs:attribute name="type" type="BasicType"/>
        </xs:extension>
      </xs:complexContent>
183 184
    </xs:complexType>
  </xs:element>
185 186 187 188 189 190 191 192 193
  <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>
194 195 196 197 198 199 200
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:attribute name="name" use="required"/>
          <xs:attribute name="type" type="BasicType"/>
          <xs:attribute name="value"/>
        </xs:extension>
      </xs:complexContent>
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
    </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 -->
216
  <xs:complexType name="DocDef">
217 218 219
    <xs:sequence>
      <xs:element minOccurs="0" ref="Doc"/>
    </xs:sequence>
220
  </xs:complexType>
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
  <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"/>
246
  <xs:element name="ModuleClasses">
247
    <xs:complexType>
248 249 250
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="ModuleClass"/>
      </xs:sequence>
251 252
    </xs:complexType>
  </xs:element>
253
  <xs:element name="ModuleClass">
254
    <xs:complexType>
255 256 257 258 259 260 261 262 263 264 265 266 267
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <xs:group ref="ExtendsDef"/>
            <xs:element minOccurs="0" ref="Properties"/>
            <xs:element minOccurs="0" ref="Actions"/>
            <xs:element minOccurs="0" ref="Data"/>
            <xs:element minOccurs="0" ref="Events"/>
          </xs:sequence>
          <xs:attribute name="name" use="required"/>
          <xs:attribute name="optional" type="xs:boolean"/>
        </xs:extension>
      </xs:complexContent>
268 269
    </xs:complexType>
  </xs:element>
270 271 272 273 274 275 276 277 278
  <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>
279 280 281 282 283 284 285 286 287 288
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <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:extension>
      </xs:complexContent>
289 290 291 292 293 294 295 296 297 298 299
    </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>
300 301 302 303 304 305 306 307
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <xs:element ref="DataType"/>
          </xs:sequence>
          <xs:attribute name="name" use="required"/>
        </xs:extension>
      </xs:complexContent>
308 309 310 311 312 313 314 315 316 317 318
    </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>
319 320 321 322 323 324 325 326 327 328 329 330
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <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:extension>
      </xs:complexContent>
331 332 333 334 335 336 337 338 339 340 341
    </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>
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
      <xs:complexContent>
        <xs:extension base="DocDef">
          <xs:sequence>
            <xs:element minOccurs="0" ref="Data"/>
          </xs:sequence>
          <xs:attribute name="name" use="required"/>
          <xs:attribute name="optional" type="xs:boolean"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:group name="ExtendsDef">
    <xs:sequence>
      <xs:element minOccurs="0" ref="extends"/>
    </xs:sequence>
  </xs:group>
358 359 360 361 362
  <xs:element name="extends">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="excludes"/>
      </xs:sequence>
ankraft's avatar
ankraft committed
363
      <xs:attribute name="domain" use="required" type="xs:Name"/>
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
      <xs:attribute name="class" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="excludes">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="exclude"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="exclude">
    <xs:complexType>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="type" use="required"/>
    </xs:complexType>
  </xs:element>
380
</xs:schema>