<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="comment">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:string"/>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="thesaurus">
		<xs:annotation>
			<xs:documentation>тезаурус </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="thesaurusDescription" type="xs:string"/>
				<xs:element name="date" type="xs:date"/>
				<xs:element name="originatingEntity" type="xs:string"/>
				<xs:element name="UDC" type="xs:string"/>
				<xs:element name="sourceIdentifier" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="conceptEntry" maxOccurs="unbounded"/>
				<xs:element ref="comment" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:string"/>
		</xs:complexType>
		<xs:key name="uniqueConcepts">
			<xs:selector xpath="conceptEntry"/>
			<xs:field xpath="@conceptId"/>
		</xs:key>
		<xs:keyref name="linkedConcepts" refer="uniqueConcepts">
			<xs:selector xpath="conceptEntry/link"/>
			<xs:field xpath="@conceptEntry"/>
		</xs:keyref>
	</xs:element>
	<xs:simpleType name="linkType" final="restriction">
		<xs:restriction base="xs:string">
			<xs:enumeration value="relatedConcept"/>
			<xs:enumeration value="broaderConceptGeneric"/>
			<xs:enumeration value="broaderConceptPartitive"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="categoryType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="subject"/>
			<xs:enumeration value="object"/>
			<xs:enumeration value="process"/>
			<xs:enumeration value="property"/>
			<xs:enumeration value="abstract"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="conceptEntry">
		<xs:annotation>
			<xs:documentation>концепция</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="termEntry" maxOccurs="unbounded"/>
				<xs:element name="characteristic" type="xs:string" minOccurs="0"/>
				<xs:element name="definition" type="xs:string" minOccurs="0"/>
				<xs:element name="link" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:attribute name="name" type="linkType" use="optional"/>
						<xs:attribute name="conceptEntry" type="xs:string" use="required"/>
					</xs:complexType>
				</xs:element>
				<xs:element name="figure" type="xs:anyURI" minOccurs="0"/>
				<xs:element ref="comment" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="conceptId" type="xs:string" use="required"/>
			<xs:attribute name="category" type="categoryType" use="optional"/>
		</xs:complexType>
		<xs:unique name="singleLink">
			<xs:selector xpath="link"/>
			<xs:field xpath="@conceptEntry"/>
		</xs:unique>
	</xs:element>
	<xs:element name="termEntry">
		<xs:annotation>
			<xs:documentation>термин</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="term" type="xs:string"/>
				<xs:element name="acronym" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="variant" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="cognate" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="context" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="weight" type="xs:anySimpleType" minOccurs="0"/>
				<xs:element ref="comment" minOccurs="0"/>
			</xs:sequence>
			<xs:attribute name="lang" type="xs:language" use="required"/>
			<xs:attribute name="id" use="required"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
