The alignment API in Java

We develop an alignment toolkit for OWL by:

An extensive presentation of the alignment API can be found here.

Getting ontoalign

Fetching the ZIP'ed version

The simplest way to use ontoalign is to get the following zipfile. It contains all the sources, compiled library, OWL API library.

Anonymous CVS

The very last version of ontoalign can be fetched from the CVS source tree. Just do the following:

$ cvs -d :pserver:cvs@cvs-sop.inria.fr:/CVS/exmosoft login
<ENTER return when asked for the password>
$ cvs -d :pserver:cvs@cvs-sop.inria.fr:/CVS/exmosoft checkout ontoalign
... and you are done. Note that you will have to fetch separately the OWL-API.

CVS account

If you have improved ontoalign and want this to be included in the source tree and want to have a CVS account for that, please contact Jerome . Euzenat (À) inrialpes . fr.

Once provided with a password you will be able to check out from and commit in our repository through:

$ export CVS_RSH=`which ssh`
$ cvs -d :ext:<loginname>@cvs-sop.inria.fr:/CVS/exmosoft checkout ontoalign
(If you are not familliar with SSH, it is useful to spend half an hour to know how to avoid to be asked your password anytime).
If you are not familiar with CVS, its is time to document yourself.

Release notes

They are provided here.

Installation

"Installing" is really straightforward.

Files

Whatever your mode of getting ontolign you will get an ontoalign directory containing the following subdirectories:

Requirements

For using you will need Java runtime environment (tested in 1.4.1) and the OWL-API binary distribution (this is included in the above zip file).
Note that OWL-API needs log4j and getopt packages, but these are included in the binary distribution of the OWL API.

For extending you will need Java compiler (tested in Java standard edition 1.4.1) and the OWL-API binary distribution (this is included in the above zip file).

For developing (compiling) you will need Java compiler (tested in Java standard edition 1.4.1) and the OWL-API binary distribution (which is not included in the CVS repositories). It is also very usefull to have Ant.

Required libraries (jar)

Using the api (align.jar) requires:

Using its implementation (procalign.jar) requires in addition:

Using the Wordnet example requires, in addition:

Assembling

A good way of setting your environment (from the CVS archive) for developing is to unzip the OWL-API binary distribution and put the files in the ontoalign directories:

$ unzip owlapi-bin-03-10-15.zip
$ mv owl/lib/* lib
$ ant jar
$ mv owl/javadoc/* javadoc
$ ant javadoc
$ rm -rf owl

Compilation and use

Generating the lib/procalign.jar file (and the other libraries) can be done by launching:

$ ant jar

Using the API

An extensive presentation of the alignment API can be found here. It documents use and extension of the API.

For demonstrating the use of the API, we implement it and use it through a particular processor (fr.inrialpes.exmo.align.util.Procalign) which:

Running the program is achieved through:
$ java -jar lib/procalign.jar
usage: Procalign [options] URI1 URI2
options are:
        --impl=className -i classname           Use the given alignment implementation.
        --renderer=className -r className       Specifies the alignment renderer
        --output=filename -o filename   Output the alignment in filename
        --alignment=filename -a filename Start from an XML alignment file
        --threshold=double -t double    Filters the similarities under threshold
        --debug[=n] -d [n]              Report debug info at level n
        --help -h                       Print this message
or ($CWD is the current directory)
$ java -jar lib/procalign.jar file://localhost$CWD/rdf/onto1.owl file://localhost$CWD/rdf/onto2.owl 
Additionaly a number of options are available:

License

The alignment API and its implementation is distributed under the GNU Lesser General Public License.

The alignment API

The OWL-API is extended with the (org.semanticweb.owl.align) package. Which describes the Alignment API. This API is, in turns, an "implementation" of the Alignment format.

It is basically made of three interfaces:

Alignment
Represents the alignment of two ontology by a specific method. It contains a specification of the alignment and a list of cells.
Cell
Represents a couple of aligned entities together with their confidence measure and alignement relation.
Relation
Represents the specification of the relation holding between two aligned entities.

More information about the attributes of these classes can be found in the format description.

Addtionnally, there is an AlignmentProcess interface which contains a method for calling a particular alignment method (it is a sub-interface of Alignment) and an AlignmentException.

Implementing and extending the API

A (default) impplementation of this API can be found in the fr.inrialpes.exmo.align.impl package.

Adding new alignments methods amounts to create a new AlignmentProcess class implementing the interface. Generally, this can extend the proposed fr.inrialpes.exmo.align.impl.BasicAlignment class and implement AlignmentProcess.

The BasicAlignment has the good taste of defining the storage sructures for ontologies and alignment specification as well as the methods for dealing with alignment display. The only method it does not implement is alignment itself. All methods can be refined (no one is final).

The NameEqAlignment class extends the BasicAlignment by aligning classes bearing the exact same name for properties and classes).

A more elaborate implementation is the EditDistNameAlignment class which uses an edit distance on class names. It thus have to build a matrix of distance and to choose the alignment from the distance. It can be called by:

$ java -jar lib/procalign.jar file://localhost$CWD/rdf/onto1.owl file://localhost$CWD/rdf/onto2.owl -i fr.inrialpes.exmo.align.impl.method.EditDistNameAlignment
which returns:
<?xml version='1.0' encoding='utf-8' standalone='no'?>
<!DOCTYPE rdf:RDF SYSTEM "align.dtd">

<rdf:RDF xmlns='http://knowledgeweb.semanticweb.org/heterogeneity/alignment'>
<Alignment>
  <xml>yes</xml>
  <level>0</level>
  <type>11</type>
  <onto1>file://localhost$CWD/rdf/onto1.owl</onto1>
  <onto2>file://localhost$CWD/rdf/onto2.owl</onto2>
  <map>
    <Cell>
      <entity1 rdf:resource='http://www.example.org/ontology1#reviewedarticle'/>
      <entity2 rdf:resource='http://www.example.org/ontology2#article'/>
      <measure rdf:datatype='xsd:float'>0.5333333333333333</measure>
      <relation>=</relation>
    </Cell>
    <Cell>
      <entity1 rdf:resource='http://www.example.org/ontology1#journalarticle'/>
      <entity2 rdf:resource='http://www.example.org/ontology2#journalarticle'/>
      <measure rdf:datatype='xsd:float'>0.0</measure>
      <relation>=</relation>
    </Cell>
  </map>
</Alignment>
</rdf:RDF>


http://co4.inrialpes.fr/align/align.html

$Id: align.html,v 1.15 2005/06/21 15:42:25 euzenat Exp $