Skip to content

Latest commit

 

History

History
105 lines (65 loc) · 5.3 KB

README.md

File metadata and controls

105 lines (65 loc) · 5.3 KB

OpenAIRE CRIS validator

A tool to assess whether an OAI-PMH endpoint can provide research information complying with the OpenAIRE Guidelines for CRIS Managers 1.1. It covers these checks.

This is a command-line Java tool that is organized as a JUnit test suite. You can also run it in your IDE.

Please read below how to build it, run it, explore its internals and give feedback. This is Open Source software, available under the terms of the Apache 2.0 License.

Current status

Travis-CI Build Status ← checking if the software builds and runs on the example files from the standard.

Releases

1.2.0 on 2019-03-15:

  • implementation changes: regular expression violation non-fatality is now achieved through a relaxed XML Schema
  • issues with cached schemas resolved: the validator should now have them all and read them in correct order

1.1.0 on 2018-11-24:

  • regular expression non-match is reported, but does not stop the harvest;
  • fix to one reported issue (#1).

1.0.0 on 2018-05-22:

  • checks fully implemented;
  • works against a real CRIS.

Usage

Build

Please make sure you have checked out the guidelines-cris-managers project in a parallel directory. Then do:

mvn clean package

Run

From command line

java -jar target/openaire-cris-validator-*-jar-with-dependencies.jar {endpoint-url}

With Java 9 you'll need the additional command-line option --add-modules=java.xml.bind to run the code (as per this answer on StackOverflow).

From Eclipse

Set up a JUnit launcher for the CRISValidator class. Pass the OAI-PMH endpoint URL as the value of the system property endpoint.to.validate. Add the parallel guidelines-cris-managers project to the classpath of the launcher (in order to access the XML Schemas).

Checking the examples from OpenAIRE Guidelines for CRIS Managers

Use file:samples/ as your endpoint-url.

Diagnostics

The validator copies the responses to the requests it makes into files in the data/ subdirectory.

Internals

CRISValidator is the main validator class. It is the JUnit4 test suite. As it reads the metadata records from the CRIS:

  • it does simple checks on the fly (using CheckingIterable); and
  • it builds an internal representation: a HashMap of trees that consist of CERIFNodes. The last test, check990_CheckReferentialIntegrityAndFunctionalDependency, works on this internal representation.

OAIPMHEndpoint is an independent implementation of an OAI-PMH 2.0 client in Java. While it uses JAXB to map the OAI-PMH 2.0 markup to Java objects, any metadata payload is opaque to it. For requests that list objects (i.e., ListIdentifiers, ListRecords or ListSets) an Iterable is returned that uses the protocol's resumption token mechanism to fetch successive chunks of objects. This is entirely transparent to the class user.

If the OAI-PMH 2.0 data provider advertises support for a compression, the endpoint client object will use it. CompressionHandlingHttpURLConnectionAdapter is a transparent compression-handling wrapper around an HttpURLConnection.

Feedback

I'll be grateful for your feedback.
Please submit a github issue or email me to [email protected].

License

Copyright 2018 Jan Dvořák ORCID iD icon https://orcid.org/0000-0001-8985-152X

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.