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

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

public class Alignment
extends java.lang.Object

Represents an alignment.


Method Summary
 void addCorrespondence(Correspondence correspondence)
          Adds a correspondence
 int getCorrespondenceCount()
          Returns the number of correspondences in this alignment
 java.util.Set<Correspondence> getCorrespondences()
          Returns this alignment's correspondences as ArrayList
 java.lang.String getLevel()
          Returns the level of this alignment
 java.lang.String getOntology1()
          Returns the URI of ontology 1
 java.lang.String getOntology2()
          Returns the URI of ontology 2
 java.lang.String getType()
          Returns the type of this alignment
 void setLevel(java.lang.String level)
          Sets the level of this alignment
 void setOntology1(java.lang.String uri)
          Sets the URI for ontology 1.
 void setOntology2(java.lang.String uri)
          Sets the URI for ontology 2.
 void setType(java.lang.String type)
          Sets the type of this alignment
 java.lang.String toString()
          Returns the alignment's string representation.
 org.w3c.dom.Document toXML()
          Returns this alignment's XML representation as DOM document.
 java.lang.String toXMLString()
          Returns the alignment's XML representation as string.
 boolean validate(org.semanticweb.owl.model.OWLOntology onto1, org.semanticweb.owl.model.OWLOntology onto2)
          Validates the aligment against the given ontologies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addCorrespondence

public void addCorrespondence(Correspondence correspondence)
Adds a correspondence

Parameters:
correspondence - correspondence to add

getCorrespondences

public java.util.Set<Correspondence> getCorrespondences()
Returns this alignment's correspondences as ArrayList

Returns:
alignment's correspondences as ArrayList

getCorrespondenceCount

public int getCorrespondenceCount()
Returns the number of correspondences in this alignment

Returns:
number of correspondences in this alignment

toString

public java.lang.String toString()
Returns the alignment's string representation. This method is used mainly for debugging purposes.

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

toXML

public org.w3c.dom.Document toXML()
                           throws javax.xml.parsers.ParserConfigurationException
Returns this alignment's XML representation as DOM document.

Returns:
this alignment's XML representation
Throws:
javax.xml.parsers.ParserConfigurationException

toXMLString

public java.lang.String toXMLString()
                             throws javax.xml.transform.TransformerConfigurationException,
                                    javax.xml.parsers.ParserConfigurationException,
                                    javax.xml.transform.TransformerException
Returns the alignment's XML representation as string. It also adds the needed DTD definition which is only possible during this step and not via the DOM interface

Returns:
string containing XML serialization of alignment
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException

validate

public boolean validate(org.semanticweb.owl.model.OWLOntology onto1,
                        org.semanticweb.owl.model.OWLOntology onto2)
                 throws InvalidAlignmentException
Validates the aligment against the given ontologies. This method uses the passed OWLOntology objects to perform this validation. During the validation there is only checked if each entity mentioned in the alignment is contained in the respective ontology.

Parameters:
onto1 - ontology 1
onto2 - ontology 2
Returns:
true if validation succeeded (it will not return false but throw an InvalidAlignmentException if the validation fails)
Throws:
InvalidAlignmentException

setLevel

public void setLevel(java.lang.String level)
Sets the level of this alignment

Parameters:
level - level to set

setType

public void setType(java.lang.String type)
Sets the type of this alignment

Parameters:
type - type to set

setOntology1

public void setOntology1(java.lang.String uri)
Sets the URI for ontology 1.

Parameters:
uri - URI of ontology 1 as string

setOntology2

public void setOntology2(java.lang.String uri)
Sets the URI for ontology 2.

Parameters:
uri - URI of ontology 2 as string

getOntology1

public java.lang.String getOntology1()
Returns the URI of ontology 1

Returns:
URI of ontology 1

getOntology2

public java.lang.String getOntology2()
Returns the URI of ontology 2

Returns:
URI of ontology 2

getLevel

public java.lang.String getLevel()
Returns the level of this alignment

Returns:
this alignment's level

getType

public java.lang.String getType()
Returns the type of this alignment

Returns:
this alignment's type