packages feed

hydra-pg-0.17.2: src/main/haskell/Com/Gdblab/PathAlgebra/Syntax.hs

-- Note: this is an automatically generated file. Do not edit.

-- | A syntax model for the path algebra grammar by Angles et al. See the paper "Path-based Algebraic Foundations of Graph Query Languages" and the ANTLR grammar at https://github.com/pathalgebra/AlgebraParser

module Com.Gdblab.PathAlgebra.Syntax where

import qualified Hydra.Core as Core
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum)
import qualified Data.Scientific as Sci

-- | An RPQ alternation: either of two sub-expressions
data Alternation =
  Alternation {
    alternationLeft :: Rpq,
    alternationRight :: Rpq}
  deriving (Eq, Ord, Read, Show)

_Alternation = Core.Name "com.gdblab.pathAlgebra.syntax.Alternation"

_Alternation_left = Core.Name "left"

_Alternation_right = Core.Name "right"

-- | A boolean operator combining complex conditions: and or or
data BoolOp =
  BoolOpAnd |
  BoolOpOr
  deriving (Eq, Ord, Read, Show)

_BoolOp = Core.Name "com.gdblab.pathAlgebra.syntax.BoolOp"

_BoolOp_and = Core.Name "and"

_BoolOp_or = Core.Name "or"

-- | A comparison symbol used in a path algebra condition
data CompareSym =
  CompareSymEqual |
  CompareSymNotEqual |
  CompareSymLessThan |
  CompareSymGreaterThan |
  CompareSymLessThanOrEqual |
  CompareSymGreaterThanOrEqual
  deriving (Eq, Ord, Read, Show)

_CompareSym = Core.Name "com.gdblab.pathAlgebra.syntax.CompareSym"

_CompareSym_equal = Core.Name "equal"

_CompareSym_notEqual = Core.Name "notEqual"

_CompareSym_lessThan = Core.Name "lessThan"

_CompareSym_greaterThan = Core.Name "greaterThan"

_CompareSym_lessThanOrEqual = Core.Name "lessThanOrEqual"

_CompareSym_greaterThanOrEqual = Core.Name "greaterThanOrEqual"

-- | A complex condition: a simple condition or a compound of conditions
data ComplexCondition =
  ComplexConditionSimple Condition |
  ComplexConditionCompound CompoundComplexCondition
  deriving (Eq, Ord, Read, Show)

_ComplexCondition = Core.Name "com.gdblab.pathAlgebra.syntax.ComplexCondition"

_ComplexCondition_simple = Core.Name "simple"

_ComplexCondition_compound = Core.Name "compound"

-- | A complex path algebra function taking a name, an inner function, and an additional argument
data ComplexFunction =
  ComplexFunction {
    complexFunctionName :: Text,
    complexFunctionInnerFunction :: Function,
    complexFunctionAdditionalArg :: Text}
  deriving (Eq, Ord, Read, Show)

_ComplexFunction = Core.Name "com.gdblab.pathAlgebra.syntax.ComplexFunction"

_ComplexFunction_name = Core.Name "name"

_ComplexFunction_innerFunction = Core.Name "innerFunction"

_ComplexFunction_additionalArg = Core.Name "additionalArg"

-- | A compound complex condition combining a simple condition and another complex condition with a boolean operator
data CompoundComplexCondition =
  CompoundComplexCondition {
    compoundComplexConditionLhs :: Condition,
    compoundComplexConditionOperator :: BoolOp,
    compoundComplexConditionRhs :: ComplexCondition}
  deriving (Eq, Ord, Read, Show)

_CompoundComplexCondition = Core.Name "com.gdblab.pathAlgebra.syntax.CompoundComplexCondition"

_CompoundComplexCondition_lhs = Core.Name "lhs"

_CompoundComplexCondition_operator = Core.Name "operator"

_CompoundComplexCondition_rhs = Core.Name "rhs"

-- | An RPQ concatenation: two sub-expressions in sequence
data Concatenation =
  Concatenation {
    concatenationLeft :: Rpq,
    concatenationRight :: Rpq}
  deriving (Eq, Ord, Read, Show)

_Concatenation = Core.Name "com.gdblab.pathAlgebra.syntax.Concatenation"

