public class SimpleOwlSim extends AbstractOwlSim implements OwlSim
Modifier and Type | Class and Description |
---|---|
static class |
SimpleOwlSim.Direction
Asymmetric metrics can be applied in either of two directions, or both can
be aggregated
|
static class |
SimpleOwlSim.Metric
Base similarity metric - may be applied at individual or class level
|
static class |
SimpleOwlSim.OutputFormat
The OutputFormat enumerates the different styles of output for sim results,
and maps 1:1 with different renderers.
|
class |
SimpleOwlSim.ScoreAttributePair
A pair consisting of an attribute class, and a score for that class
|
static class |
SimpleOwlSim.SimConfigurationProperty
Set of tags that can be used in configuration
|
OwlSim.ScoreAttributeSetPair, OwlSim.Stat, OwlSim.StatsPerIndividual
enrichmentConfig, icIRIString, isDisableLCSCache, isLCSCacheFullyPopulated, isNoLookupForLCSCache, metricStatMaxes, metricStatMeans, metricStatMins, overallStats, overallSummaryStatsPerIndividual, reasoner, simStats, simStatsPerIndividual, subgraphSummaryStatsPerIndividual
Constructor and Description |
---|
SimpleOwlSim(org.semanticweb.owlapi.model.OWLOntology sourceOntology) |
Modifier and Type | Method and Description |
---|---|
void |
addIgnoreSubClassesOf(org.semanticweb.owlapi.model.IRI iri) |
void |
addIgnoreSubClassesOf(org.semanticweb.owlapi.model.OWLClass c)
e.g.
|
void |
calculateCombinedScore(ElementPairScores eps,
double maxIC,
double bmaAsymIC) |
void |
calculateCombinedScores(List<ElementPairScores> scoreSets,
double maxIC,
double bmaAsymIC) |
void |
calculateMetricStats(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> iset,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> jset) |
protected void |
clearInformationContentCache() |
List<SimResultRenderer.AttributesSimScores> |
compareAllAttributes(org.semanticweb.owlapi.model.OWLClass c,
Set<org.semanticweb.owlapi.model.OWLClass> ds) |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
computeIndividualStats(org.semanticweb.owlapi.model.OWLNamedIndividual i)
This will compute the individual summary statistics over the
set of anntoated classes to an individual i.
|
void |
computeSystemStats()
This function will compute the IC-based summary statistics over the set of
individuals for direct annotations.
|
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.
|
List<ElementPairScores> |
findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts,
String targetIdSpace)
Find all similar matches to a pseudo-individual with a set of attributes
when compared to loaded individuals using
getGroupwiseSimilarity
with default cutoffs. |
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> |
findMatchesWithin(org.semanticweb.owlapi.model.OWLNamedIndividual i,
Set<org.semanticweb.owlapi.model.OWLNamedIndividual> candidateTargets) |
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 |
getAsymmetricElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i,
org.semanticweb.owlapi.model.OWLNamedIndividual j)
SimJ(i,j) = | Type(i) ∩ Type(j) | / | Type(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 a,
org.semanticweb.owlapi.model.OWLClass b)
SimJ(a,b) = | anc(a) ∩ anc(b) | / | anc(a) ∪ anc(b) |
|
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 a,
org.semanticweb.owlapi.model.OWLClass b,
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) |
double |
getConditionalProbability(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
int |
getCorpusSize()
The number of entities in the entire set being analyzed.
|
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) |
|
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() |
Double |
getEntropy() |
Double |
getEntropy(Set<org.semanticweb.owlapi.model.OWLClass> cset) |
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,
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> objAs,
Set<org.semanticweb.owlapi.model.OWLClass> objBs) |
ElementPairScores |
getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs,
Set<org.semanticweb.owlapi.model.OWLClass> objBs,
double minSimJPct,
double minMaxIC) |
Set<org.semanticweb.owlapi.model.OWLClass> |
getIgnoreSubClassesOf() |
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) |
SimpleOwlSim.ScoreAttributePair |
getLowestCommonSubsumerIC(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
IC(c) = -log2(p(c))
p(c) = | Inst(c) | / | Inst(owl:Thing) |
|
SimpleOwlSim.ScoreAttributePair |
getLowestCommonSubsumerIC(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b,
Double minimumIC) |
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 i,
org.semanticweb.owlapi.model.OWLClass j,
Double thresh) |
Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> |
getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
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 a,
org.semanticweb.owlapi.model.OWLNamedIndividual b)
CS(i,j) = { c : c ∈ Type(i), c ∈ Type(j) }
|
int |
getNamedCommonSubsumersCount(org.semanticweb.owlapi.model.OWLClass a,
org.semanticweb.owlapi.model.OWLClass b)
| 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 a,
org.semanticweb.owlapi.model.OWLClass b)
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>> |
getNamedSubsumers(org.semanticweb.owlapi.model.OWLClass a) |
int |
getNumElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
|{e : e ∈ Inst(c)}|
|
AttributePairScores |
getPairwiseSimilarity(org.semanticweb.owlapi.model.OWLClass c,
org.semanticweb.owlapi.model.OWLClass d) |
org.semanticweb.owlapi.reasoner.OWLReasoner |
getReasoner() |
List<OwlSim.ScoreAttributeSetPair> |
getScoredAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e)
Given an individual element, return all direct attribute classes that the individual instantiates,
combined with IC.
|
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.
|
SimPreProcessor |
getSimPreProcessor() |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
getSimStatistics(String stat) |
org.semanticweb.owlapi.model.OWLOntology |
getSourceOntology() |
int[][] |
getSubsetCoannotationMatrix(Set<org.semanticweb.owlapi.model.OWLNamedIndividual> individualSubset) |
OwlSim.StatsPerIndividual |
getSummaryStatistics()
Fetch the pre-computed summary values
|
int[][] |
initCoannotationMatrix(int[][] coaMatrix) |
void |
loadLCSCache(String fileName)
Loads a pregenerated IC cache.
|
void |
populateFullCoannotationMatrix() |
protected void |
precomputeAttributeElementCount()
Mapping between an attribute (e.g.
|
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 |
search(Set<org.semanticweb.owlapi.model.OWLClass> atts,
SimpleOwlSim.Metric metric) |
void |
setCorpusSize(int size)
Sets the number of entities in domain.
|
void |
setIgnoreSubClassesOf(Set<org.semanticweb.owlapi.model.OWLClass> ignoreSubClassesOf) |
protected void |
setInformtionContectForAttribute(org.semanticweb.owlapi.model.OWLClass c,
Double v) |
void |
setReasoner(org.semanticweb.owlapi.reasoner.OWLReasoner r) |
void |
setSimPreProcessor(SimPreProcessor simPreProcessor) |
void |
setSourceOntology(org.semanticweb.owlapi.model.OWLOntology sourceOntology) |
assignDefaultInformationContentForAllClasses, cacheInformationContentInOntology, calculateAllByAllEnrichment, calculateAllByAllEnrichment, calculateEnrichment, calculateOverallAnnotationSufficiencyForAttributeSet, calculateOverallAnnotationSufficiencyForIndividual, calculatePairwiseEnrichment, calculateSubgraphAnnotationSufficiencyForAttributeSet, calculateSubgraphAnnotationSufficiencyForIndividual, computeAttributeSetSimilarityStats, computeAttributeSetSimilarityStatsForSubgraph, computeIndividualSimilarityStats, computeIndividualStatsForSubgraph, computeSystemStatsForSubgraph, dispose, filterEnrichmentResults, findMatches, findMatches, getAsymmetricAttributeJaccardSimilarityAsPercent, getAsymmetricElementJaccardSimilarityAsPercent, getAttributeJaccardSimilarityAsPercent, getElementJaccardSimilarityAsPercent, getEnrichmentConfig, getGroupwiseSimilarity, getICSimDisj, getLowestCommonSubsumerWithLinScore, getMetadata, getMetricStats, getMinimumDistanceToAncestor, getMinimumDistanceViaMICA, getNumSharedElements, getOWLClassFromShortId, getPaths, getProperty, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsDouble, getSharedElements, getShortId, getSimProperties, getSimStatistics, getSimStats, getSummaryStatistics, getSummaryStatisticsForCollection, getSystemStats, isDisableLCSCache, isNoLookupForLCSCache, precomputeAttributeAllByAll, saveLCSCache, saveState, setDisableLCSCache, setEnrichmentConfig, setInformationContentFromOntology, setNoLookupForLCSCache, setSimProperties, setSimStats, showTimings, showTimingsAndReset, tdelta
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cacheInformationContentInOntology, calculateAllByAllEnrichment, calculateAllByAllEnrichment, calculateEnrichment, calculateOverallAnnotationSufficiencyForAttributeSet, calculateOverallAnnotationSufficiencyForIndividual, calculatePairwiseEnrichment, calculateSubgraphAnnotationSufficiencyForAttributeSet, computeAttributeSetSimilarityStats, computeAttributeSetSimilarityStatsForSubgraph, computeSystemStatsForSubgraph, dispose, findMatches, findMatches, getAsymmetricAttributeJaccardSimilarityAsPercent, getAsymmetricElementJaccardSimilarityAsPercent, getAttributeJaccardSimilarityAsPercent, getElementJaccardSimilarityAsPercent, getEnrichmentConfig, getGroupwiseSimilarity, getLowestCommonSubsumerWithLinScore, getMetadata, getMetricStats, getShortId, getSimProperties, getSimStats, getSummaryStatistics, getSystemStats, precomputeAttributeAllByAll, saveLCSCache, saveState, setDisableLCSCache, setEnrichmentConfig, setInformationContentFromOntology, setNoLookupForLCSCache, setSimProperties, showTimings
public SimpleOwlSim(org.semanticweb.owlapi.model.OWLOntology sourceOntology)
sourceOntology
- public org.semanticweb.owlapi.model.OWLOntology getSourceOntology()
getSourceOntology
in interface OwlSim
getSourceOntology
in class AbstractOwlSim
public void setSourceOntology(org.semanticweb.owlapi.model.OWLOntology sourceOntology)
public SimPreProcessor getSimPreProcessor()
public void setSimPreProcessor(SimPreProcessor simPreProcessor)
public Set<org.semanticweb.owlapi.model.OWLClass> getIgnoreSubClassesOf()
public void setIgnoreSubClassesOf(Set<org.semanticweb.owlapi.model.OWLClass> ignoreSubClassesOf)
public void addIgnoreSubClassesOf(org.semanticweb.owlapi.model.OWLClass c)
c
- public void addIgnoreSubClassesOf(org.semanticweb.owlapi.model.IRI iri)
public org.semanticweb.owlapi.reasoner.OWLReasoner getReasoner()
getReasoner
in interface OwlSim
getReasoner
in class AbstractOwlSim
public void setReasoner(org.semanticweb.owlapi.reasoner.OWLReasoner r)
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedSubsumers(org.semanticweb.owlapi.model.OWLClass a)
getNamedSubsumers
in interface OwlSim
getNamedSubsumers
in class AbstractOwlSim
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 a, org.semanticweb.owlapi.model.OWLClass b)
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
public int getNamedCommonSubsumersCount(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b)
OwlSim
| CS(i,j) | = | { c : c ∈ Type(i), c ∈ Type(j) } |
getNamedCommonSubsumersCount
in interface OwlSim
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedCommonSubsumers(org.semanticweb.owlapi.model.OWLNamedIndividual a, org.semanticweb.owlapi.model.OWLNamedIndividual b)
OwlSim
CS(i,j) = { c : c ∈ Type(i), c ∈ Type(j) }
getNamedCommonSubsumers
in interface OwlSim
public Set<org.semanticweb.owlapi.reasoner.Node<org.semanticweb.owlapi.model.OWLClass>> getNamedLowestCommonSubsumers(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b)
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
public double getAttributeSimilarity(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b, SimpleOwlSim.Metric metric)
OwlSim
getAttributeSimilarity
in interface OwlSim
public double getAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b)
OwlSim
SimJ(a,b) = | anc(a) ∩ anc(b) | / | anc(a) ∪ anc(b) |
getAttributeJaccardSimilarity
in interface OwlSim
public double getElementJaccardSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j)
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
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 double getAsymmetricAttributeJaccardSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d)
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
public double getElementGraphInformationContentSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j)
OwlSim
getElementGraphInformationContentSimilarity
in interface OwlSim
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 SimpleOwlSim.ScoreAttributePair getLowestCommonSubsumerIC(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b)
IC(c) = -log2(p(c)) p(c) = | Inst(c) | / | Inst(owl:Thing) |CACHED
a
- b
- public SimpleOwlSim.ScoreAttributePair getLowestCommonSubsumerIC(org.semanticweb.owlapi.model.OWLClass a, org.semanticweb.owlapi.model.OWLClass b, Double minimumIC)
public OwlSim.ScoreAttributeSetPair getSimilarityMaxIC(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j)
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
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
public List<SimResultRenderer.AttributesSimScores> compareAllAttributes(org.semanticweb.owlapi.model.OWLClass c, Set<org.semanticweb.owlapi.model.OWLClass> ds)
compareAllAttributes
in interface OwlSim
c
- ds
- public void search(Set<org.semanticweb.owlapi.model.OWLClass> atts, SimpleOwlSim.Metric metric)
public Set<org.semanticweb.owlapi.model.OWLClass> getAllAttributeClasses()
OwlSim
getAllAttributeClasses
in interface OwlSim
public void createElementAttributeMapFromOntology()
OwlSim
createElementAttributeMapFromOntology
in interface OwlSim
public Set<org.semanticweb.owlapi.model.OWLClass> getAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e)
OwlSim
getAttributesForElement
in interface OwlSim
public List<OwlSim.ScoreAttributeSetPair> getScoredAttributesForElement(org.semanticweb.owlapi.model.OWLNamedIndividual e)
e
- protected void precomputeAttributeElementCount()
public Set<org.semanticweb.owlapi.model.OWLNamedIndividual> getElementsForAttribute(org.semanticweb.owlapi.model.OWLClass c)
OwlSim
getElementsForAttribute
in interface OwlSim
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 Map<org.semanticweb.owlapi.model.OWLNamedIndividual,Set<org.semanticweb.owlapi.model.OWLClass>> getElementToAttributesMap()
getElementToAttributesMap
in interface OwlSim
public int getCorpusSize()
OwlSim
getCorpusSize
in interface OwlSim
getCorpusSize
in class AbstractOwlSim
public void setCorpusSize(int size)
OwlSim
setCorpusSize
in interface OwlSim
setCorpusSize
in class AbstractOwlSim
public Double getInformationContentForAttribute(org.semanticweb.owlapi.model.OWLClass c)
OwlSim
OwlSim.getNumElementsForAttribute(OWLClass)
/ corpus size) / log(2)getInformationContentForAttribute
in interface OwlSim
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 clearInformationContentCache()
clearInformationContentCache
in class AbstractOwlSim
protected void setInformtionContectForAttribute(org.semanticweb.owlapi.model.OWLClass c, Double v)
setInformtionContectForAttribute
in class AbstractOwlSim
public Double getEntropy()
getEntropy
in interface OwlSim
getEntropy
in class AbstractOwlSim
public Double getEntropy(Set<org.semanticweb.owlapi.model.OWLClass> cset)
getEntropy
in interface OwlSim
getEntropy
in class AbstractOwlSim
public AttributePairScores getPairwiseSimilarity(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d) throws UnknownOWLClassException
getPairwiseSimilarity
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 OwlSim.ScoreAttributeSetPair getLowestCommonSubsumerWithIC(org.semanticweb.owlapi.model.OWLClass i, org.semanticweb.owlapi.model.OWLClass j, Double thresh) throws UnknownOWLClassException
getLowestCommonSubsumerWithIC
in interface OwlSim
UnknownOWLClassException
public List<ElementPairScores> findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace) throws UnknownOWLClassException
OwlSim
Find all similar matches to a pseudo-individual with a set of attributes
when compared to loaded individuals using getGroupwiseSimilarity
with default cutoffs.
minSimJPct = getPropertyAsDouble({@link SimConfigurationProperty.minimumSimJ}, 0.05) * 100)
minMaxIC = getPropertyAsDouble({@link SimConfigurationProperty.minimumMaxIC}, 2.5);
findMatches
in interface OwlSim
findMatches
in class AbstractOwlSim
UnknownOWLClassException
public double getConditionalProbability(org.semanticweb.owlapi.model.OWLClass c, org.semanticweb.owlapi.model.OWLClass d)
getConditionalProbability
in interface OwlSim
getConditionalProbability
in class AbstractOwlSim
public org.apache.commons.math3.stat.descriptive.SummaryStatistics computeIndividualStats(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws UnknownOWLClassException
OwlSim
computeIndividualStats
in interface OwlSim
computeIndividualStats
in class AbstractOwlSim
UnknownOWLClassException
public void computeSystemStats() throws UnknownOWLClassException
OwlSim
computeSystemStats
in interface OwlSim
computeSystemStats
in class AbstractOwlSim
UnknownOWLClassException
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 UnknownOWLClassException
calculateMetricStats
in interface OwlSim
UnknownOWLClassException
public OwlSim.StatsPerIndividual getSummaryStatistics()
OwlSim
getSummaryStatistics
in interface OwlSim
getSummaryStatistics
in class AbstractOwlSim
SummaryStatistics
public ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i) throws UnknownOWLClassException, CutoffException
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
UnknownOWLClassException
CutoffException
public ElementPairScores getGroupwiseSimilarity(org.semanticweb.owlapi.model.OWLNamedIndividual i, org.semanticweb.owlapi.model.OWLNamedIndividual j, double minSimJPct, double minMaxIC) throws UnknownOWLClassException, CutoffException
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
UnknownOWLClassException
CutoffException
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLNamedIndividual j) throws UnknownOWLClassException, CutoffException
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
UnknownOWLClassException
CutoffException
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> atts, org.semanticweb.owlapi.model.OWLNamedIndividual j, double minSimJPct, double minMaxIC) throws UnknownOWLClassException, CutoffException
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
UnknownOWLClassException
CutoffException
public void calculateCombinedScore(ElementPairScores eps, double maxIC, double bmaAsymIC)
calculateCombinedScore
in interface OwlSim
calculateCombinedScore
in class AbstractOwlSim
public List<ElementPairScores> findMatches(Set<org.semanticweb.owlapi.model.OWLClass> atts, String targetIdSpace, double minSimJPct, double minMaxIC) throws UnknownOWLClassException
OwlSim
getGroupwiseSimilarity
with minSimJPct
and minMaxIC
cutoffs.findMatches
in interface OwlSim
UnknownOWLClassException
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 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, 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 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 List<FastOwlSim.ClassCount> getCoannotatedClassesForAttribute(org.semanticweb.owlapi.model.OWLClass c) throws Exception
getCoannotatedClassesForAttribute
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs, Set<org.semanticweb.owlapi.model.OWLClass> objBs) throws Exception
getGroupwiseSimilarity
in interface OwlSim
Exception
public ElementPairScores getGroupwiseSimilarity(Set<org.semanticweb.owlapi.model.OWLClass> objAs, Set<org.semanticweb.owlapi.model.OWLClass> objBs, double minSimJPct, double minMaxIC) throws Exception
getGroupwiseSimilarity
in interface OwlSim
Exception
public void calculateCombinedScores(List<ElementPairScores> scoreSets, double maxIC, double bmaAsymIC)
calculateCombinedScores
in interface OwlSim
Copyright © 2010–2016. All rights reserved.