<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	
	<xsd:complexType name="IntervalType">
		<xsd:attribute name="right" type="xsd:positiveInteger" use="required" />
		<xsd:attribute name="left" type="xsd:positiveInteger" use="required" />
    	<!-- <xsd:assert test="@right >= @left" /> -->
	</xsd:complexType>
	
	<xsd:complexType name="IntervalsListType">
		<xsd:sequence>
			<xsd:element name="interval" type="IntervalType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
	</xsd:complexType>
			
	<xsd:simpleType name="RegionType">
		<xsd:restriction base="xsd:string" >
			<xsd:enumeration value="ORDER" />
			<xsd:enumeration value="DISORDER" />
			<xsd:enumeration value="UNKNOWN" />
		</xsd:restriction>
	</xsd:simpleType>
			
	<xsd:complexType name="OrderLevelType">
		<xsd:sequence>
			<xsd:element name="intervals" type="IntervalsListType" maxOccurs="1" />
		</xsd:sequence>
		<xsd:attribute name="value" type="RegionType" use="required" />
	</xsd:complexType>
	
	<xsd:complexType name="ProteinType">
		<xsd:sequence>
			<xsd:element name="order_level" type="OrderLevelType" minOccurs="0" maxOccurs="unbounded" />
		</xsd:sequence>
		<xsd:attribute name="name" type="xsd:string" use="required" />
	</xsd:complexType>
	
	<xsd:element name="protein" type="ProteinType">
		<xsd:unique name="uniqueOrderLevelType">
			<xsd:selector xpath="./order_level" />
			<xsd:field xpath="@value" />
		</xsd:unique>
	</xsd:element>
</xsd:schema>