Alignment API and Server 3.6

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
Direct Known Subclasses:
ClassStructAlignment, EditDistNameAlignment, JWNLAlignment, NameAndPropertyAlignment, StringDistAlignment, StrucSubsDistAlignment

public class DistanceAlignment
extends ObjectAlignment
implements AlignmentProcess

Version:
$Id: DistanceAlignment.java 903 2009-01-11 12:50:58Z 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 addAlignDistanceCell(Object ob1, Object ob2, String relation, double measure)
           
 void align(Alignment alignment, Parameters params)
          Process matching - create distance data structures, - compute distance or similarity - extract alignment
 void cleanUp()
          Suppresses the distance matrix
 Alignment extract(String type, Parameters 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, Parameters params)
          Extract the alignment of a ?? type exact algorithm using the Hungarian method
 Alignment extractqqgreedy(double threshold, Parameters 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, Parameters params)
          Extract the alignment of a ?* type Complexity: O(n^2)
 double getAlignedDistance1(Object ob)
           
 double getAlignedDistance2(Object ob)
           
static Parameters getParameters()
           
 Similarity getSimilarity()
           
 void printDistanceMatrix(Parameters 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
 
Methods inherited from class fr.inrialpes.exmo.align.impl.BasicAlignment
accept, addAlignCell, addAlignCell, addAlignCell, addAlignCell, addCell, clone, compose, 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, getType, getXNamespace, getXNamespaces, harden, ingest, init, inverse, iterator, join, meet, nbCells, removeAlignCell, render, setExtension, setFile1, setFile2, setLevel, setOntology1, setOntology2, setType, setXNamespace
 
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
accept, 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, render, setExtension, setFile1, setFile2, setLevel, setOntology1, setOntology2, setType
 

Field Detail

sim

Similarity sim
Constructor Detail

DistanceAlignment

public DistanceAlignment()
Creation

Method Detail

setSimilarity

public void setSimilarity(Similarity s)

getSimilarity

public Similarity getSimilarity()

addAlignDistanceCell

public void addAlignDistanceCell(Object ob1,
                                 Object ob2,
                                 String relation,
                                 double measure)
                          throws AlignmentException
Throws:
AlignmentException

getAlignedDistance1

public double getAlignedDistance1(Object ob)
                           throws AlignmentException
Throws:
AlignmentException

getAlignedDistance2

public double getAlignedDistance2(Object ob)
                           throws AlignmentException
Throws:
AlignmentException

align

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

Specified by:
align in interface AlignmentProcess
Throws:
AlignmentException

getParameters

public static Parameters getParameters()

printDistanceMatrix

public void printDistanceMatrix(Parameters params)
Prints the distance matrix


cleanUp

public void cleanUp()
Suppresses the distance matrix

Overrides:
cleanUp in class BasicAlignment

extract

public Alignment extract(String type,
                         Parameters 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,
                           Parameters params)
Extract the alignment of a ?* type Complexity: O(n^2)


extractqq

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


extractqqgreedy

public Alignment extractqqgreedy(double threshold,
                                 Parameters 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 3.6

(C) INRIA & friends, 2003-2008