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 last release zipfile from the site http://gforge.inria.fr/frs/?group_id=117. It contains all the sources, compiled library, OWL API library.

Anonymous Subversion

The very last version of ontoalign can be fetched from the subversion source tree that can be found at: http://gforge.inria.fr/scm/?group_id=117

From there you have two options:

Getting the last nightly build
This will provide you with the source but no opportunity to smoothly upgrade it.
Checking out (anonymously) the repository
Can be achieved by just doing the following:

$ svn checkout svn://scm.gforge.inria.fr/svn/alignapi/trunk/ 
... and you are done.
Note that you may have to fetch separately the OWL-API.

Subversion account

If you have improved ontoalign and want this to be included in the source base or if you want to seriously work on improving the software, please contact Jerome . Euzenat (À) inrialpes . fr.

We can either commit your ponctual changes or give you commit rights to the repository (for that purpose, you will have to first register by http://gforge.inria.fr.

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


$ svn checkout svn+ssh://username@scm.gforge.inria.fr/svn/alignapi/trunk
(If you are not familliar with subversion, it is worth looking at the documentation. If you are familiar with CVS, the move is straightforward.)

Release notes

They are provided here.

Documentation

The documentation can be found on http://gforge.inria.fr/docman/?group_id=117.

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 included in the SVN repository). 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 SVN 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 in the documentation section. 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://alignapi.gforge.inria.fr/align.html

$Id: align.html 223 2006-02-22 12:18:23Z euzenat $