Skip to content

Commit

Permalink
Upgrade de.gwdg.metadataqa:metadata-qa-api from 0.9.4 to 0.9.5 #497
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Aug 21, 2024
1 parent 668af5c commit ad323cb
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ Parameters:
* `-C <file>`, `--shaclConfigurationFile <file>`: specify the SHACL like configuration file
* `-O <file>`, `--shaclOutputFile <file>`: output file (default: `shacl4bib.csv`)
* `-P <type>`, `--shaclOutputType <type>`: specify what the output files should contain. Possible values:
* `STATUS`: status only, where the following values appear:
* `STATUS`: status only (default), where the following values appear:
* `1` the criteria met,
* `0` the criteria have not met,
* `NA`: the data element is not available in the record),
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<dependency>
<groupId>de.gwdg.metadataqa</groupId>
<artifactId>metadata-qa-api</artifactId>
<version>0.9.4</version>
<version>0.9.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
5 changes: 5 additions & 0 deletions scripts/shacl4bib/shacl4bib.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#' it creates a statistics from the status columns counting the number
#' of distinct values from all possible values (that are 0, 1, NA).
#' The header of the file are
# id,0,1,NA
# the rows are the individual rules identified by their IDs
library(tidyverse)

args = commandArgs(trailingOnly=TRUE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.gwdg.metadataqa.marc.cli.utils;

import de.gwdg.metadataqa.api.json.DataElement;
import de.gwdg.metadataqa.api.model.XmlFieldInstance;
import de.gwdg.metadataqa.marc.dao.record.BibliographicRecord;
import de.gwdg.metadataqa.marc.utils.marcspec.legacy.MarcSpec;
Expand All @@ -20,6 +21,10 @@ public List<XmlFieldInstance> get(String path) {
return transformTags(extract(path));
}

public List<XmlFieldInstance> get(DataElement dataElement) {
return get(dataElement.getPath());
}

public List<String> extract(String path) {
return record.select(getMarcSpec(path));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.gwdg.metadataqa.marc.cli.utils;

import de.gwdg.metadataqa.api.json.DataElement;
import de.gwdg.metadataqa.api.model.XmlFieldInstance;
import de.gwdg.metadataqa.marc.dao.record.BibliographicRecord;
import de.gwdg.metadataqa.marc.utils.pica.path.PicaSpec;
Expand All @@ -16,6 +17,10 @@ public List<XmlFieldInstance> get(String path) {
return transformTags(extract(path));
}

public List<XmlFieldInstance> get(DataElement dataElement) {
return get(dataElement.getPath());
}

public List<String> extract(String path) {
return record.select(new PicaSpec(path));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public void completeness_pica_groupBy_file() throws Exception {
assertTrue(line.contains("\"pica\":true,"));
assertTrue(line.contains("\"replacementInControlFields\":null,"));
assertTrue(line.contains("\"marc21\":false,"));
assertTrue(line.contains("\"mqaf.version\":\"0.9.4\","));
assertTrue(line.contains("\"mqaf.version\":\"0.9.5\","));
assertTrue(line.contains("\"qa-catalogue.version\":\"0.8.0-SNAPSHOT\""));
assertTrue(line.contains("\"duration\":\"00:00:00\""));
assertTrue(line.contains("\"numberOfprocessedRecords\":10"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void validate_pica_groupBy() throws Exception {
assertTrue(line.contains("\"pica\":true,"));
assertTrue(line.contains("\"replacementInControlFields\":null,"));
assertTrue(line.contains("\"marc21\":false,"));
assertTrue(line.contains("\"mqaf.version\":\"0.9.4\","));
assertTrue(line.contains("\"mqaf.version\":\"0.9.5\","));
assertTrue(line.contains("\"qa-catalogue.version\":\"0.8.0-SNAPSHOT\""));
assertTrue(line.contains("\"duration\":\"00:00:00\""));
assertTrue(line.contains("\"numberOfprocessedRecords\":10"));
Expand Down
9 changes: 9 additions & 0 deletions validate
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,20 @@ fi
SHORT_OPTIONS="m:hnl:o:i:d:qabpxyt:rz:v:f:s:g:1:2:u:j:w:k:c:e:3:4:G:SHF:R:WTI:"
LONG_OPTIONS="marcVersion:,help,nolog,limit:,offset:,id:,defaultRecordType:,fixAlephseq,fixAlma,fixKbr,alephseq,marcxml,lineSeparated,outputDir:,trimId,ignorableFields:,ignorableRecords:,marcFormat:,dataSource:,defaultEncoding:,alephseqLineType:,picaIdField:,picaSubfieldSeparator:,picaSchemaFile:,schemaType:,picaRecordType:,allowableRecords:,groupBy:,groupListFile:,solrForScoresUrl:,summaryFileName:,summary,details,detailsFileName:,format:,emptyLargeCollectors,collectAllErrors,ignorableIssueTypes:"

echo "@: ${@}"

GETOPT=$(getopt \
-o ${SHORT_OPTIONS} \
--long ${LONG_OPTIONS} \
-n ${ME} -- "$@")
eval set -- "${GETOPT}"

echo "GETOPT: ${GETOPT}"

PARAMS=""
HELP=0
while true ; do
echo "process $1"
case "$1" in
-m|--marcVersion) PARAMS="$PARAMS --marcVersion $2" ; shift 2 ;;
-h|--help) PARAMS="$PARAMS --help" ; HELP=1; shift ;;
Expand Down Expand Up @@ -122,5 +127,9 @@ fi

CMD="/usr/bin/java -Xmx8g -cp $JAR de.gwdg.metadataqa.marc.cli.ValidatorCli"

echo 'CMD: ' $CMD
echo 'PARAMS: ' $PARAMS
echo 'REST: ' "$@"
echo $CMD $PARAMS "$@"
exit
$CMD $PARAMS "$@"

0 comments on commit ad323cb

Please sign in to comment.