owltools.sim
Class SimEngine

java.lang.Object
  extended by owltools.sim.SimEngine

public class SimEngine
extends Object

SimEngine provides access to multiple similarity calculation procedures (see Similarity). It wraps an OWLGraphWrapper object, and also provides convenience methods for calculating the LCA

Author:
cjm

Nested Class Summary
 class SimEngine.SimilarityAlgorithmException
           
 
Field Summary
 org.semanticweb.owlapi.model.OWLClass comparisonClass
           
 org.semanticweb.owlapi.model.OWLObjectProperty comparisonProperty
           
 org.semanticweb.owlapi.model.OWLObject comparisonSuperclass
           
 boolean excludeClassesInComparison
           
protected  OWLGraphWrapper graph
           
 Double minimumIC
           
 
Constructor Summary
SimEngine(OWLGraphWrapper wrapper)
           
 
Method Summary
 Set<Similarity> calculateAllSimilarity(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 Similarity calculateSimilarity(Similarity m, org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
          Calculates the similarity between two OWLObjects this is the core method of the SimEngine
 void calculateSimilarityAllByAll(String similarityAlgorithmName, Double minScore)
           
 Double calculateSimilarityScore(Similarity m, org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 org.semanticweb.owlapi.model.OWLObject createUnionExpression(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b, org.semanticweb.owlapi.model.OWLObject c)
           
 org.semanticweb.owlapi.model.OWLClassExpression edgeSetToExpression(Set<OWLGraphEdge> edges)
           
 void filterObjects(Set<org.semanticweb.owlapi.model.OWLObject> objs)
           
 Class[] getAllSimilarityAlgorithmClasses()
           
 Set<org.semanticweb.owlapi.model.OWLObject> getAttributeClosureFor(org.semanticweb.owlapi.model.OWLObject x)
           
 Set<org.semanticweb.owlapi.model.OWLObject> getAttributesFor(org.semanticweb.owlapi.model.OWLObject x)
           
 Set<org.semanticweb.owlapi.model.OWLObject> getCommonSubsumers(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 int getCommonSubsumersSize(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 int getCorpusSize()
           
 Set<String> getExcludedLabels()
          any class whose label matches any of the strings returned here will be excluded from any analysis.
 int getFrequency(org.semanticweb.owlapi.model.OWLObject obj)
           
 int getFrequency(Set<org.semanticweb.owlapi.model.OWLObject> objs)
          as getFrequency(obj), treats objs as a conjunction
 OWLGraphWrapper getGraph()
           
 Double getInformationContent(org.semanticweb.owlapi.model.OWLObject obj)
          The IC of an OWLObject is freq(Obj)/corpusSize here the frequency of an object is the number of individuals with a graph path up to the object, and the corpus size is the number of individuals in the graph
 Double getInformationContent(Set<org.semanticweb.owlapi.model.OWLObject> objs)
           
 Set<org.semanticweb.owlapi.model.OWLObject> getLeastCommonSubsumers(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
          note that this performs caching by default
 org.semanticweb.owlapi.model.OWLClassExpression getLeastCommonSubsumerSimpleClassExpression(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 int getLeastCommonSubsumersSize(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 Similarity getSimilarityAlgorithm(Class c)
           
 Similarity getSimilarityAlgorithm(String name)
          factory class for generating a Similarity instance based on its name
 Set<org.semanticweb.owlapi.model.OWLObject> getUnionSubsumers(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 int getUnionSubsumersSize(org.semanticweb.owlapi.model.OWLObject a, org.semanticweb.owlapi.model.OWLObject b)
           
 boolean hasInformationContent(org.semanticweb.owlapi.model.OWLObject obj)
           
 boolean isExcludedFromAnalysis(org.semanticweb.owlapi.model.OWLObject att)
          A class is excluded from the analysis if: it is a named entity, and the label for that entity matches the exclude labels list OR: it is a class expression, and the signature contains an excluded class
 String label(org.semanticweb.owlapi.model.OWLObject x)
           
 org.semanticweb.owlapi.model.OWLClassExpression makeIntersectionPair(org.semanticweb.owlapi.model.OWLClassExpression a, org.semanticweb.owlapi.model.OWLClassExpression b)
           
 Set<org.semanticweb.owlapi.model.OWLObject> makeNonRedundant(Set<org.semanticweb.owlapi.model.OWLObject> objs)
          An object x is redundant with a set S if: there exists an element y of S, such that y
 Set<org.semanticweb.owlapi.model.OWLObject> makeNonRedundant(Set<org.semanticweb.owlapi.model.OWLObject> objs, boolean prioritizeNamedClasses)
           
 org.semanticweb.owlapi.model.OWLClassExpression makeUnionPair(org.semanticweb.owlapi.model.OWLClassExpression a, org.semanticweb.owlapi.model.OWLClassExpression b)
           
 Set<org.semanticweb.owlapi.model.OWLObject> nonSignificantObjects()
           
 void setGraph(OWLGraphWrapper graph)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected OWLGraphWrapper graph

excludeClassesInComparison

public boolean excludeClassesInComparison

comparisonSuperclass

public org.semanticweb.owlapi.model.OWLObject comparisonSuperclass

minimumIC

public Double minimumIC

comparisonClass

public org.semanticweb.owlapi.model.OWLClass comparisonClass

comparisonProperty

public org.semanticweb.owlapi.model.OWLObjectProperty comparisonProperty
Constructor Detail

SimEngine

public SimEngine(OWLGraphWrapper wrapper)
Method Detail

getGraph

public OWLGraphWrapper getGraph()

setGraph

public void setGraph(OWLGraphWrapper graph)

getExcludedLabels

public Set<String> getExcludedLabels()
any class whose label matches any of the strings returned here will be excluded from any analysis. the set of excluded labels is controlled by loading an ontology with an entity PhenoSim_0000001 where all the literals associated with this are excluded. (note that this method may change in future)

Returns:
excluded labels

isExcludedFromAnalysis

public boolean isExcludedFromAnalysis(org.semanticweb.owlapi.model.OWLObject att)
A class is excluded from the analysis if: it is a named entity, and the label for that entity matches the exclude labels list OR: it is a class expression, and the signature contains an excluded class

Parameters:
att -
Returns:
boolean

getSimilarityAlgorithm

public Similarity getSimilarityAlgorithm(String name)
                                  throws SimEngine.SimilarityAlgorithmException
factory class for generating a Similarity instance based on its name

Parameters:
name -
Returns:
Similarity
Throws:
SimEngine.SimilarityAlgorithmException

getSimilarityAlgorithm

public Similarity getSimilarityAlgorithm(Class c)
                                  throws SimEngine.SimilarityAlgorithmException
Throws:
SimEngine.SimilarityAlgorithmException

getAllSimilarityAlgorithmClasses

public Class[] getAllSimilarityAlgorithmClasses()

getAttributeClosureFor

public Set<org.semanticweb.owlapi.model.OWLObject> getAttributeClosureFor(org.semanticweb.owlapi.model.OWLObject x)

getAttributesFor

public Set<org.semanticweb.owlapi.model.OWLObject> getAttributesFor(org.semanticweb.owlapi.model.OWLObject x)

getCorpusSize

public int getCorpusSize()

getFrequency

public int getFrequency(org.semanticweb.owlapi.model.OWLObject obj)

getFrequency

public int getFrequency(Set<org.semanticweb.owlapi.model.OWLObject> objs)
as getFrequency(obj), treats objs as a conjunction

Parameters:
objs -
Returns:

getInformationContent

public Double getInformationContent(org.semanticweb.owlapi.model.OWLObject obj)
The IC of an OWLObject is freq(Obj)/corpusSize here the frequency of an object is the number of individuals with a graph path up to the object, and the corpus size is the number of individuals in the graph

Parameters:
obj -
Returns:

getInformationContent

public Double getInformationContent(Set<org.semanticweb.owlapi.model.OWLObject> objs)

hasInformationContent

public boolean hasInformationContent(org.semanticweb.owlapi.model.OWLObject obj)

nonSignificantObjects

public Set<org.semanticweb.owlapi.model.OWLObject> nonSignificantObjects()

filterObjects

public void filterObjects(Set<org.semanticweb.owlapi.model.OWLObject> objs)

getUnionSubsumers

public Set<org.semanticweb.owlapi.model.OWLObject> getUnionSubsumers(org.semanticweb.owlapi.model.OWLObject a,
                                                                     org.semanticweb.owlapi.model.OWLObject b)

getUnionSubsumersSize

public int getUnionSubsumersSize(org.semanticweb.owlapi.model.OWLObject a,
                                 org.semanticweb.owlapi.model.OWLObject b)

getCommonSubsumers

public Set<org.semanticweb.owlapi.model.OWLObject> getCommonSubsumers(org.semanticweb.owlapi.model.OWLObject a,
                                                                      org.semanticweb.owlapi.model.OWLObject b)

getCommonSubsumersSize

public int getCommonSubsumersSize(org.semanticweb.owlapi.model.OWLObject a,
                                  org.semanticweb.owlapi.model.OWLObject b)

getLeastCommonSubsumers

public Set<org.semanticweb.owlapi.model.OWLObject> getLeastCommonSubsumers(org.semanticweb.owlapi.model.OWLObject a,
                                                                           org.semanticweb.owlapi.model.OWLObject b)
note that this performs caching by default

Parameters:
a -
b -
Returns:
LCA of a and b

getLeastCommonSubsumersSize

public int getLeastCommonSubsumersSize(org.semanticweb.owlapi.model.OWLObject a,
                                       org.semanticweb.owlapi.model.OWLObject b)

makeNonRedundant

public Set<org.semanticweb.owlapi.model.OWLObject> makeNonRedundant(Set<org.semanticweb.owlapi.model.OWLObject> objs)
An object x is redundant with a set S if: there exists an element y of S, such that y
Parameters:
objs -
Returns:

makeNonRedundant

public Set<org.semanticweb.owlapi.model.OWLObject> makeNonRedundant(Set<org.semanticweb.owlapi.model.OWLObject> objs,
                                                                    boolean prioritizeNamedClasses)

makeIntersectionPair

public org.semanticweb.owlapi.model.OWLClassExpression makeIntersectionPair(org.semanticweb.owlapi.model.OWLClassExpression a,
                                                                            org.semanticweb.owlapi.model.OWLClassExpression b)

makeUnionPair

public org.semanticweb.owlapi.model.OWLClassExpression makeUnionPair(org.semanticweb.owlapi.model.OWLClassExpression a,
                                                                     org.semanticweb.owlapi.model.OWLClassExpression b)

getLeastCommonSubsumerSimpleClassExpression

public org.semanticweb.owlapi.model.OWLClassExpression getLeastCommonSubsumerSimpleClassExpression(org.semanticweb.owlapi.model.OWLObject a,
                                                                                                   org.semanticweb.owlapi.model.OWLObject b)

calculateSimilarityScore

public Double calculateSimilarityScore(Similarity m,
                                       org.semanticweb.owlapi.model.OWLObject a,
                                       org.semanticweb.owlapi.model.OWLObject b)
                                throws SimEngine.SimilarityAlgorithmException
Parameters:
m -
a -
b -
Returns:
score
Throws:
SimEngine.SimilarityAlgorithmException

calculateSimilarity

public Similarity calculateSimilarity(Similarity m,
                                      org.semanticweb.owlapi.model.OWLObject a,
                                      org.semanticweb.owlapi.model.OWLObject b)
                               throws SimEngine.SimilarityAlgorithmException
Calculates the similarity between two OWLObjects this is the core method of the SimEngine

Parameters:
m -
a -
b -
Returns:
similarity
Throws:
SimEngine.SimilarityAlgorithmException

calculateAllSimilarity

public Set<Similarity> calculateAllSimilarity(org.semanticweb.owlapi.model.OWLObject a,
                                              org.semanticweb.owlapi.model.OWLObject b)
                                       throws SimEngine.SimilarityAlgorithmException
Throws:
SimEngine.SimilarityAlgorithmException

calculateSimilarityAllByAll

public void calculateSimilarityAllByAll(String similarityAlgorithmName,
                                        Double minScore)
                                 throws SimEngine.SimilarityAlgorithmException
Throws:
SimEngine.SimilarityAlgorithmException

label

public String label(org.semanticweb.owlapi.model.OWLObject x)

createUnionExpression

public org.semanticweb.owlapi.model.OWLObject createUnionExpression(org.semanticweb.owlapi.model.OWLObject a,
                                                                    org.semanticweb.owlapi.model.OWLObject b,
                                                                    org.semanticweb.owlapi.model.OWLObject c)

edgeSetToExpression

public org.semanticweb.owlapi.model.OWLClassExpression edgeSetToExpression(Set<OWLGraphEdge> edges)


Copyright © 2010-2012. All Rights Reserved.