{-# LANGUAGE OverloadedStrings #-}

module Hydra.Impl.Haskell.Sources.Ext.Tinkerpop.V3 where

import Hydra.Impl.Haskell.Sources.Core

import Hydra.All
import Hydra.Impl.Haskell.Dsl.Types as Types
import Hydra.Impl.Haskell.Dsl.Standard


tinkerpopV3Module :: Module Meta
tinkerpopV3Module :: Module Meta
tinkerpopV3Module = forall m.
Namespace -> [Element m] -> [Module m] -> Maybe String -> Module m
Module Namespace
ns [Element Meta]
elements [Module Meta
hydraCoreModule] forall a b. (a -> b) -> a -> b
$
    forall a. a -> Maybe a
Just String
"A simple TinkerPop version 3 syntax model"
  where
    ns :: Namespace
ns = String -> Namespace
Namespace String
"hydra/ext/tinkerpop/v3"
    core :: String -> Type m
core = forall m. Namespace -> String -> Type m
nsref forall a b. (a -> b) -> a -> b
$ forall m. Module m -> Namespace
moduleNamespace Module Meta
hydraCoreModule
    v3 :: String -> Type m
v3 = forall m. Namespace -> String -> Type m
nsref Namespace
ns
    def :: String -> Type m -> Element m
def = forall m. Namespace -> String -> Type m -> Element m
datatype Namespace
ns

    elements :: [Element Meta]
elements = [

      forall {m}. String -> Type m -> Element m
def String
"Edge" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"An edge" forall a b. (a -> b) -> a -> b
$
        forall m. String -> Type m -> Type m
lambda String
"v" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"e" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"p" forall a b. (a -> b) -> a -> b
$
        forall m. [FieldType m] -> Type m
record [
          String
"label"forall m. String -> Type m -> FieldType m
>: forall {m}. String -> Type m
v3 String
"EdgeLabel",
          String
"id"forall m. String -> Type m -> FieldType m
>: Type Meta
"e",
          String
"out"forall m. String -> Type m -> FieldType m
>: Type Meta
"v",
          String
"in"forall m. String -> Type m -> FieldType m
>: Type Meta
"v",
          String
"properties"forall m. String -> Type m -> FieldType m
>: forall m. Type m -> Type m -> Type m
Types.map (forall {m}. String -> Type m
v3 String
"PropertyKey") Type Meta
"p"],

      forall {m}. String -> Type m -> Element m
def String
"EdgeLabel" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"The (required) label of an edge" forall a b. (a -> b) -> a -> b
$
        forall m. Type m
string,

      forall {m}. String -> Type m -> Element m
def String
"Element" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"Either a vertex or an edge" forall a b. (a -> b) -> a -> b
$
        forall m. String -> Type m -> Type m
lambda String
"v" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"e" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"p" forall a b. (a -> b) -> a -> b
$
        forall m. [FieldType m] -> Type m
union [
          String
"vertex"forall m. String -> Type m -> FieldType m
>: forall {m}. String -> Type m
v3 String
"Vertex" forall m. Type m -> Type m -> Type m
@@ Type Meta
"v" forall m. Type m -> Type m -> Type m
@@ Type Meta
"p",
          String
"edge"forall m. String -> Type m -> FieldType m
>: forall {m}. String -> Type m
v3 String
"Edge" forall m. Type m -> Type m -> Type m
@@ Type Meta
"v" forall m. Type m -> Type m -> Type m
@@ Type Meta
"e" forall m. Type m -> Type m -> Type m
@@ Type Meta
"p"],

      forall {m}. String -> Type m -> Element m
def String
"Graph" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"A graph; a self-contained collection of vertices and edges" forall a b. (a -> b) -> a -> b
$
        forall m. String -> Type m -> Type m
lambda String
"v" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"e" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"p" forall a b. (a -> b) -> a -> b
$
        forall m. [FieldType m] -> Type m
record [
          String
"vertices"forall m. String -> Type m -> FieldType m
>: forall m. Type m -> Type m
Types.set forall a b. (a -> b) -> a -> b
$ forall {m}. String -> Type m
v3 String
"Vertex" forall m. Type m -> Type m -> Type m
@@ Type Meta
"v" forall m. Type m -> Type m -> Type m
@@ Type Meta
"p",
          String
"edges"forall m. String -> Type m -> FieldType m
>: forall m. Type m -> Type m
Types.set forall a b. (a -> b) -> a -> b
$ forall {m}. String -> Type m
v3 String
"Edge" forall m. Type m -> Type m -> Type m
@@ Type Meta
"v" forall m. Type m -> Type m -> Type m
@@ Type Meta
"e" forall m. Type m -> Type m -> Type m
@@ Type Meta
"p"],

      forall {m}. String -> Type m -> Element m
def String
"Property" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"A key/value property" forall a b. (a -> b) -> a -> b
$
        forall m. String -> Type m -> Type m
lambda String
"p" forall a b. (a -> b) -> a -> b
$
        forall m. [FieldType m] -> Type m
record [
          String
"key"forall m. String -> Type m -> FieldType m
>: forall {m}. String -> Type m
v3 String
"PropertyKey",
          String
"value"forall m. String -> Type m -> FieldType m
>: Type Meta
"p"],

      forall {m}. String -> Type m -> Element m
def String
"PropertyKey" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"A property key"
        forall m. Type m
string,

      forall {m}. String -> Type m -> Element m
def String
"Vertex" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"A vertex" forall a b. (a -> b) -> a -> b
$
        forall m. String -> Type m -> Type m
lambda String
"v" forall a b. (a -> b) -> a -> b
$ forall m. String -> Type m -> Type m
lambda String
"p" forall a b. (a -> b) -> a -> b
$
        forall m. [FieldType m] -> Type m
record [
          String
"label"forall m. String -> Type m -> FieldType m
>: forall {m}. String -> Type m
v3 String
"VertexLabel",
          String
"id"forall m. String -> Type m -> FieldType m
>: Type Meta
"v",
          String
"properties"forall m. String -> Type m -> FieldType m
>: forall m. Type m -> Type m -> Type m
Types.map (forall {m}. String -> Type m
v3 String
"PropertyKey") Type Meta
"p"],

      forall {m}. String -> Type m -> Element m
def String
"VertexLabel" forall a b. (a -> b) -> a -> b
$
        String -> Type Meta -> Type Meta
doc String
"The label of a vertex. The default (null) vertex is represented by the empty string" forall a b. (a -> b) -> a -> b
$
        forall m. Type m
string]