slib.sglib.algo.graph.extraction.rvf
Class RVF_DAG
java.lang.Object
slib.sglib.algo.graph.extraction.rvf.RVF
slib.sglib.algo.graph.extraction.rvf.RVF_DAG
- Direct Known Subclasses:
- RVF_TAX
public class RVF_DAG
- extends RVF
Object of this class can be used to retrieve the vertices reachable from a
particular vertex of an acyclic graph considering particular relationships
i.e. EdgeTypes
- Author:
- Sebastien Harispe
Fields inherited from class slib.sglib.algo.graph.extraction.rvf.RVF |
g, wc |
Constructor Summary |
RVF_DAG(slib.sglib.model.graph.G g,
slib.sglib.model.graph.utils.WalkConstraint wc)
Create a basic RVF object considering an acyclic graph and a only one
type of relationships to consider during the traversal. |
Method Summary |
Map<org.openrdf.model.URI,Integer> |
computeNbPathLeadingToAllVertices()
|
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
getAllRV()
Compute the set of reachable vertices for each vertices contained in the
graph according to the specified constraint associated to the instance in
use. |
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
getTerminalVertices()
Return the set of terminal vertices (leaves) reachable for all vertices
composing the loaded graph |
Map<org.openrdf.model.URI,Integer> |
propagateNbOccurences(Map<org.openrdf.model.URI,Integer> nbOccurrence)
Method used to compute the number of occurrences associated to each
vertex after the propagation of the given number of occurences. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RVF_DAG
public RVF_DAG(slib.sglib.model.graph.G g,
slib.sglib.model.graph.utils.WalkConstraint wc)
- Create a basic RVF object considering an acyclic graph and a only one
type of relationships to consider during the traversal. Note that graph
acyclicity is required to ensure coherency but is not evaluated.
- Parameters:
g
- the Semantic Graph to considerwc
- the walk constraint defining the way to reach the vertices
which must be returned by the objectacceptIncoherences
- define if an error must be thrown if an
incoherence is detected. An incoherence can be detected if no topological
order can be obtained with regard to the specified walk constraints, i.e.
if the subgraph defined by the walk constraints is not a Directed Acyclic
Graph (DAG). Indeed, this class take advantage of optimizations which can
only be applied to DAG. If you accept incoherences only a warning will be
logged, if you don't, an exception will be thrown if any incoherence is
detected. Accepting incoherences can lead to highly incoherent results,
special cares must be taken. DO NOT set this parameter to true if you
don't understand the implications.
getAllRV
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getAllRV()
throws slib.utils.ex.SLIB_Ex_Critic
- Compute the set of reachable vertices for each vertices contained in the
graph according to the specified constraint associated to the instance in
use. Exclusive process, i.e. the process doesn't consider that vertex v
is contained in the set of reachable vertices from v.
Optimized through a topological ordering
- Returns:
- an Map key V value the set of vertices reachable from the key
- Throws:
slib.utils.ex.SLIB_Ex_Critic
getTerminalVertices
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getTerminalVertices()
- Return the set of terminal vertices (leaves) reachable for all vertices
composing the loaded graph
- Returns:
- an HashMap key V, value the set of terminal vertices reachable
from the key Set
computeNbPathLeadingToAllVertices
public Map<org.openrdf.model.URI,Integer> computeNbPathLeadingToAllVertices()
throws slib.utils.ex.SLIB_Ex_Critic
- Returns:
- @throws SLIB_Ex_Critic
- Throws:
slib.utils.ex.SLIB_Ex_Critic
propagateNbOccurences
public Map<org.openrdf.model.URI,Integer> propagateNbOccurences(Map<org.openrdf.model.URI,Integer> nbOccurrence)
throws slib.utils.ex.SLIB_Ex_Critic
- Method used to compute the number of occurrences associated to each
vertex after the propagation of the given number of occurences. The
occurrence number are propagated considering a walk defined by the
relationships loaded. A number of occurrences is associated to each
vertices of the graph through the given inputs. The occurrences number
are then summed considering walks starting from the terminal vertices.
- Parameters:
nbOccurrence
- ResultStack of type Double representing the number of
occurrences of each vertices
- Returns:
- ResultStack of type Double representing the number occurrences
propagated of each vertices
- Throws:
slib.utils.ex.SLIB_Ex_Critic
Copyright © 2013. All Rights Reserved.