<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Markus Doering (BGBM, FU-Berlin) -->
<!-- Setup schema for BioCASE providers -->
<!-- Authors: M.Doering, A.Guentsch, A.Hahn -->
<!-- Botanic Museum and Botanical Garden Berlin-Dahlem -->
<xs:schema targetNamespace="http://www.biocase.org/schemas/providersetup/1.0" xmlns="http://www.biocase.org/schemas/providersetup/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="Provider">
		<xs:annotation>
			<xs:documentation>Providers Host Configuration</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="Host">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="User" type="xs:string"/>
							<xs:element name="Password" type="xs:string"/>
							<xs:element name="Datasource" type="xs:string"/>
							<xs:element name="IP" type="xs:anyURI"/>
							<xs:element name="DBMS">
								<xs:annotation>
									<xs:documentation>kind (brand) of DBMS used. will be a  controlled vocabulary.</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:enumeration value="db2"/>
										<xs:enumeration value="informix"/>
										<xs:enumeration value="ingres"/>
										<xs:enumeration value="interbase"/>
										<xs:enumeration value="mysql"/>
										<xs:enumeration value="odbc"/>
										<xs:enumeration value="odbc_tsql"/>
										<xs:enumeration value="oracle"/>
										<xs:enumeration value="postgresql"/>
										<xs:enumeration value="sybase"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element name="TextEncoding" type="xs:string"/>
							<xs:element name="RecordResultLimit" type="xs:integer" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Limits the maximum of records returned for a query.</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="DB">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="TableAlias" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>A list of aliases for tables and their keys representing the DB structure. All aliases have to be unique and no circular relation is allowed.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:complexContent>
										<xs:extension base="TableType"/>
									</xs:complexContent>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="SupportedSchemas">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Schema" minOccurs="0" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>holds the filepath to one DBmapping file.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:simpleContent>
										<xs:extension base="xs:string">
											<xs:attribute name="namespace" type="xs:string" use="required"/>
											<xs:attribute name="request" type="xs:boolean" use="required"/>
											<xs:attribute name="response" type="xs:boolean" use="required"/>
										</xs:extension>
									</xs:simpleContent>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="TableType">
		<xs:sequence>
			<xs:element name="PrimaryKey">
				<xs:annotation>
					<xs:documentation>The primary key(s) of the table.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Attribute" type="xs:string" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="ForeignKey" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>for every foreign key in the table, the targeted alias of a table is given as a attribute.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Attribute" type="xs:string" maxOccurs="unbounded">
							<xs:annotation>
								<xs:documentation>Attribute(s) that are the foreign keys. Have to be in the same order as the primary keys of the table they are pointing to.</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:sequence>
					<xs:attribute name="target" type="xs:string" use="required"/>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="alias" type="xs:string" use="required"/>
		<xs:attribute name="tablename" type="xs:string" use="required"/>
	</xs:complexType>
</xs:schema>
