INRIA & friends

fr.inrialpes.exmo.align.impl
Class BasicAlignment

java.lang.Object
  extended byfr.inrialpes.exmo.align.impl.BasicAlignment
All Implemented Interfaces:
Alignment
Direct Known Subclasses:
DistanceAlignment

public class BasicAlignment
extends java.lang.Object
implements Alignment

Represents an OWL ontology alignment. An ontology comprises a number of collections. Each ontology has a number of classes, properties and individuals, along with a number of axioms asserting information about those objects. NOTE(JE): hashtabale are indexed by URI. This is strange, but there might be a reason

Version:
$Id: BasicAlignment.java 227 2006-02-22 14:45:12Z euzenat $
Author:
Jérôme Euzenat, David Loup, Raphaël Troncy

Field Summary
protected  int debug
           
protected  Parameters extensions
           
protected  java.util.Hashtable hash1
           
protected  java.util.Hashtable hash2
           
protected  java.lang.String level
           
protected  OWLOntology onto1
           
protected  OWLOntology onto2
           
private  boolean STRICT_IMPLEMENTATION
           
protected  long time
           
protected  java.lang.String type
           
protected  java.net.URI uri1
          This is the URI of the place from which the ontology has been loaded! This is NOT the Ontology URI which can be obtained by onto1.getLogicalURI();
protected  java.net.URI uri2
           
 
Constructor Summary
BasicAlignment()
           
 
Method Summary
 void accept(AlignmentVisitor visitor)
          Alignment methods
 Cell addAlignCell(java.lang.Object ob1, java.lang.Object ob2)
           
 Cell addAlignCell(java.lang.Object ob1, java.lang.Object ob2, java.lang.String relation, double measure)
          Cell methods
