|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectslib.sml.sm.core.engine.SM_Engine
public class SM_Engine
This class defines a Semantic Measures Engine giving access to numerous
methods commonly used to define graph-based semantic measures.
The engine distinguished two types of vertices in the graph:
GraphAccessor
. In short, classes are the vertices composing the
taxonomic graph included in the given graph. In most cases the graph only
contains vertices associated to classes.
GraphAccessor
. Those instances are the vertices which are typed by
classes.
GraphReduction_Transitive
class
or even more easily using the GraphActionExecutor
class.
The engine stores commonly accessed results (e.g. ancestors of a class) which
can lead to high memory consumption dealing with large graphs.
Constructor Summary | |
---|---|
SM_Engine(slib.sglib.model.graph.G g)
Constructor of an engine associated to the given graph. |
Method Summary | |
---|---|
double |
computeGroupwiseAddOnSim(SMconf confGroupwise,
SMconf confPairwise,
Set<org.openrdf.model.URI> setA,
Set<org.openrdf.model.URI> setB)
Compute the indirect group wise semantic measure score considering the two set of vertices and the semantic measure configuration. |
double |
computeGroupwiseStandaloneSim(SMconf confGroupwise,
Set<org.openrdf.model.URI> setA,
Set<org.openrdf.model.URI> setB)
Compute the direct group wise semantic measure score considering the two set of vertices and the semantic measure configuration. |
Map<org.openrdf.model.URI,Double> |
computeIC(ICconf icConf)
Compute the information content for all classes. |
double |
computePairwiseSim(SMconf pairwiseConf,
org.openrdf.model.URI a,
org.openrdf.model.URI b)
Compute the pairwise semantic measures score considering the two vertices and the semantic measure configuration. |
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
getAllAncestorsInc()
Access to the inclusive ancestors for all classes. |
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
getAllDescendantsInc()
Access to a view of the inclusive descendants for all classes. |
Map<org.openrdf.model.URI,Integer> |
getAllNbAncestorsInc()
Inclusive process |
Map<org.openrdf.model.URI,Integer> |
getAllNbDescendantsInc()
Compute the number of inclusive descendants for all classes |
Map<org.openrdf.model.URI,Integer> |
getAllNbReachableLeaves()
Compute for each class x the number classes which are leaves which are subsumed by x. |
Map<org.openrdf.model.URI,Double> |
getAllShortestPath(org.openrdf.model.URI a,
slib.sglib.model.graph.weight.GWS weightingScheme)
CACHED |
slib.sglib.algo.graph.extraction.rvf.AncestorEngine |
getAncestorEngine()
|
Set<org.openrdf.model.URI> |
getAncestorsInc(Set<org.openrdf.model.URI> setClasses)
Compute the union of the inclusive ancestors of a set of classes. |
Set<org.openrdf.model.URI> |
getAncestorsInc(org.openrdf.model.URI v)
Give access to a view of the inclusive ancestors of a class. |
Set<org.openrdf.model.URI> |
getClasses()
Access to the set of URI of the graph considered as classes. |
slib.sglib.algo.graph.extraction.rvf.DescendantEngine |
getDescendantEngine()
|
Set<org.openrdf.model.URI> |
getDescendantsInc(org.openrdf.model.URI v)
Give access to a view of the inclusive descendants of a class. |
slib.sglib.model.graph.G |
getGraph()
Access to the graph associated to the engine. |
Set<org.openrdf.model.URI> |
getHypoAncEx(org.openrdf.model.URI a,
org.openrdf.model.URI b)
NOT_CACHED |
double |
getIC_MICA(ICconf icConf,
org.openrdf.model.URI a,
org.openrdf.model.URI b)
Get the information content of the most informative common ancestor (MICA) of two classes. |
Map<org.openrdf.model.URI,Double> |
getIC_results(ICconf icConf)
Access to a view of the information content of all classes. |
double |
getIC(ICconf icConf,
org.openrdf.model.URI v)
Get the Information Content of a class. |
Set<org.openrdf.model.URI> |
getInstances()
Access to the set of URI of the graph considered as instances. |
Set<org.openrdf.model.URI> |
getLCAs(org.openrdf.model.URI a,
org.openrdf.model.URI b)
|
slib.utils.impl.MatrixDouble<org.openrdf.model.URI,org.openrdf.model.URI> |
getMatrixScore(Set<org.openrdf.model.URI> setA,
Set<org.openrdf.model.URI> setB,
SMconf pairwiseConf)
Compute the matrix of similarity for two sets of vertex/concepts/classes. |
int |
getMaxDepth()
Access to the maximal depth of a class in the underlying taxonomic graph. |
Map<org.openrdf.model.URI,Integer> |
getMaxDepths()
Give access to a view of the maximal depth of all classes. |
org.openrdf.model.URI |
getMICA(ICconf icConf,
org.openrdf.model.URI a,
org.openrdf.model.URI b)
Get the most informative common ancestor (MICA) of two classes. |
Map<org.openrdf.model.URI,Integer> |
getMinDepths()
Give access to a view of the minimal depth of all classes. |
org.openrdf.model.URI |
getMSA(org.openrdf.model.URI a,
org.openrdf.model.URI b,
slib.sglib.model.graph.weight.GWS weightingScheme)
NOT_CACHED |
Map<org.openrdf.model.URI,Integer> |
getNbInstancesInferredPropFromCorpus()
|
Map<org.openrdf.model.URI,Integer> |
getNbOccurrenceProp()
Topological propagation considering one occurrence per term |
Map<org.openrdf.model.URI,Integer> |
getnbPathLeadingToAllVertex()
|
double |
getP_MICA(ICconf conf,
org.openrdf.model.URI a,
org.openrdf.model.URI b)
|
Set<org.openrdf.model.URI> |
getParents(org.openrdf.model.URI v)
Get the parents of a class, that is to say its direct ancestors. |
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
getReachableLeaves()
Compute for each class x the classes which are leaves which are subsumed by x. |
org.openrdf.model.URI |
getRoot()
Get the root of the taxonomic graph contained in the graph associated to the engine. |
double |
getShortestPath(org.openrdf.model.URI a,
org.openrdf.model.URI b,
slib.sglib.model.graph.weight.GWS weightingScheme)
CACHED ! Be careful modification of RelTypes requires cache clearing |
Set<org.openrdf.model.URI> |
getTaxonomicLeaves()
Access to a view of the set of leaves of the underlying taxonomic graph. |
Map<org.openrdf.model.URI,Double> |
getVector(Set<org.openrdf.model.URI> set,
SMconf groupwiseconf)
|
slib.sglib.model.graph.weight.GWS |
getWeightingScheme(String param)
TODO store the weighting scheme in a Map |
boolean |
isCachePairwiseResults()
Check if the engine is configured to store the results of the pairwise semantic measure computation. |
void |
setCachePairwiseResults(boolean cachePairwiseResults)
Set the configuration of the engine regarding pairwise semantic measure score caching. |
void |
setICSvalues(ICconf icConf,
Map<org.openrdf.model.URI,Double> ics)
Set the ICS stored for the given IC configuration to the specified set of values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SM_Engine(slib.sglib.model.graph.G g) throws slib.utils.ex.SLIB_Ex_Critic
graph
- the graph associated to the engine.
slib.utils.ex.SLIB_Ex_Critic
Method Detail |
---|
public Set<org.openrdf.model.URI> getAncestorsInc(Set<org.openrdf.model.URI> setClasses)
setClasses
- the set of classes considered
IllegalAccessException
- if the given set contains an URI which
cannot be associated to a classpublic Set<org.openrdf.model.URI> getAncestorsInc(org.openrdf.model.URI v)
v
- the considered class
IllegalAccessException
- if the given URI cannot be associated to a
classpublic Set<org.openrdf.model.URI> getDescendantsInc(org.openrdf.model.URI v)
v
- the considered class
IllegalAccessException
- if the given URI cannot be associated to a
classpublic Set<org.openrdf.model.URI> getParents(org.openrdf.model.URI v)
v
- the focus vertex
IllegalAccessException
- if the given URI cannot be associated to a
classpublic Map<org.openrdf.model.URI,Integer> getMaxDepths() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Integer> getMinDepths() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public double getIC(ICconf icConf, org.openrdf.model.URI v) throws slib.utils.ex.SLIB_Exception
icConf
- The configuration of the information contentv
- the class
IllegalAccessException
- if the given URI cannot be associated to a
class
slib.utils.ex.SLIB_Exception
public int getMaxDepth() throws slib.utils.ex.SLIB_Exception
slib.utils.ex.SLIB_Exception
public org.openrdf.model.URI getRoot() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public double getIC_MICA(ICconf icConf, org.openrdf.model.URI a, org.openrdf.model.URI b) throws slib.utils.ex.SLIB_Exception
icConf
- the configuration of the information contenta
- the first classb
- the second class
slib.utils.ex.SLIB_Exception
- if no common ancestor is found between the two
classes
IllegalAccessException
- if the given URIs cannot be associated to
a classpublic org.openrdf.model.URI getMICA(ICconf icConf, org.openrdf.model.URI a, org.openrdf.model.URI b) throws slib.utils.ex.SLIB_Exception
icConf
- the configuration of the information contenta
- the first classb
- the second class
slib.utils.ex.SLIB_Exception
- if no common ancestor is found between the two
classes
IllegalAccessException
- if the given URIs cannot be associated to
a classpublic Map<org.openrdf.model.URI,Integer> getAllNbDescendantsInc() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getAllDescendantsInc() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getAllAncestorsInc() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Double> getIC_results(ICconf icConf) throws slib.utils.ex.SLIB_Ex_Critic
icConf
- the information content considered.
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Double> computeIC(ICconf icConf) throws slib.utils.ex.SLIB_Ex_Critic
icConf
- the configuration to consider
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getReachableLeaves()
public Set<org.openrdf.model.URI> getTaxonomicLeaves()
public Map<org.openrdf.model.URI,Integer> getAllNbReachableLeaves()
public Map<org.openrdf.model.URI,Integer> getAllNbAncestorsInc() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public double computePairwiseSim(SMconf pairwiseConf, org.openrdf.model.URI a, org.openrdf.model.URI b) throws slib.utils.ex.SLIB_Ex_Critic
pairwiseConf
- the pairwise semantic measure configurationa
- the first vertex/class/conceptb
- the second vertex/class/concept
slib.utils.ex.SLIB_Ex_Critic
IllegalAccessException
- if the given URIs cannot be associated to
classes defined in the graphpublic double computeGroupwiseStandaloneSim(SMconf confGroupwise, Set<org.openrdf.model.URI> setA, Set<org.openrdf.model.URI> setB) throws slib.utils.ex.SLIB_Ex_Critic
confGroupwise
- the direct groupwise semantic measure configurationsetA
- the first set of vertices/classes/conceptssetB
- the first set of vertices/classes/concepts
slib.utils.ex.SLIB_Ex_Critic
IllegalAccessException
- if the given URIs cannot be associated to
classes defined in the graphpublic double computeGroupwiseAddOnSim(SMconf confGroupwise, SMconf confPairwise, Set<org.openrdf.model.URI> setA, Set<org.openrdf.model.URI> setB) throws slib.utils.ex.SLIB_Ex_Critic
confGroupwise
- the pairwise semantic measure configurationconfPairwise
- the indirect aggregation strategy configurationsetA
- the first set of vertices/classes/conceptssetB
- the first set of vertices/classes/concepts
slib.utils.ex.SLIB_Ex_Critic
IllegalAccessException
- if the given URIs cannot be associated to
classes defined in the graphpublic Map<org.openrdf.model.URI,Integer> getnbPathLeadingToAllVertex() throws slib.utils.ex.SLIB_Ex_Critic
slib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Integer> getNbInstancesInferredPropFromCorpus()
public Map<org.openrdf.model.URI,Integer> getNbOccurrenceProp() throws slib.utils.ex.SLIB_Exception
slib.utils.ex.SLIB_Exception
public slib.utils.impl.MatrixDouble<org.openrdf.model.URI,org.openrdf.model.URI> getMatrixScore(Set<org.openrdf.model.URI> setA, Set<org.openrdf.model.URI> setB, SMconf pairwiseConf) throws slib.utils.ex.SLIB_Ex_Critic
setA
- the first set of vertices/classes/conceptssetB
- the second set of vertices/classes/conceptspairwiseConf
- the pairwise semantic measure configuration which
must be used to compute the score of a pair of vertex
slib.utils.ex.SLIB_Ex_Critic
IllegalAccessException
- if the given URIs cannot be associated to a
classpublic boolean isCachePairwiseResults()
public void setCachePairwiseResults(boolean cachePairwiseResults)
cachePairwiseResults
- set to true if the engine must stores the
results.public Map<org.openrdf.model.URI,Double> getVector(Set<org.openrdf.model.URI> set, SMconf groupwiseconf)
set
- groupwiseconf
-
public slib.sglib.model.graph.G getGraph()
public void setICSvalues(ICconf icConf, Map<org.openrdf.model.URI,Double> ics)
icConf
- ics
- public Set<org.openrdf.model.URI> getLCAs(org.openrdf.model.URI a, org.openrdf.model.URI b) throws slib.utils.ex.SLIB_Exception
slib.utils.ex.SLIB_Exception
public slib.sglib.model.graph.weight.GWS getWeightingScheme(String param)
param
- the key corresponding to the id of the weighting scheme to
retrieve
public slib.sglib.algo.graph.extraction.rvf.AncestorEngine getAncestorEngine()
public slib.sglib.algo.graph.extraction.rvf.DescendantEngine getDescendantEngine()
public Set<org.openrdf.model.URI> getClasses()
public Set<org.openrdf.model.URI> getInstances()
public double getShortestPath(org.openrdf.model.URI a, org.openrdf.model.URI b, slib.sglib.model.graph.weight.GWS weightingScheme) throws slib.utils.ex.SLIB_Ex_Critic
a
- b
-
slib.utils.ex.SLIB_Ex_Critic
public org.openrdf.model.URI getMSA(org.openrdf.model.URI a, org.openrdf.model.URI b, slib.sglib.model.graph.weight.GWS weightingScheme) throws slib.utils.ex.SLIB_Ex_Critic
a
- b
-
slib.utils.ex.SLIB_Ex_Critic
IllegalAccessException
- if the given URI cannot be associated to a
classpublic Map<org.openrdf.model.URI,Double> getAllShortestPath(org.openrdf.model.URI a, slib.sglib.model.graph.weight.GWS weightingScheme) throws slib.utils.ex.SLIB_Ex_Critic
a
-
slib.utils.ex.SLIB_Ex_Critic
public double getP_MICA(ICconf conf, org.openrdf.model.URI a, org.openrdf.model.URI b) throws slib.utils.ex.SLIB_Exception
conf
- a
- b
-
slib.utils.ex.SLIB_Exception
IllegalAccessException
- if the given URI cannot be associated to a
classpublic Set<org.openrdf.model.URI> getHypoAncEx(org.openrdf.model.URI a, org.openrdf.model.URI b)
a
- b
-
IllegalAccessException
- if the given URI cannot be associated to a
class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |