<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:annotation>
    <xs:documentation>Standard part of any Resource Profile</xs:documentation>
  </xs:annotation>
  <xs:element name="RESOURCE_PROFILE">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="HEADER" type="HEADERType"/>
        <xs:element name="BODY" type="BODYType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="HEADERType">
    <xs:all>
      <xs:element name="RESOURCE_IDENTIFIER" type="RESOURCE_IDENTIFIERType"/>
      <xs:element name="RESOURCE_TYPE" type="RESOURCE_TYPEType"/>
      <xs:element name="RESOURCE_KIND" type="RESOURCE_KINDType"/>
      <xs:element name="RESOURCE_URI" type="RESOURCE_URIType"/>
      <xs:element name="DATE_OF_CREATION" type="DATEType"/>
    </xs:all>
  </xs:complexType>
  <xs:complexType name="BODYType">
    <xs:sequence>
      <xs:element name="CONFIGURATION" type="CONFIGURATIONType"/>
      <xs:element name="STATUS" type="STATUSType"/>
      <xs:element ref="SECURITY_PARAMETERS"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="RESOURCE_IDENTIFIERType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="RESOURCE_TYPEType">
    <xs:attribute name="value" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="VocabularyDSResourceType"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="RESOURCE_KINDType">
    <xs:attribute name="value" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="VocabularyDSResources"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="RESOURCE_URIType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="DATEType">
    <xs:attribute name="value" type="xs:dateTime" use="required"/>
  </xs:complexType>
  <xs:annotation>
    <xs:documentation>Customisable part of any Resource Profile</xs:documentation>
  </xs:annotation>
  <xs:complexType name="CONFIGURATIONType">
    <xs:sequence>
      <xs:element ref="VOCABULARY_NAME" />
      <xs:element ref="VOCABULARY_DESCRIPTION"/>
      <xs:element name="TERMS" type="VOCABULARYTERMType"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="VOCABULARYTERMType">
    <xs:sequence>
      <xs:element name="TERM" type="TERMType" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TERMType">
    <xs:sequence>
      <xs:element name="SYNONYMS">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="SYNONYM" type="SYNONYMType" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    	<xs:element name="RELATIONS" minOccurs="0">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="RELATION" type="RELATIONType" minOccurs="0" maxOccurs="unbounded"/>
    			</xs:sequence>
    		</xs:complexType>    		
    	</xs:element>	
    </xs:sequence>
    <xs:attribute name="encoding" type="xs:string" use="required"/>
    <xs:attribute name="english_name" type="xs:string" use="required"/>
    <xs:attribute name="native_name" type="xs:string" use="required"/>
    <xs:attribute name="code" type="xs:string" use="optional"/>
  </xs:complexType>
  <xs:complexType name="SYNONYMType">
    <xs:attribute name="encoding" type="xs:string" use="required"/>
    <xs:attribute name="term" type="xs:string" use="required"/>
  </xs:complexType>
	<xs:complexType name="RELATIONType">
		<xs:attribute name="type" type="xs:string" use="required"/>
		<xs:attribute name="code" type="xs:string" use="required"/>
	</xs:complexType>	
  <xs:complexType name="STATUSType">
    <xs:all>
      <xs:element name="LAST_UPDATE" type="DATEType"/>
    </xs:all>
  </xs:complexType>
  <xs:element name="VOCABULARY_NAME">
	<xs:complexType>
    	<xs:simpleContent>
      		<xs:extension base="xs:string">
				<xs:attribute name="code" type="xs:string" use="optional"></xs:attribute>
   			</xs:extension>
      	</xs:simpleContent>
   </xs:complexType>
  </xs:element>
  <xs:element name="VOCABULARY_DESCRIPTION" type="xs:string"/>
  <xs:element name="SECURITY_PARAMETERS" type="xs:string"/>
</xs:schema>