_Concatenation_left = Core.Name "left"

_Concatenation_right = Core.Name "right"

-- | A path algebra condition: a function, a comparison symbol, and a value
data Condition =
  Condition {
    conditionFunction :: Function,
    conditionCompareSym :: CompareSym,
    conditionValue :: Text}
  deriving (Eq, Ord, Read, Show)

_Condition = Core.Name "com.gdblab.pathAlgebra.syntax.Condition"

_Condition_function = Core.Name "function"

_Condition_compareSym = Core.Name "compareSym"

_Condition_value = Core.Name "value"

-- | The direction of an edge pattern: outgoing, incoming, or undirected
data EdgeDirection =
  EdgeDirectionOutgoing |
  EdgeDirectionIncoming |
  EdgeDirectionUndirected
  deriving (Eq, Ord, Read, Show)

_EdgeDirection = Core.Name "com.gdblab.pathAlgebra.syntax.EdgeDirection"

_EdgeDirection_outgoing = Core.Name "outgoing"

_EdgeDirection_incoming = Core.Name "incoming"

_EdgeDirection_undirected = Core.Name "undirected"

-- | A pattern matching an edge, with a direction and an optional regular path query
data EdgePattern =
  EdgePattern {
    edgePatternDirection :: EdgeDirection,
    edgePatternRpq :: (Maybe Rpq)}
  deriving (Eq, Ord, Read, Show)

_EdgePattern = Core.Name "com.gdblab.pathAlgebra.syntax.EdgePattern"

_EdgePattern_direction = Core.Name "direction"

_EdgePattern_rpq = Core.Name "rpq"

-- | A path algebra function: simple, nested, or complex
data Function =
  FunctionSimple SimpleFunction |
  FunctionNested NestedFunction |
  FunctionComplex ComplexFunction
  deriving (Eq, Ord, Read, Show)

_Function = Core.Name "com.gdblab.pathAlgebra.syntax.Function"

_Function_simple = Core.Name "simple"

_Function_nested = Core.Name "nested"

_Function_complex = Core.Name "complex"

-- | A group-by clause, wrapping a group-by option
newtype GroupBy =
  GroupBy {
    unGroupBy :: GroupByOption}
  deriving (Eq, Ord, Read, Show)

_GroupBy = Core.Name "com.gdblab.pathAlgebra.syntax.GroupBy"

-- | The grouping dimension of a group-by clause
data GroupByOption =
  GroupByOptionSource |
  GroupByOptionTarget |
  GroupByOptionLength |
  GroupByOptionSourceTarget |
  GroupByOptionSourceLength |
  GroupByOptionTargetLength |
  GroupByOptionSourceTargetLength
  deriving (Eq, Ord, Read, Show)

_GroupByOption = Core.Name "com.gdblab.pathAlgebra.syntax.GroupByOption"

_GroupByOption_source = Core.Name "source"

_GroupByOption_target = Core.Name "target"

_GroupByOption_length = Core.Name "length"

_GroupByOption_sourceTarget = Core.Name "sourceTarget"

_GroupByOption_sourceLength = Core.Name "sourceLength"

_GroupByOption_targetLength = Core.Name "targetLength"

_GroupByOption_sourceTargetLength = Core.Name "sourceTargetLength"

-- | The group-count projection of a path query: all groups, or a limited number
data GroupProj =
  GroupProjAll |
  GroupProjLimited Number
  deriving (Eq, Ord, Read, Show)

_GroupProj = Core.Name "com.gdblab.pathAlgebra.syntax.GroupProj"

_GroupProj_all = Core.Name "all"

_GroupProj_limited = Core.Name "limited"

-- | An edge label
type Label = String

_Label = Core.Name "com.gdblab.pathAlgebra.syntax.Label"

-- | A nested path algebra function taking a name and an inner function
data NestedFunction =
  NestedFunction {
    nestedFunctionName :: Text,
    nestedFunctionInnerFunction :: Function}
  deriving (Eq, Ord, Read, Show)

_NestedFunction = Core.Name "com.gdblab.pathAlgebra.syntax.NestedFunction"

_NestedFunction_name = Core.Name "name"

_NestedFunction_innerFunction = Core.Name "innerFunction"

-- | A pattern matching a node, with an optional binding variable
data NodePattern =
  NodePattern {
    nodePatternVariable :: (Maybe Variable)}
  deriving (Eq, Ord, Read, Show)

_NodePattern = Core.Name "com.gdblab.pathAlgebra.syntax.NodePattern"

_NodePattern_variable = Core.Name "variable"

-- | A numeric literal
type Number = Integer

_Number = Core.Name "com.gdblab.pathAlgebra.syntax.Number"

-- | An order-by clause, wrapping an order-by option
newtype OrderBy =
  OrderBy {
    unOrderBy :: OrderByOption}
  deriving (Eq, Ord, Read, Show)

_OrderBy = Core.Name "com.gdblab.pathAlgebra.syntax.OrderBy"

-- | The ordering dimension of an order-by clause
data OrderByOption =
  OrderByOptionPartition |
  OrderByOptionGroup |
  OrderByOptionPath |
  OrderByOptionPartitionGroup |
  OrderByOptionPartitionPath |
  OrderByOptionGroupPath |
  OrderByOptionPartitionGroupPath
  deriving (Eq, Ord, Read, Show)

_OrderByOption = Core.Name "com.gdblab.pathAlgebra.syntax.OrderByOption"

_OrderByOption_partition = Core.Name "partition"

_OrderByOption_group = Core.Name "group"

_OrderByOption_path = Core.Name "path"

_OrderByOption_partitionGroup = Core.Name "partitionGroup"

_OrderByOption_partitionPath = Core.Name "partitionPath"

_OrderByOption_groupPath = Core.Name "groupPath"

_OrderByOption_partitionGroupPath = Core.Name "partitionGroupPath"

-- | The path-count projection of a path query: all paths, or a limited number
data PartProj =
  PartProjAll |
  PartProjLimited Number
  deriving (Eq, Ord, Read, Show)

_PartProj = Core.Name "com.gdblab.pathAlgebra.syntax.PartProj"

_PartProj_all = Core.Name "all"

_PartProj_limited = Core.Name "limited"

-- | The name bound to a matched path
type PathName = String

_PathName = Core.Name "com.gdblab.pathAlgebra.syntax.PathName"

-- | A pattern matching a path: a name, start node, edge, end node, and an optional condition
data PathPattern =
  PathPattern {
    pathPatternPathName :: PathName,
    pathPatternStartNode :: NodePattern,
    pathPatternEdge :: EdgePattern,
    pathPatternEndNode :: NodePattern,
    pathPatternCondition :: (Maybe ComplexCondition)}
  deriving (Eq, Ord, Read, Show)

_PathPattern = Core.Name "com.gdblab.pathAlgebra.syntax.PathPattern"

_PathPattern_pathName = Core.Name "pathName"

_PathPattern_startNode = Core.Name "startNode"

_PathPattern_edge = Core.Name "edge"

_PathPattern_endNode = Core.Name "endNode"

_PathPattern_condition = Core.Name "condition"

-- | The path projection of a path query: all paths, or a limited number
data PathProj =
  PathProjAll |
  PathProjLimited Number
  deriving (Eq, Ord, Read, Show)

_PathProj = Core.Name "com.gdblab.pathAlgebra.syntax.PathProj"

_PathProj_all = Core.Name "all"

_PathProj_limited = Core.Name "limited"

-- | A path algebra query: a projection, optional restrictor, path pattern, and optional grouping/ordering
data PathQuery =
  PathQuery {
    pathQueryProjection :: Projection,
    pathQueryRestrictorExt :: (Maybe RestrictorExt),
    pathQueryPathPattern :: PathPattern,
    pathQueryGroupBy :: (Maybe GroupBy),
    pathQueryOrderBy :: (Maybe OrderBy)}
  deriving (Eq, Ord, Read, Show)

_PathQuery = Core.Name "com.gdblab.pathAlgebra.syntax.PathQuery"

_PathQuery_projection = Core.Name "projection"

_PathQuery_restrictorExt = Core.Name "restrictorExt"

_PathQuery_pathPattern = Core.Name "pathPattern"

_PathQuery_groupBy = Core.Name "groupBy"

