<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://textgrid.info/namespaces/metadata/core/2010"
	elementFormDefault="qualified" xml:lang="en" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://textgrid.info/namespaces/metadata/core/2010"
	xmlns:tgl="http://textgrid.info/namespaces/metadata/language/2010"
	xmlns:tgs="http://textgrid.info/namespaces/metadata/script/2010"
	xmlns:tgr="http://textgrid.info/namespaces/metadata/agent/2010"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="2.0"	
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

	<xs:import namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
		schemaLocation="rdf.xsd"/>
	<xs:import namespace="http://textgrid.info/namespaces/metadata/language/2010"
		schemaLocation="textgrid-metadata-language_v2_2010.xsd"/>
	<xs:import namespace="http://textgrid.info/namespaces/metadata/script/2010"
		schemaLocation="textgrid-metadata-script_2010.xsd"/>
	<xs:import namespace="http://textgrid.info/namespaces/metadata/agent/2010"
		schemaLocation="textgrid-metadata-agent_2010.xsd"/>

	<xs:complexType name="dateType">
		<xs:annotation>
			<xs:documentation>same function as our old sub-schema </xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:token">
				<xs:attribute name="date" type="tns:isoDate" use="optional"/>
				<xs:attribute name="notBefore" type="tns:isoDate" use="optional"/>
				<xs:attribute name="notAfter" type="tns:isoDate" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:simpleType name="isoDate">
		<xs:union memberTypes="xs:date xs:gYear xs:gYearMonth"/>
	</xs:simpleType>

	<xs:complexType name="identifierType">
		<xs:annotation>
			<xs:documentation>An unambiguous reference to the resource within a given context. Same
				as: http://purl.org/dc/terms/identifier </xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:token">
				<xs:attribute name="type" type="xs:token" use="required">
					<xs:annotation>
						<xs:documentation>The type of the URI in a non-TextGrid context (e.g., a
							ISBN or ISSN, a shelfmark, a registration or inventary
							number)</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="authorityType">
		<xs:annotation>
			<xs:documentation>references to authority files like thesauri etc. </xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="id" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:token">
							<xs:attribute name="type" type="xs:anyURI" use="optional">
								<xs:annotation>
									<xs:documentation>The type of the ID in a non-textgrid context
									</xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="value" type="xs:token" minOccurs="1" maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="relationType">
		<xs:sequence>
			<xs:element name="isDerivedFrom" type="xs:anyURI" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Link to an object the described
						textgrid object is derived from.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="isAlternativeFormatOf" type="xs:anyURI" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Link to an object having the same content as the described
						textgrid object but in another format. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="hasAdaptor" type="xs:anyURI" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Link to an object which is an adaptor of the described
						textgrid object.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="hasSchema" type="xs:anyURI" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Link to an object which is a schema of the described textgrid
						object.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element ref="rdf:RDF" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="generatedType">
		<xs:annotation>
			<xs:documentation>The generatedType is cerated by the middleware (TG-crud), and is
				delivered with every T-crud call, that delivers back the metadata ObjectType. With
				every #UPDATE or #UPDATEMETADATA call this generatedType must also be sent in the
				request parameter's objectType, to be able to handle concurrent modification of
				TextGrid objects.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="created" type="xs:dateTime" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Date of creation of the resource. Same as:
						http://purl.org/dc/terms/created. TODO Datentyp spezifizieren
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="lastModified" type="xs:dateTime" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Date on which the resource was changed. Same as:
						http://purl.org/dc/terms/modified. TODO Datentyp spezifizieren
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="issued" type="xs:dateTime" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Date of formal issuance (e.g., publication) of the resource.
						Same as: http://purl.org/dc/terms/issued. TODO Datentyp (oder xs:date?)
						spezifizieren</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="textgridUri" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Subproperty of identifier. An unambiguous reference to the
						resource within the textgrid context. Subproperty of identifier:
						http://purl.org/dc/elements/1.1/identifier. Hier in jedem Falle die
						TextGrid-URI (NOID). FIXME für die Fälle (1) veröffentlicht (PID – oder
						kommt der in ../provided/identifier?), (2) externe Datenquelle (oder auch
						der nicht hier?) noch weitere Identifier hier? Sonst Kardinalität auf 1..1
						setzen. </xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:anyURI">
							<xs:attribute name="extRef" type="xs:anyURI" use="optional">
								<xs:annotation>
									<xs:documentation>The TG metadata refer to an external object
									</xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="revision" type="xs:int" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>revision number</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="pid" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>persistent identifier</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:token">
							<xs:attribute name="pidType" default="handle">
								<xs:annotation>
									<xs:documentation>PID type</xs:documentation>
								</xs:annotation>
								<xs:simpleType>
									<xs:restriction base="xs:token">
										<xs:enumeration value="handle"/>
										<xs:enumeration value="urn"/>
										<xs:enumeration value="doi"/>
										<xs:enumeration value="ark"/>
										<xs:enumeration value="purl"/>
										<xs:enumeration value="other"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="extent" type="xs:nonNegativeInteger" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The size of the resource in bytes. Same as:
						http://purl.org/dc/terms/extent. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="fixity" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>"Information used to verify whether an object has been altered
						in an undocumented or unauthorized way." - stolen from the PREMIS Object
						Entity sub-schema, see
						http://www.loc.gov/standards/premis/v1/Object-v1-1.xsd. For detailed
						documentation see the PREMIS Data Dictionary
						(http://www.loc.gov/standards/premis/v2/premis-dd-2-0.pdf) section
						1.5.2</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:element name="messageDigestAlgorithm" minOccurs="1" maxOccurs="1"
							type="xs:token">
							<xs:annotation>
								<xs:documentation>The specific algorithm used to construct the
									message digest for the digital object, e.g. MD5, SHA-1..n etc.
								</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="messageDigest" minOccurs="1" maxOccurs="1"
							type="xs:token">
							<xs:annotation>
								<xs:documentation>The output of the message digest algorithm, i.e.
									the checksum</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="messageDigestOriginator" minOccurs="0" maxOccurs="1"
							type="xs:token">
							<xs:annotation>
								<xs:documentation>The agent that created the original message digest
									that is compared in a fixity check. In TextGrid: "TG-crud" or
									Service-endpoint?</xs:documentation>
							</xs:annotation>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="dataContributor" type="xs:anyURI" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Use for a person that submits data in textgrid. Same as:
						http://lcweb2.loc.gov/diglib/loc.terms/relators/DTC. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="project" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Project name and id. </xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:token">
							<xs:attribute name="id" type="xs:token" use="required"> </xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="warning" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Error report provided by the middleware when an incorrect
						textgrid object has been stored. </xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="uri" type="xs:anyURI" use="optional">
								<xs:annotation>
									<xs:documentation>The URI the warning occured.
									</xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="permissions" type="xs:token" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation> Same as accessRights
						("Information about who can access the resource or an indication of its
						security status" http://purl.org/dc/terms/accessRights) in textgrid?
						
						In TextGrid, this is dependent on the role of the person that accesses the resource.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="availability" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>information whether the TG object is subject of the (role
						based) rights management or isPublic or isStable </xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:annotation>
						<xs:documentation>possible values</xs:documentation>
					</xs:annotation>
					<xs:restriction base="xs:token">
						<xs:enumeration value="default"/>
						<xs:enumeration value="public"/>
						<xs:enumeration value="stable"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any">
				<xs:annotation>
					<xs:documentation>Reserved for future additions</xs:documentation>
				</xs:annotation>
			</xs:any>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="providedType">
		<xs:sequence>
			<xs:element name="title" type="xs:token" minOccurs="1" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A name given to the resource. Same as:
						http://purl.org/dc/terms/title; FIXME Uniform-Title allerdings ist 1..1
						:-(</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="identifier" type="tns:identifierType" minOccurs="0"
				maxOccurs="unbounded"/>
			<xs:element name="format" type="xs:token" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>File format of a textgrid object. Same as:
						http://purl.org/dc/terms/format. TODO Specification of type.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Anything that doesn't fit into the other fields.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="genericType">
		<xs:sequence>
			<xs:element name="provided" type="tns:providedType">
				<xs:annotation>
					<xs:documentation> Metadata provided by the client. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="generated" type="tns:generatedType" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation> Metadata generated by the middleware components.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="itemType">
		<xs:sequence>
			<xs:element name="rightsHolder" type="tgr:personType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation> Person or organization with copyright for an item. Same as:
						http://purl.org/dc/terms/rightsHolder FIXME dcterms-Problem wieder: Damit
						ist möglicherweise auch die Entscheidung, als Datentyp für die diversen
						Personenfelder wie rightsHolder etc. dcterms:irgendwas zu nehmen, hinfällig,
						da damit wohl keine Möglichkeit zur Spezifikation einer ID zusätzlich zum
						Inhaltsstring (Namen) gegeben ist. </xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="editionType">
		<xs:sequence>
			<xs:element name="isEditionOf" type="xs:anyURI" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Manifestation of which work? Value must be the TextGrid URI of
						a TextGrid Work object. Field is mandatory on publication. Same as:
						http://rdvocab.info/RDARelationshipsWEMI/manifestationOfWork
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="agent" type="tgr:agentType" minOccurs="1" maxOccurs="unbounded"/>
			<xs:element name="source" type="tns:sourceType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="formOfNotation" type="tgs:formOfNotationType" minOccurs="0"
				maxOccurs="unbounded"/>
			<xs:element name="language" type="tgl:languageType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="license" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation> A legal document giving official permission to do something
						with the resource. Same as: http://purl.org/dc/terms/license.
					</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="licenseUri" type="xs:anyURI">
								<xs:annotation>
									<xs:documentation> The context in which a license originates.
										Recommendation is to use Creative Commons (see:
										http://creativecommons.org/licenses/) </xs:documentation>
								</xs:annotation>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="bibliographicCitationType">
		<xs:sequence>
			<xs:element name="author" type="tgr:personType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A person or organization chiefly responsible for the
						intellectual or artistic content of the source, usually printed text. Same
						as: http://id.loc.gov/vocabulary/relators/aut.html. For a detailed
						description of the author the "agent" element in the "workType" has to be
						used.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="editor" type="tgr:personType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A person or organization who prepares for publication a work
						not primarily his/her own, such as by elucidating text, adding introductory
						or other critical matter, or technically directing an editorial staff. Same
						as: http://id.loc.gov/vocabulary/relators/edt.htmln </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="editionTitle" type="xs:token" minOccurs="1" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Name of the source (e.g., the titel of a book or a
						journal).</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="placeOfPublication" type="tns:authorityType" minOccurs="0"
				maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Place where the source was published. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="publisher" type="tgr:personType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A person or organization that makes the source available to
						the public. Same as:
						http://id.loc.gov/vocabulary/relators/pbl.html</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="dateOfPublication" type="tns:dateType" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>TG dateType.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="editionNo" type="xs:token" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Statement of the edition of the source - usually a phrase with
						or without numbers (e.g., first edition, 4th ed., etc.)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="series" type="xs:token" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Titel of a series in which the source was issued.
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="volume" type="xs:token" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Volume designation - is usually expressed as a number but
						could be roman numerals or non-numeric (e.g., 124, VI,
						etc.)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="issue" type="xs:token" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Designation of the issue of a journal the source was
						published. While usually numeric, it could be non-numeric (e.g.
						Spring)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="spage" type="xs:token" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Designates the page the source starts in a volume or issue.
						Pages are not always numeric.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="epage" type="xs:token" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Designates the page the source ends in a volume or issue. Page
						are not always numeric.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="bibIdentifier" type="tns:identifierType" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="objectCitationType">
		<xs:sequence>
			<xs:element name="objectTitle" type="xs:token" minOccurs="1" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Name of the source (e.g., the name of a painting, sculpture,
						furniture, etc. ).</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="objectContributor" type="tgr:agentType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A person or organization responsible for the intellectual or
						artistic content of a work. Same as:
						http://purl.org/dc/terms/contributor.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="objectDate" type="tns:dateType" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Date of an event in the lifecycle of the resource. Same as:
						http://purl.org/dc/terms/date. For a detailed description of the date of
						creation the "dateOfCreation" and "timeOfCreation" elements in the
						"workType" have to be used. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="objectIdentifier" type="tns:identifierType" minOccurs="0"
				maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="sourceType">
		<xs:annotation>
			<xs:documentation>Relation between the textgrid object and the description of the source
				of this object. Same as: http://purl.org/dc/terms/source</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:choice minOccurs="1" maxOccurs="1">
				<xs:element name="bibliographicCitation" type="tns:bibliographicCitationType"/>
				<xs:element name="objectCitation" type="tns:objectCitationType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="workType">
		<xs:annotation>
			<xs:documentation>FIXME Grobklassifikation.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="agent" minOccurs="0" maxOccurs="unbounded" type="tgr:agentType"/>
			<xs:element name="abstract" type="xs:string" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A summary of the work. Same as:
						http://purl.org/dc/terms/abstract</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="dateOfCreation" type="tns:dateType" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation> unser (TextGrid) Datumsmodell FIXME: "created" gibts schon in
						generated </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="spatial" type="tns:authorityType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Spatial characteristics of the work. Same as:
						http://purl.org/dc/terms/spatial</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="temporal" type="tns:authorityType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Temporal characteristics of the work. Same as:
						http://purl.org/dc/terms/temporal</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="subject" type="tns:authorityType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>The topic of the work. Same as:
						http://purl.org/dc/terms/subject.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="genre" minOccurs="1" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation> Grobklassifikation </xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:annotation>
						<xs:documentation>The genre of the work. Same as:
							http://purl.org/dc/terms/type - Hier natürlich englische Bezeichnungen,
							wenn wir mal die Liste finalisiert haben. Siehe
							http://www.textgrid.de/intern/wiki1/wiki/Genres.html </xs:documentation>
					</xs:annotation>
					<xs:restriction base="xs:string">
						<xs:enumeration value="drama"/>
						<xs:enumeration value="prose"/>
						<xs:enumeration value="verse"/>
						<xs:enumeration value="reference work"/>
						<xs:enumeration value="non-fiction"/>
						<xs:enumeration value="non-text"/>
						<xs:enumeration value="other"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="type" type="xs:token" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>The nature or genre of the work. Same as:
						http://purl.org/dc/terms/type FIXME Feinklassifikation, editierbare
						Auswahlliste</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="collectionType">
		<xs:annotation>
			<xs:documentation>TODO</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="collector" type="tgr:personType" minOccurs="1" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation> Person or corporate body creating a collection. Same as:
						http://id.loc.gov/vocabulary/relators/col.html </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="abstract" type="xs:string" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>A summary of the collection. Same as:
						http://purl.org/dc/terms/abstract</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="collectionDescription" type="xs:anyURI" minOccurs="0"
				maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation> URL of a description of this collection (e.g., project
						description on the website of a funding agency) FIXME is this still the Same
						as: http://purl.org/dc/terms/description </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="spatial" type="tns:authorityType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Spatial characteristics of the collection. Same as:
						http://purl.org/dc/terms/spatial</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="temporal" type="tns:authorityType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Temporal characteristics of the collection. Same as:
						http://purl.org/dc/terms/temporal</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="subject" type="tns:authorityType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>The topic of the collection. Same as:
						http://purl.org/dc/terms/subject.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##targetNamespace"> 
				<xs:annotation> <xs:documentation> FIXME for future additions? </xs:documentation> 
				</xs:annotation> </xs:any> 
				XXX leads to an ambiguous grammar
				-->
		</xs:sequence>
	</xs:complexType>

	<xs:element name="object">
	<xs:annotation>
		<xs:documentation>The root element should also be used in CRUD
			arguments and returned by
			TG-search whenever TG-search returns complete metadata records.
		</xs:documentation>
	</xs:annotation>

	<xs:complexType>
		<xs:sequence>
			<xs:element name="generic" type="tns:genericType"
				minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Metadata available in all kinds of TextGrid
						objects.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:choice minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>FIXME Aggregationen, die keine Editionen sind,
						müssen hier
						irgendwie einsortiert werden ... sind dies Items? Klar
						sind sie das :-) Dann
						bekommen sie einen rightsHolder. Sind sie was
						anderes? Benötigen Sie hier
						einen spezifischen Metadatensatz?
					</xs:documentation>
				</xs:annotation>
				<xs:element name="item" type="tns:itemType">
					<xs:annotation>
						<xs:documentation> Item specific metadata. </xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="edition" type="tns:editionType">
					<xs:annotation>
						<xs:documentation> Metadata specific for editions. - An embodiment
							of a
							work. Broader than:
							http://rdvocab.info/uri/schema/FRBRentitiesRDA/Manifestation
						</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="work" type="tns:workType">
					<xs:annotation>
						<xs:documentation>Metadata specific for works. - A distinct
							intellectual or
							artistic creation. Broader than:
							http://rdvocab.info/uri/schema/FRBRentitiesRDA/Work
						</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="collection" type="tns:collectionType">
					<xs:annotation>
						<xs:documentation> FIXME - je nach Sammlungs-Konzept und dessen
							Umsetzung -
							public-Bereich </xs:documentation>
					</xs:annotation>
				</xs:element>
				<!-- xs:any namespace="##targetNamespace"> <xs:annotation> <xs:documentation> 
					FIXME ggf. künftige Erweiterungen des Metadatenschemas? </xs:documentation> 
					</xs:annotation> </xs:any -->
			</xs:choice>
			<xs:element name="custom" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>The custom field may contain any additional
						metadata records
						for specific projects or specific applications.
					</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:sequence>
						<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax">
						</xs:any>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="relations" type="tns:relationType"
				minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>FIXME wir haben ein paar spezifische Relationen,
						wollen aber
						auch beliebige Beziehungen durch die Anwender erlauben.
						Die Optionen hier
						sind vermutlich: (a) wir erlauben beliebiges
						RDF/XML und werten bestimmte
						bestandteile aus. (b) wir erlauben
						"unsere" relationen + beliebiges RDF/XML,
						also eine Substruktur
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
</xs:element>
	

	<xs:complexType name="metadataContainerType">
		<xs:annotation>
			<xs:documentation>Container type that contains exactly one metadata record, complete
				with it's root element (tns:object)</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element ref="tns:object"/>
		</xs:sequence>
	</xs:complexType>

	<xs:element name="tgObjectMetadata" type="tns:metadataContainerType">
		<xs:annotation>
			<xs:documentation>Element for the container type.</xs:documentation>
		</xs:annotation>
	</xs:element>
</xs:schema>
