|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fzi.kadmos.api.impl.SimpleAlignment
public final class SimpleAlignment
Class representing a simple alignment of two ontologies. The alignment consists of
a set of correspondences.
Only 1:1 correspondences are allowed, i.e. no entity of each ontology can occur in more
than one correspondence. addCorrespondence(de.fzi.kadmos.api.Correspondence extends org.semanticweb.owlapi.model.OWLEntity>) will throw a MultiplicityException
if this constraint would be violated while adding correspondences.
Correspondences are stored in hash data structures for constant time access. Note that correspondences once they are created cannot be changed apart from their confidence value. Changing the confidence value does not change the hashcode of the correspondence and thus the hash data structures still provide valid object references.
When cloning this object, the clone will reference the same ontologies as this object, and correspondences of the clone will reference the same entities as resp. correspondences in this object. That is referenced ontologies and corresponding entites will not be cloned recursively.
| Method Summary | ||
|---|---|---|
void |
addCorrespondence(Correspondence<? extends OWLEntity> corr)
Adds a correspondence to an alignment if possible. |
|
void |
attachListener(AlignmentListener listener)
Registers an AlignmentListener. |
|
void |
clear()
Clears the alignment. |
|
SimpleAlignment |
clone()
Creates a clone of this alignment. |
|
boolean |
contains(Correspondence<? extends OWLEntity> corr)
Checks if this alignment contains a correspondence with the same entities as the provided correspondence. |
|
boolean |
contains(IRI ent1,
IRI ent2)
Checks if a correspondence of two entities specified by their IRIs is part of this alignment. |
|
|
contains(T ent1,
T ent2)
Checks if a correspondence of two specified entities is part of this alignment. |
|
boolean |
containsEntity1(IRI ent)
Checks if this alignment contains a correspondence with a first entity specified by an IRI. |
|
boolean |
containsEntity1(OWLEntity ent)
Checks if this alignment contains a correspondence with a specific first entity. |
|
boolean |
containsEntity2(IRI ent)
Checks if this alignment contains a correspondence with a second entity specified by an IRI. |
|
boolean |
containsEntity2(OWLEntity ent)
Checks if this alignment contains a correspondence with a specific second entity. |
|
void |
detachListener(AlignmentListener listener)
Deregisters an AlignmentListener. |
|
boolean |
equals(Object other)
|
|
Set<Correspondence<? extends OWLEntity>> |
getCorrespondences()
Gets the set of correspondences of this alignment. |
|
Correspondence<? extends OWLEntity> |
getEntity1Corr(IRI ent)
Gets the correspondence with a specific entity as entity 1. |
|
|
getEntity1Corr(T ent)
Gets the correspondence with a specific entity as entity 1. |
|
Correspondence<? extends OWLEntity> |
getEntity2Corr(IRI ent)
Gets the correspondence with a specific entity as entity 2. |
|
|
getEntity2Corr(T ent)
Gets the correspondence with a specific entity as entity 2. |
|
Correspondence<? extends OWLEntity> |
getEntityCorr(IRI ent1,
IRI ent2)
Gets the correspondence with specific entities as entity 1 and entity2. |
|
|
getEntityCorr(T ent1,
T ent2)
Gets the correspondence with specific entities as entity 1 and entity 2. |
|
OWLOntology |
getOntology1()
Gets the first ontology of this alignment. |
|
OWLOntology |
getOntology2()
Gets the second ontology of this alignment. |
|
int |
hashCode()
|
|
boolean |
isEmpty()
Checks, whether this alignment is empty, i.e. |
|
Iterator<Correspondence<? extends OWLEntity>> |
iterator()
|
|
void |
removeCorrespondence(Correspondence<? extends OWLEntity> corr)
Removes a correspondence from this alignment if present. |
|
int |
size()
Gets the size of this alignment. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void addCorrespondence(Correspondence<? extends OWLEntity> corr)
throws MultiplicityException,
IllegalArgumentException,
IncompatibleOntologyException
addCorrespondence in interface Alignmentcorr - The correspondence to be added.
MultiplicityException - if multiplicity of correspondence is violated.
IllegalArgumentException - if the argument is null
IncompatibleOntologyException - if either of the corresponding entities is
not contained in the signature of the according
aligned ontology.public boolean contains(Correspondence<? extends OWLEntity> corr)
contains in interface Alignmentcorr - The correspondence to be checked if it is contained by this alignment.
true if this alignment contains a correspondence with the same
entities as corr, false otherwise.
public <T extends OWLEntity> boolean contains(T ent1,
T ent2)
contains in interface AlignmentT - Type of the entities of correspondence to be checked.ent1 - Entity 1.ent2 - Entity 2.
true if a correspondence of ent1 and ent2
is part of this alignment, false otherwise.
public boolean contains(IRI ent1,
IRI ent2)
contains in interface Alignmentent1 - IRI of entity 1.ent2 - IRI of entity 2.
true if a correspondence of ent1 and ent2
is part of this alignment, false otherwise.public boolean containsEntity1(OWLEntity ent)
containsEntity1 in interface Alignmentent - Entity to be checked if present as entity 1 in a correspondence in this alignment.
true if ent participates as entity 1 of a correspondence in this alignment, false otherwise.public boolean containsEntity2(OWLEntity ent)
containsEntity2 in interface Alignmentent - Entity to be checked if present as entity 2 in a correspondence in this alignment.
true if ent participates as entity 2 of a correspondence in this alignment, false otherwise.public boolean containsEntity1(IRI ent)
containsEntity1 in interface Alignmentent - IRI of entity to be checked if present as entity 1 in a correspondence in this alignment.
true if ent participates as entity 1 of a correspondence in this alignment, false otherwise.public boolean containsEntity2(IRI ent)
containsEntity2 in interface Alignmentent - IRI of entity to be checked if present as entity 2 in a correspondence in this alignment.
true if ent participates as entity 2 of a correspondence in this alignment, false otherwise.public Set<Correspondence<? extends OWLEntity>> getCorrespondences()
getCorrespondences in interface Alignmentpublic <T extends OWLEntity> Correspondence<T> getEntity1Corr(T ent)
null will be returned.
getEntity1Corr in interface AlignmentT - Entity type.ent - Entity 1 of the requested correspondence.
ent as entity 1, or null if no such correspondence exists.public <T extends OWLEntity> Correspondence<T> getEntity2Corr(T ent)
null will be returned.
getEntity2Corr in interface AlignmentT - Entity type.ent - Entity 2 of the requested correspondence.
ent as entity 2, or null if no such correspondence exists.public Correspondence<? extends OWLEntity> getEntity1Corr(IRI ent)
null will be returned.
getEntity1Corr in interface Alignmentent - IRI of entity 1 of the requested correspondence.
ent as entity 1, or null if no such correspondence exists.public Correspondence<? extends OWLEntity> getEntity2Corr(IRI ent)
null will be returned.
getEntity2Corr in interface Alignmentent - IRI of entity 2 of the requested correspondence.
ent as entity 2, or null if no such correspondence exists.
public <T extends OWLEntity> Correspondence<T> getEntityCorr(T ent1,
T ent2)
null will be returned.
getEntityCorr in interface AlignmentT - Entity type.ent1 - Entity 1 of the requested correspondence.ent2 - Entity 2 of the requested correspondence.
ent as entity 1 and ent as entity 2,
or null if no such correspondence exists.
public Correspondence<? extends OWLEntity> getEntityCorr(IRI ent1,
IRI ent2)
null will be returned.
getEntityCorr in interface Alignmentent1 - IRI of entity 1 of the requested correspondence.ent2 - IRI of entity 2 of the requested correspondence.
ent1 as entity 1 and ent2 as entity 2
or null if no such correspondence exists.public OWLOntology getOntology1()
getOntology1 in interface Alignmentpublic OWLOntology getOntology2()
getOntology2 in interface Alignmentpublic void removeCorrespondence(Correspondence<? extends OWLEntity> corr)
removeCorrespondence in interface Alignmentcorr - The correspondence to be removed.public Iterator<Correspondence<? extends OWLEntity>> iterator()
iterator in interface Iterable<Correspondence<? extends OWLEntity>>public void clear()
clear in interface Alignmentpublic int size()
size in interface Alignmentpublic boolean isEmpty()
isEmpty in interface Alignmenttrue iff this alignment contains no correspondences,
false otherwise.public void attachListener(AlignmentListener listener)
AlignmentListener.
The AlignmentListener gets notified
when the alignment changes.
Calling this method with an AlignmentListener
that is already registered is a no-op.
attachListener in interface Alignmentlistener - AlignmentListener to register.public void detachListener(AlignmentListener listener)
AlignmentListener.
The AlignmentListener will be no longer
notified when the alignment changes.
Calling this method with an AlignmentListener
that is not registered is a no-op.
detachListener in interface Alignmentlistener - AlignmentListener to deregister.public SimpleAlignment clone()
clone in interface Alignmentclone in class Objectpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||