_PathQuery_orderBy = Core.Name "orderBy"

-- | An RPQ one-or-more repetition of a sub-expression, with an optional restrictor
data Plus =
  Plus {
    plusExpression :: Rpq,
    plusRestrictor :: (Maybe RpqRestrictor)}
  deriving (Eq, Ord, Read, Show)

_Plus = Core.Name "com.gdblab.pathAlgebra.syntax.Plus"

_Plus_expression = Core.Name "expression"

_Plus_restrictor = Core.Name "restrictor"

-- | The projection of a path query: part, group, and path projections
data Projection =
  Projection {
    projectionPartProj :: PartProj,
    projectionGroupProj :: GroupProj,
    projectionPathProj :: PathProj}
  deriving (Eq, Ord, Read, Show)

_Projection = Core.Name "com.gdblab.pathAlgebra.syntax.Projection"

_Projection_partProj = Core.Name "partProj"

_Projection_groupProj = Core.Name "groupProj"

_Projection_pathProj = Core.Name "pathProj"

-- | A path restrictor: walk, trail, simple, acyclic, or shortest
data RestrictorExt =
  RestrictorExtWalk |
  RestrictorExtTrail |
  RestrictorExtSimple |
  RestrictorExtAcyclic |
  RestrictorExtShortest
  deriving (Eq, Ord, Read, Show)

_RestrictorExt = Core.Name "com.gdblab.pathAlgebra.syntax.RestrictorExt"

_RestrictorExt_walk = Core.Name "walk"

_RestrictorExt_trail = Core.Name "trail"

_RestrictorExt_simple = Core.Name "simple"

_RestrictorExt_acyclic = Core.Name "acyclic"

_RestrictorExt_shortest = Core.Name "shortest"

-- | A regular path query expression
data Rpq =
  RpqParenthesis Rpq |
  RpqLabel Label |
  RpqNegated Label |
  RpqReverse Label |
  RpqOptional Rpq |
  RpqPlus Plus |
  RpqStar Star |
  RpqConcatenation Concatenation |
  RpqAlternation Alternation
  deriving (Eq, Ord, Read, Show)

_Rpq = Core.Name "com.gdblab.pathAlgebra.syntax.Rpq"

_Rpq_parenthesis = Core.Name "parenthesis"

_Rpq_label = Core.Name "label"

_Rpq_negated = Core.Name "negated"

_Rpq_reverse = Core.Name "reverse"

_Rpq_optional = Core.Name "optional"

_Rpq_plus = Core.Name "plus"

_Rpq_star = Core.Name "star"

_Rpq_concatenation = Core.Name "concatenation"

_Rpq_alternation = Core.Name "alternation"

-- | A restrictor applied to a regular path query, wrapping a restrictor extension
newtype RpqRestrictor =
  RpqRestrictor {
    unRpqRestrictor :: RestrictorExt}
  deriving (Eq, Ord, Read, Show)

_RpqRestrictor = Core.Name "com.gdblab.pathAlgebra.syntax.RpqRestrictor"

-- | A simple path algebra function taking a name and a single argument
data SimpleFunction =
  SimpleFunction {
    simpleFunctionName :: Text,
    simpleFunctionArgument :: Text}
  deriving (Eq, Ord, Read, Show)

_SimpleFunction = Core.Name "com.gdblab.pathAlgebra.syntax.SimpleFunction"

_SimpleFunction_name = Core.Name "name"

_SimpleFunction_argument = Core.Name "argument"

-- | An RPQ zero-or-more repetition of a sub-expression, with an optional restrictor
data Star =
  Star {
    starExpression :: Rpq,
    starRestrictor :: (Maybe RpqRestrictor)}
  deriving (Eq, Ord, Read, Show)

_Star = Core.Name "com.gdblab.pathAlgebra.syntax.Star"

_Star_expression = Core.Name "expression"

_Star_restrictor = Core.Name "restrictor"

-- | A text literal
type Text = String

_Text = Core.Name "com.gdblab.pathAlgebra.syntax.Text"

-- | A variable name bound in a path pattern
type Variable = String

_Variable = Core.Name "com.gdblab.pathAlgebra.syntax.Variable"