# A format for ontology alignment

The Alignment API use a general Alignment format. Its goal is to be able to express an alignment in a consensual format. It can then be manipulated by various tools which will use it as imput for further alignment methods, transform it into axioms or transformations or compare different alignments.

This is a first format that could be extended for accomodating further needs. The Alignment API offers the Expressive and Declarative Ontology Alignment Language (EDOAL) for more elaborate uses.

We describe below its source descriptions, its specifications and some implementations.

## Specifications

There are two specifications of the format:

OWL Ontology
  An OWL description of the format which can then be described in RDF. This is the reference description of the format.
DTD
  A DTD for expressing the same format in RDF/XML. It is useful for tools which wants to have a more fixed format than RDF.

The namespace used by these formats is `http://knowledgeweb.semanticweb.org/heterogeneity/alignment#`.

## Format description

### `Alignment` class

The `Alignment` class describes a partlicular alignment. Its properties are the following:

xml
  (value: "yes"/"no") indicates if the alignment can be read as an XML file compliant with the DTD;
level
  (values: "0", "1", "2EDOAL") the level of alignment
type
  (values: "11"/"1?"/"1+"/"1*"/"?1"/"??"/"?+"/"?*"/"+1"/"+?"/"++"/"+*"/"*1"/"*?"/"?+"/"**") the type of alignment;
onto1
  (value: Ontology) the first ontology to be aligned;
onto2
  (value: Ontology) the second ontology to be aligned;
map
  (value: Cell*) the set of correspondance between entities of the ontologies.

### `Cell` class

entity1
  (value: URI) the URI of some entity of the first ontology;
entity2
  (value: URI) the URI of some entity of the second ontology;
measure
  (value: float between 0. and 1.) the confidence in the assertion that the relation holds between the first and the second entity (the value is given as a distance between entities: the higher the smallest the value, the higher the confidence);
relation
  (value: String, see below) the relation holding between the first and second entity.

### `Relation` class

This class does not currently exists in the format (it exists in its implementation). Currently, the relation is expressed as a string. It can be a Java classname. If this class is available under the Java environment, then the relation will be an instance of this class.

## Extensions

The format as implemented here supports extensions both on Alignments and on Cells. I.e., if additional string-valued qualified attributes are added to the objects, they will be preserved through the implementation.

Moreover, many standard extensions have already been defined and are documented.

## JAVA implementation

The Alignment API implements this format. In particular it provides tools for:

- Outputing the RDF/XML format from the API;
- Parsing the RDF/XML format into the API;
- Processing alignment methods on ontologies and generating the alignment Cells.

There is a small stand-alone program that parses an alignment and displays it ($CWD is the directory where you are):

    $ java -jar lib/procalign file://$CWD/rdf/onto1.owl file://$CWD/rdf/onto2.owl
    <?xml version='1.0' encoding='utf-8' standalone='no'?>
    <rdf:RDF xmlns='http://knowledgeweb.semanticweb.org/heterogeneity/alignment#'
             xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
             xmlns:xsd='http://www.w3.org/2001/XMLSchema#'
             xmlns:align='http://knowledgeweb.semanticweb.org/heterogeneity/alignment#'>
    <Alignment>
      <xml>yes</xml>
      <level>0</level>
      <type>**</type>
      <align:method>fr.inrialpes.exmo.align.impl.method.StringDistAlignment</align:method>
      <align:time>7</align:time>
      <onto1>
        <Ontology rdf:about="http://www.example.org/ontology1">
          <location>file:examples/rdf/onto1.owl</location>
          <formalism>
            <Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/>
          </formalism>
        </Ontology>
      </onto1>
      <onto2>
        <Ontology rdf:about="http://www.example.org/ontology2">
          <location>file:examples/rdf/onto2.owl</location>
          <formalism>
            <Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/>
          </formalism>
        </Ontology>
      </onto2>
      <map>
        <Cell>
          <entity1 rdf:resource='http://www.example.org/ontology1#reviewedarticle'/>
          <entity2 rdf:resource='http://www.example.org/ontology2#journalarticle'/>
          <relation>=</relation>
          <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>0.4666666666666667</measure>
        </Cell>
      </map>
      <map>
        <Cell>
          <entity1 rdf:resource='http://www.example.org/ontology1#journalarticle'/>
          <entity2 rdf:resource='http://www.example.org/ontology2#journalarticle'/>
          <relation>=</relation>
          <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure>
        </Cell>
      </map>
    </Alignment>
    </rdf:RDF>