From 10632093ad88db24fb7641008d6a5b818bb686b7 Mon Sep 17 00:00:00 2001
From: "Stefan E. Funk" <funk@sub.uni-goettingen.de>
Date: Thu, 9 Feb 2023 13:18:07 +0100
Subject: [PATCH] fix: fix OAI error with non existent works mentioned in
 isEditionOf fields

---
 .../textgrid/middleware/OaipmhUtilities.java  |  53 ++-
 .../middleware/RecordDelivererDC.java         |   4 +-
 .../middleware/RecordDelivererDatacite.java   |  84 ++--
 .../middleware/RecordDelivererIdiom.java      |  33 +-
 .../RecordListDelivererDatacite.java          |   9 +
 .../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 ------------------
 .../src/main/resources/simpledc20021212.xsd   | 137 ++++---
 .../test/online/OaipmhUtilitiesOnline.java    |  52 ++-
 .../test/online/tg/TestTGBasicsOnline.java    |   2 +-
 .../test/online/tg/TestTGGetRecordOnline.java |  18 +-
 .../tg/TestTGListIdentifiersOnline.java       |   2 +-
 .../online/tg/TestTGListRecordsOnline.java    |   2 +-
 25 files changed, 246 insertions(+), 1511 deletions(-)
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-contributorType-v3.1.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-dateType-v3.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-descriptionType-v3.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-relatedIdentifierType-v3.1.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-relationType-v3.1.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-resourceType-v3.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/include/datacite-titleType-v3.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/oaf-1.0.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/oaf-common-1.0.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/oaf-datasource-1.0.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/oaf-org-1.0.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/oaf-project-1.0.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/oaf-result-1.0.xsd
 delete mode 100644 oaipmh-core/src/main/openaire/openaire.xsd

diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/OaipmhUtilities.java b/oaipmh-core/src/main/java/info/textgrid/middleware/OaipmhUtilities.java
index c9f4017d..266dd0e4 100644
--- a/oaipmh-core/src/main/java/info/textgrid/middleware/OaipmhUtilities.java
+++ b/oaipmh-core/src/main/java/info/textgrid/middleware/OaipmhUtilities.java
@@ -1,6 +1,7 @@
 package info.textgrid.middleware;
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.io.StringWriter;
 import java.math.BigInteger;
 import java.text.ParseException;
@@ -24,6 +25,9 @@ import javax.xml.bind.Marshaller;
 import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
 import org.elasticsearch.action.get.GetRequest;
 import org.elasticsearch.action.get.GetResponse;
 import org.elasticsearch.client.RequestOptions;
@@ -31,6 +35,9 @@ import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 import info.textgrid.clients.AuthClient;
 import info.textgrid.clients.tgauth.AuthClientException;
 import info.textgrid.middleware.oaipmh.GetRecordType;
@@ -386,7 +393,7 @@ public class OaipmhUtilities {
    * @return
    * @throws IOException
    */
-  protected static GetResponse getRcordByIDFromElasticSearch(OaipmhElasticSearchClient theESClient,
+  protected static GetResponse getRecordByIDFromElasticSearch(OaipmhElasticSearchClient theESClient,
       String idInElasticSearchIndex, String[] includes, String[] excludes) throws IOException {
 
     log.fine("id in es index: " + idInElasticSearchIndex);
@@ -597,6 +604,50 @@ public class OaipmhUtilities {
     return result.trim();
   }
 
+
+  /**
+   * @param message
+   * @return
+   * @throws IOException
+   */
+  public static MetadataType buildMETSErrorMetadata(String message) throws IOException {
+
+    MetadataType result = new MetadataType();
+
+    String metsError =
+        "<mets xsi:schemaLocation=\"http://www.loc.gov/METS/"
+            + " http://www.loc.gov/standards/mets/mets.xsd\""
+            + " xmlns=\"http://www.loc.gov/METS/\""
+            + " xmlns:dv=\"http://dfg-viewer.de/\""
+            + " xmlns:xlink=\"http://www.w3.org/1999/xlink\""
+            + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
+            + "  <amdSec ID=\"error\" />\n"
+            + "  <structMap TYPE=\"LOGICAL\">\n"
+            + "    <div LABEL=\"error\">\n"
+            + "      <![CDATA[ " + message + " ]]>\n"
+            + "    </div>\n"
+            + "  </structMap>\n"
+            + "</mets>\n";
+
+    log.warning(message);
+
+    try {
+      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+      DocumentBuilder builder;
+      builder = factory.newDocumentBuilder();
+      Document doc = builder.parse(new InputSource(new StringReader(metsError)));
+
+      result.setAny(doc.getDocumentElement());
+
+    } catch (ParserConfigurationException | SAXException e1) {
+      log.severe(
+          "ERROR BUILDING ERROR METS METADATA PART! PLEASE CONTACT YOUR LOCAL XML BUILDER! SYSTEM MESSAGE: "
+              + e1.getMessage());
+    }
+
+    return result;
+  }
+
   // **
   // PRIVATE METHODS
   // **
diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDC.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDC.java
index 5a3e2f30..1eccda04 100644
--- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDC.java
+++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDC.java
@@ -56,7 +56,7 @@ public class RecordDelivererDC extends RecordDelivererAbstract {
     String[] excludes = Strings.EMPTY_ARRAY;
 
     GetResponse esResultObject =
-        OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient, id, includes, excludes);
+        OaipmhUtilities.getRecordByIDFromElasticSearch(this.oaiEsClient, id, includes, excludes);
 
     log.fine("es result id/size: " + (esResultObject != null
         ? esResultObject.getId() + "/" + esResultObject.getFields().size()
@@ -159,7 +159,7 @@ public class RecordDelivererDC extends RecordDelivererAbstract {
       String[] excludes = Strings.EMPTY_ARRAY;
 
       responseWorkValues =
-          OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient, id, includes, excludes);
+          OaipmhUtilities.getRecordByIDFromElasticSearch(this.oaiEsClient, id, includes, excludes);
 
     } catch (IOException e) {
       // TODO Auto-generated catch block
diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java
index 8a2a1167..1722a4aa 100644
--- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java
+++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererDatacite.java
@@ -49,8 +49,6 @@ import info.textgrid.middleware.oaipmh.Resource.Titles.Title;
 /**
  * @author Maximilian Brodhun, SUB Göttingen
  * @author Stefan E. Funk, SUB Göttingen
- * @version 2023-01-10
- * @since 2020-06-13
  */
 @Component
 public class RecordDelivererDatacite extends RecordDelivererAbstract {
@@ -138,7 +136,7 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract {
     String replacedID = idInElasticSearchIndex.replace(this.repositoryObjectURIPrefix, "");
     GetRecordType getRecordType = new GetRecordType();
 
-    GetResponse esResultObject = OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient,
+    GetResponse esResultObject = OaipmhUtilities.getRecordByIDFromElasticSearch(this.oaiEsClient,
         replacedID, this.fields, Strings.EMPTY_ARRAY);
 
     // **
@@ -455,30 +453,32 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract {
       // *
 
       if (this.textgrid) {
-
-        // TODO CHECK THIS!
-
-        String[] workFields = {this.handle};
-        RelatedIdentifier relatedIdentifier = new RelatedIdentifier();
-        relatedIdentifier.setRelatedIdentifierType(RelatedIdentifierType.HANDLE);
-        // relatedIdentifier.setRelatedMetadataScheme(TGConstants.TEXTGRID_METADATASCHEME);
-        relatedIdentifier.setRelationType(RelationType.IS_PART_OF);
-        // relatedIdentifier.setSchemeType("XSD");
-        // relatedIdentifier.setSchemeURI(TGConstants.TEXTGRID_METADATASCHEME_URI);
-
         String uriForWork =
             OaipmhUtilities.firstEntryFieldLoader(this.jsonObj, relatedIdentifierField)
                 .replace(this.repositoryObjectURIPrefix, "");
-        relatedIdentifier
-            .setValue(
-                OaipmhUtilities
-                    .firstEntryFieldLoader(
-                        new JSONObject(
-                            OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient,
-                                uriForWork, workFields, Strings.EMPTY_ARRAY).getSource()),
-                        this.handle));
-
-        relatedIdentifiers.getRelatedIdentifier().add(relatedIdentifier);
+        if (uriForWork != null && !uriForWork.isEmpty()) {
+
+          log.fine("looking for work with id " + uriForWork);
+
+          try {
+            JSONObject resultOfFurtherObject =
+                new JSONObject(OaipmhUtilities.getRecordByIDFromElasticSearch(this.oaiEsClient,
+                    uriForWork, this.workFields, Strings.EMPTY_ARRAY).getSource());
+
+            RelatedIdentifier relatedIdentifier = new RelatedIdentifier();
+            relatedIdentifier.setRelatedIdentifierType(RelatedIdentifierType.HANDLE);
+            // relatedIdentifier.setRelatedMetadataScheme(TGConstants.TEXTGRID_METADATASCHEME);
+            relatedIdentifier.setRelationType(RelationType.IS_PART_OF);
+            // relatedIdentifier.setSchemeType("XSD");
+            // relatedIdentifier.setSchemeURI(TGConstants.TEXTGRID_METADATASCHEME_URI);
+            relatedIdentifier.setValue(
+                OaipmhUtilities.firstEntryFieldLoader(resultOfFurtherObject, this.handle));
+            relatedIdentifiers.getRelatedIdentifier().add(relatedIdentifier);
+          } catch (IOException e) {
+            log.warning("work with id " + uriForWork + " does not exist in elasticsearch! "
+                + e.getMessage());
+          }
+        }
       }
 
       // **
@@ -535,19 +535,31 @@ public class RecordDelivererDatacite extends RecordDelivererAbstract {
       if (this.textgrid) {
         String idForWorkObject =
             OaipmhUtilities.firstEntryFieldLoader(this.jsonObj, this.relationToWorkObject);
-        if (idForWorkObject != null) {
+        if (idForWorkObject != null && !idForWorkObject.isEmpty()) {
           idForWorkObject = idForWorkObject.replace(this.repositoryObjectURIPrefix, "");
-          JSONObject resultOfFurtherObject =
-              new JSONObject(OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient,
-                  idForWorkObject, this.workFields, Strings.EMPTY_ARRAY).getSource());
-          // Create abstract for every dc:description.
-          List<String> abstractsFromWork =
-              OaipmhUtilities.listFieldLoader(resultOfFurtherObject, descriptionField);
-          for (String d : abstractsFromWork) {
-            Description description = new Description();
-            description.setDescriptionType(OpenaireDescriptionType.ABSTRACT);
-            description.getContent().add(d);
-            descriptions.getDescription().add(description);
+
+          log.fine("looking for work with uri " + idForWorkObject);
+
+          try {
+            JSONObject resultOfFurtherObject =
+                new JSONObject(OaipmhUtilities.getRecordByIDFromElasticSearch(this.oaiEsClient,
+                    idForWorkObject, this.workFields, Strings.EMPTY_ARRAY).getSource());
+
+            // Create abstract for every dc:description.
+            List<String> abstractsFromWork =
+                OaipmhUtilities.listFieldLoader(resultOfFurtherObject, descriptionField);
+
+            log.fine("found abstracts: " + abstractsFromWork.toString());
+
+            for (String d : abstractsFromWork) {
+              Description description = new Description();
+              description.setDescriptionType(OpenaireDescriptionType.ABSTRACT);
+              description.getContent().add(d);
+              descriptions.getDescription().add(description);
+            }
+          } catch (IOException e) {
+            log.warning("work with id " + idForWorkObject + " does not exist in elasticsearch! "
+                + e.getMessage());
           }
         }
       }
diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIdiom.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIdiom.java
index 2017672b..3f1676a8 100644
--- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIdiom.java
+++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordDelivererIdiom.java
@@ -3,7 +3,6 @@ package info.textgrid.middleware;
 import java.io.IOException;
 import java.io.StringReader;
 import java.text.ParseException;
-import java.util.NoSuchElementException;
 import java.util.logging.Logger;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -24,8 +23,6 @@ import info.textgrid.middleware.oaipmh.RecordType;
 /**
  * @author Maximilian Brodhun, SUB Göttingen
  * @author Stefan E. Funk, SUB Göttingen
- * @version 2023-01-06
- * @since 2019-03-12
  */
 @Component
 public class RecordDelivererIdiom extends RecordDelivererAbstract {
@@ -104,20 +101,26 @@ public class RecordDelivererIdiom extends RecordDelivererAbstract {
 
     if (objectType.equals("ARTEFACT")) {
       try {
+
+        log.fine("calling ClassicMayanMetsMods for: " + textgridRevisionURI);
+
         ClassicMayanMetsMods metsmods = new ClassicMayanMetsMods(
             textgridBaseURI,
             creationDate,
             modificationDate);
 
         log.fine("metsmods title: " + metsmods.getArtefactTitle());
+        log.fine("setting metsmods metadata");
+
+        MetadataType metadata = idiomMets(metsmods);
+        recordType.setMetadata(metadata);
 
-        recordType.setMetadata(idiomMets(metsmods));
+        log.fine("metsmods metadata set");
 
-      } catch (JSONException | ParserConfigurationException | SAXException | IOException
-          | ParseException | NoSuchElementException e) {
+      } catch (ParserConfigurationException | SAXException | ParseException e) {
         String message = "ERROR getting IDIOM METS record for ID " + textgridRevisionURI + "! "
             + e.getClass().getName() + ": " + e.getMessage();
-        log.warning(message);
+        recordType.setMetadata(OaipmhUtilities.buildMETSErrorMetadata(message));
       }
     }
 
@@ -132,19 +135,7 @@ public class RecordDelivererIdiom extends RecordDelivererAbstract {
         recordType = idi.getRecord();
       } else {
         String message = "ERROR getting IDIOM IMAGE record for ID " + textgridRevisionURI + "!";
-        log.warning(message);
-        String metsError =
-            "<mets xsi:schemaLocation=\"http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/mets.xsd\"\n"
-                + "xmlns=\"http://www.loc.gov/METS/\" xmlns:dv=\"http://dfg-viewer.de/\"\n"
-                + "xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n"
-                + "<amdSec ID=\"error\"/>\n"
-                + "<structMap TYPE=\"LOGICAL\">\n"
-                + "<div LABEL=\"" + message + "\"/>\n"
-                + "</structMap>\n"
-                + "</mets>";
-        MetadataType errorMetadata = new MetadataType();
-        errorMetadata.setAny(metsError);
-        recordType.setMetadata(errorMetadata);
+        recordType.setMetadata(OaipmhUtilities.buildMETSErrorMetadata(message));
       }
     }
 
@@ -221,7 +212,7 @@ public class RecordDelivererIdiom extends RecordDelivererAbstract {
 
     String[] searchField = {theSearchField};
     JSONObject json = new JSONObject();
-    json = new JSONObject(OaipmhUtilities.getRcordByIDFromElasticSearch(this.oaiEsClient, changedId,
+    json = new JSONObject(OaipmhUtilities.getRecordByIDFromElasticSearch(this.oaiEsClient, changedId,
         searchField, Strings.EMPTY_ARRAY).getSource());
 
     result = OaipmhUtilities.firstEntryFieldLoader(json, theSearchField);
diff --git a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDatacite.java b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDatacite.java
index ee8c5738..feb02d3a 100644
--- a/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDatacite.java
+++ b/oaipmh-core/src/main/java/info/textgrid/middleware/RecordListDelivererDatacite.java
@@ -211,8 +211,17 @@ public class RecordListDelivererDatacite extends RecordListDelivererAbstract {
         if (hit != null && hit.getFields() != null) {
           String id2add;
           // TODO Could we not use hit.getId() also for TG hits? Where is the difference?
+          // TODO See:
+          // TODO hit.getId(): xj5w.0
+          // TODO hit.getSourceAsMap(): textgrid:xj5w.0
           if (this.textgrid) {
+
+            System.out.println("  ####  hit.getId(): " + hit.getId());
+
             id2add = hit.getSourceAsMap().get(this.identifierField).toString();
+
+            System.out.println("  ####  hit.getSourceAsMap(): " + id2add);
+
           } else {
             id2add = hit.getId();
           }
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
deleted file mode 100644
index c472076a..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-contributorType-v3.1.xsd
+++ /dev/null
@@ -1,35 +0,0 @@
-<?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
deleted file mode 100644
index 0455f8ac..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-dateType-v3.xsd
+++ /dev/null
@@ -1,21 +0,0 @@
-<?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
deleted file mode 100644
index 881a4dfd..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-descriptionType-v3.xsd
+++ /dev/null
@@ -1,19 +0,0 @@
-<?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
deleted file mode 100644
index a300456d..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-relatedIdentifierType-v3.1.xsd
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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
deleted file mode 100644
index ed8516b5..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-relationType-v3.1.xsd
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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
deleted file mode 100644
index 3205a0cd..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-resourceType-v3.xsd
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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
deleted file mode 100644
index ed2508ad..00000000
--- a/oaipmh-core/src/main/openaire/include/datacite-titleType-v3.xsd
+++ /dev/null
@@ -1,14 +0,0 @@
-<?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
deleted file mode 100644
index 952ae31d..00000000
--- a/oaipmh-core/src/main/openaire/oaf-1.0.xsd
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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
deleted file mode 100644
index 8c52e22a..00000000
--- a/oaipmh-core/src/main/openaire/oaf-common-1.0.xsd
+++ /dev/null
@@ -1,298 +0,0 @@
-<?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
deleted file mode 100644
index c84ec253..00000000
--- a/oaipmh-core/src/main/openaire/oaf-datasource-1.0.xsd
+++ /dev/null
@@ -1,76 +0,0 @@
-<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
deleted file mode 100644
index 3c46fca4..00000000
--- a/oaipmh-core/src/main/openaire/oaf-org-1.0.xsd
+++ /dev/null
@@ -1,41 +0,0 @@
-<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
deleted file mode 100644
index abcba4d9..00000000
--- a/oaipmh-core/src/main/openaire/oaf-project-1.0.xsd
+++ /dev/null
@@ -1,111 +0,0 @@
-<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
deleted file mode 100644
index 2ffd3984..00000000
--- a/oaipmh-core/src/main/openaire/oaf-result-1.0.xsd
+++ /dev/null
@@ -1,242 +0,0 @@
-<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
deleted file mode 100644
index a88a5f04..00000000
--- a/oaipmh-core/src/main/openaire/openaire.xsd
+++ /dev/null
@@ -1,380 +0,0 @@
-<?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>
diff --git a/oaipmh-core/src/main/resources/simpledc20021212.xsd b/oaipmh-core/src/main/resources/simpledc20021212.xsd
index c4bd03d5..f0ad14be 100644
--- a/oaipmh-core/src/main/resources/simpledc20021212.xsd
+++ b/oaipmh-core/src/main/resources/simpledc20021212.xsd
@@ -1,76 +1,79 @@
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-           xmlns="http://purl.org/dc/elements/1.1/"
-           targetNamespace="http://purl.org/dc/elements/1.1/"
-           elementFormDefault="qualified"
-           attributeFormDefault="unqualified">
+	xmlns="http://purl.org/dc/elements/1.1/"
+	targetNamespace="http://purl.org/dc/elements/1.1/"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
 
-  <xs:annotation>
-    <xs:documentation xml:lang="en">
-      Simple DC XML Schema, 2002-10-09
-      by Pete Johnston (p.johnston@ukoln.ac.uk),
-      Carl Lagoze (lagoze@cs.cornell.edu), Andy Powell (a.powell@ukoln.ac.uk),
-      Herbert Van de Sompel (hvdsomp@yahoo.com).
-      This schema defines terms for Simple Dublin Core, i.e. the 15
-      elements from the http://purl.org/dc/elements/1.1/ namespace, with
-      no use of encoding schemes or element refinements.
-      Default content type for all elements is xs:string with xml:lang
-      attribute available.
+	<xs:annotation>
+		<xs:documentation xml:lang="en">
+			Simple DC XML Schema, 2002-10-09
+			by Pete Johnston (p.johnston@ukoln.ac.uk),
+			Carl Lagoze (lagoze@cs.cornell.edu), Andy Powell (a.powell@ukoln.ac.uk),
+			Herbert Van de Sompel (hvdsomp@yahoo.com).
+			This schema defines terms for Simple Dublin Core, i.e. the 15
+			elements from the http://purl.org/dc/elements/1.1/ namespace, with
+			no use of encoding schemes or element refinements.
+			Default content type for all elements is xs:string with xml:lang
+			attribute available.
 
-      Supercedes version of 2002-03-12. 
-      Amended to remove namespace declaration for http://www.w3.org/XML/1998/namespace namespace,
-      and to reference lang attribute via built-in xml: namespace prefix.
-      xs:appinfo also removed.
-    </xs:documentation>
-  </xs:annotation>
+			Supercedes version of 2002-03-12.
+			Amended to remove namespace declaration for
+			http://www.w3.org/XML/1998/namespace namespace,
+			and to reference lang attribute via built-in xml: namespace prefix.
+			xs:appinfo also removed.
+		</xs:documentation>
+	</xs:annotation>
 
-  <xs:import namespace="http://www.w3.org/XML/1998/namespace"
-             schemaLocation="https://www.w3.org/2001/03/xml.xsd">
-  </xs:import>
+	<!-- In case of an error such as "Server returned HTTP response code: 429 
+		for URL: https://www.w3.org/2001/03/XMLSchema.dtd" try using VPN, downloading 
+		all needed files for offline could be another solution... -->
+	<xs:import namespace="http://www.w3.org/XML/1998/namespace"
+		schemaLocation="https://www.w3.org/2001/03/xml.xsd">
+	</xs:import>
 
-  <xs:element name="title" type="elementType"/>
-  <xs:element name="creator" type="elementType"/>
-  <xs:element name="subject" type="elementType"/>
-  <xs:element name="description" type="elementType"/>
-  <xs:element name="publisher" type="elementType"/>
-  <xs:element name="contributor" type="elementType"/>
-  <xs:element name="date" type="elementType"/>
-  <xs:element name="type" type="elementType"/>
-  <xs:element name="format" type="elementType"/>
-  <xs:element name="identifier" type="elementType"/>
-  <xs:element name="source" type="elementType"/>
-  <xs:element name="language" type="elementType"/>
-  <xs:element name="relation" type="elementType"/>
-  <xs:element name="coverage" type="elementType"/>
-  <xs:element name="rights" type="elementType"/>
+	<xs:element name="title" type="elementType" />
+	<xs:element name="creator" type="elementType" />
+	<xs:element name="subject" type="elementType" />
+	<xs:element name="description" type="elementType" />
+	<xs:element name="publisher" type="elementType" />
+	<xs:element name="contributor" type="elementType" />
+	<xs:element name="date" type="elementType" />
+	<xs:element name="type" type="elementType" />
+	<xs:element name="format" type="elementType" />
+	<xs:element name="identifier" type="elementType" />
+	<xs:element name="source" type="elementType" />
+	<xs:element name="language" type="elementType" />
+	<xs:element name="relation" type="elementType" />
+	<xs:element name="coverage" type="elementType" />
+	<xs:element name="rights" type="elementType" />
 
-  <xs:group name="elementsGroup">
-  <xs:sequence>
-    <xs:choice minOccurs="0" maxOccurs="unbounded">
-      <xs:element ref="title"/>
-      <xs:element ref="creator"/>
-      <xs:element ref="subject"/>
-      <xs:element ref="description"/>
-      <xs:element ref="publisher"/>
-      <xs:element ref="contributor"/>
-      <xs:element ref="date"/>
-      <xs:element ref="type"/>
-      <xs:element ref="format"/>
-      <xs:element ref="identifier"/>
-      <xs:element ref="source"/>
-      <xs:element ref="language"/>
-      <xs:element ref="relation"/>
-      <xs:element ref="coverage"/>
-      <xs:element ref="rights"/>
-    </xs:choice>
-    </xs:sequence>
-  </xs:group>
+	<xs:group name="elementsGroup">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element ref="title" />
+				<xs:element ref="creator" />
+				<xs:element ref="subject" />
+				<xs:element ref="description" />
+				<xs:element ref="publisher" />
+				<xs:element ref="contributor" />
+				<xs:element ref="date" />
+				<xs:element ref="type" />
+				<xs:element ref="format" />
+				<xs:element ref="identifier" />
+				<xs:element ref="source" />
+				<xs:element ref="language" />
+				<xs:element ref="relation" />
+				<xs:element ref="coverage" />
+				<xs:element ref="rights" />
+			</xs:choice>
+		</xs:sequence>
+	</xs:group>
 
-  <xs:complexType name="elementType">
-    <xs:simpleContent>
-      <xs:extension base="xs:string">
-        <xs:attribute ref="xml:lang" use="optional"/>
-      </xs:extension>
-    </xs:simpleContent>
-  </xs:complexType>
+	<xs:complexType name="elementType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute ref="xml:lang" use="optional" />
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
 
 </xs:schema>
diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java
index 36603a88..be424d27 100644
--- a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java
+++ b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/OaipmhUtilitiesOnline.java
@@ -49,8 +49,8 @@ public class OaipmhUtilitiesOnline {
   // public static final String PROPERTIES_FILE = "oaipmh.test.textgridlab-org.properties";
   public static final String PROPERTIES_FILE = "oaipmh.test.dev-textgridlab-org.properties";
 
-  public static final boolean TEST_ALL_PAGES = false;
-  // public static final boolean TEST_ALL_PAGES = true;
+  // public static final boolean TEST_ALL_PAGES = false;
+  public static final boolean TEST_ALL_PAGES = true;
 
   // ## CHANGE SETTINGS ABOVE FOR SETTING TEST SCOPE ---------------------------------------------
 
@@ -77,12 +77,12 @@ public class OaipmhUtilitiesOnline {
   public static final String NOT_TESTED = " >>> NOT_TESTED";
   public static final String NO_TOKEN = "-1";
 
-  public static final String NO_SET = null;
-  public static final String NO_THREAD_NAME = "";
   public static final boolean NO_METADATA_FORMAT_WITH_RESTOK = false;
   public static final boolean METADATA_FORMAT_WITH_RESTOK = true;
   public static final boolean NO_ERROR_EXPECTED = false;
   public static final boolean ERROR_EXPECTED = true;
+  public static final String NO_SET = null;
+  public static final String NO_THREAD_NAME = "MAIN";
   public static final String NO_FROM = null;
   public static final String NO_UNTIL = null;
   public static final String NO_QUERY = "";
@@ -142,7 +142,7 @@ public class OaipmhUtilitiesOnline {
 
     Response result;
 
-    System.out.println("\twaiting: " + TIME + " millies");
+    System.out.println("\t" + theThreadName + "waiting: " + TIME + " millies");
 
     try {
       Thread.sleep(TIME);
@@ -335,7 +335,7 @@ public class OaipmhUtilitiesOnline {
 
     // Test if the header identifiers are sound.
     if (theVerb.equals(VERB_LIST_RECORDS) || theVerb.equals(VERB_LIST_IDENTIFIERS)) {
-      examineTGHeaderIDs(responseString, theMetadataPrefix);
+      examineTGHeaderIDs(responseString, theMetadataPrefix, theThreadName);
     }
 
     // Test if the header dates and record (modification) dates are equal.
@@ -379,7 +379,7 @@ public class OaipmhUtilitiesOnline {
 
         // Test if the header identifiers are sound.
         if (theVerb.equals(VERB_LIST_RECORDS)) {
-          examineTGHeaderIDs(responseString, theMetadataPrefix);
+          examineTGHeaderIDs(responseString, theMetadataPrefix, theThreadName);
         }
 
         // Test general metadata content (if verb is listRecords!), must go conform with the
@@ -480,7 +480,7 @@ public class OaipmhUtilitiesOnline {
     String cursorStr = toktag.substring(toktag.indexOf("cursor=\"") + 8);
     int cursor = Integer.parseInt(cursorStr.substring(0, cursorStr.indexOf("\"")));
     System.out.println("\t" + theThreadName + "complete list size: " + size);
-    System.out.println("\tdelivered with last response: " + cursor);
+    System.out.println("\t" + theThreadName + "delivered with last response: " + cursor);
 
     // If token is provided, test cursor and element count!
     if (!restok.isEmpty()) {
@@ -507,9 +507,12 @@ public class OaipmhUtilitiesOnline {
     // If no token is provided, stop querying.
     else {
       // Check <record> count, must be completeListSize % recordsExpectedPerRequest.
-      if (recordCount != size % recordsExpectedPerRequest) {
+      // NOTE In case we have exactly recordsExpectedPerRequest records, we have to use moduloCount!
+      int moduloCount = recordCount % recordsExpectedPerRequest;
+      int moduloExpected = size % recordsExpectedPerRequest;
+      if (moduloCount != moduloExpected) {
         String message = theThreadName + ": " + recordOrHeader + " count mismatch, should be "
-            + size % recordsExpectedPerRequest + ", but is " + recordCount;
+            + moduloExpected + ", but is " + recordCount;
         assertTrue(message, false);
       }
 
@@ -557,8 +560,29 @@ public class OaipmhUtilitiesOnline {
       String message = OAI_DATACITE_PREFIX + " needs to deliver content with schema: "
           + EXPECTED_DATACITE_FORMAT_CONTENT + "!";
       assertTrue(message, false);
-
     }
+
+    // DEBUG OUTPUT Trace empty record tags without metadata.
+    // try {
+    // File f = new File("kaputt.log");
+    // if (!f.exists()) {
+    // f.createNewFile();
+    // }
+    // FileWriter kaputt = new FileWriter(f, true);
+    // String mustNOTcontain = "</header>\n" + " </record>";
+    // if (theResponseString.contains(mustNOTcontain)) {
+    // int loc = theResponseString.indexOf(mustNOTcontain);
+    // kaputt.append("#########################################\n");
+    // kaputt.append(loc + "\n");
+    // kaputt.append("#########################################\n");
+    // kaputt.append(theResponseString.substring(loc - 200, loc + 200) + "\n");
+    // kaputt.append("#########################################\n");
+    // }
+    // kaputt.close();
+    // } catch (IOException e) {
+    // // TODO Auto-generated catch block
+    // e.printStackTrace();
+    // }
   }
 
   /**
@@ -570,8 +594,10 @@ public class OaipmhUtilitiesOnline {
    * 
    * @param theResponseString
    * @param theMetadataPrefix
+   * @param theThreadName
    */
-  public static void examineTGHeaderIDs(String theResponseString, String theMetadataPrefix) {
+  public static void examineTGHeaderIDs(String theResponseString, String theMetadataPrefix,
+      String theThreadName) {
 
     HashSet<String> idHash = new HashSet<String>();
 
@@ -590,7 +616,7 @@ public class OaipmhUtilitiesOnline {
       }
     }
 
-    System.out.println("\tID hash (" + idHash.size() + "): " + idHash);
+    System.out.println("\t[" + theThreadName + "] ID hash (" + idHash.size() + "): " + idHash);
 
     // Check for ID count: Hash size (unique IDs!) must be equal to the count of ID headers!
     if (count != idHash.size()) {
diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGBasicsOnline.java b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGBasicsOnline.java
index 4aab59a7..1b3db1f3 100644
--- a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGBasicsOnline.java
+++ b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGBasicsOnline.java
@@ -27,7 +27,7 @@ import info.textgrid.middleware.test.online.OaipmhUtilitiesOnline;
  * 
  * @author Stefan E. Funk, SUB Göttingen
  */
-@Ignore
+//@Ignore
 public class TestTGBasicsOnline {
 
   // **
diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGGetRecordOnline.java b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGGetRecordOnline.java
index 78ee5b78..56538b57 100644
--- a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGGetRecordOnline.java
+++ b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGGetRecordOnline.java
@@ -36,7 +36,7 @@ import info.textgrid.middleware.test.online.OaipmhUtilitiesOnline;
  * 
  * @author Stefan E. Funk, SUB Göttingen
  */
-@Ignore
+// @Ignore
 public class TestTGGetRecordOnline {
 
   // **
@@ -186,12 +186,13 @@ public class TestTGGetRecordOnline {
   }
 
   /**
+   * @param theThreadName
    * @throws IOException
-   * @throws DatatypeConfigurationException
    * @throws ParseException
+   * @throws DatatypeConfigurationException
    */
   @Test
-  public void testGetRecordIdiomMETS()
+  public void testGetRecordIdiomMETS(String theThreadName)
       throws IOException, ParseException, DatatypeConfigurationException {
 
     System.out.println(OaipmhUtilitiesOnline.TESTING + "testGetRecordIdiomMETS()");
@@ -211,7 +212,8 @@ public class TestTGGetRecordOnline {
     }
 
     // Test OAI header.
-    OaipmhUtilitiesOnline.examineTGHeaderIDs(response, OaipmhUtilitiesOnline.OAI_IDIOMMETS_PREFIX);
+    OaipmhUtilitiesOnline.examineTGHeaderIDs(response, OaipmhUtilitiesOnline.OAI_IDIOMMETS_PREFIX,
+        theThreadName);
     OaipmhUtilitiesOnline.examineTGModificationDates(response);
 
     System.out.println("\tresponse: " + response);
@@ -219,12 +221,13 @@ public class TestTGGetRecordOnline {
   }
 
   /**
+   * @param theThreadName
    * @throws IOException
-   * @throws DatatypeConfigurationException
    * @throws ParseException
+   * @throws DatatypeConfigurationException
    */
   @Test
-  public void testGetRecordIDIOMMETSImage()
+  public void testGetRecordIDIOMMETSImage(String theThreadName)
       throws IOException, ParseException, DatatypeConfigurationException {
 
     System.out.println(OaipmhUtilitiesOnline.TESTING + "testGetRecordIDIOMMETS_Image()");
@@ -246,7 +249,8 @@ public class TestTGGetRecordOnline {
     }
 
     // Test OAI header.
-    OaipmhUtilitiesOnline.examineTGHeaderIDs(response, OaipmhUtilitiesOnline.OAI_IDIOMMETS_PREFIX);
+    OaipmhUtilitiesOnline.examineTGHeaderIDs(response, OaipmhUtilitiesOnline.OAI_IDIOMMETS_PREFIX,
+        theThreadName);
     OaipmhUtilitiesOnline.examineTGModificationDates(response);
 
     System.out.println("\tresponse: " + response);
diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListIdentifiersOnline.java b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListIdentifiersOnline.java
index 3a373f61..99e7d2c4 100644
--- a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListIdentifiersOnline.java
+++ b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListIdentifiersOnline.java
@@ -26,7 +26,7 @@ import info.textgrid.middleware.test.online.OaipmhUtilitiesOnline;
  * 
  * @author Stefan E. Funk, SUB Göttingen
  */
-@Ignore
+//@Ignore
 public class TestTGListIdentifiersOnline {
 
   // **
diff --git a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListRecordsOnline.java b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListRecordsOnline.java
index 500dae53..e971bc0b 100644
--- a/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListRecordsOnline.java
+++ b/oaipmh-core/src/test/java/info/textgrid/middleware/test/online/tg/TestTGListRecordsOnline.java
@@ -26,7 +26,7 @@ import info.textgrid.middleware.test.online.OaipmhUtilitiesOnline;
  * 
  * @author Stefan E. Funk, SUB Göttingen
  */
-@Ignore
+// @Ignore
 public class TestTGListRecordsOnline {
 
   // **
-- 
GitLab