YASMEEN matching engine

From D4Science Wiki
Revision as of 19:26, 27 October 2013 by Fabio.fiorellato (Talk | contribs) (-ps)

Jump to: navigation, search

"Yet Another Species Matching Execution ENgine" - Matching engine CLI tool

Purposes

The YASMEEN matching engine is the command line (CLI) tool that implements the MATCH DATA and PRODUCE MATCHING RESULTS steps in the YASMEEN data flow.

It takes a parsed input data file as input, a set of TAF files as reference data, a set of matchlets configuration options and identifies matching between input and reference data entries, producing results in a format specified by the user.

Command line

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

This CLI tool can be launched with the '-h' option to get a report of the available options:

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

Will give:

usage:
 -dontSkipHeader          Set this option if the parsed input data file doesn't start with a CSV header row
 -h                       Print this message
 -hfm                     Instructs the system to halt the current data process at the first valid matching (i.e. a matching
                          with an overall score higher than the minimum set)
 -inFile <arg>            Path to a text file containing the parsed input data (one per line)
 -law <arg>               Sets the different lexical algorithms weight for matchers that do perform lexical comparisons. The
                          syntax of this parameter is: <lev>:<sndx>:<trig>, with <lev> being the weight of the calculated
                          Levenshtein similarity, <sndx> being the weight of the calculated soundex comparison and <trig> being
                          the weight of the calculated trigram similarity. To enable Levenshtein similarity only, use -law
                          100:0:0. Conversely, to enable soundex only you should use: -law 0:100:0, to enable trigrams only you
                          should use -law 0:0:100 and to enable an equal mix of all three, you should use -law 100:100:100.
                          Valid values for each of these three weights are in the range [0, 100]
 -man                     Enables the authority name matching
 -mant <arg>              Sets the authority name matching results minimum score threshold (0.0, 1.0]
 -manw <arg>              Sets the authority name matching weight (0.0, n]
 -may                     Enables the authority year matching
 -mayt <arg>              Sets the authority year matching results minimum score threshold (0.0, 1.0]
 -mayw <arg>              Sets the authority year matching weight (0.0, n]
 -mc <arg>                Sets the maximum number of matching candidates for each entry [1, n]
 -mftm                    Enables the FuzzyTaxamatch matching
 -mftmt <arg>             Sets the FuzzyTaxamatch matching results minimum score threshold (0.0, 1.0]
 -mftmw <arg>             Sets the FuzzyTaxamatch matching weight (0.0, n]
 -mgn                     Enables the genus name matching
 -mgnt <arg>              Sets the genus name matching results minimum score threshold (0.0, 1.0]
 -mgnw <arg>              Sets the genus name matching weight (0.0, n]
 -mNgn                    Enables the normalized genus name matching
 -mNgnt <arg>             Sets the normalized genus name matching results minimum score threshold (0.0, 1.0]
 -mNgnw <arg>             Sets the normalized genus name matching weight (0.0, n]
 -mNsn                    Enables the normalized species name matching
 -mNsnt <arg>             Sets the normalized species name matching results minimum score threshold (0.0, 1.0]
 -mNsnw <arg>             Sets the normalized species name matching weight (0.0, n]
 -mSn                     Enables the scientific name matching
 -msn                     Enables the species name matching
 -msnt <arg>              Sets the species name matching results minimum score threshold (0.0, 1.0]
 -mSnt <arg>              Sets the scientific name matching results minimum score threshold (0.0, 1.0]
 -msnw <arg>              Sets the species name matching weight (0.0, n]
 -mSnw <arg>              Sets the scientific name matching weight (0.0, n]
 -mst <arg>               Sets the matching results minimum score threshold (0.0, 1.0]
 -mt                      If enabled, target data will be materialized in-memory before actually launching the process [
                          EXPERIMENTAL FEATURE ]
 -mtm                     Enables the Taxamatch matching
 -mtmw <arg>              Sets the Taxamatch matching weight (0.0, n]
 -outFile <arg>           Results will be written to this file. When not set defaults to standard output.
 -ps                      If the -pt option is enabled, each thread will be assigned a fraction of the input source data to
                          process against the target data [ EXPERIMENTAL FEATURE ]
 -pt <arg>                Specifies the number of threads for parallel execution. It can either be an absolute number (e.g. -pt
                          4 - use 4 parallel threads) or a relative number with respect to the number of cores (e.g. -pt 4.5x -
                          use a number of thread that is 4.5 times the number of available cores) [ EXPERIMENTAL FEATURE ]
 -refData <arg>           Specify coordinates for a reference data source. These are in the form: <PROVIDER ID>@<TAXA SOURCE
                          URL>(,<VERNACULAR NAMES SOURCE URL>)
 -report                  Results are emitted in human-readable format
 -verbose                 Enables emitting some (very) verbose messages during the process
 -wait                    Request to wait for users hitting ENTER before starting the process
 -xml                     Results will be emitted in XML format
 -xslTemplate <arg>       Specifies an embedded transformation template for the XML output among { stripped, simple, csv,
                          csvNoHeader }
 -xslTemplateFile <arg>   Apply the given XSL stylesheet to the XML output before emitting the results

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)

-wait

This option requires no argument and - when set - will force the engine to wait for user pressing the ENTER key before actually launching the process.

-verbose

