<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2012 sp1 (x64) (http://www.altova.com) by European Commission - DG INFSO (European Commission - DG INFSO) -->
<!-- edited by the OpenAIRE+ tech team - 2014-10-24 -->
<!--  v2.1 changelog:
	- reverted back the publication and dataset content to be enclosed in a sequence element
      v2.0 changelog:
	- changed namespace from http://namespace.openaire.eu to http://namespace.openaire.eu/sygma
	- publications and datasets have been enclosed in a choice element: either you have publications or datasets
	- elements inside publication and dataset have been enclosed in an unbounded choice, so that the order does not matter
	- added authors for dataset
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/sygma" targetNamespace="http://namespace.openaire.eu/sygma" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:annotation>
		<xs:documentation>This schema describes the OpenAIRE response to SyGMa publications or
			datasets queries</xs:documentation>
	</xs:annotation>
	<xs:element name="response">
		<xs:annotation>
			<xs:documentation>Response root element for Publications and Dataset
				queries</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="header" type="headerType">
					<xs:annotation>
						<xs:documentation>Response header containing details of number of results
							for the query</xs:documentation>
					</xs:annotation>
				</xs:element>
				<!-- Changed by OpenAIRE+ tech team: this element is a choice: either you have publications or datasets -->
				<xs:choice>
					<xs:element name="publications" type="publicationsType">
						<xs:annotation>
							<xs:documentation>Publications wrapper</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="datasets" type="datasetsType">
						<xs:annotation>
							<xs:documentation>Datasets wrapper</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:choice>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="publicationsType">
		<xs:sequence>
			<xs:element name="publication" type="publicationType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Publication details entity</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="publicationType">
		<!--Changed by Sygma team for tecnhical reasons. When using choice JAXB, the Java model classes generator will transform all sub-elements in JAXBElement<?> and group them in a Collection<JAXBElement<?>>, making the mapping complex.  -->
		<xs:sequence>
			<xs:element name="openaireid" type="xs:string">
				<xs:annotation>
					<xs:documentation>Publication OpenAireId</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="doi" type="xs:string" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Publication D.O.I (s)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- Changed by OpenAIRE+ tech team: let's allow no description for related publications -->
			<xs:element name="description" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Publications description</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- Changed by OpenAIRE+ tech team: let's allow no description for related publications -->
			<xs:element name="publicationtype" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Publication type</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="title" type="xs:string">
				<xs:annotation>
					<xs:documentation>Publication title</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="authors" type="authorsType">
				<xs:annotation>
					<xs:documentation>Publication authors</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- Changed by OpenAIRE+ tech team: repeatable sources -->
			<xs:element name="sourcejournal" type="xs:string" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Title of journal here publication was
						published</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- Changed by OpenAIRE+ tech team: dates are usually dateTime or date, but can also be only the year, that's why I'm setting the type of this element to xs:string -->
			<xs:element name="dateofacceptance" type="xs:string"/>
			<xs:element name="webresource" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Web links to publicatiion</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="bestlicense" type="xs:string">
				<xs:annotation>
					<xs:documentation>The best license available for this publication among the
						available licenses of its children elements</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="datasetsType">
		<xs:sequence>
			<xs:element name="dataset" type="datasetType" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Dataset details entity</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="datasetType">
		<!--Changed by Sygma team for tecnhical reasons. When using choice JAXB, the Java model classes generator will transform all sub-elements in JAXBElement<?> and group them in a Collection<JAXBElement<?>>, making the mapping complex.  -->
		<xs:sequence>
			<xs:element name="openaireid" type="xs:string">
				<xs:annotation>
					<xs:documentation>Dataset OpenAireId</xs:documentation>
				</xs:annotation>
			</xs:element>
			<!-- Changed by OpenAIRE+ tech team: added dataset author -->
			<xs:element name="authors" type="authorsType">
				<xs:annotation>
					<xs:documentation>Publication authors</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="doi" type="xs:string" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Dataser D.O.I.(s)</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="description" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Dataset description</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="title" type="xs:string">
				<xs:annotation>
					<xs:documentation>Dataset title</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="webresource" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>Web links to dataset</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="bestlicense" type="xs:string">
				<xs:annotation>
					<xs:documentation>The best license available for this dataset among the
							available licenses of its children elements</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="relatedpublications" type="publicationsType" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Dataset Related publications</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="headerType">
		<xs:sequence>
			<xs:element name="size" type="xs:integer">
				<xs:annotation>
					<xs:documentation>Number of results in the response</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="page" type="xs:integer">
				<xs:annotation>
					<xs:documentation>Page of the results </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="total" type="xs:integer">
				<xs:annotation>
					<xs:documentation>Total number of query results</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="authorsType">
		<xs:sequence>
			<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
</xs:schema>
