de.dfleischhacker.uni.thesis.utils.alignment
Class Correspondence

java.lang.Object
  extended by de.dfleischhacker.uni.thesis.utils.alignment.Correspondence

public class Correspondence
extends java.lang.Object

Represents a correspondence made of the following components


Constructor Summary
Correspondence()
          Initializes the correspondence without values.
Correspondence(java.lang.String entity1, java.lang.String entity2, java.lang.String relation)
          Initializes the correspondence using the given values.
Correspondence(java.lang.String entity1, java.lang.String entity2, java.lang.String relation, float measure)
          Initializes the correspondence using the given values
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the given correspondence is equal to this correspondence.
 java.lang.String getEntity1()
           
 java.lang.String getEntity2()
           
 float getMeasure()
           
 java.lang.String getRelation()
           
 int hashCode()
          Returns this correspondence's hashCode.
 void setEntity1(java.lang.String entity1)
          Sets entity1
 void setEntity2(java.lang.String entity2)
          Sets entity2
 void setMeasure(float measure)
          Set measure.
 void setRelation(java.lang.String relation)
          Sets the relation holding between entity 1 and 2
 java.lang.String toString()
          Returns the correspondence's string representation
 org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
          Returns this correspondence's XML representation.
 org.w3c.dom.Element toXML(org.w3c.dom.Document doc, boolean addNamespace)
          Returns this correspondence's XML representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Correspondence

public Correspondence(java.lang.String entity1,
                      java.lang.String entity2,
                      java.lang.String relation,
                      float measure)
Initializes the correspondence using the given values

Parameters:
entity1 - entity from ontology 1
entity2 - entity from ontology 2
relation - relations holding between entity1 and entity2
measure - confidence measure for relation

Correspondence

public Correspondence(java.lang.String entity1,
                      java.lang.String entity2,
                      java.lang.String relation)
Initializes the correspondence using the given values. The confidence measure for this correspondence is set to 1.0

Parameters:
entity1 - entity from ontology 1
entity2 - entity from ontology 2
relation - relations holding between entity1 and entity2

Correspondence

public Correspondence()
Initializes the correspondence without values. This is used by the AlignmentManager while reading an alignment from files.

Method Detail

toString

public java.lang.String toString()
Returns the correspondence's string representation

Overrides:
toString in class java.lang.Object
Returns:
correspondence's string representation

toXML

public org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
                          throws javax.xml.parsers.ParserConfigurationException
Returns this correspondence's XML representation. The given document is used to generate the elements. This is a convenience method which omits the RDF namespace declaration.

Returns:
XML representation
Throws:
javax.xml.parsers.ParserConfigurationException

toXML

public org.w3c.dom.Element toXML(org.w3c.dom.Document doc,
                                 boolean addNamespace)
                          throws javax.xml.parsers.ParserConfigurationException
Returns this correspondence's XML representation. The given document is used to generate the elements. If addNamespace is true the namespace declaration for RDF is added to the root of the generated XML snippet, otherwise this namespace is omitted and should be added at an higher level element (i.e. when the different correspondence snippets are combined to a full XML document).

Parameters:
addNamespace - if true namespace delaration for RDF will be added to the root of the generated XML snippets, otherwise this declaration is omitted
Returns:
XML representation
Throws:
javax.xml.parsers.ParserConfigurationException

hashCode

public int hashCode()
Returns this correspondence's hashCode. The hashcode is determined by creating the string containing entity1 + "--" + relation + "--" + entity2 and returning this string's hashCode. This approachs guarantees that the hashcode requirements are fulfilled for the Correspondence objects.

Overrides:
hashCode in class java.lang.Object
Returns:
hashCode of this correspondence

equals

public boolean equals(java.lang.Object obj)
Returns true if the given correspondence is equal to this correspondence. Two correspondeces are equal if and only if entity1 AND entity2 AND relation are the same values in both correspondeces.

Overrides:
equals in class java.lang.Object
Parameters:
obj - correspondence to compare to
Returns:
true if correspondences are equal, false otherwise

setEntity1

public void setEntity1(java.lang.String entity1)
Sets entity1

Parameters:
entity1 - URI for entity1 as string

setEntity2

public void setEntity2(java.lang.String entity2)
Sets entity2

Parameters:
entity2 - URI for entity 2 as string

setRelation

public void setRelation(java.lang.String relation)
Sets the relation holding between entity 1 and 2

Parameters:
relation - relation holding between entities

setMeasure

public void setMeasure(float measure)
Set measure. This should be in range from 0 to 1.

Parameters:
measure - measure to set

getEntity1

public java.lang.String getEntity1()
Returns:
the entity1

getEntity2

public java.lang.String getEntity2()
Returns:
the entity2

getRelation

public java.lang.String getRelation()
Returns:
the relation

getMeasure

public float getMeasure()
Returns:
the measure