Returns true if there is a cycle in the graph, i.e.
Returns true if there is a cycle in the graph, i.e. either
- there is a path n1 -> n2 -> ... -> n1 or - a loop, i.e. an edge that connects a vertex to itself.
Applies topological sort and returns the resulting layers.
Applies topological sort and returns the resulting layers. Each layer contains its level and a set of rules.
the layers
Returns all nodes that are connected by an edge to itself.
(Changed in version 2.8.0) Set.map now returns a Set, so it will discard duplicate values.
a simple string representation of this graph
This converts the graph-specific inner nodes to its corresponding outer nodes which may exist outside a graph context.
This converts the graph-specific inner nodes to its corresponding outer nodes which may exist outside a graph context.
the set of rules contained in this graph
(Changed in version 2.9.0) The behavior of scanRight has changed. The previous behavior can be reproduced with scanRight.reverse.
(Changed in version 2.9.0) transpose throws an IllegalArgumentException if collections are not uniformly sized.
Given a set of rules R, a rule dependency graph (RDG) is a directed graph G = (V, E) such that
The dependency between two rules r_i and r_j, denoted as r_i -> r_j, resp. "r_i depends on r_j" indicates that the result of r_j is used as input of r_i. In particular, that means we use the same direction in the graph although one would expect to have an edge from the rule r_j producing the data to the rule r_i consuming the data.
Some notes about the types used: The Rule class stems from org.apache.jena.reasoner.rulesys and comprises a list of antecedents (body) and a list of consequents (head), i.e.
consequent [, consequent] <- antecedent [, antecedent]
where each consequent or antecedent can be a TriplePattern (i.e. a triple of Nodes, themselves being either variables, wildcards, embedded functors, uri or literal graph nodes), a Functor or a Rule.
The Graph and LDiEdge ('labeled directed edge') classes stem from scalax.collection which provides the main graph functionality. Considering a scalax.collection.Graph two kinds of Nodes are distinguished:
- Outer Nodes Outer nodes exist outside of the context of any particular graph and must be provided by the library user. When added to a graph, they will be transparently wrapped by a corresponding inner node. Outer nodes must satisfy the upper bound of the node type parameter of the graph - Inner Nodes Inner nodes are objects bound to a particular graph. They are transparently created on graph instantiation or on adding nodes to a graph. Inner nodes are instances of the inner class NodeT, hence the term, and are implementing the InnerNodeLike interface. An inner node acts as a container of the corresponding outer node also providing a wealth of graph functionality such as diSuccessors or pathTo. Inner nodes always equal to the contained, user-provided outer node thus facilitating interchangeability of inner and outer nodes in many situations. Note that NodeT is a path dependent type such as g.NodeT with g denoting a single graph instance.
(Descriptions taken from http://www.scala-graph.org/guides/core-inner-outer.html)