GraphEngine

object GraphEngine

Functions

Link copied to clipboard
fun evaluate(graph: Graph, matchSpec: MatchSpec): MatchResult

The entry point for computing a graph pattern (translated to the MatchSpec "plan") against a graph.

Link copied to clipboard
fun Graph.getMatchingSteps(spec: StepSpec): List<Triple<Graph.Node, Graph.Edge, Graph.Node>>

Compute any StepSpec (an elementary node-edge-node path, in any direction), by combining the scan methods from Graph. TODO: Consider making this method as the API of Graph, as it is, by itself, tirned out to be sufficient, so far as a "window" in a graph for the needs of this engine's implementation.

Link copied to clipboard
fun joinAdjacentStrides(left: StrideResult, right: StrideResult): StrideResult
Link copied to clipboard
fun joinStridesOnBinders(strides: List<StrideResult>): MatchResult

Joins results of stride matches on distinct path patterns of a graph pattern. In general, this is a cartesian product, but it is whittled down by the requirement that a given binder variable binds to the same graph element in each individual answer.

Link copied to clipboard
fun stridesJoinable(leftSpec: StrideSpec, rightSpec: StrideSpec): (Stride, Stride) -> Boolean

Given two StrideSpecs for adjacent strides, formulate a predicate for checking whether two adjacent strides are joinable. They are joinable if