de.unima.alcomox.mapping
Class Correspondence

java.lang.Object
  extended by de.unima.alcomox.mapping.Correspondence
All Implemented Interfaces:
java.lang.Comparable<Correspondence>

public class Correspondence
extends java.lang.Object
implements java.lang.Comparable<Correspondence>

A correspondence represents a (simple) semantic relation between two entities belonging to different ontologies. The enties are first only referred to by their uris (unbound correspondence), when the container mapping is bound to the ontologies the entities attributed are set to the internal entity representation.


Constructor Summary
Correspondence(java.lang.String sourceEntityUri, java.lang.String targetEntityUri, SemanticRelation relation)
          Constructs an unbound correspondence with confidence value set to 1.0.
Correspondence(java.lang.String sourceConcept, java.lang.String targetConcept, SemanticRelation relation, double confidence)
          Constructs an unbound correspondence with confidence value set to 1.0.
 
Method Summary
 int compareTo(Correspondence correspondence)
           
 boolean equals(java.lang.Object thatObject)
           
 double getConfidence()
           
 int getId()
           
 SemanticRelation getRelation()
           
 Entity getSourceEntity()
           
 java.lang.String getSourceEntityId()
           
 java.lang.String getSourceEntityUri()
           
 java.lang.String getSourceNamespace()
           
 Entity getTargetEntity()
           
 java.lang.String getTargetEntityId()
           
 java.lang.String getTargetEntityUri()
           
 java.lang.String getTargetNamespace()
           
 int hashCode()
           
 void invert()
           
protected  void invertRelation()
           
 boolean isEquivOrSub()
           
 boolean isEquivOrSuper()
           
 void setConfidence(double confidence)
           
 void setRelation(SemanticRelation relation)
           
 void setSourceEntity(Entity entity)
           
 void setSourceEntityUri(java.lang.String sourceEntity)
           
 void setSourceNamespace(java.lang.String namespace)
           
 void setTargetEntity(Entity entity)
           
 void setTargetEntityUri(java.lang.String targetEntity)
           
 void setTargetNamespace(java.lang.String namespace)
           
 void setTopConfidence()
          Sets the confidence value to 1.0 without need to catch a Exception.
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Correspondence

public Correspondence(java.lang.String sourceEntityUri,
                      java.lang.String targetEntityUri,
                      SemanticRelation relation)
               throws CorrespondenceException
Constructs an unbound correspondence with confidence value set to 1.0.

Parameters:
sourceEntityUri - Uri of the source entity.
targetEntityUri - Uri of the target entity.
relation - Semantic relation between two entities.
Throws:
CorrespondenceException - Thrown if the uris are not wellformed (in a weak sense). Checking wether the uri reference can be resolved does not occur in this context.

Correspondence

public Correspondence(java.lang.String sourceConcept,
                      java.lang.String targetConcept,
                      SemanticRelation relation,
                      double confidence)
               throws CorrespondenceException
Constructs an unbound correspondence with confidence value set to 1.0.

Parameters:
sourceEntityUri - Uri of the source entity.
targetEntityUri - Uri of the target entity.
relation - Semantic relation between two entities.
confidence - Confidence value of this correspondence.
Throws:
CorrespondenceException - Thrown if the uris are not wellformed (in a weak sense) and if the confidence value is not in the range from 0.0 to 1.0. Checking wether the uri reference can be resolved does not occur in this context.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
String representation of this correspondence.

toShortString

public java.lang.String toShortString()
Returns:
Short string representation of this correspondence.

getId

public int getId()

equals

public boolean equals(java.lang.Object thatObject)
Overrides:
equals in class java.lang.Object
Returns:
True if uri of source entity, uri of target entity and semantic relation are the same, false otherwise. Equality is not affected by the confidence value. This means that two correspondences can be equal if they make thze same statement with different trust in the statement. Input mappings that contain such correspondences are regarded as incorrect.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(Correspondence correspondence)
Specified by:
compareTo in interface java.lang.Comparable<Correspondence>

getSourceEntityUri

public java.lang.String getSourceEntityUri()

getTargetEntityUri

public java.lang.String getTargetEntityUri()

getRelation

public SemanticRelation getRelation()

getConfidence

public double getConfidence()

getSourceEntity

public Entity getSourceEntity()

getTargetEntity

public Entity getTargetEntity()

getSourceNamespace

public java.lang.String getSourceNamespace()

getTargetNamespace

public java.lang.String getTargetNamespace()

isEquivOrSuper

public boolean isEquivOrSuper()

isEquivOrSub

public boolean isEquivOrSub()

setSourceEntityUri

public void setSourceEntityUri(java.lang.String sourceEntity)
                        throws CorrespondenceException
Throws:
CorrespondenceException

setTargetEntityUri

public void setTargetEntityUri(java.lang.String targetEntity)
                        throws CorrespondenceException
Throws:
CorrespondenceException

setConfidence

public void setConfidence(double confidence)

setTopConfidence

public void setTopConfidence()
Sets the confidence value to 1.0 without need to catch a Exception.


setRelation

public void setRelation(SemanticRelation relation)

setSourceEntity

public void setSourceEntity(Entity entity)

setTargetEntity

public void setTargetEntity(Entity entity)

getSourceEntityId

public java.lang.String getSourceEntityId()

getTargetEntityId

public java.lang.String getTargetEntityId()

setSourceNamespace

public void setSourceNamespace(java.lang.String namespace)

setTargetNamespace

public void setTargetNamespace(java.lang.String namespace)

invert

public void invert()

invertRelation

protected void invertRelation()