<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2007 rel. 3 (http://www.altova.com) by francesco (ISTI) -->
<xs:schema xmlns="http://www.isti.cnr.it/costglue" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cmd="http://www.escience.clrc.ac.uk/schemas/scientific" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.isti.cnr.it/costglue" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xsi:schemaLocation="http://www.escience.clrc.ac.uk/schemas/scientific D:\Projects\Potorti\CCLRC.xsd">
	<!-- wnet.isti.cnr.it/software/costglue/schema/2007/CostGlue.xsd -->
	<!-- wnet.isti.cnr.it/software/costglue/schema/2007/CostGlue-CLRC.xsd -->
	<xs:import namespace="http://www.escience.clrc.ac.uk/schemas/scientific" schemaLocation="D:\Projects\Potorti\CCLRC.xsd"/>
	<xs:element name="CostGlueMetadata">
		<xs:complexType>
			<xs:choice>
				<xs:element ref="Study"/>
				<xs:element ref="DataGroup"/>
				<xs:element ref="Archive"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
	<xs:element name="Archive">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Study"/>
				<xs:element ref="DataGroup" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="Study" type="StudyType"/>
	<xs:element name="DataGroup" type="DataGroupType"/>
	<xs:complexType name="StudyType">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
			<xs:element name="Institution" type="cmd:InstitutionType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Person" type="cmd:StudyPersonType" maxOccurs="unbounded"/>
			<xs:element name="Information" type="cmd:StudyInformationType" minOccurs="0"/>
			<xs:element name="Notes" type="xs:string" minOccurs="0"/>
			<xs:element name="Investigation" type="InvestigationType"/>
			<xs:element name="RelatedPublication" type="cmd:PublicationType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="StudyID" type="xs:ID" use="required"/>
	</xs:complexType>
	<xs:complexType name="InvestigationType">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
			<xs:element name="InvestigationType" type="cmd:InvestigationTypes"/>
			<xs:element name="Abstract" type="xs:string" minOccurs="0"/>
			<!-- <xs:element name="Resources" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> -->
			<!-- <xs:element name="RelatedReference" type="cmd:RelatedReferenceType" minOccurs="0" maxOccurs="unbounded"/> -->
			<xs:element name="DataHolding" type="DataHoldingType"/>
			<xs:element name="People" type="PeopleType" minOccurs="0"/>
			<xs:element name="PostProcessingObject" type="PostProcessingObjectType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="InvestigationID" type="xs:ID" use="required"/>
	</xs:complexType>
	<xs:complexType name="DataHoldingType">
		<xs:sequence>
			<xs:element name="ArchiveID"/>
			<xs:element name="ArchiveName" type="xs:string"/>
			<xs:element name="ArchiveLocation" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="DataGroupRef" type="DataGroupRefType" maxOccurs="unbounded"/>
			<xs:element name="Parameters">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Parameter" type="FieldType" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="Fields">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Field" type="FieldType" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="DataGroupRefType">
		<xs:sequence>
			<xs:element name="DataGroupLocator">
				<xs:annotation>
					<xs:documentation>It should be a valid pointer to retrieve the row data as well as metadata</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="Abstract" type="xs:string" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ParametersType">
		<xs:sequence>
			<xs:element name="Parameter" type="ParameterType" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ParameterType">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
			<xs:element name="Value" type="xs:anySimpleType"/>
			<xs:element name="Type" type="xs:string"/>
			<xs:element name="Description" type="xs:string" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="FieldType">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
			<xs:element name="Type" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="PeopleType">
		<xs:choice>
			<xs:element name="PersonRef" type="xs:string"/>
			<xs:element name="Person" type="cmd:PersonType" maxOccurs="unbounded"/>
		</xs:choice>
	</xs:complexType>
	<xs:complexType name="PostProcessingObjectType">
		<xs:sequence>
			<xs:element name="Name" type="xs:string"/>
			<xs:element name="Abstract" type="xs:string"/>
			<xs:element name="MIME" type="xs:string"/>
			<xs:element name="Location" type="xs:string">
				<xs:annotation>
					<xs:documentation>Reference to retrieve the physical object from the CostGlue Archive</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="People" type="PeopleType" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="ID" type="xs:ID" use="required"/>
	</xs:complexType>
	<xs:complexType name="DataGroupType">
		<xs:sequence>
			<xs:element name="Description" type="xs:string" minOccurs="0"/>
			<xs:element name="Parameters" type="ParametersType"/>
			<xs:element name="Fields">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Field" type="FieldType"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="Size"/>
			<xs:element name="People" type="PeopleType" minOccurs="0"/>
			<xs:element name="Software" type="SoftwareType" minOccurs="0"/>
			<xs:element name="PostProcessingObject" type="PostProcessingObjectType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="ID" type="xs:ID" use="required">
			<xs:annotation>
				<xs:documentation>Unique IS referred by the schema instance associated to the Index Table</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="InvestigationID" type="xs:IDREF" use="required">
			<xs:annotation>
				<xs:documentation>Reference to the Investigation to which this Run is associated</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="StudyID" type="xs:IDREF" use="required">
			<xs:annotation>
				<xs:documentation>Reference to the Study to which this Run is associated</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="SoftwareType">
		<xs:complexContent>
			<xs:extension base="cmd:ProgramType">
				<xs:sequence>
					<xs:element name="Source" type="xs:anyURI" minOccurs="0"/>
					<xs:element name="Patch" type="SoftwareType" minOccurs="0" maxOccurs="unbounded"/>
					<xs:element name="Input" minOccurs="0"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>
