|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.unima.alcomox.mapping.Mapping
public class Mapping
A mapping is a ordered list of correspondences. It provided several set operations on the correspondences. As well as ordering and several operations like normalization and thresholding.
Field Summary | |
---|---|
static int |
FORMAT_RDF
Standard format of the OAEI. |
static int |
FORMAT_TXT
Simple text-based proprietary format. |
protected boolean[] |
idPattern
|
protected org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
Mapping()
Constructs a mapping with an empty list of correspondences. |
|
Mapping(java.util.ArrayList<Correspondence> correspondences)
Constructs a mapping with the given list of correspondences. |
|
Mapping(java.util.Set<Correspondence> correspondencesAsSet)
Constructs a mapping with the given set of correspondences. |
|
Mapping(java.lang.String filepath)
Constructs a mapping from a mapping given in a file, that has to be formated in the alignment API format. |
|
Mapping(java.lang.String filepath,
int format)
Constructs a mapping from a mapping given in a file. |
Method Summary | |
---|---|
void |
activateFastIdentification()
Activates fast idpattern used for hast identification is e.g. hashsets. |
void |
adjustConceptConfidence(double factor)
|
void |
adjustPropertyConfidence(double factor)
|
int |
applyThreshhold(double threshhold)
Applies a threshold on the mapping by removing every correspondence with a confidence below the threhold. |
void |
applyThresholdRelative(double rt)
Applies a threshold such that the fraction of the rt worst correspondences are removed. |
Mapping |
bind(LocalOntology sourceOntology,
LocalOntology targetOntology)
Binds the mapping (more precise: the uris of the correspondences) to the internal representation of the entities. |
int |
compareTo(Mapping that)
|
boolean |
contains(Correspondence c1)
Checks if a given correspondence is contained in this mapping. |
int |
convertToEquivalenceCorrespondences()
Converts all correspondences from the mapping that express a different semantic relation than equivalence to equivalence. |
boolean |
equals(java.lang.Object object)
|
void |
filterBySourceNamespace(java.lang.String sourceNamespace)
Filters out every correspondence in this mapping that has not the specified source namespace. |
void |
filterByTargetNamespace(java.lang.String targetNamespace)
Filters out every correspondence in this mapping that has not the specified target namespace. |
Correspondence |
get(int index)
|
double |
getConfidenceLowerBound()
|
double |
getConfidenceTotal()
|
double |
getConfidenceUpperBound()
|
java.util.Set<ConflictPair> |
getConflictPairs()
|
Mapping |
getCopy()
Creates and returns a copy of this mapping. |
java.util.ArrayList<Correspondence> |
getCorrespondences()
Returns the correspondences of this mapping as list. |
java.util.HashSet<Correspondence> |
getCorrespondencesAsSet()
Returns the correspondences of this mapping as set. |
Mapping |
getDifference(Mapping that)
Returns the set difference between this mapping and that mapping. |
boolean[] |
getIdPattern()
|
Mapping |
getIntersection(Mapping that)
Returns the intersection between this mapping and that. |
static Mapping |
getJoinedMapping(Mapping[] mappings)
Joins the specified mappings into a single mapping that contains all correspondences of the specified mappings. |
static Mapping |
getJoinedMapping(Mapping[] mappings,
double[] weights)
|
java.lang.String |
getMetaDescription()
Returns different kinds of meta information about this mapping. |
Mapping |
getUnion(Mapping that)
Returns the union of this mapping and that. |
int |
hashCode()
|
void |
invert()
Inverts this mapping. |
boolean |
isUnique()
|
java.util.Iterator<Correspondence> |
iterator()
|
void |
joinToEquivalence()
Joins all pairs like a < b and a > b into equivalence correspondences a = b in place. |
void |
modifyToEquivalenceCorrespondences()
|
void |
normalize()
Normalizes the confidences of the correspondences to the range [0.0, 1.0]. |
void |
normalize(double normConfidence)
Sets all correspondences in this mapping to the same value. |
void |
normalize(double minBound,
double maxBound)
Normalizes the confidences of the correspondences to a given range. |
Correspondence |
pop()
Removes the last correspondence from this mapping. |
void |
push(Correspondence correspondence)
Adds a correspondence at the end of a mapping. |
void |
push(Mapping mapping)
Adds each correspondence of another mapping at the end of this mapping. |
int |
reduceToEquivalenceCorrespondences()
Remove all correspondences from the mapping that express a different semantic relation than equivalence. |
Correspondence |
remove(int index)
Removes a correspondence at a specified index. |
void |
replaceSourceNamespace(java.lang.String namespace)
|
void |
replaceSubstring(java.lang.String regExp,
java.lang.String newString)
Helper method for easy working with different version of alignments that encoded version numbers in uris (like for each year of the benchmark track). |
void |
replaceTargetNamespace(java.lang.String namespace)
|
void |
setConflictPairs(java.util.Set<ConflictPair> cps)
|
void |
setCorrespondences(java.util.AbstractList<Correspondence> correspondences)
Sets a list of correspondences as correspondences of the mapping. |
void |
setCorrespondences(java.util.Set<Correspondence> correspondencesAsSet)
Sets a set of correspondences as correspondences of the mapping. |
void |
shrinkTill(Correspondence c)
Removes every correspondence from the first one till the specified correspondence inclusive. |
int |
size()
Returns the size of the mapping. |
void |
sortDescending()
|
void |
splitToSubsumptionCorrespondences()
Splits all equivalence correspondences in this mapping into subsumption correspondences in both directions. |
Mapping |
subMapping(int indexInclusive)
Returns a submapping of this mapping from index 0 to indexInclusive. |
java.lang.String |
toShortString()
|
java.lang.String |
toString()
|
java.lang.String |
toVeryShortString()
|
void |
write(java.lang.String filepath)
Writes a mapping in RDF format to a specified path. |
void |
write(java.lang.String filepath,
int format)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FORMAT_TXT
public static final int FORMAT_RDF
protected org.apache.log4j.Logger log
protected boolean[] idPattern
Constructor Detail |
---|
public Mapping()
public Mapping(java.lang.String filepath, int format) throws MappingException
filepath
- The path to the file.format
- The format of the mapping file.
MappingException
- Thrown if the file is not available or caontains invalid format.public Mapping(java.lang.String filepath) throws MappingException
filepath
- The path to the file.
MappingException
- Thrown if the file is not available or caontains invalid format.public Mapping(java.util.ArrayList<Correspondence> correspondences)
correspondences
- The correspondences of the mapping as list.public Mapping(java.util.Set<Correspondence> correspondencesAsSet)
correspondences
- The correspondences of the mapping as set.Method Detail |
---|
public void write(java.lang.String filepath, int format) throws MappingException
MappingException
public void write(java.lang.String filepath) throws MappingException
filepath
-
MappingException
public void activateFastIdentification()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString()
public java.lang.String toVeryShortString()
public java.lang.String getMetaDescription()
public double getConfidenceLowerBound()
public double getConfidenceUpperBound()
public boolean isUnique()
public Mapping getDifference(Mapping that)
that
- The mapping to be compared to this mapping.
public Mapping getIntersection(Mapping that)
that
- The mapping to be intersected to this mapping.
public Mapping getUnion(Mapping that)
that
- The mapping to be unioned with this mapping.
public Mapping getCopy()
public int applyThreshhold(double threshhold)
threshhold
- The threshold.
public void normalize(double normConfidence) throws AlcomoException
normConfidence
- The new confidence value for all correspondences in this mapping.
AlcomoException
- Thrown if the chosen confidence value is not in the range [0,1].public void normalize()
minBound
- The lower bound (inclusive) of the range.maxBound
- The upper bound (inclusive) of the range.public void normalize(double minBound, double maxBound)
minBound
- The lower bound (inclusive) of the range.maxBound
- The upper bound (inclusive) of the range.public void invert()
public void setCorrespondences(java.util.AbstractList<Correspondence> correspondences)
public void setCorrespondences(java.util.Set<Correspondence> correspondencesAsSet)
public java.util.ArrayList<Correspondence> getCorrespondences()
public java.util.HashSet<Correspondence> getCorrespondencesAsSet()
public int size()
public Mapping bind(LocalOntology sourceOntology, LocalOntology targetOntology) throws MappingException, CorrespondenceException
sourceOntology
- Source ontology.targetOntology
- Target ontology.
MappingException
- Thrown if a correspondences relates entities of different types that
cannot be matched for principle reasons.
CorrespondenceException
- Thrown in case of an adjustment of confidences that is not possible.public Correspondence get(int index)
public void push(Correspondence correspondence)
correspondence
- The correspondence to be added.public void push(Mapping mapping)
mapping
- The mapping to be added.public Correspondence pop()
public Correspondence remove(int index)
index
- The index of the correspondence.
public final boolean[] getIdPattern()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Iterator<Correspondence> iterator()
iterator
in interface java.lang.Iterable<Correspondence>
public void sortDescending()
public void shrinkTill(Correspondence c)
public Mapping subMapping(int indexInclusive)
indexInclusive
- The index of the last correspondence to be part of the sub mapping
public int reduceToEquivalenceCorrespondences()
public void modifyToEquivalenceCorrespondences()
public static Mapping getJoinedMapping(Mapping[] mappings) throws PCFException, CorrespondenceException
mappings
- The mappings to be joined.
PCFException
CorrespondenceException
public static Mapping getJoinedMapping(Mapping[] mappings, double[] weights) throws PCFException, CorrespondenceException
PCFException
CorrespondenceException
public void adjustPropertyConfidence(double factor)
public void adjustConceptConfidence(double factor)
public double getConfidenceTotal()
public int compareTo(Mapping that)
compareTo
in interface java.lang.Comparable<Mapping>
public void filterBySourceNamespace(java.lang.String sourceNamespace)
sourceNamespace
- The namespace to be used as filter.public void filterByTargetNamespace(java.lang.String targetNamespace)
targetNamespace
- The namespace to be used as filter.public void setConflictPairs(java.util.Set<ConflictPair> cps)
public java.util.Set<ConflictPair> getConflictPairs()
public void replaceSubstring(java.lang.String regExp, java.lang.String newString) throws CorrespondenceException
regExp
- newString
-
CorrespondenceException
public void replaceSourceNamespace(java.lang.String namespace)
public void replaceTargetNamespace(java.lang.String namespace)
public void applyThresholdRelative(double rt)
rt
- The relative threshold (between 0 and 1.0).public int convertToEquivalenceCorrespondences()
public void splitToSubsumptionCorrespondences() throws CorrespondenceException
CorrespondenceException
- Cannot occur within this method.public boolean contains(Correspondence c1)
c1
- The correspondence for which it is checked containment
public void joinToEquivalence()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |