slib.sglib.algo.graph.utils
Class RooterDAG
java.lang.Object
slib.sglib.algo.graph.utils.RooterDAG
public class RooterDAG
- extends Object
Object used to root a graph taking into consideration edge types defining
roots.
- Author:
- Sebastien Harispe
Method Summary |
static org.openrdf.model.URI |
rootUnderlyingDAG(slib.sglib.model.graph.G g,
org.openrdf.model.URI rootUri,
slib.sglib.model.graph.utils.WalkConstraint wc,
boolean checkUnderlyingDAG)
Add a unique root to a DAG (underlying DAG) composed of multiple roots. |
static org.openrdf.model.URI |
rootUnderlyingTaxonomicDAG(slib.sglib.model.graph.G g,
org.openrdf.model.URI rootUri)
Root the underlying taxonomic DAG of the specified graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RooterDAG
public RooterDAG()
rootUnderlyingDAG
public static org.openrdf.model.URI rootUnderlyingDAG(slib.sglib.model.graph.G g,
org.openrdf.model.URI rootUri,
slib.sglib.model.graph.utils.WalkConstraint wc,
boolean checkUnderlyingDAG)
throws slib.utils.ex.SLIB_Ex_Critic
- Add a unique root to a DAG (underlying DAG) composed of multiple roots.
The processed graph must be/contains a DAG according to a specified
set of edge type here called EtypeDAG. In other words the reduction of
the given graph build only considering the edges (and the involved nodes)
of a type contained in EtypeDAG must be a DAG. This reduction of the
given graph is here called the underlying DAG (uDAG). Roots are defined
as all terminal vertices of the uDAG according to invEtypeDAG the inverse
of set of edge type composing EtypeDAG i.e. vertices of uDAG without out
edges of a type contained in invEtypeDAG. i.e. vertices without out edges
of type EtypeRoot. uDAG is then ensured to be connected (more
about) after processing if uDAG is already rooted no treatment
performed, specified root is not added and the current root URI is
returned
Example
input G a cyclic graph containing multiple taxonomic
graphs (DAG considering SUPERCLASSOF/SUBCLASSOF relationships)
EtypeDAG = SUPERCLASSOF
uDAG the unconnected graph composed of the underlying taxonomic graphs
invEtypeDAG = SUBCLASSOF
roots : all uDAG graphs which are
not subsumed by a vertex
process -> add a subsuming vertex
(rootURI) for each vertices in roots if the set of root is upper than 1
(no unique root)
- Parameters:
g
- the graph to rootetypeDAG
- the set of edge types used to detect the underlying DAG.
The inverse of etypeDAG is used to detect uDAG roots.checkUnderlyingDAG
- if true DAG conformity of the underlying graph
induced by etypeDAG is checked. If checkUnderlyingDAG is set to true and
uDAG DAG property is not validated an critical exception is
thrown.rootUri
- dir
-
- Returns:
- the URI of the root
- Throws:
slib.utils.ex.SLIB_Ex_Critic
rootUnderlyingTaxonomicDAG
public static org.openrdf.model.URI rootUnderlyingTaxonomicDAG(slib.sglib.model.graph.G g,
org.openrdf.model.URI rootUri)
throws slib.utils.ex.SLIB_Ex_Critic
- Root the underlying taxonomic DAG of the specified graph.
- Parameters:
g
- rootUri
-
- Returns:
- the URI of the root
- Throws:
slib.utils.ex.SLIB_Ex_Critic
- See Also:
RooterDAG#rootUnderlyingDAG(G, Set, boolean, URI)
Copyright © 2013. All Rights Reserved.