Difference between revisions of "YASMEEN converter"

From D4Science Wiki
Jump to: navigation, search
(Usage examples)
(Common invocation)
Line 76: Line 76:
 
* Convert a DWCA file and store the results in an user-specified folder
 
* Convert a DWCA file and store the results in an user-specified folder
  
  java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/Provider1_DWCA_file.zip -outDir /path/to/TAF/dir/Provider1 -providerId PRVD1
+
  java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/file/Provider1_DWCA_file.zip -outDir /path/to/TAF/dir/Provider1 -providerId PRVD1
  
 
Will produce the:  
 
Will produce the:  
Line 92: Line 92:
 
folder
 
folder
  
=== DWCA folder as input
+
=== DWCA folder as input ===
  
=== No output folder specified
+
* Convert DWCA from a folder and store the results in an user-specified folder
  
=== Placeholder substitution
+
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/folder/Provider1 -outDir /path/to/TAF/dir/Provider1 -providerId PRVD1
 +
 
 +
Will produce the:
 +
 
 +
* PRVD1_taxa.taf.gz
 +
 
 +
and
 +
 
 +
* PRVD1_vernacular.taf.gz
 +
 
 +
in the
 +
 
 +
/path/to/TAF/dir/Provider1
 +
 
 +
folder, assuming that the
 +
 
 +
/path/to/DWCA/folder/Provider1
 +
 
 +
folder contains the meta.xml and referenced .txt files as per DWCA specification.
 +
 
 +
=== No output folder specified ===
 +
 
 +
* Convert a DWCA file and store the results in the default folder
 +
 
 +
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/file/Provider1_DWCA_file.zip -providerId PRVD1
 +
 
 +
Will produce the:
 +
 
 +
* PRVD1_taxa.taf.gz
 +
 
 +
and
 +
 
 +
* PRVD1_vernacular.taf.gz
 +
 
 +
in the
 +
 
 +
/path/to/DWCA/file/out
 +
 
 +
folder
 +
 
 +
=== Placeholder substitution ===
 +
 
 +
* Convert a DWCA file and store the results in an user-specified folder (using placeholders both in the input file and output dir options)
 +
 
 +
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/file/{providerId}/{providerId}_All_DWCA_file.zip -outDir /path/to/TAF/dir/{providerId} -providerId PRVD1
 +
 
 +
Will read the input DWCA file from:
 +
 
 +
/path/to/DWCA/file/PRVD1/PRVD1_All_DWCA_file.zip
 +
 
 +
and produce the
 +
 
 +
* PRVD1_taxa.taf.gz
 +
 
 +
and
 +
 
 +
* PRVD1_vernacular.taf.gz
 +
 
 +
in the
 +
 
 +
/path/to/TAF/dir/PRVD1
 +
 
 +
folder
  
 
== Appendix ==
 
== Appendix ==

Revision as of 15:02, 26 October 2013

"Yet Another Species Matching Execution ENgine" - DWCA to TAF data converter CLI tool

Purposes

Command line

java -jar YASMINE-converter-<version>.jar <options>

You can launch it with the '-h' option to get a report of the available options with their description:

java -jar YASMINE-converter-<version>.jar -h

Will give:

usage:
 -h                  Print this message
 -inFile <arg>       Specify an input file (either a DWCA file or a folder containing an exploded DWCA file content
 -outDir <arg>       Specify the output folder that will contain the .taf files resulting from the conversion of the input DWCA
 -providerId <arg>   Specify the provider ID. This will have impact on the name of the .taf files generated by the conversion,
                     that will be <provider ID>_taxa.taf and <provider ID>_vernacular.taf

General command line options

-h

This option requires no arguments, and - when set - will print the help message and exit (no parsing will be performed)

Input data command line options

-inFile

Mandatory.

Specifies the input file. This can be either a DWCA file or a folder containing an exploded DWCA file content.

Output data command line options

-providerId

Mandatory.

Specifies the provider ID. This identifier will be used to actually name the TAF files generated by the conversion.

Taxa and vernacular TAF files produced out of the input DWCA will be named as:

and

respectively.

-outDir

Optional.

Specifies the output folder that will contain the TAF files resulting from the conversion of the input DWCA.

When this option is not explicitly set, the output directory is determined as follows:

  • If the input file is a proper DWCA file, the output directory will be created in its same folder and be named 'out'
  • If the input file is a folder containing the exploded files in a DWCA file, the output directory will be created in the input folder and be named 'out'

Placeholders expansion

Actual values of the -inFile and -outDir options can use the

{providerId}

placeholder that will in turn be converted in the value of the -providerId options before attempting to access the input file / folder and create the output folder specified by the corresponding options.

Usage examples

Common invocation

  • Convert a DWCA file and store the results in an user-specified folder
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/file/Provider1_DWCA_file.zip -outDir /path/to/TAF/dir/Provider1 -providerId PRVD1

Will produce the:

  • PRVD1_taxa.taf.gz

and

  • PRVD1_vernacular.taf.gz

in the

/path/to/TAF/dir/Provider1 

folder

DWCA folder as input

  • Convert DWCA from a folder and store the results in an user-specified folder
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/folder/Provider1 -outDir /path/to/TAF/dir/Provider1 -providerId PRVD1

Will produce the:

  • PRVD1_taxa.taf.gz

and

  • PRVD1_vernacular.taf.gz

in the

/path/to/TAF/dir/Provider1 

folder, assuming that the

/path/to/DWCA/folder/Provider1

folder contains the meta.xml and referenced .txt files as per DWCA specification.

No output folder specified

  • Convert a DWCA file and store the results in the default folder
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/file/Provider1_DWCA_file.zip -providerId PRVD1

Will produce the:

  • PRVD1_taxa.taf.gz

and

  • PRVD1_vernacular.taf.gz

in the

/path/to/DWCA/file/out 

folder

Placeholder substitution

  • Convert a DWCA file and store the results in an user-specified folder (using placeholders both in the input file and output dir options)
java -jar YASMEEN-converter-<version>.jar -inFile /path/to/DWCA/file/{providerId}/{providerId}_All_DWCA_file.zip -outDir /path/to/TAF/dir/{providerId} -providerId PRVD1

Will read the input DWCA file from:

/path/to/DWCA/file/PRVD1/PRVD1_All_DWCA_file.zip

and produce the

  • PRVD1_taxa.taf.gz

and

  • PRVD1_vernacular.taf.gz

in the

/path/to/TAF/dir/PRVD1 

folder

Appendix

Download

You can download the YASMEEN converter through one of this URLs:

  • [http:// v1.1.1] ( KB)