Alignment API and Server 4.2.${version.update}

fr.inrialpes.exmo.align.impl
Class DistanceAlignment

java.lang.Object
  extended by fr.inrialpes.exmo.align.impl.BasicAlignment
      extended by fr.inrialpes.exmo.align.impl.ObjectAlignment
          extended by fr.inrialpes.exmo.align.impl.DistanceAlignment
All Implemented Interfaces:
Cloneable, Iterable<Cell>, Alignment, AlignmentProcess, Visitable
Direct Known Subclasses:
ClassStructAlignment, JWNLAlignment, NameAndPropertyAlignment, StringDistAlignment, StrucSubsDistAlignment

public abstract class DistanceAlignment
extends ObjectAlignment
implements AlignmentProcess

The mother class for distance or similarity-based alignments. It is abstract because it does not provide an implemented similarity measure Otherwise everything is fine. This class should work with similarity and distances, as soon as, the used similarity structure is defined as such.

Version:
$Id: DistanceAlignment.java 1508 2010-08-30 13:08:20Z euzenat $
Author:
Jérôme Euzenat

Field Summary
(package private)  Similarity sim
           
 
Fields inherited from class fr.inrialpes.exmo.align.impl.ObjectAlignment
init
 
Fields inherited from class fr.inrialpes.exmo.align.impl.BasicAlignment
debug, extensions, hash1, hash2, level, namespaces, onto1, onto2, time, type
 
Constructor Summary
DistanceAlignment()
          Creation
 
Method Summary
 void align(Alignment alignment, Properties params)
          Process matching - create distance data structures, - compute distance or similarity - extract alignment
 void cleanUp()
          Suppresses the distance matrix
 Alignment extract(String type, Properties params)
          Extract the alignment form the Similarity There are theoretically 16 types of extractors composing the characteristics [q]estion mark = ?, one or zero relation [s]tar = *, one, zero or many relations [1] = 1, exactly one relation [p]lus = +, one or many relations for each place of the relation.
 Alignment extractqq(double threshold, Properties params)
          Extract the alignment of a ?? type exact algorithm using the Hungarian method
 Alignment extractqqgreedy(double threshold, Properties params)
          Greedy algorithm: 1) dump the part of the matrix distance above threshold in a sorted set 2) traverse the sorted set and each time a correspondence involving two entities that have no correspondence is encountered, add it to the alignment.
 Alignment extractqs(double threshold, Properties params)
          Extract the alignment of a ?* type Complexity: O(n^2)
 Similarity getSimilarity()
           
 void printDistanceMatrix(Properties params)
          Prints the distance matrix
 void setSimilarity(Similarity s)
           
 
Methods inherited from class fr.inrialpes.exmo.align.impl.ObjectAlignment
createCell, createNewAlignment, getOntology1URI, getOntology2URI, init, loadInit, loadOntology, ontology1, ontology2, toObjectAlignment, toURIAlignment, toURIAlignment
 
Methods inherited from class fr.inrialpes.exmo.align.impl.BasicAlignment
accept, addAlignCell, addAlignCell, addAlignCell, addAlignCell, addCell, avgConfidence, clone, compose, convertExtension, cut, cut, cut2, diff, dump, getAlignCell1, getAlignCell2, getAlignCells1, getAlignCells2, getAlignedObject1, getAlignedObject2, getAlignedRelation1, getAlignedRelation2, getAlignedStrength1, getAlignedStrength2, getArrayElements, getElements, getExtension, getExtensions, getFile1, getFile2, getLevel, getOntology1, getOntology2, getOntologyObject1, getOntologyObject2, getParameters, getType, getXNamespace, getXNamespaces, harden, ingest, init, inverse, iterator, join, maxConfidence, meet, minConfidence, nbCells, remCell, removeAlignCell, render, setExtension, setExtensions, setFile1, setFile2, setLevel, setOntology1, setOntology2, setType, setXNamespace, varianceConfidence
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.semanticweb.owl.align.Alignment
addAlignCell, addAlignCell, clone, compose, cut, cut, diff, dump, getAlignCell1, getAlignCell2, getAlignCells1, getAlignCells2, getAlignedObject1, getAlignedObject2, getAlignedRelation1, getAlignedRelation2, getAlignedStrength1, getAlignedStrength2, getElements, getExtension, getExtensions, getFile1, getFile2, getLevel, getOntology1, getOntology1URI, getOntology2, getOntology2URI, getType, harden, init, init, inverse, iterator, join, meet, nbCells, remCell, render, setExtension, setFile1, setFile2, setLevel, setOntology1, setOntology2, setType
 
Methods inherited from interface org.semanticweb.owl.align.Visitable
accept
 

Field Detail

sim

Similarity sim
Constructor Detail

DistanceAlignment

public DistanceAlignment()
Creation

Method Detail

setSimilarity

public void setSimilarity(Similarity s)

getSimilarity

public Similarity getSimilarity()

align

public void align(Alignment alignment,
                  Properties params)
           throws AlignmentException
Process matching - create distance data structures, - compute distance or similarity - extract alignment

Specified by:
align in interface AlignmentProcess
Throws:
AlignmentException

printDistanceMatrix

public void printDistanceMatrix(Properties params)
Prints the distance matrix


cleanUp

public void cleanUp()
Suppresses the distance matrix

Overrides:
cleanUp in class BasicAlignment

extract

public Alignment extract(String type,
                         Properties params)
                  throws AlignmentException
Extract the alignment form the Similarity There are theoretically 16 types of extractors composing the characteristics [q]estion mark = ?, one or zero relation [s]tar = *, one, zero or many relations [1] = 1, exactly one relation [p]lus = +, one or many relations for each place of the relation. Howerver, since it is not possible from a matrics to guarantee that one object will be in at least one relation, this is restricted to the four following types: ?? (covering 11, 1? and ?1) ** (covering ++, *+ and +*) ?* (covering 1*, 1+ and ?+) *? (covering +?, *1 and +1)

Throws:
AlignmentException

extractqs

public Alignment extractqs(double threshold,
                           Properties params)
Extract the alignment of a ?* type Complexity: O(n^2)


extractqq

public Alignment extractqq(double threshold,
                           Properties params)
Extract the alignment of a ?? type exact algorithm using the Hungarian method


extractqqgreedy

public Alignment extractqqgreedy(double threshold,
                                 Properties params)
Greedy algorithm: 1) dump the part of the matrix distance above threshold in a sorted set 2) traverse the sorted set and each time a correspondence involving two entities that have no correspondence is encountered, add it to the alignment. Complexity: O(n^2.logn) Pitfall: no global optimality is warranted, nor stable marriage for instance if there is the following matrix: (a,a')=1., (a,b')=.9, (b,a')=.9, (b,b')=.1 This algorithm will select the first and last correspondances of overall similarity 1.1, while the optimum is the second solution with overall of 1.8.


Alignment API and Server 4.2.${version.update}

(C) INRIA & friends, 2003-${curryear}