protected  void addCell(Cell c)
           
 Alignment compose(Alignment align)
          The second alignment is composed with the first one meaning that for any pair (o, o', n, r) in O and (o',o", n', r') in O' the resulting alignment will contain: ( o, o", join(n,n'), compose(r, r')) iff compose(r,r') exists.
 void cut(double threshold)
          Default cut implementation For compatibility with API until version 1.1
 void cut(java.lang.String method, double threshold)
          Cut refinement : - getting those cells with strength above n (hard) - getting the n best cells (best) - getting those cells with strength at worse n under the best (span) - getting the n% best cells (perc) - getting those cells with strength at worse n% of the best (prop) Rule: threshold is betweew 1 and 0
 void cut2(double threshold)
          The cut function suppresses from an alignment all the cell over a particulat threshold
 void dump(org.xml.sax.ContentHandler h)
          Housekeeping
 Cell getAlignCell1(java.lang.Object ob)
          Cells are retrieved These primitives are deprecated.
 Cell getAlignCell2(java.lang.Object ob)
           
 java.util.Set getAlignCells1(java.lang.Object ob)
          Cells are retrieved These primitives are deprecated.
 java.util.Set getAlignCells2(java.lang.Object ob)
           
 java.lang.Object getAlignedObject1(java.lang.Object ob)
          Each part of the cell can be queried independently.
 java.lang.Object getAlignedObject2(java.lang.Object ob)
           
 Relation getAlignedRelation1(java.lang.Object ob)
           
 Relation getAlignedRelation2(java.lang.Object ob)
           
 double getAlignedStrength1(java.lang.Object ob)
           
 double getAlignedStrength2(java.lang.Object ob)
           
 java.util.ArrayList getArrayElements()
           
 java.util.Enumeration getElements()
           
 java.lang.String getExtension(java.lang.String label)
           
 Parameters getExtensions()
          Extensions are a way to read and add other information (metadata) to the alignment structure itself.
 java.net.URI getFile1()
           
 java.net.URI getFile2()
           
 java.lang.String getLevel()
           
 java.lang.Object getOntology1()
          Alignment methods *
 java.lang.Object getOntology2()
           
 java.lang.String getType()
           
 void harden(double threshold)
          The harden function acts like threshold but put all weights to 1.
protected  void ingest(Alignment alignment)
          Incorporate the cells of the alignment into its own alignment.
protected  void init(OWLOntology onto1, OWLOntology onto2)
           
 Alignment inverse()
          A new alignment is created such that for any pair (o, o', n, r) in O the resulting alignment will contain: ( o', o, n, inverse(r)) iff compose(r) exists.
 Alignment join(Alignment align)
          The second alignment is join with the first one meaning that for any pair (o, o', n, r) in O and (o, o', n', r) in O' the resulting alignment will contain: ( o, o", join(n,n'), r) any pair which is in only one alignment is discarded.
 Alignment meet(Alignment align)
          The second alignment is meet with the first one meaning that for any pair (o, o', n, r) in O and (o, o', n', r) in O' the resulting alignment will contain: ( o, o', meet(n,n'), r) any pair which is in only one alignment is preserved.
 int nbCells()
           
 void removeAlignCell(Cell c)
           
 void render(AlignmentVisitor renderer)
          This should be rewritten in order to generate the axiom ontology instead of printing it! And then use ontology serialization for getting it printed.
 void setExtension(java.lang.String label, java.lang.String value)
           
 void setFile1(java.net.URI u)
          Alignment type: Currently defined a sa String.
 void setFile2(java.net.URI u)
           
 void setLevel(java.lang.String level)
          Alignment type: Currently defined a sa String.
 void setOntology1(java.lang.Object ontology)
           
 void setOntology2(java.lang.Object ontology)
           
 void setType(java.lang.String type)
          Alignment type: Currently defined a sa String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRICT_IMPLEMENTATION

private boolean STRICT_IMPLEMENTATION

debug

protected int debug

level

protected java.lang.String level

type

protected java.lang.String type

onto1

protected OWLOntology onto1

onto2

protected OWLOntology onto2

hash1

protected java.util.Hashtable hash1

hash2

protected java.util.Hashtable hash2

time

protected long time

extensions

protected Parameters extensions

uri1

protected java.net.URI uri1
This is the URI of the place from which the ontology has been loaded! This is NOT the Ontology URI which can be obtained by onto1.getLogicalURI();


uri2

protected java.net.URI uri2
Constructor Detail

BasicAlignment

public BasicAlignment()
Method Detail

accept

public void accept(AlignmentVisitor visitor)
            throws AlignmentException
Description copied from interface: Alignment
Alignment methods

Specified by:
accept in interface Alignment
Throws:
AlignmentException

init

protected void init(OWLOntology onto1,
                    OWLOntology onto2)

nbCells

public int nbCells()
Specified by:
nbCells in interface Alignment

getOntology1

public java.lang.Object getOntology1()
Alignment methods *

Specified by:
getOntology1 in interface Alignment

getOntology2

public java.lang.Object getOntology2()
Specified by:
getOntology2 in interface Alignment

setOntology1

public void setOntology1(java.lang.Object ontology)
                  throws AlignmentException
Specified by:
setOntology1 in interface Alignment
Throws:
AlignmentException

setOntology2

public void setOntology2(java.lang.Object ontology)
                  throws AlignmentException
Specified by:
setOntology2 in interface Alignment
Throws:
AlignmentException

setType

public void setType(java.lang.String type)
Description copied from interface: Alignment
Alignment type: Currently defined a sa String. This string is supposed to contain two characters: among ?, 1, *, + Can be implemented otherwise

Specified by:
setType in interface Alignment

getType

public java.lang.String getType()
Specified by:
getType in interface Alignment

setLevel

public void setLevel(java.lang.String level)
Description copied from interface: Alignment
Alignment type: Currently defined a sa String. This string is supposed to contain two characters: among ?, 1, *, + Can be implemented otherwise

Specified by:
setLevel in interface Alignment

getLevel

public java.lang.String getLevel()
Specified by:
getLevel in interface Alignment

getFile1

public java.net.URI getFile1()
Specified by:
getFile1 in interface Alignment

setFile1

public void setFile1(java.net.URI u)
Description copied from interface: Alignment
Alignment type: Currently defined a sa String. This string is supposed to contain two characters: among ?, 1, *, + Can be implemented otherwise

Specified by:
setFile1 in interface Alignment

getFile2

public java.net.URI getFile2()
Specified by:
getFile2 in interface Alignment

setFile2

public void setFile2(java.net.URI u)
Specified by:
setFile2 in interface Alignment

getExtensions

public Parameters getExtensions()
Description copied from interface: Alignment
Extensions are a way to read and add other information (metadata) to the alignment structure itself.

Specified by:
getExtensions in interface Alignment

setExtension

public void setExtension(java.lang.String label,
                         java.lang.String value)
Specified by:
setExtension in interface Alignment

getExtension

public java.lang.String getExtension(java.lang.String label)
Specified by:
getExtension in interface Alignment

getElements

public java.util.Enumeration getElements()
Specified by:
getElements in interface Alignment

getArrayElements

public java.util.ArrayList getArrayElements()

addAlignCell

public Cell addAlignCell(java.lang.Object ob1,
                         java.lang.Object ob2,
                         java.lang.String relation,
                         double measure)
                  throws AlignmentException
Cell methods

Specified by:
addAlignCell in interface Alignment
Throws:
AlignmentException

addAlignCell

public Cell addAlignCell(java.lang.Object ob1,
                         java.lang.Object ob2)
                  throws AlignmentException
Specified by:
addAlignCell in interface Alignment
Throws:
AlignmentException

addCell

protected void addCell(Cell c)
                throws AlignmentException
Throws:
AlignmentException

getAlignCells1

public java.util.Set getAlignCells1(java.lang.Object ob)
                             throws AlignmentException
Description copied from interface: Alignment
Cells are retrieved These primitives are deprecated. Use getAlignCells1 and getAlignCells2 instead. Reason: this applies only for 1:1 alignments Some implementations might act cleverly (retrieving the best value). Basic implementations may raise the exception

Specified by:
getAlignCells1 in interface Alignment
Throws:
AlignmentException

getAlignCells2

public java.util.Set getAlignCells2(java.lang.Object ob)
                             throws AlignmentException
Specified by:
getAlignCells2 in interface Alignment
Throws:
AlignmentException

getAlignCell1

public Cell getAlignCell1(java.lang.Object ob)
                   throws AlignmentException
Description copied from interface: Alignment
Cells are retrieved These primitives are deprecated. Use getAlignCells1 and getAlignCells2 instead. Reason: this applies only for 1:1 alignments Some implementations might act cleverly (retrieving the best value). Basic implementations may raise the exception

Specified by:
getAlignCell1 in interface Alignment
Throws:
AlignmentException

getAlignCell2

public Cell getAlignCell2(java.lang.Object ob)
                   throws AlignmentException
Specified by:
getAlignCell2 in interface Alignment
Throws:
AlignmentException

getAlignedObject1

public java.lang.Object getAlignedObject1(java.lang.Object ob)
                                   throws AlignmentException
Description copied from interface: Alignment
Each part of the cell can be queried independently. These primitives are deprecated. Use getAlignCells1 and getAlignCells2 instead. Reason: this applies only for 1:1 alignments Some implementations might act cleverly (retrieving the best value). Basic implementations may raise the exception

Specified by:
getAlignedObject1 in interface Alignment
Throws:
AlignmentException

getAlignedObject2

public java.lang.Object getAlignedObject2(java.lang.Object ob)
                                   throws AlignmentException
Specified by:
getAlignedObject2 in interface Alignment
Throws:
AlignmentException

getAlignedRelation1

public Relation getAlignedRelation1(java.lang.Object ob)
                             throws AlignmentException
Specified by:
getAlignedRelation1 in interface Alignment
Throws:
AlignmentException

getAlignedRelation2

public Relation getAlignedRelation2(java.lang.Object ob)
                             throws AlignmentException
Specified by:
getAlignedRelation2 in interface Alignment
Throws:
AlignmentException

getAlignedStrength1

public double getAlignedStrength1(java.lang.Object ob)
                           throws AlignmentException
Specified by:
getAlignedStrength1 in interface Alignment
Throws:
AlignmentException

getAlignedStrength2

public double getAlignedStrength2(java.lang.Object ob)
                           throws AlignmentException
Specified by:
getAlignedStrength2 in interface Alignment
Throws:
AlignmentException

removeAlignCell

public void removeAlignCell(Cell c)
                     throws AlignmentException
Throws:
AlignmentException

cut2

public void cut2(double threshold)
          throws AlignmentException
The cut function suppresses from an alignment all the cell over a particulat threshold

Throws:
AlignmentException

cut

public void cut(double threshold)
         throws AlignmentException
Default cut implementation For compatibility with API until version 1.1

Specified by:
cut in interface Alignment
Throws:
AlignmentException

cut

public void cut(java.lang.String method,
                double threshold)
         throws AlignmentException
Cut refinement : - getting those cells with strength above n (hard) - getting the n best cells (best) - getting those cells with strength at worse n under the best (span) - getting the n% best cells (perc) - getting those cells with strength at worse n% of the best (prop) Rule: threshold is betweew 1 and 0

Specified by:
cut in interface Alignment
Throws:
AlignmentException

harden

public void harden(double threshold)
            throws AlignmentException
The harden function acts like threshold but put all weights to 1.

Specified by:
harden in interface Alignment
Throws:
AlignmentException

meet

public Alignment meet(Alignment align)
               throws AlignmentException
The second alignment is meet with the first one meaning that for any pair (o, o', n, r) in O and (o, o', n', r) in O' the resulting alignment will contain: ( o, o', meet(n,n'), r) any pair which is in only one alignment is preserved.

Specified by:
meet in interface Alignment
Throws:
AlignmentException

join

public Alignment join(Alignment align)
               throws AlignmentException
The second alignment is join with the first one meaning that for any pair (o, o', n, r) in O and (o, o', n', r) in O' the resulting alignment will contain: ( o, o", join(n,n'), r) any pair which is in only one alignment is discarded.

Specified by:
join in interface Alignment
Throws:
AlignmentException

compose

public Alignment compose(Alignment align)
                  throws AlignmentException
The second alignment is composed with the first one meaning that for any pair (o, o', n, r) in O and (o',o", n', r') in O' the resulting alignment will contain: ( o, o", join(n,n'), compose(r, r')) iff compose(r,r') exists.

Specified by:
compose in interface Alignment
Throws:
AlignmentException

inverse

public Alignment inverse()
                  throws AlignmentException
A new alignment is created such that for any pair (o, o', n, r) in O the resulting alignment will contain: ( o', o, n, inverse(r)) iff compose(r) exists.

Specified by:
inverse in interface Alignment
Throws:
AlignmentException

dump

public void dump(org.xml.sax.ContentHandler h)
Housekeeping

Specified by:
dump in interface Alignment

ingest

protected void ingest(Alignment alignment)
               throws AlignmentException
Incorporate the cells of the alignment into its own alignment. Note: for the moment, this does not copy but really incorporates. So, if hardening or cutting, are applied, then the ingested alignmment will be modified as well.

Throws:
AlignmentException

render

public void render(AlignmentVisitor renderer)
            throws AlignmentException
This should be rewritten in order to generate the axiom ontology instead of printing it! And then use ontology serialization for getting it printed.

Specified by:
render in interface Alignment
Throws:
AlignmentException

INRIA & friends

..no bottom yet...