<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Tyler Bell (n/a) -->
<xs:schema targetNamespace="http://www.heritage-standards.org/midas/schema/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" id="heep_request" xmlns:midas="http://www.heritage-standards.org/midas/schema/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:annotation>
		<xs:documentation>This is the HEEP request schema, used to structure requests made from a HEEP client to a HEEP Service. It is part of the MIDAS namespace.</xs:documentation>
	</xs:annotation>
	<!-- Type definition for valid request criterion types, used within the 'reuqest' element -->
	<xs:simpleType name="matchtypes">
		<xs:restriction base="xs:string">
			<xs:enumeration value="contains"/>
			<xs:enumeration value="isexactly"/>
			<xs:enumeration value="beginswith"/>
			<xs:enumeration value="endswith"/>
			<xs:enumeration value="isgreaterthan"/>
			<xs:enumeration value="islessthan"/>
			<xs:enumeration value="isgreaterthanorequalto"/>
			<xs:enumeration value="islesthanorequalto"/>
			<xs:enumeration value="isnot"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- Type definition for valid request boolean, used within the 'reuqest' element -->
	<xs:simpleType name="booltypes">
		<xs:restriction base="xs:string">
			<xs:enumeration value="and"/>
			<xs:enumeration value="or"/>
			<xs:enumeration value="not"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- Begin /HEEP_request -->
	<xs:element name="HEEP_request">
		<xs:annotation>
			<xs:documentation>Root node for the HEEP request.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="auth" minOccurs="0">
					<xs:annotation>
						<xs:documentation>Use either session or authinfo, not both</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:choice>
							<xs:element name="session" minOccurs="0"/>
							<!-- Begin /HEEP_request/auth -->
							<xs:element name="authinfo" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Empty authentication element containing username and passwd elements.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<!-- Begin /HEEP_request/auth/username -->
										<xs:element name="username">
											<xs:annotation>
												<xs:documentation>Authentication username.</xs:documentation>
											</xs:annotation>
										</xs:element>
										<!-- Begin /HEEP_request/auth/password -->
										<xs:element name="password">
											<xs:annotation>
												<xs:documentation>Authentication password.</xs:documentation>
											</xs:annotation>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:choice>
					</xs:complexType>
				</xs:element>
				<!-- Begin /HEEP_request/request -->
				<xs:element name="request">
					<xs:annotation>
						<xs:documentation>Empty element containing structured informaiton about the request</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<!-- Begin /HEEP_request/request /requesttype-->
							<xs:element name="requesttype">
								<xs:annotation>
									<xs:documentation>The type of request: GetData, GetCap, GetQuerySummary</xs:documentation>
								</xs:annotation>
							</xs:element>
							<!-- Begin /HEEP_request/request /dataset-->
							<xs:element name="requestnode" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>The dataset(s), capabilitites, or other requested elements</xs:documentation>
								</xs:annotation>
							</xs:element>
							<!-- Begin /HEEP_request/request /queryset-->
							<xs:element name="queryset">
								<xs:annotation>
									<xs:documentation>Used for data queries only; this empty element contains  data used to build the query itself</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<!-- Begin /HEEP_request/request /queryset/criterion-->
										<!-- Elemenent definition for criterion type, used within the 'reuqest' element -->
										<xs:element ref="midas:bracketset"/>
										<xs:element name="sortby" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Node(s) to sort the results by. Expressed in xpath format.</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="start" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Record to start returning results on. Base 1</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="limit" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Number of records to return from the results of a given select set.</xs:documentation>
											</xs:annotation>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="service" type="xs:string" use="optional" default="FISH:HEEP"/>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="version" type="xs:decimal" use="optional" default="1"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- Globale element 'criterion' -->
	<xs:element name="criterion">
		<xs:annotation>
			<xs:documentation>String or number criterion / term or identifier being searched on.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="bool" type="midas:booltypes" use="optional" default="and">
				<xs:annotation>
					<xs:documentation>The Boolean operator to be use in conjunction with the preceeding criterion</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="node" type="xs:string" use="required">
				<xs:annotation>
					<xs:documentation>xpath node used to indicate the unit of information being queried (will be mapped to a field in the database by the HEEP Service designers)</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="matchtype" type="midas:matchtypes" use="optional" default="isexactly">
				<xs:annotation>
					<xs:documentation>One of a controlled list of string and integer comparisons: is exactly, isgreaterthan, beginswith, etc. (default: isexactly)</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<!-- Global element 'bracketset' -->
	<xs:element name="bracketset">
		<xs:annotation>
			<xs:documentation>Enclosed set of search criteria; can contain criteria/on or nested bracketsets</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="midas:criterion" maxOccurs="unbounded"/>
				<xs:element ref="midas:bracketset" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="bool" type="midas:booltypes" use="optional" default="and">
				<xs:annotation>
					<xs:documentation>The Boolean operator to be use in conjunction with the preceeding criterion</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="node" type="xs:string" use="required">
				<xs:annotation>
					<xs:documentation>xpath node used to indicate the unit of information being queried (will be mapped to a field in the database by the HEEP Service designers)</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<!-- <xs:element ref="midas:criterion" minOccurs="1" maxOccurs="unbounded"/> -->
		</xs:complexType>
	</xs:element>
</xs:schema>
