public class SM_Engine extends Object
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 and Description |
---|
SM_Engine(slib.sglib.model.graph.G g)
Constructor of an engine associated to the given graph.
|
Modifier and Type | Method and Description |
---|---|
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(boolean addAnInstanceToEachTerminalClass)
Computes the number of instances which is associated to all the classes
which are defined in the graph (with inferences).
|
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.
|
Set<org.openrdf.model.URI> |
getReachableLeaves(org.openrdf.model.URI uri)
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.
|
public SM_Engine(slib.sglib.model.graph.G g) throws slib.utils.ex.SLIB_Ex_Critic
g
- the graph associated to the engine.slib.utils.ex.SLIB_Ex_Critic
public Set<org.openrdf.model.URI> getAncestorsInc(Set<org.openrdf.model.URI> setClasses)
setClasses
- the set of classes consideredpublic Set<org.openrdf.model.URI> getAncestorsInc(org.openrdf.model.URI v)
v
- the considered classpublic Set<org.openrdf.model.URI> getDescendantsInc(org.openrdf.model.URI v)
v
- the considered classpublic Set<org.openrdf.model.URI> getParents(org.openrdf.model.URI v)
v
- the focus vertexpublic 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 classslib.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 classslib.utils.ex.SLIB_Exception
- if no common ancestor is found between the two
classespublic 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 classslib.utils.ex.SLIB_Exception
- if no common ancestor is found between the two
classespublic 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 considerslib.utils.ex.SLIB_Ex_Critic
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getReachableLeaves()
public Set<org.openrdf.model.URI> getReachableLeaves(org.openrdf.model.URI uri)
uri
- 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/conceptslib.utils.ex.SLIB_Ex_Critic
public 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/conceptsslib.utils.ex.SLIB_Ex_Critic
public 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/conceptsslib.utils.ex.SLIB_Ex_Critic
public 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(boolean addAnInstanceToEachTerminalClass)
addAnInstanceToEachTerminalClass
- if true, each class which doesn't
subsumes any other classes is assumed to have an instance which is only
an instance of this class (without considering inference). This can be
required to ensure that the number of instances associated to a class is
never equal to 0.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 vertexslib.utils.ex.SLIB_Ex_Critic
public 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
retrievepublic 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
- weightingScheme
- 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
- weightingScheme
- slib.utils.ex.SLIB_Ex_Critic
public 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
- weightingScheme
- 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
public Set<org.openrdf.model.URI> getHypoAncEx(org.openrdf.model.URI a, org.openrdf.model.URI b)
a
- b
- Copyright © 2014. All rights reserved.