<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by Markus Doering (BGBM, FU-Berlin) -->
<!-- A schema to create configuration files for database providers to link their arbitrary database to the generic unit-wrapper of BioCASE -->
<!-- Authors: M.Doering, A.Guentsch, A.Hahn -->
<!-- Botanic Museum and Botanical Garden Berlin-Dahlem -->
<xs:schema targetNamespace="http://www.biocase.org/schemas/conceptmapping/1.0" xmlns="http://www.biocase.org/schemas/conceptmapping/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="conceptMapping">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="schemaNamespace" type="urlType">
					<xs:annotation>
						<xs:documentation>the Namespace of the described/configured Schema. Should include the version of the schema eg http://www.bgbm.org/tdwg/abcd/v1.0</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="recordIdentifier" type="pathType">
					<xs:annotation>
						<xs:documentation>The xpath to the element used as the Identifier for the basic record of the concept. E.g Units for ABCD, or maybe names for other concepts. Important for the count method.</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="dataElement" type="elementType">
					<xs:annotation>
						<xs:documentation>An element (inherits attribute properties)</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="attributeType">
		<xs:sequence>
			<xs:element name="name" type="xs:string"/>
			<xs:element name="w3cType" type="xs:string" minOccurs="0"/>
			<xs:element name="vocabulary" minOccurs="0">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="term" maxOccurs="unbounded">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="schemaTerm" type="xs:string"/>
									<xs:element name="dbTerm" type="xs:string" minOccurs="0"/>
								</xs:sequence>
							</xs:complexType>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="repMin" type="xs:integer"/>
			<xs:element name="annot" type="xs:string" minOccurs="0"/>
			<xs:element name="dbAttribute" minOccurs="0">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="dbTable" type="xs:string" use="required"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="path" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="elementType">
		<xs:complexContent>
			<xs:extension base="attributeType">
				<xs:sequence>
					<xs:element name="repMax" type="xs:string"/>
					<xs:element name="choiceNodeId" type="xs:integer" minOccurs="0"/>
					<xs:element name="choiceElemId" type="xs:integer" minOccurs="0"/>
					<xs:element name="prefChoiceElemId" minOccurs="0">
						<xs:complexType>
							<xs:simpleContent>
								<xs:extension base="xs:integer">
									<xs:attribute name="prefChoiceNodeId" type="xs:integer" use="required"/>
								</xs:extension>
							</xs:simpleContent>
						</xs:complexType>
					</xs:element>
					<xs:element name="dontRepeat" type="xs:boolean" minOccurs="0"/>
					<xs:element name="attributes" minOccurs="0">
						<xs:complexType>
							<xs:sequence>
								<xs:element name="attr" type="attributeType" maxOccurs="unbounded"/>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
					<xs:element name="childElements" minOccurs="0">
						<xs:complexType>
							<xs:sequence>
								<xs:element name="dataElement" type="elementType" maxOccurs="unbounded"/>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:simpleType name="urlType">
		<xs:annotation>
			<xs:documentation>A simpleType to represent a URL that does a pattern match to verify a full URL without whitespace.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="http://[^ ]*[^., \n\t>&quot;]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="pathType">
		<xs:annotation>
			<xs:documentation>A simpleType to represent an xpath-type used for querying.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="(/[a-zA-Z0-9_\-]+)+(\[@[a-zA-Z0-9_\-]+\])?"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>

