Package org.partiql.lang.graph

Types

Link copied to clipboard
enum DirSpec : Enum<DirSpec>

Specification of an edge direction. The boolean fields at the enum values capture their semantics in a way that is useful for "compiling" them to graph scans.

Link copied to clipboard
data class EdgeSpec(binder: Variable?, label: LabelSpec, dir: DirSpec) : ElemSpec
Link copied to clipboard
sealed class ElemSpec
Link copied to clipboard
abstract class ExternalGraphException(message: String) : RuntimeException
Link copied to clipboard
object ExternalGraphReader

A validator and reader for external graphs represented in Ion in accordance with the graph.isl schema.

Link copied to clipboard
object GpmlTranslator

Translate an AST graph pattern into a "plan spec" to be executed by the graph engine. Currently, the only non-trivial aspect is making sure (in normalizeElemList) that node and edge elements alternate. This (as well as the plan specs) is expected to become more sophisticated as more graph pattern features are supported (esp. quantifiers and alternation).

Link copied to clipboard
interface Graph

This is an "external" interface to a graph data value, providing functionality needed for a pattern-matching processor. The intent is to come up with something that can be implemented by different "platforms" in different ways. There are only minimal assumptions about the underlying implementation of graph nodes and edges: they must provide access to labels and payloads and the == equality must distinguish and equate them properly. In particular, there is no node-edge-node "pointer" navigation. The graph's structure is exposed only through the "scan" functions for getting adjacent nodes and edges satisfying certain criteria.

Link copied to clipboard
object GraphEngine
Link copied to clipboard
class GraphIonException(message: String) : ExternalGraphException
Link copied to clipboard
class GraphReadException(message: String) : ExternalGraphException
Link copied to clipboard
class GraphValidationException(message: String) : ExternalGraphException
Link copied to clipboard
sealed class LabelSpec

Label specifications for selecting graph elements (nodes or edges) based on labels at them.

Link copied to clipboard
data class MatchResult(specs: List<StrideSpec>, result: List<List<Stride>>)

The result of matching specs, a list of stride specs derived from a list of path patterns. The result is a "table" where each "column" is headed by a stride spec from specs and contains matching strides. That is, each row contains strides matching each stride spec.

Link copied to clipboard
data class MatchSpec(strides: List<StrideSpec>)

Translation of a graph match pattern -- a collection of path patterns -- into a "plan" for GraphEngine.

Link copied to clipboard
data class NodeSpec(binder: Variable?, label: LabelSpec) : ElemSpec
Link copied to clipboard

A straightforward implementation of in-memory graphs.

Link copied to clipboard
data class StepSpec(dirSpec: DirSpec, tripleSpec: Triple<LabelSpec, LabelSpec, LabelSpec>)

A step in a graph is a triple of adjacent node, edge, node. A StepSpec describes a set of steps of interest.

Link copied to clipboard
data class Stride(elems: List<Graph.Elem>)

A stride is a sequence like node, edge, node, edge, ..., node that is, strictly alternating nodes and edges, starting and ending with a node. It is used as an intermediate step in computing path matches.

Link copied to clipboard
data class StrideJoin(left: StrideTree, right: StrideTree) : StrideTree
Link copied to clipboard
data class StrideLeaf(stride: StrideSpec) : StrideTree
Link copied to clipboard
data class StrideResult(spec: StrideSpec, result: Set<Stride>)

The result of matching a StrideSpec in a graph. Each Stride in result is one valid match for spec. Keeping spec within the result is for maintaining the association between Variables and graph elements in result that the variables matched.

Link copied to clipboard
data class StrideSpec(elems: List<ElemSpec>)

Translation of a path pattern into a "plan" for GraphEngine.

Link copied to clipboard
sealed class StrideTree

A StrideTree is a plan for computing matches for a stride. Joins needed to compute a stride can be performed in different orders; a StrideTree represents a chosen order.

Link copied to clipboard
typealias Variable = String

A variable in a graph pattern binding a node or an edge.