<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema  targetNamespace="http://www.cs.indiana.edu/dde/namespaces/2008/02/catalog/domain"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:lead="http://schemas.leadproject.org/2007/01/lms/lead" 
             xmlns:fgdc="http://schemas.leadproject.org/2007/01/lms/fgdc" 
             xmlns:le="http://schemas.leadproject.org/2007/01/lms/leadelements" 
             xmlns:cat="http://www.cs.indiana.edu/dde/namespaces/2008/02/catalog/domain"
             xml:lang="en"
             elementFormDefault="qualified"
             attributeFormDefault="unqualified">

	<!-- Imports and Includes-->
	<xsd:import namespace="http://schemas.leadproject.org/2007/01/lms/lead"/>

	<!-- ************ -->
	<!-- Object Types -->
	<!-- ************ -->
	<xsd:complexType name="catalogDataType">
		<xsd:annotation>
			<xsd:documentation>
				The catalog data element is defined in the xmccat_types_metadata schema
				as being of this catalogDataType.  This allows each domain to defined its
				own object types in the choice within this type.
				Defining the type here allows each domain to only need an XML Bean compiled
				for this xmccat_domain_metadata schema - the same XML Bean can be used for
				the xmccat types schema for all domains.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:choice>
				<xsd:group ref="cat:catalogObjectGroup"/>
			</xsd:choice>
			<xsd:element name="catalogType" type="cat:catalogAggregationType" />
			<xsd:element name="parentId" type="xsd:string" minOccurs="0" />
		</xsd:sequence>
	</xsd:complexType>


	<xsd:complexType name="objectResponseType">
		<xsd:sequence>
			<xsd:group ref="cat:catalogObjectGroup"/>
			<xsd:element ref="cat:objectResponse" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="objectClass" type="cat:catalogAggregationType" use="required"/>
		<xsd:attribute name="objectId" type="xsd:string" use="required"/>
		<xsd:attribute name="hasChildren" type="xsd:boolean" default="false" use="optional"/>
	</xsd:complexType>

	<xsd:element name="objectResponse" type="cat:objectResponseType"/>

	<xsd:complexType name="propertyResponseType">
		<xsd:sequence>
			<xsd:group ref="cat:propertyFilterGroup" minOccurs="0"/>
			<xsd:element ref="cat:propertyResponse" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="objectClass" type="cat:catalogAggregationType" use="required"/>
		<xsd:attribute name="objectId" type="xsd:string" use="required"/>
		<xsd:attribute name="hasChildren" type="xsd:boolean" default="false" use="optional"/>
	</xsd:complexType>

	<xsd:element name="propertyResponse" type="cat:propertyResponseType"/>

	<!-- ***************************************************************************************** -->
	<!-- ****                          DOMAIN SPECIFIC CONFIGURATION                          **** -->
	<!-- ****                                                                                 **** -->
	<!-- ****  Domain specific changes should only be made to the section below this point.   **** -->
	<!-- ****  The part of the schema above this point should NOT be modified.                **** -->
	<!-- ***************************************************************************************** -->
	<xsd:simpleType name="catalogAggregationType">
		<xsd:annotation>
			<xsd:documentation>
				THE OBJECT TYPES ARE DEFINED FOR EACH DOMAIN AND 
				MUST ALSO BE DEFINED IN THE DATABASE.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="FILE"/>
			<xsd:enumeration value="COLLECTION"/>
			<xsd:enumeration value="EXPERIMENT"/>
			<xsd:enumeration value="PROJECT"/>
		</xsd:restriction>
	</xsd:simpleType>

	<!-- Catalog Object Insert and Query Response -->
	<xsd:group name="catalogObjectGroup">
		<xsd:annotation>
			<xsd:documentation>
				Each valid root metadata element for a domain should be 
				listed as one of the choices within this type. The any
				element should be replaced.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:choice>
				<xsd:any processContents="lax" minOccurs="0" maxOccurs="0"/>
				<xsd:element ref="lead:LEADresource"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:group>

	<!-- ************** -->
	<!-- Add Properties -->
	<!-- ************** -->
	<xsd:complexType name="catalogPropertyAddType">
		<xsd:sequence>
			<xsd:choice>
				<xsd:element ref="fgdc:theme"/>
				<xsd:element ref="fgdc:place"/>
				<xsd:element ref="fgdc:stratum"/>
				<xsd:element ref="fgdc:temporal"/>
				<xsd:element ref="lead:geospatial"/>
				<xsd:element ref="fgdc:dsgpoly"/>
				<xsd:element ref="le:vertdom"/>
				<xsd:element ref="lead:eainfo"/>
				<xsd:element ref="fgdc:detailed"/>
				<xsd:element ref="fgdc:overview"/>
				<xsd:element ref="lead:distinfo"/>
				<xsd:element ref="fgdc:stdorder"/>
				<xsd:element ref="lead:dataqual"/>
				<xsd:element ref="le:procstep"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:element name="catalogPropertyAdd" type="cat:catalogPropertyAddType"/>


	<!-- ***************** -->
	<!-- Update Properties -->
	<!-- ***************** -->
	<xsd:complexType name="catalogPropertyUpdateType">
		<xsd:sequence>
			<xsd:choice>
				<xsd:element ref="lead:citation"/>
				<xsd:element ref="lead:descript"/>
				<xsd:element ref="lead:status"/>
				<xsd:element ref="lead:accconst"/>
				<xsd:element ref="lead:useconst"/>
				<xsd:element ref="fgdc:theme"/>
				<xsd:element ref="fgdc:place"/>
				<xsd:element ref="fgdc:stratum"/>
				<xsd:element ref="fgdc:temporal"/>
				<xsd:element ref="lead:metainfo"/>
				<xsd:element ref="lead:timeperd"/>
				<xsd:element ref="fgdc:bounding"/>
				<xsd:element ref="fgdc:dsgpoly"/>
				<xsd:element ref="le:vertdom"/>
				<xsd:element ref="fgdc:detailed"/>
				<xsd:element ref="fgdc:overview"/>
				<xsd:element ref="fgdc:cntinfo"/>
				<xsd:element ref="fgdc:stdorder"/>
				<xsd:element ref="fgdc:complete"/>
				<xsd:element ref="le:procstep"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:element name="catalogPropertyUpdate" type="cat:catalogPropertyUpdateType"/>


	<!-- ********************************** -->
	<!-- AddQuery Meatadata Property Filter -->
	<!-- ********************************** -->
	<xsd:group name="propertyFilterGroup">
		<xsd:annotation>
			<xsd:documentation>
				All of the query response object types based on one or 
				more property filters use this group.
				The order of metadata properties included is based on the 
				order of the filters in the query.  Other than those where 
				the occurrance restriction is unbounded will generally only
				have a single instance since they occur only once in the schema.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:choice maxOccurs="unbounded">
				<xsd:element ref="lead:citation"/>
				<xsd:element ref="lead:descript"/>
				<xsd:element ref="lead:status"/>
				<xsd:element ref="lead:accconst"/>
				<xsd:element ref="lead:useconst"/>
				<xsd:element ref="fgdc:theme"/>
				<xsd:element ref="fgdc:place"/>
				<xsd:element ref="fgdc:stratum"/>
				<xsd:element ref="fgdc:temporal"/>
				<xsd:element ref="lead:metainfo"/>
				<xsd:element ref="lead:timeperd"/>
				<xsd:element ref="fgdc:bounding"/>
				<xsd:element ref="fgdc:dsgpoly"/>
				<xsd:element ref="le:vertdom"/>
				<xsd:element ref="fgdc:detailed"/>
				<xsd:element ref="fgdc:overview"/>
				<xsd:element ref="fgdc:cntinfo"/>
				<xsd:element ref="fgdc:stdorder"/>
				<xsd:element ref="fgdc:complete"/>
				<xsd:element ref="le:procstep"/>
				<xsd:element ref="le:resourceID"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:group>

</xsd:schema>
