Alignment API: Command line interface

The implementation offers various command line tools available in the fr.inrialpes.exmo.align.cli package:

Procalign
Runs a matcher on a pair of ontologies
ParserPrinter
Parses and alignment and displays it in various formats.
TransformQuery
Transform a SPARQL query according to an alignment.
EvalAlign
Evaluates and alignment with respect to a reference alignment.
TestGen
Generates tests for evaluating matchers.
GroupAlign
Runs a matcher against several different test cases.
GroupEval
Evaluates several matcher results in several different test cases.
ExtGroupEval
Same as above with extended evaluators
WGroupEval
Same as above with weighted evaluators.
GenPlot
Generates various pliots from matcher resulst (ROC curves or precision/recall graphs).
GroupOutput
Generates other representations of matcher results.

These command line operations usually share switch conventions:

Matching

The implementation offers a stand-alone program (fr.inrialpes.exmo.align.cli.Procalign) which:

Additional options are available:

Running the program is achieved through:

$ java -cp lib/procalign.jar --help usage: java fr.inrialpes.exmo.align.cli.Procalign [options] ontoURI ontoURI Matches the two ontologies identified by <ontoURI> Options: -a,--alignment <FILE> Use initial alignment FILE -D <NAME=VALUE> Use value for given property -d,--debug <LEVEL> debug argument is deprecated, use logging instead See http://alignapi.gforge.inria.fr/logging.html -h,--help Print this page -i,--impl <CLASS> Use the given CLASS for matcher -o,--output <FILE> Send output to FILE -P,--params <FILE> Read parameters from FILE -r,--renderer <CLASS> Use the given CLASS for output -T,--cutmethod <METHOD> Method to use for triming (hard|perc|prop|best|span) -t,--threshold <DOUBLE> Trim the alignment with regard to threshold Alignment API implementation 4.6 (1886:1889M)

Parameters can be passed to all the command line interfaces through the "-Dname=value" scheme. These parameters are either used by the command line utility or transmitted to the called programs, e.g., align(). Parameters can also be passed through an XML file through the "-P filename" option.

Displaying alignments

Another such utility (ParserPrinter) allows to read an alignment, to manipulate it and to output it without processing the align method.

$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.ParserPrinter usage: java fr.inrialpes.exmo.align.cli.ParserPrinter [options] alignfile Parse the given <alignfile> and prints it Options: -D <NAME=VALUE> Use value for given property -d,--debug <LEVEL> debug argument is deprecated, use logging instead See http://alignapi.gforge.inria.fr/logging.html -e,--embedded Read the alignment as embedded in a XML file -h,--help Print this page -i,--inverse Inverse first and second ontology -o,--output <FILE> Send output to FILE -P,--params <FILE> Read parameters from FILE -p,--parser <CLASS> Use the given CLASS for parsing -r,--renderer <CLASS> Use the given CLASS for rendering -T,--cutmethod <METHOD> Method to use for triming (hard|perc|prop|best|span) -t,--threshold <DOUBLE> Trim the alignment with regard to threshold -w,--outputDir <DIR> Split the output in a DIRectory (SPARQL) Alignment API implementation 4.6 (1886:1889M)

The utility may be invoked in the following way:

$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.ParserPrinter file:examples/rdf/newsample.rdf -r fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor

Translating queries

Another such utility (TransformQuery) allows to read a query (either from the command line, from the standard input or from a file) and prints out the same query in which entities of the first ontology in the alignment have been replaced by corresponding entities of the second ontology. Additional namespaces may be defined for simplifying the output.

$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.TransformQuery --help usage: java fr.inrialpes.exmo.align.cli.TransformQuery [options] QUERY Transforms the given QUERY according to an alignment Options: -a,--alignment <URI> use the alignment identified by URI -D <NAME=VALUE> Use value for given property -d,--debug <LEVEL> debug argument is deprecated, use logging instead See http://alignapi.gforge.inria.fr/logging.html -e,--echo Echo the input query -h,--help Print this page -o,--output <FILE> Send output to FILE -P,--params <FILE> Read parameters from FILE -q,--query <FILE> get the query from the corresponding FILE Alignment API implementation 4.6 (1886:1889M)

The utility may be invoked in the following way:

$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.TransformQuery -a file:examples/rdf/newsample.rdf -q examples/rdf/query.sparql -Donto2=http://www.example.org/ontology2#

Batch matching

There is a small utility (GroupAlign) which allows to implement batch matching. It starts with a directory containing a set of subdirectories. Each subdirectory contains an ontology to align (usually called onto.rdf) and there exist an ontology to be aligned againts these (-n argument, e.g., named ./onto.rdf).

$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.GroupAlign --help usage: java fr.inrialpes.exmo.align.cli.GroupAlign [options] Matches pairs of ontologies in subdirectories Options: -a,--alignment <FILE> Use an initial alignment FILE -D <NAME=VALUE> Use value for given property -d,--debug <LEVEL> debug argument is deprecated, use logging instead See http://alignapi.gforge.inria.fr/logging.html -h,--help Print this page -i,--impl <CLASS> Use the given Alignment implementation -n,--name <URI> Use the given URI as common source ontology -o,--output <FILE> Send output to FILE -P,--params <FILE> Read parameters from FILE -r,--renderer <CLASS> Use the given CLASS for rendering -s,--source <FILE> Source ontology FILEname (default onto1.rdf) -t,--target <FILE> Target ontology FILEname (default onto.rdf) -u,--uriprefix <URI> URI prefix of the target -w,--directory <DIR> The DIRectory containing the data to match Alignment API implementation 4.6 (1886:1889M)

Invoking GroupAlign with some implementation (-i argument), some set of parameters (-P argument), the name of the output file (-o argument) and optionally a renderer (-r argument) will output the resulting alignment in each of these directories:

$ java -cp $CWD/../lib/procalign.jar fr.inrialpes.exmo.align.cli@.GroupAlign -o edna -n file://$CWD/101/onto.rdf -i fr.inrialpes.exmo.align.impl.method.EditDistNameAlignment

This will compare each onto.rdf file in each of the subdirectory to the file://$CWD/101/onto.rdf with the EditDistNameAlignment method and output the result in a edna.rdf file in each directory.

The output is ready to be evaluated by GroupEval.

Generating tests

Tools for generating matching tests (TestGen) are described in the test generation page.

Evaluating alignments

Tools for evaluating (EvalAlign) and batch evaluating alignments (GroupEval, ExtGroupEval, WGroupEval) and displaying results (GenPlot, GroupOutput) are described in the evaluation page.


http://alignapi.gforge.inria.fr/builtin.html

$Id$