REST API for the Metadata Quality Assessment Framework
build
mvn clean package
deploy
- stop Tomcat if running
- copy the .war file to Tomcat
cp tartget/mqaf-ws.war path/to/tomcat/webapps-javaee
- start Tomcat
The REST API endpoint is available at https://YOURSERVER/ws/validate
You can use the following parameters (see more details here):
@RequestParam(value = "headers", defaultValue = "") String headers,
schemaFile
(optional, String, default: "") The schema configuration fileschemaFormat
(optional, String, default: "yaml") The format of the Schema file (yaml
orjson
)measurements
(optional, String, default: "") The measurement configuration filemeasurementsFormat
(optional, String, default: "yaml") The format of the Schema file (yaml
orjson
)inputFile
(optional, String) The input filegzip
(optional, boolean) A flag to denote if the input file is gzippedrecordAddress
(optional, String) The XPath expression that separates individual records within an XML file (it can be used if theinputFile
is an XML file)output
(optional, String) The output fileoutputFormat
(optional, String, defaultValue = "csv") The output formatheaders
(optional, String) A comma spearated string denoting the header of the input CSV (if the input is a CSV file without header line)
Validate a binary marc file in pure MARC21 schema:
DIR=/path/to/files
curl -X POST \
-F 'schemaFile=${DIR}/dc-schema.yaml' \
-F 'schemaFormat=yaml' \
-F 'measurementsFile=${DIR}/measurement.json' \
-F 'measurementsFormat=json' \
-F 'inputFile=${DIR}/UB_W-rzburg_Texte.xml' \
-F 'recordAddress=//oai:record' \
-F 'gzip=false' \
-F 'outputFormat=CSV' \
-F 'output=${DIR}/output.csv' \
http://localhost:8080/mqaf-ws/validate