From 367f2cff7844cf198bd9a9b7d05142aace158846 Mon Sep 17 00:00:00 2001
From: Maximilian Brodhun <brodhun@sub.uni-goettingen.de>
Date: Thu, 16 Jul 2020 18:20:05 +0200
Subject: [PATCH] prepare OpenAireRecordList and added missing schemafiles

---
 .../textgrid/middleware/OpenAireRecord.java   |   3 -
 .../include/datacite-contributorType-v3.1.xsd |  35 ++
 .../openaire/include/datacite-dateType-v3.xsd |  21 +
 .../include/datacite-descriptionType-v3.xsd   |  19 +
 .../datacite-relatedIdentifierType-v3.1.xsd   |  30 ++
 .../include/datacite-relationType-v3.1.xsd    |  38 ++
 .../include/datacite-resourceType-v3.xsd      |  26 ++
 .../include/datacite-titleType-v3.xsd         |  14 +
 oaipmh-core/src/main/openaire/oaf-1.0.xsd     |  30 ++
 .../src/main/openaire/oaf-common-1.0.xsd      | 298 ++++++++++++++
 .../src/main/openaire/oaf-datasource-1.0.xsd  |  76 ++++
 oaipmh-core/src/main/openaire/oaf-org-1.0.xsd |  41 ++
 .../src/main/openaire/oaf-project-1.0.xsd     | 111 +++++
 .../src/main/openaire/oaf-result-1.0.xsd      | 242 +++++++++++
 oaipmh-core/src/main/openaire/openaire.xsd    | 380 ++++++++++++++++++
 15 files changed, 1361 insertions(+), 3 deletions(-)
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-contributorType-v3.1.xsd
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-dateType-v3.xsd
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-descriptionType-v3.xsd
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-relatedIdentifierType-v3.1.xsd
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-relationType-v3.1.xsd
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-resourceType-v3.xsd
 create mode 100644 oaipmh-core/src/main/openaire/include/datacite-titleType-v3.xsd
 create mode 100644 oaipmh-core/src/main/openaire/oaf-1.0.xsd
 create mode 100644 oaipmh-core/src/main/openaire/oaf-common-1.0.xsd
 create mode 100644 oaipmh-core/src/main/openaire/oaf-datasource-1.0.xsd
 create mode 100644 oaipmh-core/src/main/openaire/oaf-org-1.0.xsd
 create mode 100644 oaipmh-core/src/main/openaire/oaf-project-1.0.xsd
 create mode 100644 oaipmh-core/src/main/openaire/oaf-result-1.0.xsd
 create mode 100644 oaipmh-core/src/main/openaire/openaire.xsd

diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/OpenAireRecord.java b/oaipmh-core/src/main/java/info/textgrid/middleware/OpenAireRecord.java
index 9dc1a548..2a0ef350 100644
--- a/oaipmh-core/src/main/java/info/textgrid/middleware/OpenAireRecord.java
+++ b/oaipmh-core/src/main/java/info/textgrid/middleware/OpenAireRecord.java
@@ -100,9 +100,6 @@ public class OpenAireRecord extends RecordDelivererAbstract {
      */
     public GetRecordType getRecordById(String idInElasticSearchIndex) throws ParseException, DatatypeConfigurationException {
     	jsonObj = new JSONObject(OAIPMHUtilities.getRcordByIDFromElasticSearch(idInElasticSearchIndex, this.fields, Strings.EMPTY_ARRAY).getSource());
-    	for(String field : this.fields) {
-    		System.out.println(field);
-    	}
     	
     	HeaderType header = new HeaderType();
     	header.setDatestamp(OAIPMHUtilities.datestampAsString(OAIPMHUtilities.fieldLoader(jsonObj, TGConstants.CREATED)));
diff --git a/oaipmh-core/src/main/openaire/include/datacite-contributorType-v3.1.xsd b/oaipmh-core/src/main/openaire/include/datacite-contributorType-v3.1.xsd
new file mode 100644
index 00000000..c472076a
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-contributorType-v3.1.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+   2013-05 v3.0: Addition of ID to simpleType element, added values "ResearchGroup" & "Other"
+   2014-08-20 v3.1: Addition of value "DataCurator"
+   2015-05-14 v4.0 dropped value "Funder", use new "funderReference" -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+  <xs:simpleType name="contributorType" id="contributorType">
+    <xs:annotation>
+      <xs:documentation>The type of contributor of the resource.</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="ContactPerson"/>
+      <xs:enumeration value="DataCollector"/>
+      <xs:enumeration value="DataCurator"/>
+      <xs:enumeration value="DataManager"/>
+      <xs:enumeration value="Distributor"/>
+      <xs:enumeration value="Editor"/>
+      <xs:enumeration value="HostingInstitution"/>
+      <xs:enumeration value="Other"/>
+      <xs:enumeration value="Producer"/>
+      <xs:enumeration value="ProjectLeader"/>
+      <xs:enumeration value="ProjectManager"/>
+      <xs:enumeration value="ProjectMember"/>
+      <xs:enumeration value="RegistrationAgency"/>
+      <xs:enumeration value="RegistrationAuthority"/>
+      <xs:enumeration value="RelatedPerson"/>
+      <xs:enumeration value="ResearchGroup"/>
+      <xs:enumeration value="RightsHolder"/>
+      <xs:enumeration value="Researcher"/>
+      <xs:enumeration value="Sponsor"/>
+      <xs:enumeration value="Supervisor"/>
+      <xs:enumeration value="WorkPackageLeader"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/include/datacite-dateType-v3.xsd b/oaipmh-core/src/main/openaire/include/datacite-dateType-v3.xsd
new file mode 100644
index 00000000..0455f8ac
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-dateType-v3.xsd
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+     2013-05 v3.0: Addition of ID to simpleType element; addition of value "Collected"; deleted "StartDate" & "EndDate"-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+  <xs:simpleType name="dateType" id="dateType">
+    <xs:annotation>
+      <xs:documentation>The type of date. Use RKMS‐ISO8601 standard for depicting date ranges.To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Accepted"/>
+      <xs:enumeration value="Available"/>
+      <xs:enumeration value="Collected"/>
+      <xs:enumeration value="Copyrighted"/>
+      <xs:enumeration value="Created"/>
+      <xs:enumeration value="Issued"/>
+      <xs:enumeration value="Submitted"/>
+      <xs:enumeration value="Updated"/>
+      <xs:enumeration value="Valid"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/include/datacite-descriptionType-v3.xsd b/oaipmh-core/src/main/openaire/include/datacite-descriptionType-v3.xsd
new file mode 100644
index 00000000..881a4dfd
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-descriptionType-v3.xsd
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+     2013-05 v3.0: Addition of ID to simpleType element, addition of value "Methods"
+     2015-02-12 v4.0: Addition of value "TechnicalInfo"-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+  <xs:simpleType name="openaireDescriptionType" id="openaireDescriptionType">
+    <xs:annotation>
+      <xs:documentation>The type of the description.</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Abstract"/>
+      <xs:enumeration value="Methods"/>
+      <xs:enumeration value="SeriesInformation"/>
+      <xs:enumeration value="TableOfContents"/>
+      <xs:enumeration value="TechnicalInfo"/>
+      <xs:enumeration value="Other"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/include/datacite-relatedIdentifierType-v3.1.xsd b/oaipmh-core/src/main/openaire/include/datacite-relatedIdentifierType-v3.1.xsd
new file mode 100644
index 00000000..a300456d
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-relatedIdentifierType-v3.1.xsd
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+     2013-05 v3.0: Addition of ID to simpleType element; addition of value "PMID"
+	 2014-08-20 v3.1: Addition of values "arxiv" and "bibcode"-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+	<xs:simpleType name="relatedIdentifierType" id="relatedIdentifierType">
+		<xs:annotation>
+			<xs:documentation>The type of the RelatedIdentifier.</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="ARK"/>
+			<xs:enumeration value="arXiv"/>
+			<xs:enumeration value="bibcode"/>
+			<xs:enumeration value="DOI"/>
+			<xs:enumeration value="EAN13"/>
+			<xs:enumeration value="EISSN"/>
+			<xs:enumeration value="Handle"/>
+			<xs:enumeration value="ISBN"/>
+			<xs:enumeration value="ISSN"/>
+			<xs:enumeration value="ISTC"/>
+			<xs:enumeration value="LISSN"/>
+			<xs:enumeration value="LSID"/>
+			<xs:enumeration value="PMID"/>
+			<xs:enumeration value="PURL"/>
+			<xs:enumeration value="UPC"/>
+			<xs:enumeration value="URL"/>
+			<xs:enumeration value="URN"/>
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/include/datacite-relationType-v3.1.xsd b/oaipmh-core/src/main/openaire/include/datacite-relationType-v3.1.xsd
new file mode 100644
index 00000000..ed8516b5
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-relationType-v3.1.xsd
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+     2013-05 v3.0: Addition of ID to simpleType element, addition of values "IsIdenticalTo", "HasMetadata" & "IsMetadataFor"
+	 2014-08-20 v3.1: Addition of values "Reviews" & "IsReviewedBy" and "IsDerivedFrom" & "IsSourceOf"-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+	<xs:simpleType name="relationType" id="relationType">
+		<xs:annotation>
+			<xs:documentation>Description of the relationship of the resource being registered (A) and the related resource (B).</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="IsCitedBy"/>
+			<xs:enumeration value="Cites"/>
+			<xs:enumeration value="IsSupplementTo"/>
+			<xs:enumeration value="IsSupplementedBy"/>
+			<xs:enumeration value="IsContinuedBy"/>
+			<xs:enumeration value="Continues"/>
+			<xs:enumeration value="IsNewVersionOf"/>
+			<xs:enumeration value="IsPreviousVersionOf"/>
+			<xs:enumeration value="IsPartOf"/>
+			<xs:enumeration value="HasPart"/>
+			<xs:enumeration value="IsReferencedBy"/>
+			<xs:enumeration value="References"/>
+			<xs:enumeration value="IsDocumentedBy"/>
+			<xs:enumeration value="Documents"/>
+			<xs:enumeration value="IsCompiledBy"/>
+			<xs:enumeration value="Compiles"/>
+			<xs:enumeration value="IsVariantFormOf"/>
+			<xs:enumeration value="IsOriginalFormOf"/>
+			<xs:enumeration value="IsIdenticalTo"/>
+			<xs:enumeration value="HasMetadata"/>
+			<xs:enumeration value="IsMetadataFor"/>
+			<xs:enumeration value="Reviews"/>
+			<xs:enumeration value="IsReviewedBy"/>
+			<xs:enumeration value="IsDerivedFrom"/>
+			<xs:enumeration value="IsSourceOf"/>
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/include/datacite-resourceType-v3.xsd b/oaipmh-core/src/main/openaire/include/datacite-resourceType-v3.xsd
new file mode 100644
index 00000000..3205a0cd
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-resourceType-v3.xsd
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+     2013-05 v3.0: Addition of ID to simpleType element; added values "Audiovisual", "Workflow" & "Other"; deleted value "Film" -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+  <xs:simpleType name="resourceType" id="resourceType">
+    <xs:annotation>
+      <xs:documentation>The general type of a resource.</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Audiovisual"/>
+      <xs:enumeration value="Collection"/>
+      <xs:enumeration value="Dataset"/>
+      <xs:enumeration value="Event"/>
+      <xs:enumeration value="Image"/>
+      <xs:enumeration value="InteractiveResource"/>
+      <xs:enumeration value="Model"/>
+      <xs:enumeration value="PhysicalObject"/>
+      <xs:enumeration value="Service"/>
+      <xs:enumeration value="Software"/>
+      <xs:enumeration value="Sound"/>
+      <xs:enumeration value="Text"/>
+      <xs:enumeration value="Workflow"/>
+      <xs:enumeration value="Other"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/include/datacite-titleType-v3.xsd b/oaipmh-core/src/main/openaire/include/datacite-titleType-v3.xsd
new file mode 100644
index 00000000..ed2508ad
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/include/datacite-titleType-v3.xsd
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
+  2013-05 v3.0: Addition of ID to simpleType element
+  2015-02-12 v4.0 Added value "Other" -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified">
+  <xs:simpleType name="titleType" id="titleType">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="AlternativeTitle"/>
+      <xs:enumeration value="Subtitle"/>
+      <xs:enumeration value="TranslatedTitle"/>
+      <xs:enumeration value="Other"/>
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/oaf-1.0.xsd b/oaipmh-core/src/main/openaire/oaf-1.0.xsd
new file mode 100644
index 00000000..952ae31d
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/oaf-1.0.xsd
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+  xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns="http://namespace.openaire.eu/oaf"
+  targetNamespace="http://namespace.openaire.eu/oaf">
+
+  <xs:annotation>
+    <xs:documentation>This schema describes the XML serialization of the OpenAIRE Research Graph. 
+      For an overview of the model, please check the OpenAIRE Research Graph Data Model at https://doi.org/10.5281/zenodo.2643199
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:include schemaLocation="oaf-result-1.0.xsd"/>
+  <xs:include schemaLocation="oaf-org-1.0.xsd"/>
+  <xs:include schemaLocation="oaf-datasource-1.0.xsd"/>
+  <xs:include schemaLocation="oaf-project-1.0.xsd"/>
+
+  <xs:element name="entity">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice>
+          <xs:element ref="result"/>
+          <xs:element ref="organization"/>
+          <xs:element ref="datasource"/>
+          <xs:element ref="project"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/oaf-common-1.0.xsd b/oaipmh-core/src/main/openaire/oaf-common-1.0.xsd
new file mode 100644
index 00000000..8c52e22a
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/oaf-common-1.0.xsd
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+	xmlns="http://namespace.openaire.eu/oaf" targetNamespace="http://namespace.openaire.eu/oaf">
+
+	<xs:annotation>
+		<xs:documentation>This schema defines common types that can be re-used.</xs:documentation>
+	</xs:annotation>
+
+	<xs:simpleType name="emptyType">
+		<xs:restriction base="xs:string">
+			<xs:length value="0"/>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="boolOrEmptyType">
+		<xs:union memberTypes="emptyType xs:boolean"/>
+	</xs:simpleType>
+
+	<xs:simpleType name="stringOrEmptyType">
+		<xs:union memberTypes="emptyType xs:string"/>
+	</xs:simpleType>
+	
+	<xs:attributeGroup name="dataInfoAttributeGroup">
+		<xs:attribute name="inferred" use="optional" type="xs:boolean">
+			<xs:annotation>
+				<xs:documentation>True if this information has been inferred by the automatic
+					inference algorithms run by OpenAIRE. </xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="trust" use="optional" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>Value of trust of this information in the range [0,1]. More the
+					value, more trustworthy is the information. </xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="inferenceprovenance" use="optional" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>Which algorithm inferred the current property. </xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attributeGroup ref="qualifierAttributeGroup"></xs:attributeGroup>
+	</xs:attributeGroup>
+	
+	<xs:attributeGroup name="qualifierAttributeGroup">
+		<xs:attribute name="classid" use="required" type="xs:string"/>
+		<xs:attribute name="classname" use="required" type="xs:string"/>
+		<xs:attribute name="schemeid" use="required" type="xs:string"/>
+		<xs:attribute name="schemename" use="required" type="xs:string"/>
+	</xs:attributeGroup>
+	
+	<xs:complexType name="fieldType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:complexType name="qualifierType">
+		<xs:attributeGroup ref="qualifierAttributeGroup"/>
+	</xs:complexType>
+	
+	<xs:complexType name="dataInfoType">
+		<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+	</xs:complexType>
+	
+	<xs:complexType name="structuredPropertyElementType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attributeGroup ref="qualifierAttributeGroup"/>
+				<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:complexType name="labeledIdElementType">
+		<xs:attribute name="id" use="required"/>
+		<xs:attribute name="label" use="required"/>
+	</xs:complexType>
+	
+	<!-- <oaf:context id="egi" label="EGI" type="community">
+            <oaf:category id="egi::virtual" label="EGI virtual organizations">
+                <oaf:concept id="egi::virtual::2" label="alice"/>
+            </oaf:category>
+        </oaf:context>
+         <oaf:community id="{@id}" label="{@label}">
+            <xsl:apply-templates/>
+        </oaf:community>
+	-->
+	<xs:complexType name="contextType">
+		<xs:complexContent>
+			<xs:extension base="labeledIdElementType">
+				<xs:sequence maxOccurs="unbounded">
+					<xs:element name="category" type="categoryType"/>
+				</xs:sequence>
+				<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="categoryType">
+		<xs:complexContent>
+			<xs:extension base="labeledIdElementType">
+				<xs:sequence minOccurs="0" maxOccurs="unbounded">
+					<xs:element name="concept" type="conceptType"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="conceptType">
+		<xs:complexContent>
+			<xs:extension base="labeledIdElementType">
+				<xs:sequence maxOccurs="unbounded" minOccurs="0">
+					<xs:element name="concept" type="conceptType"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="namedIdElementType">
+		<xs:attribute name="id" use="required"/>
+		<xs:attribute name="name" use="required"/>
+		<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+	</xs:complexType>
+
+	<xs:complexType name="relsType">
+		<xs:annotation>
+			<xs:documentation>Relationships to other entities.</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded" minOccurs="0">
+			<xs:element name="rel" type="relType" minOccurs="0"/>
+		</xs:choice>
+	</xs:complexType>
+
+	<xs:complexType name="relType">
+		<xs:sequence>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="to" type="relToType"/>
+				<xs:element name="title" type="xs:string"/>
+				<xs:element name="websiteurl"/>
+				<xs:choice>
+					<xs:group ref="relDataSourceGroup"/>
+					<xs:group ref="relResultGroup"/>
+					<xs:group ref="relProjectGroup"/>
+					<xs:group ref="relOrganizationGroup"/>
+					<xs:group ref="fundingGroup"/>
+				</xs:choice>
+			</xs:choice>
+		</xs:sequence>
+		<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+	</xs:complexType>
+
+	<xs:group name="relDataSourceGroup">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="officialname" type="xs:string"/>
+				<xs:element name="datasourcetype" type="qualifierType"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:group>
+
+	<xs:group name="relResultGroup">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="collectedfrom" type="namedIdElementType"/>
+				<xs:element name="url" type="xs:string"/>
+				<xs:element name="pid" type="structuredPropertyElementType"/>
+				<xs:element name="dateofacceptance" type="xs:string"/>
+				<xs:element name="publisher" type="xs:string"/>
+				<xs:element name="resulttype" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> Tells if the related record is about a publication or a
+							dataset. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<!-- the following fields are available only for similarity relations -->
+				<xs:element name="similarity" type="xs:double">
+					<xs:annotation>
+						<xs:documentation>The similarity degree expressed in the range (0,1]. This
+							field is avaiable only when the to/@class is one of
+							{hasAmongTopNSimilarDocuments,
+							isAmongTopNSimilarDocuments}</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="type">
+					<xs:annotation>
+						<xs:documentation>The similarity degree expressed in the range (0,1]. This
+							field is avaiable only when the to/@class is one of
+							{hasAmongTopNSimilarDocuments,
+							isAmongTopNSimilarDocuments}</xs:documentation>
+					</xs:annotation>
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="STANDARD"/>
+							<xs:enumeration value="WEBUSAGE"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:element>
+			</xs:choice>
+		</xs:sequence>
+	</xs:group>
+
+	<xs:group name="relProjectGroup">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="code" type="xs:string"/>
+				<xs:element name="acronym" type="xs:string"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:group>
+
+	<xs:group name="fundingGroup">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="contracttype" type="qualifierType"/>
+				<xs:element name="funding" type="fundingFlatType"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:group>
+
+	<xs:group name="relOrganizationGroup">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="legalname" type="xs:string"/>
+				<xs:element name="legalshortname" type="xs:string"/>
+				<xs:element name="country" type="xs:string"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:group>
+
+
+	<xs:complexType name="relToType">
+		<xs:annotation>
+			<xs:documentation>Information about the related entity. <p>The semantics of the
+					relationships is expressed by the attributes class and scheme. </p>
+			</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="class" use="required" type="xs:string"/>
+				<xs:attribute name="type" use="required" type="xs:string">
+					<xs:annotation>
+						<xs:documentation>The type of the related entity. <p>Allowed values are:
+								project, organization, datasource, result, person.</p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:attribute>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="fundingFlatType">
+		<xs:sequence>
+			<xs:element name="funder" type="funderFlatType" minOccurs="1" maxOccurs="1"/>
+			<xs:element name="funding_level_0" type="namedFundingLevel" minOccurs="0"
+				maxOccurs="unbounded"/>
+			<xs:element name="funding_level_1" type="namedFundingLevel" minOccurs="0"
+				maxOccurs="unbounded"/>
+			<xs:element name="funding_level_2" type="namedFundingLevel" minOccurs="0"
+				maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="funderFlatType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="id" use="required" type="xs:string"/>
+				<xs:attribute name="shortname" use="required" type="xs:string"/>
+				<xs:attribute name="name" use="required" type="xs:string"/>
+				<xs:attribute name="jurisdiction" use="optional" type="xs:string"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="namedFundingLevel">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="name" use="required" type="xs:string"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+
+	<xs:complexType name="externalreferenceType">
+		<xs:sequence>
+			<xs:element name="sitename" type="xs:string" minOccurs="0" maxOccurs="1"/>
+			<!--<xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>-->
+			<xs:element name="url" type="xs:string" minOccurs="0" maxOccurs="1"/>
+			<xs:element name="qualifier" type="qualifierType" minOccurs="0" maxOccurs="1"/>
+			<xs:element name="refidentifier" type="xs:string" minOccurs="0" maxOccurs="1"/>
+		</xs:sequence>
+		<xs:attributeGroup ref="dataInfoAttributeGroup"/>
+	</xs:complexType>
+
+
+	<!-- REMOVE FROM HERE TO THE END -->
+
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/oaf-datasource-1.0.xsd b/oaipmh-core/src/main/openaire/oaf-datasource-1.0.xsd
new file mode 100644
index 00000000..c84ec253
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/oaf-datasource-1.0.xsd
@@ -0,0 +1,76 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/oaf"
+	targetNamespace="http://namespace.openaire.eu/oaf" elementFormDefault="qualified">
+
+	<xs:annotation>
+		<xs:documentation>This schema describes elements and properties of OpenAIRE datasources: https://issue.openaire.research-infrastructures.eu/projects/openaire2020-wiki/wiki/Core_entity_datasource</xs:documentation>
+	</xs:annotation>
+
+	<xs:include schemaLocation="oaf-common-1.0.xsd"/>
+
+	<xs:element name="datasource">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="namespaceprefix" type="xs:string" />
+				<xs:element name="officialname" type="xs:string" />
+				<xs:element name="englishname" type="xs:string" />
+				<xs:element name="websiteurl" type="xs:string" />
+				<xs:element name="logourl" type="xs:string" />
+				<xs:element name="contactemail" type="xs:string" />
+				<xs:element name="datasourcetype" type="qualifierType">
+					<xs:annotation>
+						<xs:documentation>For allowed values check terms in:http://api.openaire.eu/vocabularies/dnet:datasource_typologies</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="openairecompatibility" type="qualifierType">
+					<xs:annotation>
+						<xs:documentation>
+							Level of compatibility of this datasource with regards to the
+							guidelines.
+							<p>For allowed values check:
+								http://api.openaire.eu/vocabularies/dnet:datasourceCompatibilityLevel
+							</p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="dateofvalidation" type="xs:string">
+					<xs:annotation>
+						<xs:documentation>When this datasource has been validated by the
+							OpenAire
+							Validator.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="latitude" type="xs:string"  />
+				<xs:element name="longitude" type="xs:string"  />
+				<xs:element name="description" type="xs:string" />
+				<xs:element name="subjects" type="structuredPropertyElementType">
+					<xs:annotation>
+						<xs:documentation>
+							Subjects and keywords.
+							<p>For allowed values check:
+								http://api.openaire.eu/vocabularies/dnet:result_subjects
+							</p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="originalId" type="xs:string" />
+				<xs:element name="collectedfrom" type="namedIdElementType">
+					<xs:annotation>
+						<xs:documentation>Identifier and name of the datasource from which
+							this datasource has
+							been collected from.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="pid" type="structuredPropertyElementType" />
+				<xs:element name="rels" type="relsType">
+					<xs:annotation>
+						<xs:documentation>Relationships to other entities.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				
+			</xs:choice>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/oaf-org-1.0.xsd b/oaipmh-core/src/main/openaire/oaf-org-1.0.xsd
new file mode 100644
index 00000000..3c46fca4
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/oaf-org-1.0.xsd
@@ -0,0 +1,41 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/oaf"
+	targetNamespace="http://namespace.openaire.eu/oaf" elementFormDefault="qualified">
+
+	<xs:annotation>
+		<xs:documentation>This schema describes elements and properties of OpenAIRE entities of type organization: https://issue.openaire.research-infrastructures.eu/projects/openaire2020-wiki/wiki/Core_entity_organization</xs:documentation>
+	</xs:annotation>
+
+	<xs:include schemaLocation="oaf-common-1.0.xsd"/>
+
+	<xs:element name="organization">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="legalname" type="xs:string"/>
+				<xs:element name="legalshortname" type="xs:string"/>
+				<xs:element name="logourl" type="xs:string"/>
+				<xs:element name="originalId" type="xs:string"/>
+				<xs:element name="websiteurl" type="xs:string"/>
+				<xs:element name="country" type="qualifierType">
+					<xs:annotation>
+						<xs:documentation>Countries in ISO 3166-1 alpha-2. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				
+				<xs:element name="collectedfrom" type="namedIdElementType">
+					<xs:annotation>
+						<xs:documentation>Identifier and name of the datasource from which this
+							organization has been collected from. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="pid" type="structuredPropertyElementType"/>
+				<xs:element name="rels" type="relsType">
+					<xs:annotation>
+						<xs:documentation>Relationships to other entities. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<!-- If we decide not to show deduplicated org, then we have to remove this field -->
+				<!-- <xs:element name="duplicates" type="mergedOrgs"/> -->
+			</xs:choice>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/oaf-project-1.0.xsd b/oaipmh-core/src/main/openaire/oaf-project-1.0.xsd
new file mode 100644
index 00000000..abcba4d9
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/oaf-project-1.0.xsd
@@ -0,0 +1,111 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/oaf"
+	targetNamespace="http://namespace.openaire.eu/oaf" elementFormDefault="qualified">
+
+	<xs:annotation>
+		<xs:documentation>This schema describes elements and properties of OpenAIRE project entity: https://issue.openaire.research-infrastructures.eu/projects/openaire2020-wiki/wiki/Core_entity_project</xs:documentation>
+	</xs:annotation>
+
+	<xs:include schemaLocation="oaf-common-1.0.xsd"/>
+
+	<xs:element name="project">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="code" type="xs:string">
+					<xs:annotation>
+						<xs:documentation>Project code as assigned by the project's funder.</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="title" type="xs:string"/>
+				<xs:element name="acronym" type="xs:string"/>
+				<xs:element name="callidentifier" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> Identifier of the call for proposal.</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="contactfullname" type="xs:string"/>
+				<xs:element name="contactfax" type="xs:string"/>
+				<xs:element name="contactphone" type="xs:string"/>
+				<xs:element name="contactemail" type="xs:string"/>
+				<xs:element name="contracttype" type="qualifierType"/>
+				<xs:element name="keywords" type="xs:string"/>
+				<xs:element name="websiteurl" type="xs:string"/>
+				<xs:element name="startdate" type="xs:string"/>
+				<xs:element name="enddate" type="xs:string"/>
+				<xs:element name="duration" type="xs:string"/>
+				<xs:element name="ecsc39" type="boolOrEmptyType">
+					<xs:annotation>
+						<xs:documentation>True if the project has the special clause 39. Available
+							only for EC FP7 funded projects. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="oamandatepublications" type="xs:boolean">
+					<xs:annotation>
+						<xs:documentation>True if the project's funding mandates the availability of project's publications in Open Access.</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="ecarticle29_3" type="boolOrEmptyType">
+					<xs:annotation>
+						<xs:documentation>True if the project is under the EC Open Data Pilot. Available only for EC H2020 funded projects. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="subjects" type="qualifierType"/>
+					
+				<xs:element name="fundingtree" type="fundingTreeType"/>
+				<xs:element name="originalId" type="xs:string"/>
+				<xs:element name="collectedfrom" type="namedIdElementType">
+					<xs:annotation>
+						<xs:documentation>Identifier and name of the datasource from which this
+							project has been collected from. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="pid" type="qualifierType"/>
+				<xs:element name="rels" type="relsType">
+					<xs:annotation>
+						<xs:documentation>Relationships to other entities. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+			</xs:choice>
+		</xs:complexType>
+	</xs:element>
+
+	<!-- to be removed, and replaced by ContextType -->
+	<xs:complexType name="fundingTreeType">
+		<xs:sequence>
+			<xs:element name="funder" type="funderType"/>
+			<xs:choice maxOccurs="unbounded">
+				<!-- Three-tier funding hierarchies -->
+				<xs:element name="funding_level_2" type="fundingType"/>
+				<!-- Two-tier funding hierarchies -->
+				<xs:element name="funding_level_1" type="fundingType"/>
+				<!-- No funding hierarchy -->
+				<xs:element name="funding_level_0" type="fundingType"/>
+			</xs:choice>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="fundingType">
+		<xs:all>
+			<xs:element name="id" type="xs:string"/>
+			<xs:element name="description" type="xs:string"/>
+			<xs:element name="name" type="xs:string"/>
+			<xs:element name="class" type="xs:string"/>
+			<xs:element name="parent" type="fundingParentType"/>
+		</xs:all>
+	</xs:complexType>
+
+	<xs:complexType name="fundingParentType">
+		<xs:choice minOccurs="0">
+			<xs:element name="funding_level_1" type="fundingType"/>
+			<xs:element name="funding_level_0" type="fundingType"/>
+		</xs:choice>
+	</xs:complexType>
+
+	<xs:complexType name="funderType">
+		<xs:all>
+			<xs:element name="id" type="xs:string"/>
+			<xs:element name="shortname" type="xs:string"/>
+			<xs:element name="name" type="xs:string"/>
+			<xs:element name="jurisdiction" type="xs:string"/>
+		</xs:all>
+	</xs:complexType>
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/oaf-result-1.0.xsd b/oaipmh-core/src/main/openaire/oaf-result-1.0.xsd
new file mode 100644
index 00000000..2ffd3984
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/oaf-result-1.0.xsd
@@ -0,0 +1,242 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+	xmlns="http://namespace.openaire.eu/oaf" targetNamespace="http://namespace.openaire.eu/oaf">
+
+	<xs:annotation>
+		<xs:documentation>This schema describes elements and properties of the OpenAIRE Result entity. For an overview of the model, please check the OpenAIRE Research Graph Data Model at https://doi.org/10.5281/zenodo.2643199</xs:documentation>
+	</xs:annotation>
+
+	<xs:include schemaLocation="oaf-common-1.0.xsd"/>
+
+	<xs:element name="result">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="creator">
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="xs:string">
+								<xs:attribute name="name" type="xs:string"/>
+								<xs:attribute name="surname" type="xs:string"/>
+								<xs:attribute name="ORCID" type="xs:string"/>
+								<xs:attribute name="rank" type="xs:int"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="resulttype" type="qualifierType">
+					<xs:annotation>
+						<xs:documentation> Tells if this record is about a publication or a dataset.
+							<p>For allowed values check:
+								http://api.openaire.eu/vocabularies/dnet:result_typologies </p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="language" type="qualifierType"/>
+				<xs:element name="country" type="dataInfoType"/>
+				<xs:element name="subject" type="structuredPropertyElementType"/>
+				<xs:element name="title" type="structuredPropertyElementType">
+					<xs:annotation>
+						<xs:documentation> Title of this research result. <p>Different types of
+								titles are allowed: see http://api.openaire.eu/vocabularies/dnet:dataCite_title</p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="relevantdate" type="structuredPropertyElementType"/>
+				<xs:element name="description" type="xs:string"/>	
+				<xs:element name="dateofacceptance" type="xs:string"/>
+				<xs:element name="publisher" type="xs:string"/>	
+				<xs:element name="embargoenddate" type="xs:string"/>
+				<xs:element name="source" type="xs:string">
+					<xs:annotation>
+						<xs:documentation>The semantics of this field is inherited from dc:source in
+							Dublin Core. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="format" type="xs:string"/>
+				<xs:element name="contributor" type="xs:string"/>
+				<xs:element name="resourcetype" type="qualifierType">
+					<xs:annotation>
+						<xs:documentation> This field is valid only if resulttype is "dataset". It
+							expresses the nature of the dataset. <p>For allowed values check:
+								http://api.openaire.eu/vocabularies/dnet:publication_resource </p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="coverage" type="xs:string"/>
+				<xs:element name="bestaccessright" type="qualifierType">
+					<xs:annotation>
+						<xs:documentation> The best access right available for this result among the
+							available licenses of its children elements. <p>For allowed values
+								check: http://api.openaire.eu/vocabularies/dnet:access_modes </p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="journal" type="journalType"/>	
+				<xs:element name="pid" type="structuredPropertyElementType">
+					<xs:annotation>
+						<xs:documentation> Persistent identifier. <p>For allowed pid systems check:
+								http://api.openaire.eu/vocabularies/dnet:pid_types </p>
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="device" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> This field is valid only if resulttype is "dataset". It
+							contains information about the device used to generate the dataset.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="size" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> This field is valid only if resulttype is "dataset". It
+							contains information about the size of the dataset. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="version" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> This field is valid only if resulttype is "dataset". It
+							contains information about the version of the dataset.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="lastmetadataupdate" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> This field is valid only if resulttype is "dataset". It
+							is the last update date of the metadata of the dataset.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="metadataversionnumber" type="xs:string">
+					<xs:annotation>
+						<xs:documentation> This field is valid only if resulttype is "dataset". It
+							contains information about the version of the metadata of the dataset.
+						</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="originalId" type="xs:string" maxOccurs="unbounded"/>
+				<xs:element name="collectedfrom" type="namedIdElementType" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>Identifier and name of the datasource from which this
+							result has been collected from (e.g., "OpenDOAR"). </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="context" type="contextType">
+					<xs:annotation>
+						<xs:documentation>Research community, initiative, infrastructure or funding agency related to this result.</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="rels" type="relsType">
+					<xs:annotation>
+						<xs:documentation>Relationships to other entities. </xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="instances" type="instancesType" minOccurs="1" maxOccurs="1"/>
+				<xs:element name="citations" type="citationsType" maxOccurs="1" minOccurs="0"/>
+			</xs:choice>
+		</xs:complexType>
+	</xs:element>
+
+	<xs:complexType name="citationsType">
+		<xs:sequence>
+			<xs:element name="citation" maxOccurs="unbounded" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="rawText"/>
+						<xs:element name="id" minOccurs="0" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:attribute name="value"/>
+								<xs:attribute name="type"/>
+								<xs:attribute name="confidenceLevel"/>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="provenance" type="xs:string"/>
+		<xs:attribute name="trust" type="xs:string"/>
+	</xs:complexType>
+
+	<xs:complexType name="journalType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="eissn" use="optional"/>
+				<xs:attribute name="issn" use="optional"/>
+				<xs:attribute name="lissn" use="optional"/>
+				<xs:attribute name="ep" use="optional"/>
+				<xs:attribute name="iss" use="optional"/>
+				<xs:attribute name="sp" use="optional"/>
+				<xs:attribute name="vol" use="optional"/>			
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="instancesType">
+		<xs:sequence>
+			<xs:element name="instance" type="instanceType" minOccurs="1" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Actual digital representation of the publication or dataset.
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="externalreference" type="externalreferenceType" minOccurs="0"
+				maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="instanceType">
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="license" type="fieldType">
+				<xs:annotation>
+					<xs:documentation> License to access this actual manifestation of the
+						result. Typically it is a URL. OpenAIRE does not yet attempt any harmonization and reflect the original values that are available in the collected metadata records. 
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="accessright" type="qualifierType"/>
+			<xs:element name="instancetype" type="qualifierType">
+				<xs:annotation>
+					<xs:documentation> Type of the instance, for example: article, thesis, etc.
+							<p>For allowed values check: http://api.openaire.eu/vocabularies/dnet:publication_resource
+						</p>
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="collectedfrom" type="namedIdElementType" maxOccurs="1">
+				<xs:annotation>
+					<xs:documentation>Datasource from which OpenAIRE collected the description of this instance.</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="hostedby" type="namedIdElementType" maxOccurs="1">
+				<xs:annotation>
+					<xs:documentation>Datasource hosting this file. </xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="webresource" type="webresourceType" minOccurs="1"
+				maxOccurs="unbounded"/>
+			<xs:element name="distributionlocation" type="xs:string" minOccurs="0"/>
+			<xs:element name="dateofacceptance" type="xs:string" minOccurs="0"/>
+			<xs:element name="processingchargeamount" type="fieldType">
+				<xs:annotation>
+					<xs:documentation> Article/Book Processing Charge </xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="processingchargecurrency" type="fieldType">
+				<xs:annotation>
+					<xs:documentation>Currency for the value in processingchargeamount </xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="refereed" type="fieldType">
+				<xs:annotation>
+					<xs:documentation>Peer-review status</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:choice>
+		<xs:attribute name="id" use="required"/>
+	</xs:complexType>
+
+	<xs:complexType name="webresourceType">
+		<xs:sequence>
+			<xs:element name="url" type="xs:string" minOccurs="1" maxOccurs="1"/>
+		</xs:sequence>
+	</xs:complexType>
+
+</xs:schema>
diff --git a/oaipmh-core/src/main/openaire/openaire.xsd b/oaipmh-core/src/main/openaire/openaire.xsd
new file mode 100644
index 00000000..a88a5f04
--- /dev/null
+++ b/oaipmh-core/src/main/openaire/openaire.xsd
@@ -0,0 +1,380 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Revision history
+     2010-08-26   Complete revision according to new common specification by the metadata work group after review. AJH, DTIC
+	 2010-11-17 Revised to current state of kernel review, FZ, TIB 
+	 2011-01-17 Complete revsion after community review. FZ, TIB
+	 2011-03-17 Release of v2.1: added a namespace; mandatory properties got minLength; changes in the definitions of relationTypes
+	 IsDocumentedBy/Documents and isCompiledBy/Compiles; changes type of property "Date" from xs:date to xs:string. FZ, TIB
+	 2011-06-27 v2.2: namespace: kernel-2.2, additions to controlled lists "resourceType", "contributorType", "relatedIdentifierType", and "descriptionType". Removal of intermediate include-files.
+     2013-05 v3.0: namespace: kernel-3.0; delete LastMetadataUpdate & MetadateVersionNumber; additions to controlled lists "contributorType", "dateType", "descriptionType", "relationType", "relatedIdentifierType" & "resourceType"; deletion of "StartDate" & "EndDate" from list "dateType" and "Film" from "resourceType";  allow arbitrary order of elements; allow optional wrapper elements to be empty; include openaire:lang attribute for title, subject & description; include attribute schemeURI for nameIdentifier of creator, contributor & subject; added new attributes "relatedMetadataScheme", "schemeURI" & "schemeType" to relatedIdentifier; included new property "geoLocation" 
+	 2014-08-20 v3.1: additions to controlled lists "relationType", contributorType" and "relatedIdentifierType"; introduction of new child element "affiliation" to "creator" and "contributor"-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-3" targetNamespace="http://datacite.org/schema/kernel-3" elementFormDefault="qualified" >
+	
+	<xs:include schemaLocation="include/datacite-titleType-v3.xsd"/>
+	<xs:include schemaLocation="include/datacite-contributorType-v3.1.xsd"/>
+	<xs:include schemaLocation="include/datacite-dateType-v3.xsd"/>
+	<xs:include schemaLocation="include/datacite-resourceType-v3.xsd"/>
+	<xs:include schemaLocation="include/datacite-relationType-v3.1.xsd"/>
+	<xs:include schemaLocation="include/datacite-relatedIdentifierType-v3.1.xsd"/>
+	<xs:include schemaLocation="include/datacite-descriptionType-v3.xsd"/>
+	<xs:element name="resource">
+		<xs:annotation>
+			<xs:documentation>
+	Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.
+        Note: This is the case for all wrapper elements within this schema!</xs:documentation>
+			<xs:documentation>No content in this wrapper element.</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:all>
+				<!--REQUIRED FIELDS-->
+				<xs:element name="identifier">
+					<xs:annotation>
+						<xs:documentation>A persistent identifier that identifies a resource.</xs:documentation>
+						<xs:documentation>Currently, only DOI is allowed.</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="doiType">
+								<xs:attribute name="identifierType" use="required" fixed="DOI"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="creators">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="creator" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.</xs:documentation>
+									<xs:documentation>Format: Family, Given.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="creatorName">
+											<xs:simpleType>
+												<xs:restriction base="nonemptycontentStringType"/>
+											</xs:simpleType>
+										</xs:element>
+										<xs:element name="nameIdentifier" minOccurs="0">
+											<xs:complexType>
+												<xs:simpleContent>
+													<xs:extension base="nonemptycontentStringType">
+														<xs:attribute name="nameIdentifierScheme" use="required"/>
+														<xs:attribute name="schemeURI" type="xs:anyURI" use="optional"/>
+													</xs:extension>
+												</xs:simpleContent>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="affiliation" minOccurs="0" maxOccurs="unbounded"/>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="titles">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="title" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>A name or title by which a resource is known.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="nonemptycontentStringType">
+											<xs:attribute name="titleType" type="titleType" use="optional"/>
+											<xs:attribute name="lang"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="publisher">
+					<xs:annotation>
+						<xs:documentation>The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the resource. This property will be used to formulate the citation, so consider the prominence of the role.</xs:documentation>
+						<xs:documentation>In the case of datasets, "publish" is understood to mean making the data available to the community of researchers.</xs:documentation>
+					</xs:annotation>
+					<xs:simpleType>
+						<xs:restriction base="nonemptycontentStringType"/>
+					</xs:simpleType>
+				</xs:element>
+				<xs:element name="publicationYear">
+					<xs:annotation>
+						<xs:documentation>Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.</xs:documentation>
+						<xs:documentation>In the case of datasets, "publish" is understood to mean making the data available on a specific date to the community of researchers. If there is no standard publication year value, use the date that would be preferred from a citation perspective.</xs:documentation>
+						<xs:documentation>YYYY</xs:documentation>
+					</xs:annotation>
+					<xs:simpleType>
+						<xs:restriction base="yearType"/>
+					</xs:simpleType>
+				</xs:element>
+				<!--OPTIONAL FIELDS-->
+				<xs:element name="subjects" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="subject" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Subject, keywords, classification codes, or key phrases describing the resource.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="xs:string">
+											<xs:attribute name="subjectScheme" use="optional"/>
+											<xs:attribute name="schemeURI" type="xs:anyURI" use="optional"/>
+											<xs:attribute name="lang"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="contributors" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="contributor" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.</xs:documentation>
+									<xs:documentation>The personal name format should be: Family, Given.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="contributorName">
+											<xs:simpleType>
+												<xs:restriction base="xs:string">
+													<xs:minLength value="1"/>
+												</xs:restriction>
+											</xs:simpleType>
+										</xs:element>
+										<xs:element name="nameIdentifier" minOccurs="0">
+											<xs:complexType>
+												<xs:simpleContent>
+													<xs:extension base="xs:string">
+														<xs:attribute name="nameIdentifierScheme" use="required"/>
+														<xs:attribute name="schemeURI" type="xs:anyURI" use="optional"/>
+													</xs:extension>
+												</xs:simpleContent>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="affiliation" minOccurs="0" maxOccurs="unbounded"/>
+									</xs:sequence>
+									<xs:attribute name="contributorType" type="contributorType" use="required"/>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="dates" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="date" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Different dates relevant to the work.</xs:documentation>
+									<xs:documentation>YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="xs:string">
+											<xs:attribute name="dateType" type="dateType" use="required"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="language" type="xs:language" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Primary language of the resource. Allowed values are taken from  IETF BCP 47, ISO 639-1 language codes.</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="resourceType" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>The type of a resource. You may enter an additional free text description.</xs:documentation>
+						<xs:documentation>The format is open, but the preferred format is a single term of some detail so that a pair can be formed with the sub-property.</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="xs:string">
+								<xs:attribute name="resourceTypeGeneral" type="resourceType" use="required"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="alternateIdentifiers" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="alternateIdentifier" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>An identifier or identifiers other than the primary Identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. May be used for local identifiers. AlternateIdentifier should be used for another identifier of the same instance (same location, same file).</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="xs:string">
+											<xs:attribute name="alternateIdentifierType" use="required"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="relatedIdentifiers" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="relatedIdentifier" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="xs:string">
+											<xs:attribute name="relatedIdentifierType" type="relatedIdentifierType" use="required"/>
+											<xs:attribute name="relationType" type="relationType" use="required"/>
+											<xs:attribute name="relatedMetadataScheme" use="optional"/>
+											<xs:attribute name="schemeURI" type="xs:anyURI" use="optional"/>
+											<xs:attribute name="schemeType" use="optional"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="sizes" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="size" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Unstructures size information about the resource.</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="formats" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="format" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Technical format of the resource.</xs:documentation>
+									<xs:documentation>Use file extension or MIME type where possible.</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="version" type="xs:string" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Version number of the resource. If the primary resource has changed the version number increases.</xs:documentation>
+						<xs:documentation>Register a new identifier for a major version change. Individual stewards need to determine which are major vs. minor versions. May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates. May be used in conjunction with property 17 (Description) to indicate the nature and file/record range of version.</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="rightsList" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="rights" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable. 
+Use the complete title of a license and include version information if applicable.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="xs:string">
+											<xs:attribute name="rightsURI" type="xs:anyURI" use="optional"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="descriptions" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="description" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>All additional information that does not fit in any of the other categories. May be used for technical information. It is a best practice to supply a description.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType mixed="true">
+									<xs:choice>
+										<xs:element name="br" minOccurs="0" maxOccurs="unbounded">
+											<xs:simpleType>
+												<xs:restriction base="xs:string">
+													<xs:length value="0"/>
+												</xs:restriction>
+											</xs:simpleType>
+										</xs:element>
+									</xs:choice>
+									<xs:attribute name="openaireDescriptionType" type="openaireDescriptionType" use="required"/>
+									<xs:attribute name="lang"/>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="geoLocations" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="geoLocation" minOccurs="0" maxOccurs="unbounded">
+								<xs:annotation>
+									<xs:documentation>Spatial region or named place where the data was gathered or about which the data is focused.</xs:documentation>
+									<xs:documentation>A point contains a single latitude-longitude pair, separated by whitespace.</xs:documentation>
+									<xs:documentation>A box contains two white space separated latitude-longitude pairs, with each pair separated by whitespace. The first pair is the lower corner, the second is the upper corner.</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="geoLocationPoint" type="point" minOccurs="0"/>
+										<xs:element name="geoLocationBox" type="box" minOccurs="0"/>
+										<xs:element name="geoLocationPlace" minOccurs="0"/>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:all>
+		</xs:complexType>
+	</xs:element>
+	<!-- TYPE DECLARATIONS -->
+	<!-- defines the value for a DOI: DOI must start with "10."  -->
+	<xs:simpleType name="doiType">
+		<xs:restriction base="xs:token">
+			<xs:pattern value="10\..+/.+"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- defines value for mandatory fields -->
+	<xs:simpleType name="nonemptycontentStringType">
+		<xs:restriction base="xs:string">
+			<xs:minLength value="1"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:attributeGroup name="nameId">
+		<xs:attribute name="nameIdentifier" type="xs:string" use="optional"/>
+		<xs:attribute name="nameIdentifierScheme" type="xs:string" use="optional"/>
+	</xs:attributeGroup>
+	<!-- defines the value for a year -->
+	<xs:simpleType name="yearType">
+		<xs:restriction base="xs:token">
+			<xs:pattern value="[\d]{4}"/>
+		</xs:restriction>
+		<!-- definitions for geoLocation -->
+	</xs:simpleType>
+	<xs:simpleType name="point">
+		<xs:restriction base="listOfDoubles">
+			<xs:minLength value="2"/>
+			<xs:maxLength value="2"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="box">
+		<xs:restriction base="listOfDoubles">
+			<xs:minLength value="4"/>
+			<xs:maxLength value="4"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="listOfDoubles">
+		<xs:list itemType="xs:double"/>
+	</xs:simpleType>
+</xs:schema>
-- 
GitLab