This option requires no argument and - when set - will instruct the engine to produce extremely verbose output during the computation.

Input file command line options

-inFile

Mandatory.

Specifies the path to the input file (in parsed input data format) containing the data to match against the specified (via the -refData option) reference data sets.

-dontSkipHeader

Optional.

This option requires no argument and - when enabled - will tell the engine that the input data file does not contain a header row. This makes sense only when the parsed input data file has been produced with the -noHeader option enabled in the input data parser tool.

Reference data command line options

-refData

Mandatory.

Specifies the coordinates for a reference data source. These are in the form:

<PROVIDER ID>@<TAXA TAF URL>(,<VERNACULAR NAMES TAF URL>)
  • The <PROVIDER ID> part is mandatory: it is a user-specified identifier (e.g. ASFIS, FISHBASE, OBIS) that provides context to the reference data.
  • The <TAXA TAF URL> part is also mandatory, while the <VERNACULAR NAMES TAF URL> part is optional (there's no current matchlet that works on vernacular names for the time being).

This option can be repeated multiple times on the command line, once for every reference data source to use.

Please note: the file:// protocol needs to be used to reference local TAF files.

Placeholders expansion

In the TAF file URLs you can also use placeholders that will be expanded to their corresponding values.

These are:

{providerId}

that will be replaced with the actual <PROVIDER ID> as specified by the reference data option value [ works with any URL protocol ]

{cd}

that will be replaced with the current directory (according to the OS-specific filesystem path format) [ works with 'file://' URLs only ]

-mt

Optional.

This option requires no argument and - when set - will instruct the matching engine to materialize reference data sets (specified via the -refData option) in memory.

In-memory materialization happens just before the actual matching process start and takes a time proportional to the number (and size) of specified reference data sets. It also requires proper Java heap dimensioning via the -Xms and -Xmx command line options, especially for larger data sets. In turn, it will produce relevant increases in the matching engine efficiency.

By default, the matching engine starts with the -mt option not enabled, thus it will stream reference data on request and have an extremely small additional memory footprint (albeit at the expense of efficiency).

Matching execution configuration options

-pt

Parallel Threads [ optional ]

Specifies the number of parallel threads to use during process execution: its value can either be an absolute number of threads (e.g. -pt 4) or a multiple of the number of CPU cores available on the host machine (e.g. -pt 1.5x).

Known parallel execution process models suggest that the maximum number of parallel threads should not be bigger than twice the number of CPU cores. Conversely, a bigger number of parallel threads will produce no actual benefits in efficiency.

By default, the process execution will use a single thread unless the -pt option is set.

-ps

Parallelize Sources [ optional ]

This option requires no value and can be set only in combination with the -pt option.

By default, when the -pt option is enabled, reference data are split in a number of non-overlapping subsets and each is processed by a separate thread against the whole set of input data.

Conversely, when this option is also enabled, it's the input data set (the sources) that gets split in non-overlapping subsets and each of these is in turn processed by a separate thread against the whole set of reference data.

Matching process configuration options

-mst

Minimum Score Threshold [ optional ]

This option sets the minimum overall score that an input data / reference data pair matching must have in order to appear in the output.

It requires a value in the range (0.0, 1.0] and - when not set - defaults to 0.5.

The overall score of an input data / reference data pair matching is the weighted score of all the configured (and triggered) matchlets applied to that same input data / reference data pair.

-mc

Maximum Candidates [ optional ]

Specifies the maximum number of matching candidates (reference data occurrences) that each input data can have in the matching result.

Generally speaking, depending on the minimum overall score threshold (see the -mst option), an input data might match with many a reference data with different overall scores: this option will restrict the number of identified matching candidates to be at most the specified value, retaining the matching candidates that produce the higher overall scores.

It can be set to a non negative integer value, whereas 0 has the special meaning of don't restrict the maximum number of matching candidates (all matching with a score higher than the minimum overall score threshold will be retained in the output).

When not set, defaults to 0 (unrestricted).

-hafm

Optional.

This option requires no value and - when set - will instruct the matching engine to halt an input data comparison process as soon as a valid matching (i.e. a matching with a score higher than or equal to the minimum overall score threshold - see the -mst option) is found.

When enabled, this options can speed up the matching process albeit at the cost of producing sub-optimal results.

Moreover, it will produce at most one matching candidate per each input data and thus can be enabled only when the -mc option is not set or set to a value of 1.

Matchlets configuration options

-law

Scientific name matchlet configuration

-mSn
-mSnw
-mSnt

Genus name matchlet configuration

-mgn
-mgnw
-mgnt

Normalized (stemmed) genus name matchlet configuration

-mNgn
-mNgnw
-mNgnt

Species name matchlet configuration

-msn
-msnw
-msnt

Normalized (stemmed) species name matchlet configuration

-mNsn
-mNsnw
-mNsnt

Author name name matchlet configuration

-man
-manw
-mant

Author year matchlet configuration

-may
-mayw
-mayt

FuzzyTaxamatch matchlet configuration

-mftm
-mftmw
-mftmt

Taxamatch matchlet configuration

-mtm
-mtmw

Output file command line options

-outFile

Output format command line options

-report

-xml

-xslTemplate

-xslTemplateFile

Usage examples

Appendix

Download

You can download the YASMEEN matching engine through one of this URLs: