packages feed

hydra-pg-0.18.0: src/main/haskell/Hydra/Pg/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 Hydra.Pg.Gdblab.PathAlgebra.Syntax where

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

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

_Alternation = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Alternation"

_Alternation_left = Model.Name "left"

_Alternation_right = Model.Name "right"

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

_BoolOp = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.BoolOp"

_BoolOp_and = Model.Name "and"

_BoolOp_or = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.CompareSym"

_CompareSym_equal = Model.Name "equal"

_CompareSym_notEqual = Model.Name "notEqual"

_CompareSym_lessThan = Model.Name "lessThan"

_CompareSym_greaterThan = Model.Name "greaterThan"

_CompareSym_lessThanOrEqual = Model.Name "lessThanOrEqual"

_CompareSym_greaterThanOrEqual = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.ComplexCondition"

_ComplexCondition_simple = Model.Name "simple"

_ComplexCondition_compound = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.ComplexFunction"

_ComplexFunction_name = Model.Name "name"

_ComplexFunction_innerFunction = Model.Name "innerFunction"

_ComplexFunction_additionalArg = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.CompoundComplexCondition"

_CompoundComplexCondition_lhs = Model.Name "lhs"

_CompoundComplexCondition_operator = Model.Name "operator"

_CompoundComplexCondition_rhs = Model.Name "rhs"

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

_Concatenation = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Concatenation"

_Concatenation_left = Model.Name "left"

_Concatenation_right = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Condition"

_Condition_function = Model.Name "function"

_Condition_compareSym = Model.Name "compareSym"

_Condition_value = Model.Name "value"

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

_EdgeDirection = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.EdgeDirection"

_EdgeDirection_outgoing = Model.Name "outgoing"

_EdgeDirection_incoming = Model.Name "incoming"

_EdgeDirection_undirected = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.EdgePattern"

_EdgePattern_direction = Model.Name "direction"

_EdgePattern_rpq = Model.Name "rpq"

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

_Function = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Function"

_Function_simple = Model.Name "simple"

_Function_nested = Model.Name "nested"

_Function_complex = Model.Name "complex"

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

_GroupBy = Model.Name "hydra.pg.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.GroupByOption"

_GroupByOption_source = Model.Name "source"

_GroupByOption_target = Model.Name "target"

_GroupByOption_length = Model.Name "length"

_GroupByOption_sourceTarget = Model.Name "sourceTarget"

_GroupByOption_sourceLength = Model.Name "sourceLength"

_GroupByOption_targetLength = Model.Name "targetLength"

_GroupByOption_sourceTargetLength = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.GroupProj"

_GroupProj_all = Model.Name "all"

_GroupProj_limited = Model.Name "limited"

-- | An edge label
type Label = String

_Label = Model.Name "hydra.pg.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.NestedFunction"

_NestedFunction_name = Model.Name "name"

_NestedFunction_innerFunction = Model.Name "innerFunction"

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

_NodePattern = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.NodePattern"

_NodePattern_variable = Model.Name "variable"

-- | A numeric literal
type Number = Integer

_Number = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Number"

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

_OrderBy = Model.Name "hydra.pg.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.OrderByOption"

_OrderByOption_partition = Model.Name "partition"

_OrderByOption_group = Model.Name "group"

_OrderByOption_path = Model.Name "path"

_OrderByOption_partitionGroup = Model.Name "partitionGroup"

_OrderByOption_partitionPath = Model.Name "partitionPath"

_OrderByOption_groupPath = Model.Name "groupPath"

_OrderByOption_partitionGroupPath = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.PartProj"

_PartProj_all = Model.Name "all"

_PartProj_limited = Model.Name "limited"

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

_PathName = Model.Name "hydra.pg.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.PathPattern"

_PathPattern_pathName = Model.Name "pathName"

_PathPattern_startNode = Model.Name "startNode"

_PathPattern_edge = Model.Name "edge"

_PathPattern_endNode = Model.Name "endNode"

_PathPattern_condition = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.PathProj"

_PathProj_all = Model.Name "all"

_PathProj_limited = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.PathQuery"

_PathQuery_projection = Model.Name "projection"

_PathQuery_restrictorExt = Model.Name "restrictorExt"

_PathQuery_pathPattern = Model.Name "pathPattern"

_PathQuery_groupBy = Model.Name "groupBy"

_PathQuery_orderBy = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Plus"

_Plus_expression = Model.Name "expression"

_Plus_restrictor = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Projection"

_Projection_partProj = Model.Name "partProj"

_Projection_groupProj = Model.Name "groupProj"

_Projection_pathProj = Model.Name "pathProj"

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

_RestrictorExt = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.RestrictorExt"

_RestrictorExt_walk = Model.Name "walk"

_RestrictorExt_trail = Model.Name "trail"

_RestrictorExt_simple = Model.Name "simple"

_RestrictorExt_acyclic = Model.Name "acyclic"

_RestrictorExt_shortest = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Rpq"

_Rpq_parenthesis = Model.Name "parenthesis"

_Rpq_label = Model.Name "label"

_Rpq_negated = Model.Name "negated"

_Rpq_reverse = Model.Name "reverse"

_Rpq_optional = Model.Name "optional"

_Rpq_plus = Model.Name "plus"

_Rpq_star = Model.Name "star"

_Rpq_concatenation = Model.Name "concatenation"

_Rpq_alternation = Model.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 = Model.Name "hydra.pg.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.SimpleFunction"

_SimpleFunction_name = Model.Name "name"

_SimpleFunction_argument = Model.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 = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Star"

_Star_expression = Model.Name "expression"

_Star_restrictor = Model.Name "restrictor"

-- | A text literal
type Text = String

_Text = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Text"

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

_Variable = Model.Name "hydra.pg.gdblab.pathAlgebra.syntax.Variable"