public class FastOwlSim extends AbstractOwlSim implements OwlSim
Modifier and Type | Class and Description |
---|---|
class |
FastOwlSim.ClassCount |
OwlSim.ScoreAttributeSetPair, OwlSim.Stat, OwlSim.StatsPerIndividual
Modifier and Type | Field and Description |
---|---|
static Comparator<FastOwlSim.ClassCount> |
ClassCountComparator |
org.semanticweb.owlapi.model.OWLClass |
debugClass |
corpusSize, enrichmentConfig, icIRIString, isDisableLCSCache, isLCSCacheFullyPopulated, isNoLookupForLCSCache, metricStatMaxes, metricStatMeans, metricStatMins, overallStats, overallSummaryStatsPerIndividual, reasoner, simStats, simStatsPerIndividual, subgraphSummaryStatsPerIndividual
Constructor and Description |
---|
FastOwlSim(org.semanticweb.owlapi.model.OWLOntology sourceOntology) |
FastOwlSim(org.semanticweb.owlapi.reasoner.OWLReasoner reasoner) |
Modifier and Type | Method and Description |
---|---|
void |
assignDefaultInformationContentForAllClasses() |
void |
calculateCombinedScores(List<ElementPairScores> scoreSets,
double maxMaxIC,
double maxBMA)
Given a set of scorings between an individual i, and a set of individuals j1 ..jn ∈ J,
calculate the combined score for each i,j pair where j ∈ J
|
void |
calculateMetricStats(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> iset,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> jset) |
protected void |
clearInformationContentCache() |
protected void |
clearLCSCache() |
List<SimResultRenderer.AttributesSimScores> |
compareAllAttributes(org.semanticweb.owlapi.model.OWLClass c,
Set<org.semanticweb.owlapi.model.OWLClass> ds) |
Double[][] |
computeTFIDFMatrix(int[][] subsetMatrix,
int numIndividualsInSubset,
int[][] backgroundMatrix,
int numIndividualsInBackground) |
int[][] |
convertCountMatrixToFrequency(int[][] matrix,
int normalizationFactor) |
void |
createElementAttributeMapFromOntology()
This must be called prior to calculation of any similarity metrics.
|
void |
dispose()
call when owlsim object is no longer required
|
List<ElementPairScores> |
findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts,
String targetIdSpace,
double minSimJPct,
double minMaxIC)
Find all similar matches to a pseudo-individual with a set of attributes
when compared to loaded individuals using
getGroupwiseSimilarity
with minSimJPct and minMaxIC cutoffs. |
List<ElementPairScores> |
findMatchesRefactored(Set<org.semanticweb.owlapi.model.OWLClass> atts,
String targetIdSpace) |
List<ElementPairScores> |
findMatchesRefactored(Set<org.semanticweb.owlapi.model.OWLClass> atts,
String targetIdSpace,
double minSimJPct,
double minMaxIC) |
List<ElementPairScores> |
findMatchesWithin(org.semanticweb.owlapi.model.OWLNamedIndividual i,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargets) |
List<ElementPairScores> |
findMatchesWithin(Set<org.semanticweb.owlapi.model.OWLClass> atts,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargetSet,
double minSimJPct,
double minMaxIC) |
Set<org.semanticweb.owlapi.model.OWLClass> |
getAllAttributeClasses()
returns all attribute classes - i.e.
|
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> |
getAllElements() |
double |
getAsymmetricAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
SimJASym(c,d) = | anc(c) ∩ anc(d) | / | anc(d) |
|
double |
getAsymmetricElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j) |
double |
getAsymmetricElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(j) |
|
int |
getAsymmetricElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
|
double |
getAttributeGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
sums of IC of the intersection attributes/ sum of IC of union attributes.
|
double |
getAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
SimJ(a,b) = | anc(a) ∩ anc(b) | / | anc(a) ∪ anc(b) |
|
int |
getAttributeJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
Equivalent to
OwlSim.getAttributeJaccardSimilarity(OWLClass, OWLClass) * 100 |
Set<org.semanticweb.owlapi.model.OWLClass> |
getAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e)
Gets all attribute classes used to describe individual element e.
|
double |
getAttributeSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d,
SimpleOwlSim.Metric metric)
This method provides a generic wrapper onto other attribute-based similarity
methods
Compares two classes (attributes) according to the specified metric
|
List<FastOwlSim.ClassCount> |
getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c) |
List<FastOwlSim.ClassCount> |
getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c,
Double cutoff,
int numIndividualsInBackground) |
List<FastOwlSim.ClassCount> |
getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c,
int numIndividualsInBackground) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts,
int matchCutoff) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i,
int matchCutoff) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForMatches(List<ElementPairScores> matches,
Set<org.semanticweb.owlapi.model.OWLClass> atts) |
List<FastOwlSim.ClassCount> |
getCoAnnotatedClassesForMatches(List<ElementPairScores> matches,
Set<org.semanticweb.owlapi.model.OWLClass> atts,
int matchCutoff) |
double |
getElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
sums of IC of the intersection attributes/ sum of IC of union attributes.
|
double |
getElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(i) ∪ Type(j) |
|
int |
getElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Equivalent to
OwlSim.getElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual) * 100 |
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> |
getElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
inferred
|
Map<org.semanticweb.owlapi.model.OWLNamedIndividual,Set<org.semanticweb.owlapi.model.OWLClass>> |
getElementToAttributesMap() |
ElementPairScores |
getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i)
Compare a named individual
i to itself. |
ElementPairScores |
getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Compare two named individuals
(i,j) . |
ElementPairScores |
getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
double minSimJPct,
double minMaxIC)
Compare two named individuals
i , filtering on
minSimJ and minMaxIC |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Compare a set of attributes against the named individual
i . |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
double minSimJPct,
double minMaxIC)
Compare a set of attributes against the named individual
i . |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> attsI,
Set<org.semanticweb.owlapi.model.OWLClass> attsJ) |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> attsI,
Set<org.semanticweb.owlapi.model.OWLClass> attsJ,
double minSimJPct,
double minMaxIC) |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getInferredAttributes(org.semanticweb.owlapi.model.OWLNamedIndividual a) |
Double |
getInformationContentForAttribute(org.semanticweb.owlapi.model.OWLClass c)
IC = -(log
OwlSim.getNumElementsForAttribute(OWLClass) / corpus size) / log(2) |
OwlSim.ScoreAttributeSetPair |
getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
Resnick similarity measure, together with all LCSs (MICAs) that
have this as IC
|
OwlSim.ScoreAttributeSetPair |
getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d,
Double thresh) |
OwlSimMetadata |
getMetadata() |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
CS(a,b) = { c : c ∈ RSub(a), c ∈ RSub(b) }
|
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
CS(i,j) = { c : c ∈ Type(i), c ∈ Type(j) }
|
int |
getNamedCommonSubsumersCount(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
| CS(i,j) | = | { c : c ∈ Type(i), c ∈ Type(j) } |
|
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedLowestCommonSubsumers(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d)
CSredundant(a,b) = { c : c ∈ CS(a,b), &E; c' : c' ∈ CS(a,b), c' &in Sub(c) }
LCS(a,b) = CS(a,b) - CSredundant
|
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedReflexiveSubsumers(org.semanticweb.owlapi.model.OWLClass a) |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedUnionSubsumers(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
int |
getNumElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
|{e : e ∈ Inst(c)}|
|
int |
getNumSharedElements(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
int |
getNumSharedElements(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d,
org.semanticweb.owlapi.model.OWLClass e) |
AttributePairScores |
getPairwiseSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
OwlSim.ScoreAttributeSetPair |
getSimilarityBestMatchAverage(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
SimpleOwlSim.Metric metric,
SimpleOwlSim.Direction dir) |
OwlSim.ScoreAttributeSetPair |
getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j) |
OwlSim.ScoreAttributeSetPair |
getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
SimpleOwlSim.Metric metric)
See: Pesquita et al
|
OwlSim.ScoreAttributeSetPair |
getSimilarityMaxIC(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
Find the inferred attribute shared by both i and j that has highest IC.
|
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
getSimStatistics(String stat) |
int[][] |
getSubsetCoannotationMatrix(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> individualSubset) |
int[][] |
initCoannotationMatrix(int[][] coaMatrix) |
void |
loadLCSCache(String fileName)
Loads a pregenerated IC cache.
|
void |
logCountMatrix(int[][] matrix) |
org.semanticweb.owlapi.model.OWLClass |
owlThing()
Convenience method.
|
org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass> |
owlThingNode()
Convenience method.
|
void |
populateFullCoannotationMatrix() |
protected void |
populateSimilarityMatrix(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j,
ElementPairScores ijscores) |
void |
saveLCSCache(String fileName,
Double thresholdIC)
As
OwlSim.saveLCSCache(String) , but do not write a line for any LCS
whose IC falls below the threshold. |
void |
saveState(String fileName)
Experimental: save internal state of object
|
protected void |
setInformtionContectForAttribute(org.semanticweb.owlapi.model.OWLClass c,
Double v) |
cacheInformationContentInOntology, calculateAllByAllEnrichment, calculateAllByAllEnrichment, calculateCombinedScore, calculateEnrichment, calculateOverallAnnotationSufficiencyForAttributeSet, calculateOverallAnnotationSufficiencyForIndividual, calculatePairwiseEnrichment, calculateSubgraphAnnotationSufficiencyForAttributeSet, calculateSubgraphAnnotationSufficiencyForIndividual, computeAttributeSetSimilarityStats, computeAttributeSetSimilarityStatsForSubgraph, computeIndividualSimilarityStats, computeIndividualStats, computeIndividualStatsForSubgraph, computeSystemStats, computeSystemStatsForSubgraph, filterEnrichmentResults, findMatches, findMatches, findMatches, getAsymmetricAttributeJaccardSimilarityAsPercent, getConditionalProbability, getCorpusSize, getEnrichmentConfig, getEntropy, getEntropy, getICSimDisj, getLowestCommonSubsumerWithLinScore, getMetricStats, getMinimumDistanceToAncestor, getMinimumDistanceViaMICA, getNamedSubsumers, getOWLClassFromShortId, getPaths, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsDouble, getReasoner, getSharedElements, getShortId, getSimProperties, getSimStatistics, getSimStats, getSourceOntology, getSummaryStatistics, getSummaryStatistics, getSummaryStatisticsForCollection, getSystemStats, isDisableLCSCache, isNoLookupForLCSCache, precomputeAttributeAllByAll, saveLCSCache, setCorpusSize, setDisableLCSCache, setEnrichmentConfig, setInformationContentFromOntology, setNoLookupForLCSCache, setSimProperties, setSimStats, showTimings, showTimingsAndReset, tdelta
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cacheInformationContentInOntology, calculateAllByAllEnrichment, calculateAllByAllEnrichment, calculateCombinedScore, calculateEnrichment, calculateOverallAnnotationSufficiencyForAttributeSet, calculateOverallAnnotationSufficiencyForIndividual, calculatePairwiseEnrichment, calculateSubgraphAnnotationSufficiencyForAttributeSet, computeAttributeSetSimilarityStats, computeAttributeSetSimilarityStatsForSubgraph, computeIndividualStats, computeSystemStats, computeSystemStatsForSubgraph, findMatches, findMatches, findMatches, getAsymmetricAttributeJaccardSimilarityAsPercent, getConditionalProbability, getCorpusSize, getEnrichmentConfig, getEntropy, getEntropy, getLowestCommonSubsumerWithLinScore, getMetricStats, getNamedSubsumers, getReasoner, getShortId, getSimProperties, getSimStats, getSourceOntology, getSummaryStatistics, getSummaryStatistics, getSystemStats, precomputeAttributeAllByAll, saveLCSCache, setCorpusSize, setDisableLCSCache, setEnrichmentConfig, setInformationContentFromOntology, setNoLookupForLCSCache, setSimProperties, showTimings
public org.semanticweb.owlapi.model.OWLClass debugClass
public static Comparator<FastOwlSim.ClassCount> ClassCountComparator
public FastOwlSim(org.semanticweb.owlapi.model.OWLOntology sourceOntology)
sourceOntology
- public FastOwlSim(org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
reasoner
- public void dispose()
OwlSim
dispose
in interface OwlSim
dispose
in class AbstractOwlSim
public Set<org.semanticweb.owlapi.model.OWLClass> getAllAttributeClasses()
OwlSim
getAllAttributeClasses
in interface OwlSim
public void createElementAttributeMapFromOntology() throws UnknownOWLClassException
OwlSim
createElementAttributeMapFromOntology
in interface OwlSim
UnknownOWLClassException
public Set<org.semanticweb.owlapi.model.OWLClass> getAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e) throws UnknownOWLClassException
OwlSim
getAttributesForElement
in interface OwlSim
UnknownOWLClassException
public Set<org.semanticweb.owlapi.model.OWLNamedIndividual> getElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
OwlSim
getElementsForAttribute
in interface OwlSim
UnknownOWLClassException
public int getNumSharedElements(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
getNumSharedElements
in class AbstractOwlSim
UnknownOWLClassException
public int getNumSharedElements(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d, org.semanticweb.owlapi.model.OWLClass e) throws UnknownOWLClassException
UnknownOWLClassException
public int getNumElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
OwlSim
getNumElementsForAttribute
in interface OwlSim
public Set<org.semanticweb.owlapi.model.OWLNamedIndividual> getAllElements()
getAllElements
in interface OwlSim
public void assignDefaultInformationContentForAllClasses()
assignDefaultInformationContentForAllClasses
in class AbstractOwlSim
public Double getInformationContentForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws UnknownOWLClassException
OwlSim
OwlSim.getNumElementsForAttribute(OWLClass)
/ corpus size) / log(2)getInformationContentForAttribute
in interface OwlSim
UnknownOWLClassException
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getInferredAttributes(org.semanticweb.owlapi.model.OWLNamedIndividual a)
getInferredAttributes
in interface OwlSim
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedReflexiveSubsumers(org.semanticweb.owlapi.model.OWLClass a)
getNamedReflexiveSubsumers
in interface OwlSim
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
CS(a,b) = { c : c ∈ RSub(a), c ∈ RSub(b) }NOT CACHED. Always returns a copy of the CS list
getNamedCommonSubsumers
in interface OwlSim
UnknownOWLClassException
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedUnionSubsumers(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
UnknownOWLClassException
public int getNamedCommonSubsumersCount(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
| CS(i,j) | = | { c : c ∈ Type(i), c ∈ Type(j) } |
getNamedCommonSubsumersCount
in interface OwlSim
UnknownOWLClassException
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
CS(i,j) = { c : c ∈ Type(i), c ∈ Type(j) }
getNamedCommonSubsumers
in interface OwlSim
UnknownOWLClassException
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedLowestCommonSubsumers(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
CSredundant(a,b) = { c : c ∈ CS(a,b), &E; c' : c' ∈ CS(a,b), c' &in Sub(c) } LCS(a,b) = CS(a,b) - CSredundant
getNamedLowestCommonSubsumers
in interface OwlSim
UnknownOWLClassException
public double getAttributeSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d, SimpleOwlSim.Metric metric) throws UnknownOWLClassException
OwlSim
getAttributeSimilarity
in interface OwlSim
UnknownOWLClassException
public AttributePairScores getPairwiseSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
getPairwiseSimilarity
in interface OwlSim
UnknownOWLClassException
public double getAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
SimJ(a,b) = | anc(a) ∩ anc(b) | / | anc(a) ∪ anc(b) |
getAttributeJaccardSimilarity
in interface OwlSim
UnknownOWLClassException
public int getAttributeJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
OwlSim.getAttributeJaccardSimilarity(OWLClass, OWLClass)
* 100getAttributeJaccardSimilarityAsPercent
in interface OwlSim
getAttributeJaccardSimilarityAsPercent
in class AbstractOwlSim
UnknownOWLClassException
public double getElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(i) ∪ Type(j) |Here Type(i) is the set of all (direct and indirect) inferred types for an individual.
getElementJaccardSimilarity
in interface OwlSim
UnknownOWLClassException
public int getElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
OwlSim.getElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual)
* 100getElementJaccardSimilarityAsPercent
in interface OwlSim
getElementJaccardSimilarityAsPercent
in class AbstractOwlSim
UnknownOWLClassException
public double getAsymmetricAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
SimJASym(c,d) = | anc(c) ∩ anc(d) | / | anc(d) |If c is subsumed by d then the score is 1. i.e.
c ∈ Sub(d) → SimJASym(c,d) = 1
getAsymmetricAttributeJaccardSimilarity
in interface OwlSim
UnknownOWLClassException
public double getAsymmetricElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(j) |
getAsymmetricElementJaccardSimilarity
in interface OwlSim
UnknownOWLClassException
public int getAsymmetricElementJaccardSimilarityAsPercent(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
OwlSim.getAsymmetricElementJaccardSimilarity(OWLNamedIndividual, OWLNamedIndividual)
* 100getAsymmetricElementJaccardSimilarityAsPercent
in interface OwlSim
getAsymmetricElementJaccardSimilarityAsPercent
in class AbstractOwlSim
UnknownOWLClassException
public double getElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
getElementGraphInformationContentSimilarity
in interface OwlSim
UnknownOWLClassException
public double getAttributeGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
getAttributeGraphInformationContentSimilarity
in interface OwlSim
UnknownOWLClassException
public double getAsymmetricElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
UnknownOWLClassException
public OwlSim.ScoreAttributeSetPair getSimilarityMaxIC(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException
OwlSim
MaxIC(i,j) = max { IC(c) : c ∈ LCS(i,j) } CMaxIC(i,j) = { c : c ∈ LCS(i,j), IC(c) = MaxIC(i,j) }As a convenience, this method also returns the LCS class as well as the IC This is the same metric used by Lord et al in Investigating semantic similarity measures across the Gene Ontology: the relationship between sequence and annotation.
getSimilarityMaxIC
in interface OwlSim
UnknownOWLClassException
public OwlSim.ScoreAttributeSetPair getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j)
getSimilarityBestMatchAverageAsym
in interface OwlSim
public OwlSim.ScoreAttributeSetPair getSimilarityBestMatchAverageAsym(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, SimpleOwlSim.Metric metric)
OwlSim
BMAM(i,j) = avg { s : c ∈ Attr(i), max { s : d ∈ Attr(j), s = M(c,d) } }
getSimilarityBestMatchAverageAsym
in interface OwlSim
public OwlSim.ScoreAttributeSetPair getSimilarityBestMatchAverage(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, SimpleOwlSim.Metric metric, SimpleOwlSim.Direction dir)
getSimilarityBestMatchAverage
in interface OwlSim
protected void populateSimilarityMatrix(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, ElementPairScores ijscores) throws UnknownOWLClassException, NoElementAttributeMapException
public OwlSim.ScoreAttributeSetPair getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
OwlSim
getLowestCommonSubsumerWithIC
in interface OwlSim
UnknownOWLClassException
public OwlSim.ScoreAttributeSetPair getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d, Double thresh) throws UnknownOWLClassException
getLowestCommonSubsumerWithIC
in interface OwlSim
UnknownOWLClassException
public List<ElementPairScores> findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace, double minSimJPct, double minMaxIC) throws Exception
OwlSim
getGroupwiseSimilarity
with minSimJPct
and minMaxIC
cutoffs.findMatches
in interface OwlSim
Exception
public List<ElementPairScores> findMatchesWithin(org.semanticweb.owlapi.model.OWLNamedIndividual i, Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargets) throws Exception
findMatchesWithin
in interface OwlSim
Exception
public List<ElementPairScores> findMatchesWithin(Set<org.semanticweb.owlapi.model.OWLClass> atts, Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargetSet, double minSimJPct, double minMaxIC) throws Exception
Exception
public List<ElementPairScores> findMatchesRefactored(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace) throws Exception
Exception
public List<ElementPairScores> findMatchesRefactored(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace, double minSimJPct, double minMaxIC) throws Exception
Exception
public ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws Exception
OwlSim
Compare a named individual i
to itself.
For efficiency, the phenoDigm score should be calculated in the calling
function.
This will use no cutoff (-1,-1).
getGroupwiseSimilarity
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> attsI, Set<org.semanticweb.owlapi.model.OWLClass> attsJ) throws Exception
getGroupwiseSimilarity
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws Exception
OwlSim
(i,j)
.
This will default to using the following cutoffs:
minSimJPct = getPropertyAsDouble({@link SimConfigurationProperty.minimumSimJ}, 0.05) * 100)
minMaxIC = getPropertyAsDouble({@link SimConfigurationProperty.minimumMaxIC}, 2.5);
getGroupwiseSimilarity
in interface OwlSim
getGroupwiseSimilarity
in class AbstractOwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, double minSimJPct, double minMaxIC) throws Exception
OwlSim
Compare two named individuals i
, filtering on
minSimJ
and minMaxIC
While an initial combinedScore
is populated in the returned
ElementPairScores
object, it should be properly set in
the calling function with calculateCombinedScore
and
i.maxIC and i.bmaAsymIC
getGroupwiseSimilarity
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws Exception
OwlSim
Compare a set of attributes against the named individual i
.
For efficiency, the phenoDigm score should be calculated in the calling
function.
This will default to using the following cutoffs:
minSimJPct = getPropertyAsDouble({@link SimConfigurationProperty.minimumSimJ}, 0.05) * 100)
minMaxIC = getPropertyAsDouble({@link SimConfigurationProperty.minimumMaxIC}, 2.5);
getGroupwiseSimilarity
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLNamedIndividual j, double minSimJPct, double minMaxIC) throws Exception
OwlSim
i
.
For efficiency, the phenoDigm score should be calculated in the calling
function.
If no cutoffs are desired, set minSimJPct
and minMaxIC
= -1
getGroupwiseSimilarity
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> attsI, Set<org.semanticweb.owlapi.model.OWLClass> attsJ, double minSimJPct, double minMaxIC) throws Exception
getGroupwiseSimilarity
in interface OwlSim
Exception
public void calculateCombinedScores(List<ElementPairScores> scoreSets, double maxMaxIC, double maxBMA)
CombinedScore(i,j) = ( maxPecrentScore(i,j) / avgPercentScore(i,j) ) / 2given
maxPecrentScore(i,j) = (maxScore(i,j) / maxScore(i, k)) * 100 avgPecrentScore(i,j) = (avgScore(i,j) / avgScore(i, k)) * 100where k is the optimal match for i. We assume k has been calculated in advance, and maxScore(i, k) and avgScore(i, k) are provided as inputs Currently, we hardcode:
calculateCombinedScores
in interface OwlSim
scoreSets
- - set of all i,j scores for a constant imaxMaxIC
- - maxScore(i, k)maxBMA
- - avgScore(i, k)public List<SimResultRenderer.AttributesSimScores> compareAllAttributes(org.semanticweb.owlapi.model.OWLClass c, Set<org.semanticweb.owlapi.model.OWLClass> ds) throws UnknownOWLClassException
compareAllAttributes
in interface OwlSim
c
- ds
- UnknownOWLClassException
public org.semanticweb.owlapi.model.OWLClass owlThing()
public org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass> owlThingNode()
public void saveState(String fileName) throws IOException
OwlSim
saveState
in interface OwlSim
saveState
in class AbstractOwlSim
IOException
public void saveLCSCache(String fileName, Double thresholdIC) throws IOException
OwlSim
OwlSim.saveLCSCache(String)
, but do not write a line for any LCS
whose IC falls below the threshold.
Use this if you expect the size of the cache to be large. If not set,
the number of lines will be |A| x |A|saveLCSCache
in interface OwlSim
IOException
public void loadLCSCache(String fileName) throws IOException
OwlSim
loadLCSCache
in interface OwlSim
fileName
- IOException
protected void setInformtionContectForAttribute(org.semanticweb.owlapi.model.OWLClass c, Double v)
setInformtionContectForAttribute
in class AbstractOwlSim
protected void clearInformationContentCache()
clearInformationContentCache
in class AbstractOwlSim
protected void clearLCSCache() throws UnknownOWLClassException
UnknownOWLClassException
public Map<org.semanticweb.owlapi.model.OWLNamedIndividual,Set<org.semanticweb.owlapi.model.OWLClass>> getElementToAttributesMap()
getElementToAttributesMap
in interface OwlSim
public org.apache.commons.math3.stat.descriptive.SummaryStatistics getSimStatistics(String stat)
getSimStatistics
in interface OwlSim
public void calculateMetricStats(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> iset, Set<org.semanticweb.owlapi.model.OWLNamedIndividual> jset) throws Exception
calculateMetricStats
in interface OwlSim
Exception
public OwlSimMetadata getMetadata()
getMetadata
in interface OwlSim
getMetadata
in class AbstractOwlSim
public Double[][] computeTFIDFMatrix(int[][] subsetMatrix, int numIndividualsInSubset, int[][] backgroundMatrix, int numIndividualsInBackground) throws UnknownOWLClassException
computeTFIDFMatrix
in interface OwlSim
UnknownOWLClassException
public List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws Exception
getCoannotatedClassesForAttribute
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c, int numIndividualsInBackground) throws Exception
getCoannotatedClassesForAttribute
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c, Double cutoff, int numIndividualsInBackground) throws Exception
getCoannotatedClassesForAttribute
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws Exception
getCoAnnotatedClassesForIndividual
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoAnnotatedClassesForIndividual(org.semanticweb.owlapi.model.OWLNamedIndividual i, int matchCutoff) throws Exception
getCoAnnotatedClassesForIndividual
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts) throws Exception
getCoAnnotatedClassesForAttributes
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoAnnotatedClassesForAttributes(Set<org.semanticweb.owlapi.model.OWLClass> atts, int matchCutoff) throws Exception
getCoAnnotatedClassesForAttributes
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoAnnotatedClassesForMatches(List<ElementPairScores> matches, Set<org.semanticweb.owlapi.model.OWLClass> atts) throws Exception
getCoAnnotatedClassesForMatches
in interface OwlSim
Exception
public List<FastOwlSim.ClassCount> getCoAnnotatedClassesForMatches(List<ElementPairScores> matches, Set<org.semanticweb.owlapi.model.OWLClass> atts, int matchCutoff) throws Exception
Exception
public int[][] getSubsetCoannotationMatrix(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> individualSubset) throws Exception
getSubsetCoannotationMatrix
in interface OwlSim
Exception
public void populateFullCoannotationMatrix() throws Exception
populateFullCoannotationMatrix
in interface OwlSim
Exception
public int[][] convertCountMatrixToFrequency(int[][] matrix, int normalizationFactor)
convertCountMatrixToFrequency
in interface OwlSim
public int[][] initCoannotationMatrix(int[][] coaMatrix)
initCoannotationMatrix
in interface OwlSim
public void logCountMatrix(int[][] matrix)
Copyright © 2010–2015. All rights reserved.