<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"
	elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<xs:element name="collections">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="collection" minOccurs="0" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="collection">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:long" />
				<xs:element name="name" type="xs:string" />
				<xs:element name="description" type="xs:string" />
				<xs:element name="type" type="CollectionType" />
				<xs:element name="languages">
					<xs:complexType>
						<xs:sequence>
							<xs:element ref="language" minOccurs="0" maxOccurs="unbounded" />
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="domains">
					<xs:complexType>
						<xs:sequence>
							<xs:element ref="domain" minOccurs="0" maxOccurs="unbounded" />
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="language">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:string" />
				<xs:element name="count" type="xs:int" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="domains">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="domain" minOccurs="0" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="domain">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:string" />
				<xs:element name="parent" type="xs:string" minOccurs="0" />
				<xs:element name="name" type="xs:string" />
				<xs:element name="count" type="xs:int" minOccurs="0" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="CollectionType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="public" />
			<xs:enumeration value="private" />
		</xs:restriction>
	</xs:simpleType>

	<xs:element name="ArrayOfTerm">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="term" minOccurs="0" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="term">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="term" type="xs:string" />
				<xs:element name="entryID" type="xs:long" />
				<xs:element name="collectionID" type="xs:long" />
				<xs:element name="collectionName" type="xs:string" />
				<xs:element name="collectionType" type="xs:long" />
				<xs:element name="domainID" type="xs:string" />
				<xs:element name="domainName" type="xs:string" />
				<xs:element name="language" type="xs:string" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="extractionResult">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="text" type="xs:string" />
				<xs:element name="terms" type="xs:string" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
