Open Data Format (O-DF), an Open Group Internet of Things (IoT) Standard – O-DF XSD Schema (Normative)
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited by Kary Främling (Aalto University) -->
<!-- Root Data Model Schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Object" type="ObjectType"/>
<xs:element name="InfoItem" type="InfoItemType"/>
<xs:element name="value" type="valueType"/>
<xs:element name="Objects" type="ObjectsType">
<xs:annotation>
<xs:documentation>Data Model Root Element</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="ObjectsType">
<xs:sequence>
<xs:element ref="Object" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="version" use="optional">
<xs:annotation>
<xs:documentation>Schema version used.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="ObjectType">
<xs:sequence>
<xs:element name="id" type="qlmID" maxOccurs="unbounded"/>
<xs:element ref="description" minOccurs="0"/>
<xs:element ref="InfoItem" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="Object" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="type"/>
<xs:anyAttribute>
<xs:annotation>
<xs:documentation>Proprietary or extended attributes.</xs:documentation>
</xs:annotation>
</xs:anyAttribute>
</xs:complexType>
<xs:complexType name="InfoItemType">
<xs:sequence>
<xs:element name="name" type="qlmID" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Optional list of other names for the same InfoItem.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element ref="description" minOccurs="0"/>
<xs:element name="MetaData" minOccurs="0">
<xs:annotation>
<xs:documentation>Meta-data about the InfoItem, such as "latency", "unit" etc.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="InfoItem" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="value" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" use="required">
<xs:annotation>
<xs:documentation>Name of InfoItem, such as "PowerConsumption", "Diameter" or similar.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute>
<xs:annotation>
<xs:documentation>Proprietary or extended attributes.</xs:documentation>
</xs:annotation>
</xs:anyAttribute>
</xs:complexType>
<xs:element name="description">
<xs:annotation>
<xs:documentation>String with some"human-readable" text.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="lang" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Language of "description" text.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute>
<xs:annotation>
<xs:documentation>Proprietary or extended attributes.</xs:documentation>
</xs:annotation>
</xs:anyAttribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:complexType name="qlmID">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="idType" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Text identifying the ID schema.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="tagType" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>Text identifying the ID Tag media type.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="startDate" type="xs:dateTime" use="optional">
<xs:annotation>
<xs:documentation>Start of validity for the ID</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="endDate" type="xs:dateTime" use="optional">
<xs:annotation>
<xs:documentation>End of validity for the ID</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute>
<xs:annotation>
<xs:documentation>Proprietary attributes.</xs:documentation>
</xs:annotation>
</xs:anyAttribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="valueType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="type" use="optional" default="xs:string">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="dateTime" type="xs:dateTime" use="optional"/>
<xs:attribute name="unixTime" type="xs:long" use="optional"/>
<xs:anyAttribute/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>