<?xml version = "1.0" encoding = "UTF-8"?>
<!--
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (C) 2007 Open Microscopy Environment
#       Massachusetts Institute of Technology,
#       National Institutes of Health,
#       University of Dundee
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!--
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Written by:  
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->

<!--
RC2 was the STD definition from 2004-2007
RC3 added internationalization with labels (Josiah Johnston) was not available to HEAD
RC4 introduced polymorphism with the Parent attribute and
	optional DBLocation (STs moved to one-ST per table).
	RC4 joined into HEAD after the 2.6.1 release
-->

<!--Generated by Turbo XML 2.3.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
	 targetNamespace = "http://www.openmicroscopy.org/XMLschemas/STD/RC3/STD.xsd"
	 xmlns:STD = "http://www.openmicroscopy.org/XMLschemas/STD/RC3/STD.xsd"
	 version = "RC4"
	 elementFormDefault = "qualified">
	<import namespace = "http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
	<element name = "Element">
		<annotation>
			<documentation>Describes a field of a SemanticType</documentation>
		</annotation>
		<complexType>
			<sequence>
				<element ref = "STD:Label" minOccurs = "0" maxOccurs = "unbounded"/>
				<element ref = "STD:Description" minOccurs = "0" maxOccurs = "unbounded"/>
			</sequence>
			<attribute name = "Name" use = "required">
				<simpleType>
					<restriction base = "string">
						<maxLength value = "64"/>
					</restriction>
				</simpleType>
			</attribute>
			<attribute name = "DBLocation" use = "optional" type = "string"/>
			<attribute name = "Parent" use = "optional" type = "string"/>
			<attribute name = "DataType" use = "required">
				<simpleType>
					<restriction base = "string">
						<enumeration value = "bigint"/>
						<enumeration value = "integer"/>
						<enumeration value = "smallint"/>
						<enumeration value = "double"/>
						<enumeration value = "float"/>
						<enumeration value = "boolean"/>
						<enumeration value = "string"/>
						<enumeration value = "reference"/>
					</restriction>
				</simpleType>
			</attribute>
			<attribute name = "RefersTo" type = "string"/>
		</complexType>
	</element>
	<element name = "SemanticType">
		<annotation>
			<documentation>
				Defines a semantic type.
				Notes:
				Granularity of SemanticType is infered from the granularity of the record it derives from. In a record, this granularity is specified by the AppliesTo attribute.
			</documentation>
		</annotation>
		<complexType>
			<sequence>
				<element ref = "STD:Label" minOccurs = "0" maxOccurs = "unbounded"/>
				<element ref = "STD:Description" minOccurs = "0" maxOccurs = "unbounded"/>
				<element ref = "STD:Element" maxOccurs = "unbounded"/>
			</sequence>
			<attribute name = "Name" use = "required">
				<simpleType>
					<restriction base = "string">
						<maxLength value = "64"/>
					</restriction>
				</simpleType>
			</attribute>
			<attribute name = "AppliesTo" use = "required">
				<annotation>
					<documentation>This specifies what this record is an attribute of. The options are Global, Dataset, Image, or Feature.
					</documentation>
				</annotation>
				<simpleType>
					<restriction base = "string">
						<enumeration value = "G"/>
						<enumeration value = "D"/>
						<enumeration value = "I"/>
						<enumeration value = "F"/>
						<length value = "1"/>
					</restriction>
				</simpleType>
			</attribute>
		</complexType>
		<unique name = "SemanticElement">
			<selector xpath = "STD:SemanticElement"/>
			<field xpath = "@Name"/>
		</unique>
	</element>
	<element name = "SemanticTypeDefinitions">
		<annotation>
			<documentation>Describes semantic types that can be derived from custom attributes. </documentation>
		</annotation>
		<complexType>
			<sequence>
				<element ref = "STD:SemanticType" maxOccurs = "unbounded"/>
			</sequence>
		</complexType>
		<unique name = "SemanticTypeName">
			<selector xpath = "STD:SemanticType"/>
			<field xpath = "@SemanticTypeName"/>
		</unique>
	</element>
	<attribute name = "SemanticTypeName">
		<simpleType>
			<restriction base = "string">
				<maxLength value = "64"/>
			</restriction>
		</simpleType>
	</attribute>
	<element name = "Description">
		<annotation>
			<documentation>
				Just some free-form text to describe Images, Screens and Projects.
				The content model is ANY, which means that en entire XML sub-document can be placed here.
			</documentation>
		</annotation>
		<complexType>
			<simpleContent>
				<extension base = "string">
					<attribute ref = "xml:lang" default = "en"/>
				</extension>
			</simpleContent>
		</complexType>
	</element>
	<element name = "Label">
		<complexType>
			<simpleContent>
				<extension base = "string">
					<attribute ref = "xml:lang" default = "en"/>
				</extension>
			</simpleContent>
		</complexType>
	</element>
</schema>