Skip to content

Commit bd7e66c

Browse files
committed
Add command line script
1 parent eaa0922 commit bd7e66c

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ digital collections.
5252
* [Using an experimental version](#using-an-experimental-version)
5353
* [More info](#more-info)
5454

55+
5556
## Quality dimensions
5657

5758
The framework measures the following features:
@@ -83,8 +84,22 @@ above these there are some helper calculators:
8384

8485
## Running as command-line application
8586

86-
Go to the project https://github.com/viaacode/metadata-quality-assessment to
87-
run this framework as a CLI.
87+
usage:
88+
89+
```
90+
./mqa -i <file> -s <file> -m <file>
91+
[-f <format>] [-h <arg>] [-o <file>] [-r <path>] [-v <format>] [-w <format>] [-z]
92+
```
93+
* `-i,--input <file>` Input file.
94+
* `-s,--schema <file>` Schema file describing the metadata structure to run assessment against.
95+
* `-v,--schemaFormat <format>` Format of schema file: json, yaml. Default: based on file extension, else json.
96+
* `-m,--measurements <file>` Configuration file for measurements.
97+
* `-w,--measurementsFormat <format>` Format of measurements config file: json, yaml. Default: based on file extension, else json.
98+
* `-o,--output <file>` Output file.
99+
* `-f,--outputFormat <format>` Format of the output: json, ndjson (new line delimited JSON), csv, csvjson (json encoded in csv; useful for RDB bulk loading). Default: ndjson.
100+
* `-r,--recordAddress <path>` An XPath or JSONPath expression to separate individual records in an XML or JSON files.
101+
* `-z,--gzip` Flag to indicate that input is gzipped.
102+
* `-h,--headers <arg>` Headers to copy from source
88103

89104
## Using the library
90105

mqa

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
#-----------------------------------------------------------------------
3+
# Command line interface for the Metadata Quality Assessment Framework -
4+
#-----------------------------------------------------------------------
5+
export VERSION=0.9.0
6+
java -jar $(dirname $(readlink -f $0))/target/metadata-qa-api-${VERSION}-shaded.jar $@

src/main/java/de/gwdg/metadataqa/api/cli/App.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,55 +156,55 @@ private static Options buildOptions() {
156156

157157
Option inputOption = Option.builder("i")
158158
.numberOfArgs(1)
159-
.argName("input file")
159+
.argName("file")
160160
.required(true)
161161
.longOpt(INPUT_FILE)
162162
.desc("Input file.")
163163
.build();
164164

165165
Option outputOption = Option.builder("o")
166166
.numberOfArgs(1)
167-
.argName("output file")
167+
.argName("file")
168168
.required(false)
169169
.longOpt(OUTPUT_FILE)
170170
.desc("Output file.")
171171
.build();
172172

173173
Option outputFormatOption = Option.builder("f")
174174
.numberOfArgs(1)
175-
.argName("output format")
175+
.argName("format")
176176
.required(false)
177177
.longOpt(OUTPUT_FORMAT)
178178
.desc("Format of the output: json, ndjson (new line delimited JSON), csv, csvjson (json encoded in csv; useful for RDB bulk loading). Default: ndjson.")
179179
.build();
180180

181181
Option schemaConfigOption = Option.builder("s")
182182
.numberOfArgs(1)
183-
.argName("schema configuration")
183+
.argName("file")
184184
.required(true)
185185
.longOpt(SCHEMA_CONFIG)
186186
.desc("Schema file to run assessment against.")
187187
.build();
188188

189189
Option schemaFormatOption = Option.builder("v")
190190
.numberOfArgs(1)
191-
.argName("schema format")
191+
.argName("format")
192192
.required(false)
193193
.longOpt(SCHEMA_FORMAT)
194194
.desc("Format of schema file: json, yaml. Default: based on file extension, else json.")
195195
.build();
196196

197197
Option measurementsConfigOption = Option.builder("m")
198198
.numberOfArgs(1)
199-
.argName("measurement configuration")
199+
.argName("file")
200200
.required(true)
201201
.longOpt(MEASUREMENTS_CONFIG)
202202
.desc("Configuration file for measurements.")
203203
.build();
204204

205205
Option measurementsFormatOption = Option.builder("w")
206206
.numberOfArgs(1)
207-
.argName("measurement format")
207+
.argName("format")
208208
.required(false)
209209
.longOpt(MEASUREMENTS_FORMAT)
210210
.desc("Format of measurements config file: json, yaml. Default: based on file extension, else json.")
@@ -226,7 +226,7 @@ private static Options buildOptions() {
226226

227227
Option recordAddressOption = Option.builder("r")
228228
.numberOfArgs(1)
229-
.argName("record address")
229+
.argName("path")
230230
.required(false)
231231
.longOpt(RECORD_ADDRESS)
232232
.desc("An XPath or JSONPath expression to separate individual records in an XML or JSON files.")

0 commit comments

Comments
 (0)