-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell binding for Gremlin graph query language -- -- Haskell binding for Gremlin graph query language. See -- README.md for detail. -- -- This package is the main entry point of greskell family. It re-exports -- greskell-core package, and adds some useful functions to it. @package greskell @version 0.1.0.0 module Data.Greskell.Binder -- | A Monad that manages binding variables to values. -- --
--   >>> let binder = (,) <$> newBind (10 :: Int) <*> newBind "hoge"
--   
--   >>> let ((var_int, var_str), binding) = runBinder binder
--   
--   >>> toGremlin var_int
--   "__v0"
--   
--   >>> toGremlin var_str
--   "__v1"
--   
--   >>> sortBy (comparing fst) $ HashMap.toList binding
--   [("__v0",Number 10.0),("__v1",String "hoge")]
--   
data Binder a -- | Binding between Gremlin variable names and JSON values. type Binding = Object -- | Create a new Gremlin variable bound to the given value. -- -- The value v is kept in the monadic context. The returned -- Greskell is a Gremlin variable pointing to the v. The -- Gremlin variable is guaranteed to be unique in the current monadic -- context. newBind :: ToJSON v => v -> Binder (Greskell v) -- | Execute the given Binder monad to obtain Binding. runBinder :: Binder a -> (a, Binding) instance GHC.Base.Monad Data.Greskell.Binder.Binder instance GHC.Base.Applicative Data.Greskell.Binder.Binder instance GHC.Base.Functor Data.Greskell.Binder.Binder -- | This module defines types and functions about TinkerPop graph -- structure API. module Data.Greskell.Graph -- | org.apache.tinkerpop.gremlin.structure.Element interface in a -- TinkerPop graph. class Element e where { type family ElementID e; type family ElementProperty e :: * -> *; } -- | org.apache.tinkerpop.gremlin.structure.Vertex interface in a -- TinkerPop graph. class (Element v) => Vertex v -- | org.apache.tinkerpop.gremlin.structure.Edge interface in a -- TinkerPop graph. class (Element e) => Edge e where { type family EdgeVertexID e; } -- | org.apache.tinkerpop.gremlin.structure.Property interface in -- a TinkerPop graph. class Property p -- | Get key of this property. propertyKey :: Property p => p v -> Text -- | Get value of this property. propertyValue :: Property p => p v -> v -- | org.apache.tinkerpop.gremlin.structure.T enum. -- -- T is a token to get data b from an Element a. data T a b -- | T.id token. tId :: Element a => Greskell (T a (ElementID a)) -- | T.key token. tKey :: (Element (p v), Property p) => Greskell (T (p v) Text) -- | T.label token. tLabel :: Element a => Greskell (T a Text) -- | T.value token. tValue :: (Element (p v), Property p) => Greskell (T (p v) v) -- | A property key accessing value b in an Element a. In -- Gremlin, it's just a String type. newtype Key a b Key :: Greskell Text -> Key a b [unKey] :: Key a b -> Greskell Text -- | Create a Key from a literal string. key :: Text -> Key a b -- | General vertex type you can use for Vertex class, based on -- aeson data types. data AVertex AVertex :: GraphSON Value -> Text -> PropertyMapList AVertexProperty (GraphSON Value) -> AVertex -- | ID of this vertex [avId] :: AVertex -> GraphSON Value -- | Label of this vertex [avLabel] :: AVertex -> Text -- | Properties of this vertex. [avProperties] :: AVertex -> PropertyMapList AVertexProperty (GraphSON Value) -- | General edge type you can use for Edge class, based on aeson -- data types. data AEdge AEdge :: GraphSON Value -> Text -> Text -> Text -> GraphSON Value -> GraphSON Value -> PropertyMapSingle AProperty (GraphSON Value) -> AEdge -- | ID of this edge. [aeId] :: AEdge -> GraphSON Value -- | Label of this edge. [aeLabel] :: AEdge -> Text -- | Label of this edge's destination vertex. [aeInVLabel] :: AEdge -> Text -- | Label of this edge's source vertex. [aeOutVLabel] :: AEdge -> Text -- | ID of this edge's destination vertex. [aeInV] :: AEdge -> GraphSON Value -- | ID of this edge's source vertex. [aeOutV] :: AEdge -> GraphSON Value -- | Properties of this edge. [aeProperties] :: AEdge -> PropertyMapSingle AProperty (GraphSON Value) -- | General vertex property type you can use for VertexProperty, based on -- aeson data types. data AVertexProperty v AVertexProperty :: GraphSON Value -> Text -> v -> PropertyMapSingle AProperty (GraphSON Value) -> AVertexProperty v -- | ID of this vertex property. [avpId] :: AVertexProperty v -> GraphSON Value -- | Label and key of this vertex property. [avpLabel] :: AVertexProperty v -> Text -- | Value of this vertex property. [avpValue] :: AVertexProperty v -> v -- | (meta)properties of this vertex property. [avpProperties] :: AVertexProperty v -> PropertyMapSingle AProperty (GraphSON Value) -- | General simple property type you can use for Property class. data AProperty v AProperty :: Text -> v -> AProperty v [apKey] :: AProperty v -> Text [apValue] :: AProperty v -> v -- | Common basic operations supported by maps of properties. class PropertyMap m -- | Look up a property associated with the given key. lookupOne :: PropertyMap m => Text -> m p v -> Maybe (p v) -- | Look up all properties associated with the given key. lookupList :: PropertyMap m => Text -> m p v -> [p v] -- | Put a property into the map. putProperty :: (PropertyMap m, Property p) => p v -> m p v -> m p v -- | Remove all properties associated with the given key. removeProperty :: PropertyMap m => Text -> m p v -> m p v -- | Return all properties in the map. allProperties :: PropertyMap m => m p v -> [p v] -- | A PropertyMap that has a single value per key. -- -- putProperty replaces the old property by the given property. -- -- <> returns the union of the two given property maps. If -- the two property maps share some same keys, the value from the left -- map wins. data PropertyMapSingle p v -- | A PropertyMap that can keep more than one values per key. -- -- lookupOne returns the first property associated with the given -- key. -- -- putProperty prepends the given property to the property list. -- -- <> returns the union of the two given property maps. If -- the two property maps share some same keys, those property lists are -- concatenated. data PropertyMapList p v -- | Lookup a property value from a PropertyMap by key. lookupOneValue :: (PropertyMap m, Property p) => Text -> m p v -> Maybe v -- | Lookup a list of property values from a PropertyMap by key. lookupListValues :: (PropertyMap m, Property p) => Text -> m p v -> [v] -- | Lookup a property Value by the given key, and parse it. parseOneValue :: (PropertyMap m, Property p, FromJSON v) => Text -> m p (GraphSON Value) -> Parser v -- | Lookup a list of property values from a PropertyMap by the -- given key, and parse them. parseListValues :: (PropertyMap m, Property p, FromJSON v) => Text -> m p (GraphSON Value) -> Parser [v] -- | Like parseListValues, but this function fails when there -- is no property with the given key. parseNonEmptyValues :: (PropertyMap m, Property p, FromJSON v) => Text -> m p (GraphSON Value) -> Parser (NonEmpty v) -- | Create a PropertyMap from list of Propertys. fromProperties :: (PropertyMap m, Property p, Monoid (m p v)) => [p v] -> m p v -- | This typeclass is for internal use. -- -- JSON parser with a property key given from outside. class FromJSONWithKey a instance GHC.Classes.Eq Data.Greskell.Graph.AVertex instance GHC.Show.Show Data.Greskell.Graph.AVertex instance Data.Traversable.Traversable p => Data.Traversable.Traversable (Data.Greskell.Graph.PropertyMapList p) instance Data.Foldable.Foldable p => Data.Foldable.Foldable (Data.Greskell.Graph.PropertyMapList p) instance GHC.Base.Functor p => GHC.Base.Functor (Data.Greskell.Graph.PropertyMapList p) instance GHC.Base.Monoid (Data.Greskell.Graph.PropertyMapList p v) instance GHC.Classes.Eq (p v) => GHC.Classes.Eq (Data.Greskell.Graph.PropertyMapList p v) instance GHC.Show.Show (p v) => GHC.Show.Show (Data.Greskell.Graph.PropertyMapList p v) instance GHC.Classes.Eq Data.Greskell.Graph.AEdge instance GHC.Show.Show Data.Greskell.Graph.AEdge instance GHC.Classes.Eq v => GHC.Classes.Eq (Data.Greskell.Graph.AVertexProperty v) instance GHC.Show.Show v => GHC.Show.Show (Data.Greskell.Graph.AVertexProperty v) instance Data.Traversable.Traversable p => Data.Traversable.Traversable (Data.Greskell.Graph.PropertyMapSingle p) instance Data.Foldable.Foldable p => Data.Foldable.Foldable (Data.Greskell.Graph.PropertyMapSingle p) instance GHC.Base.Functor p => GHC.Base.Functor (Data.Greskell.Graph.PropertyMapSingle p) instance GHC.Base.Monoid (Data.Greskell.Graph.PropertyMapSingle p v) instance GHC.Classes.Eq (p v) => GHC.Classes.Eq (Data.Greskell.Graph.PropertyMapSingle p v) instance GHC.Show.Show (p v) => GHC.Show.Show (Data.Greskell.Graph.PropertyMapSingle p v) instance GHC.Classes.Eq (t (p v)) => GHC.Classes.Eq (Data.Greskell.Graph.PropertyMapGeneric t p v) instance GHC.Show.Show (t (p v)) => GHC.Show.Show (Data.Greskell.Graph.PropertyMapGeneric t p v) instance GHC.Classes.Ord v => GHC.Classes.Ord (Data.Greskell.Graph.AProperty v) instance GHC.Classes.Eq v => GHC.Classes.Eq (Data.Greskell.Graph.AProperty v) instance GHC.Show.Show v => GHC.Show.Show (Data.Greskell.Graph.AProperty v) instance GHC.Classes.Eq (Data.Greskell.Graph.Key a b) instance GHC.Show.Show (Data.Greskell.Graph.Key a b) instance Data.Greskell.Graph.Element Data.Greskell.Graph.AVertex instance Data.Greskell.Graph.Vertex Data.Greskell.Graph.AVertex instance Data.Greskell.GraphSON.GraphSONTyped Data.Greskell.Graph.AVertex instance Data.Aeson.Types.FromJSON.FromJSON Data.Greskell.Graph.AVertex instance Data.Greskell.Graph.PropertyMap Data.Greskell.Graph.PropertyMapList instance (Data.Greskell.Graph.Property p, Data.Greskell.GraphSON.GraphSONTyped (p v), Data.Aeson.Types.FromJSON.FromJSON (p v), Data.Greskell.Graph.FromJSONWithKey (p v)) => Data.Aeson.Types.FromJSON.FromJSON (Data.Greskell.Graph.PropertyMapList p v) instance Data.Greskell.Graph.Element Data.Greskell.Graph.AEdge instance Data.Greskell.Graph.Edge Data.Greskell.Graph.AEdge instance Data.Greskell.GraphSON.GraphSONTyped Data.Greskell.Graph.AEdge instance Data.Aeson.Types.FromJSON.FromJSON Data.Greskell.Graph.AEdge instance Data.Aeson.Types.FromJSON.FromJSON v => Data.Aeson.Types.FromJSON.FromJSON (Data.Greskell.Graph.AVertexProperty v) instance Data.Aeson.Types.FromJSON.FromJSON v => Data.Greskell.Graph.FromJSONWithKey (Data.Greskell.Graph.AVertexProperty v) instance Data.Greskell.GraphSON.GraphSONTyped (Data.Greskell.Graph.AVertexProperty v) instance Data.Greskell.Graph.Element (Data.Greskell.Graph.AVertexProperty v) instance Data.Greskell.Graph.Property Data.Greskell.Graph.AVertexProperty instance GHC.Base.Functor Data.Greskell.Graph.AVertexProperty instance Data.Foldable.Foldable Data.Greskell.Graph.AVertexProperty instance Data.Traversable.Traversable Data.Greskell.Graph.AVertexProperty instance Data.Greskell.Graph.PropertyMap Data.Greskell.Graph.PropertyMapSingle instance (Data.Greskell.Graph.Property p, Data.Greskell.GraphSON.GraphSONTyped (p v), Data.Aeson.Types.FromJSON.FromJSON (p v), Data.Greskell.Graph.FromJSONWithKey (p v)) => Data.Aeson.Types.FromJSON.FromJSON (Data.Greskell.Graph.PropertyMapSingle p v) instance Data.Semigroup.Semigroup (t (p v)) => GHC.Base.Monoid (Data.Greskell.Graph.PropertyMapGeneric t p v) instance (GHC.Base.Functor t, GHC.Base.Functor p) => GHC.Base.Functor (Data.Greskell.Graph.PropertyMapGeneric t p) instance (Data.Foldable.Foldable t, Data.Foldable.Foldable p) => Data.Foldable.Foldable (Data.Greskell.Graph.PropertyMapGeneric t p) instance (Data.Traversable.Traversable t, Data.Traversable.Traversable p) => Data.Traversable.Traversable (Data.Greskell.Graph.PropertyMapGeneric t p) instance Data.Aeson.Types.FromJSON.FromJSON v => Data.Aeson.Types.FromJSON.FromJSON (Data.Greskell.Graph.AProperty v) instance Data.Aeson.Types.FromJSON.FromJSON v => Data.Greskell.Graph.FromJSONWithKey (Data.Greskell.Graph.AProperty v) instance Data.Greskell.Graph.Property Data.Greskell.Graph.AProperty instance Data.Greskell.GraphSON.GraphSONTyped (Data.Greskell.Graph.AProperty v) instance GHC.Base.Functor Data.Greskell.Graph.AProperty instance Data.Foldable.Foldable Data.Greskell.Graph.AProperty instance Data.Traversable.Traversable Data.Greskell.Graph.AProperty instance GHC.Base.Functor (Data.Greskell.Graph.Key a) instance Data.String.IsString (Data.Greskell.Graph.Key a b) instance Data.Greskell.Greskell.ToGreskell (Data.Greskell.Graph.Key a b) instance Data.Greskell.GraphSON.GraphSONTyped (Data.Greskell.Graph.T a b) -- | This modules defines types and functions for utility classes in -- Gremlin. module Data.Greskell.Gremlin -- | java.util.function.Predicate interface. -- -- A Predicate p is a function that takes -- PredicateArg p and returns Bool. class Predicate p where { type family PredicateArg p; } -- | .and method. pAnd :: Predicate p => Greskell p -> Greskell p -> Greskell p -- | .or method. pOr :: Predicate p => Greskell p -> Greskell p -> Greskell p -- | .test method. pTest :: Predicate p => Greskell p -> Greskell (PredicateArg p) -> Greskell Bool -- | .nagate method. pNegate :: Predicate p => Greskell p -> Greskell p -- | Type for anonymous class of Predicate interface. newtype PredicateA a PredicateA :: (a -> Bool) -> PredicateA a [unPredicateA] :: PredicateA a -> a -> Bool -- | org.apache.tinkerpop.gremlin.process.traversal.P class. -- -- P a keeps data of type a and compares it with data -- of type a given as the Predicate argument. data P a -- | P.not static method. -- --
--   >>> toGremlin $ pNot $ pEq $ number 10
--   "P.not(P.eq(10.0))"
--   
pNot :: Greskell (P a) -> Greskell (P a) -- | P.eq static method. -- --
--   >>> toGremlin $ pEq $ string "hoge"
--   "P.eq(\"hoge\")"
--   
pEq :: Greskell a -> Greskell (P a) -- | P.neq static method. pNeq :: Greskell a -> Greskell (P a) -- | P.lt static method. pLt :: Greskell a -> Greskell (P a) -- | P.lte static method. pLte :: Greskell a -> Greskell (P a) -- | P.gt static method. pGt :: Greskell a -> Greskell (P a) -- | P.gte static method. pGte :: Greskell a -> Greskell (P a) -- | P.inside static method. -- --
--   >>> toGremlin $ pInside (number 10) (number 20)
--   "P.inside(10.0,20.0)"
--   
pInside :: Greskell a -> Greskell a -> Greskell (P a) -- | P.outside static method. pOutside :: Greskell a -> Greskell a -> Greskell (P a) -- | P.between static method. pBetween :: Greskell a -> Greskell a -> Greskell (P a) -- | P.within static method. -- --
--   >>> toGremlin $ pWithin (["foo", "bar", "hoge"] :: [Greskell String])
--   "P.within(\"foo\",\"bar\",\"hoge\")"
--   
pWithin :: [Greskell a] -> Greskell (P a) -- | P.without static method. pWithout :: [Greskell a] -> Greskell (P a) -- | java.util.Comparator interface. -- -- Comparator compares two data of type CompareArg -- c. class Comparator c where { type family CompareArg c; } -- | .compare method. cCompare :: Comparator c => Greskell c -> Greskell (CompareArg c) -> Greskell (CompareArg c) -> Greskell Int -- | .reverse method. cReversed :: Comparator c => Greskell c -> Greskell c -- | .thenComparing method. cThenComparing :: Comparator c => Greskell c -> Greskell c -> Greskell c -- | Type for anonymous class of Comparator interface. newtype ComparatorA a ComparatorA :: (a -> a -> Int) -> ComparatorA a [unComparatorA] :: ComparatorA a -> a -> a -> Int -- | org.apache.tinkerpop.gremlin.process.traversal.Order enum. data Order a -- | decr order. -- --
--   >>> toGremlin oDecr
--   "Order.decr"
--   
oDecr :: Greskell (Order a) -- | incr order. oIncr :: Greskell (Order a) -- | shuffle order. oShuffle :: Greskell (Order a) instance Data.Greskell.Gremlin.Comparator (Data.Greskell.Gremlin.Order a) instance Data.Greskell.GraphSON.GraphSONTyped (Data.Greskell.Gremlin.Order a) instance Data.Greskell.Gremlin.Comparator (Data.Greskell.Gremlin.ComparatorA a) instance Data.Greskell.Gremlin.Predicate (Data.Greskell.Gremlin.P a) instance Data.Greskell.GraphSON.GraphSONTyped (Data.Greskell.Gremlin.P a) instance Data.Greskell.Gremlin.Predicate (Data.Greskell.Gremlin.PredicateA a) -- | This module defines GTraversal, greskell counterpart of -- GraphTraversal class object, and a DSL of composing graph -- traversal steps. module Data.Greskell.GTraversal -- | GraphTraversal class object of TinkerPop. It takes data -- s from upstream and emits data e to downstream. Type -- c is called "walk type", a marker to describe the effect of -- the traversal. -- -- GTraversal is NOT a Category. Because a -- GraphTraversal object keeps some context data, the starting -- (left-most) GraphTraversal object controls most of the -- behavior of entire composition of traversals and steps. This violates -- Category law. newtype GTraversal c s e GTraversal :: Greskell (GraphTraversal c s e) -> GTraversal c s e [unGTraversal] :: GTraversal c s e -> Greskell (GraphTraversal c s e) -- | Phantom type for GraphTraversal class. In greskell, we -- usually use GTraversal instead of Greskell -- GraphTraversal. data GraphTraversal c s e -- | Types that can convert to GTraversal. class ToGTraversal g toGTraversal :: (ToGTraversal g, WalkType c) => g c s e -> GTraversal c s e -- | Lift WalkType from to to. Use this for type -- matching. liftWalk :: (ToGTraversal g, WalkType from, WalkType to, Lift from to) => g from s e -> g to s e -- | A chain of one or more Gremlin steps. Like GTraversal, type -- s is the input, type e is the output, and type -- c is a marker to describe the step. -- -- Walk represents a chain of method calls such as -- .has(x).outE(). Because this is not a Gremlin (Groovy) -- expression, we use bare Walk, not Greskell Walk. -- -- Walk is a Category. You can use functions from -- Control.Category to compose Walks. This is equivalent to -- making a chain of method calls in Gremlin. -- -- Walk is not an Eq, because it's difficult to define true -- equality between Gremlin method calls. If we define it naively, it -- might have conflict with Category law. data Walk c s e -- | GraphTraversalSource class object of TinkerPop. It is a -- factory object of GraphTraversals. data GraphTraversalSource -- | Class of phantom type markers to describe the effect of the -- walk/traversals. class WalkType t -- | WalkType for filtering steps. -- -- A filtering step is a step that does filtering only. It takes input -- and emits some of them without any modification, reordering, traversal -- actions, or side-effects. Filtering decision must be solely based on -- each element. -- -- A Walk w is Filter type iff: -- --
--   (gSideEffect w == gIdentity) AND (gFilter w == w)
--   
-- -- If Walks w1 and w2 are Filter type, -- then -- --
--   gAnd [w1, w2] == w1 >>> w2 == w2 >>> w1
--   
data Filter -- | WalkType for steps without any side-effects. This includes -- transformations, reordring, injections and graph traversal actions. -- -- A Walk w is Transform type iff: -- --
--   gSideEffect w == gIdentity
--   
-- -- Obviously, every Filter type Walks are also -- Transform type. data Transform -- | WalkType for steps that may have side-effects. -- -- A side-effect here means manipulation of the "sideEffect" in Gremlin -- context (i.e. the stash of data kept in a Traversal object), as well -- as interaction with the world outside the Traversal object. -- -- For example, the following steps (in Gremlin) all have side-effects. -- --
--   .addE('label')
--   .aggregate('x')
--   .sideEffect(System.out.&println)
--   .map { some_variable += 1 }
--   
data SideEffect -- | Relation of WalkTypes where one includes the other. -- from can be lifted to to, because to is -- more powerful than from. class Lift from to -- | Relation of WalkTypes where the child walk c is split -- from the parent walk p. -- -- When splitting, transformation effect done in the child walk is rolled -- back (canceled) in the parent walk. class Split c p -- | Create GraphTraversalSource from a varible name in Gremlin -- --
--   >>> toGremlin $ source "g"
--   "g"
--   
source :: Text -> Greskell GraphTraversalSource -- | .V() method on GraphTraversalSource. sV :: Vertex v => [Greskell (ElementID v)] -> Greskell GraphTraversalSource -> GTraversal Transform () v -- | Monomorphic version of sV. -- --
--   >>> toGremlin (source "g" & sV' (map (value . Aeson.Number) [1,2,3]))
--   "g.V(1.0,2.0,3.0)"
--   
sV' :: [Greskell Value] -> Greskell GraphTraversalSource -> GTraversal Transform () AVertex -- | .E() method on GraphTraversalSource. sE :: Edge e => [Greskell (ElementID e)] -> Greskell GraphTraversalSource -> GTraversal Transform () e -- | Monomorphic version of sE. -- --
--   >>> toGremlin (source "g" & sE' (map (value . Aeson.Number) [1]))
--   "g.E(1.0)"
--   
sE' :: [Greskell Value] -> Greskell GraphTraversalSource -> GTraversal Transform () AEdge -- | Apply the Walk to the GTraversal. In Gremlin, this means -- calling a chain of methods on the Traversal object. -- --
--   >>> toGremlin (source "g" & sV' [] &. gValues ["age"])
--   "g.V().values(\"age\")"
--   
(&.) :: GTraversal c a b -> Walk c b d -> GTraversal c a d infixl 1 &. -- | Same as &. with arguments flipped. -- --
--   >>> toGremlin (gValues ["age"] $. sV' [] $ source "g")
--   "g.V().values(\"age\")"
--   
($.) :: Walk c b d -> GTraversal c a b -> GTraversal c a d infixr 0 $. -- | Unsafely create GTraversal from the given raw Gremlin script. -- --
--   >>> toGremlin $ unsafeGTraversal "g.V().count()"
--   "g.V().count()"
--   
unsafeGTraversal :: Text -> GTraversal c s e -- | Unsafely create a Walk that represents a single method call on -- a GraphTraversal. -- --
--   >>> toGremlin (source "g" & sV' [] &. unsafeWalk "valueMap" ["'foo'", "'bar'"])
--   "g.V().valueMap('foo','bar')"
--   
unsafeWalk :: WalkType c => Text -> [Text] -> Walk c s e -- | Optionally modulate the main Walk with some modulating -- Walks. -- --
--   >>> toGremlin (source "g" & sV' [] &. modulateWith (unsafeWalk "path" []) [unsafeWalk "by" ["'name'"], unsafeWalk "by" ["'age'"]])
--   "g.V().path().by('name').by('age')"
--   
modulateWith :: (WalkType c) => Walk c s e -> [Walk c e e] -> Walk c s e -- | .identity step. gIdentity :: WalkType c => Walk c s s -- | Monomorphic version of gIdentity. gIdentity' :: Walk Filter s s -- | .filter step that takes a traversal. -- --
--   >>> toGremlin (source "g" & sV' [] &. gFilter (gOut' ["knows"]))
--   "g.V().filter(__.out(\"knows\"))"
--   
gFilter :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s -- | .has step with one argument. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHas1 "age")
--   "g.V().has(\"age\")"
--   
gHas1 :: (WalkType c, Element s) => Key s v -> Walk c s s -- | Monomorphic version of gHas1. gHas1' :: (Element s) => Key s v -> Walk Filter s s -- | .has step with two arguments. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHas2 "age" (31 :: Greskell Int))
--   "g.V().has(\"age\",31)"
--   
gHas2 :: (WalkType c, Element s) => Key s v -> Greskell v -> Walk c s s -- | Monomorphic verson of gHas2. gHas2' :: (Element s) => Key s v -> Greskell v -> Walk Filter s s -- | .has step with two arguments and P type. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHas2P "age" (pBetween (30 :: Greskell Int) 40))
--   "g.V().has(\"age\",P.between(30,40))"
--   
gHas2P :: (WalkType c, Element s) => Key s v -> Greskell (P v) -> Walk c s s -- | Monomorphic version of gHas2P. gHas2P' :: (Element s) => Key s v -> Greskell (P v) -> Walk Filter s s -- | .hasLabel step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHasLabel "person")
--   "g.V().hasLabel(\"person\")"
--   
gHasLabel :: (Element s, WalkType c) => Greskell Text -> Walk c s s -- | Monomorphic version of gHasLabel. gHasLabel' :: (Element s) => Greskell Text -> Walk Filter s s -- | .hasLabel step with P type. Supported since TinkerPop -- 3.2.7. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHasLabelP (pEq "person"))
--   "g.V().hasLabel(P.eq(\"person\"))"
--   
gHasLabelP :: (Element s, WalkType c) => Greskell (P Text) -> Walk c s s -- | Monomorphic version of gHasLabelP. gHasLabelP' :: Element s => Greskell (P Text) -> Walk Filter s s -- | .hasId step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHasId (value $ Aeson.Number 7))
--   "g.V().hasId(7.0)"
--   
gHasId :: (Element s, WalkType c) => Greskell (ElementID s) -> Walk c s s -- | Monomorphic version of gHasId. gHasId' :: Element s => Greskell (ElementID s) -> Walk Filter s s -- | .hasId step with P type. Supported since TinkerPop -- 3.2.7. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHasIdP (pLte $ value $ Aeson.Number 100))
--   "g.V().hasId(P.lte(100.0))"
--   
gHasIdP :: (Element s, WalkType c) => Greskell (P (ElementID s)) -> Walk c s s -- | Monomorphic version of gHasIdP. gHasIdP' :: Element s => Greskell (P (ElementID s)) -> Walk Filter s s -- | .hasKey step. The input type should be a VertexProperty. -- --
--   >>> toGremlin (source "g" & sV' [] &. gProperties [] &. gHasKey "age")
--   "g.V().properties().hasKey(\"age\")"
--   
gHasKey :: (Element (p v), Property p, WalkType c) => Greskell Text -> Walk c (p v) (p v) -- | Monomorphic version of gHasKey. gHasKey' :: (Element (p v), Property p) => Greskell Text -> Walk Filter (p v) (p v) -- | .hasKey step with P type. Supported since TinkerPop -- 3.2.7. gHasKeyP :: (Element (p v), Property p, WalkType c) => Greskell (P Text) -> Walk c (p v) (p v) -- | Monomorphic version of gHasKeyP. gHasKeyP' :: (Element (p v), Property p) => Greskell (P Text) -> Walk Filter (p v) (p v) -- | .hasValue step. The input type should be a VertexProperty. -- --
--   >>> toGremlin (source "g" & sV' [] &. gProperties ["age"] &. gHasValue (32 :: Greskell Int))
--   "g.V().properties(\"age\").hasValue(32)"
--   
gHasValue :: (Element (p v), Property p, WalkType c) => Greskell v -> Walk c (p v) (p v) -- | Monomorphic version of gHasValue. gHasValue' :: (Element (p v), Property p) => Greskell v -> Walk Filter (p v) (p v) -- | .hasValue step with P type. Supported since TinkerPop -- 3.2.7. -- --
--   >>> toGremlin (source "g" & sV' [] &. gProperties ["age"] &. gHasValueP (pBetween (30 :: Greskell Int) 40))
--   "g.V().properties(\"age\").hasValue(P.between(30,40))"
--   
gHasValueP :: (Element (p v), Property p, WalkType c) => Greskell (P v) -> Walk c (p v) (p v) -- | Monomorphic version of gHasValueP. gHasValueP' :: (Element (p v), Property p) => Greskell (P v) -> Walk Filter (p v) (p v) -- | .and step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gAnd [gOut' ["knows"], gHas1 "age"])
--   "g.V().and(__.out(\"knows\"),__.has(\"age\"))"
--   
gAnd :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => [g c s e] -> Walk p s s -- | .or step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gOr [gOut' ["knows"], gHas1 "age"])
--   "g.V().or(__.out(\"knows\"),__.has(\"age\"))"
--   
gOr :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => [g c s e] -> Walk p s s -- | .not step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gNot (gOut' ["knows"]))
--   "g.V().not(__.out(\"knows\"))"
--   
gNot :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s -- | .order step. -- --
--   >>> let key_age = ("age" :: Key AVertex Int)
--   
--   >>> toGremlin (source "g" & sV' [] &. gOrder [gBy1 key_age])
--   "g.V().order().by(\"age\")"
--   
--   >>> toGremlin (source "g" & sV' [] &. gOrder [gBy2 key_age oDecr, gBy1 tId])
--   "g.V().order().by(\"age\",Order.decr).by(T.id)"
--   
--   >>> toGremlin (source "g" & sV' [] &. gOrder [gBy2 (gOut' ["knows"] >>> gCount) oIncr, gBy2 tId oIncr])
--   "g.V().order().by(__.out(\"knows\").count(),Order.incr).by(T.id,Order.incr)"
--   
gOrder :: [ByComparator s] -> Walk Transform s s -- | .range step. This step is not a Filter, because the -- filtering decision by this step is based on position of each element, -- not the element itself. This violates Filter law. -- --
--   >>> toGremlin (source "g" & sV' [] &. gRange 0 100)
--   "g.V().range(0,100)"
--   
gRange :: Greskell Int -> Greskell Int -> Walk Transform s s -- | .flatMap step. -- -- .flatMap step is a Transform step even if the child -- walk is Filter type. This is because .flatMap step -- always modifies the path of the Traverser. -- --
--   >>> toGremlin (source "g" & sV' [] &. gFlatMap (gOut' ["knows"] >>> gOut' ["created"]))
--   "g.V().flatMap(__.out(\"knows\").out(\"created\"))"
--   
gFlatMap :: (ToGTraversal g) => g Transform s e -> Walk Transform s e -- | .values step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gValues ["name", "age"])
--   "g.V().values(\"name\",\"age\")"
--   
gValues :: Element s => [Key s e] -> Walk Transform s e -- | .properties step. -- --
--   >>> toGremlin (source "g" & sV' [] &. gProperties ["age"])
--   "g.V().properties(\"age\")"
--   
gProperties :: (Element s, Property p, ElementProperty s ~ p) => [Key s v] -> Walk Transform s (p v) -- | .fold step. gFold :: Walk Transform a [a] -- | .count step. gCount :: Walk Transform a Int -- | .out step gOut :: (Vertex v1, Vertex v2) => [Greskell Text] -> Walk Transform v1 v2 -- | Monomorphic version of gOut. -- --
--   >>> toGremlin (source "g" & sV' ["person"] &. gOut' ["knows"])
--   "g.V(\"person\").out(\"knows\")"
--   
gOut' :: (Vertex v) => [Greskell Text] -> Walk Transform v AVertex -- | .outE step gOutE :: (Vertex v, Edge e) => [Greskell Text] -> Walk Transform v e -- | Monomorphic version of gOutE gOutE' :: (Vertex v) => [Greskell Text] -> Walk Transform v AEdge -- | .in step gIn :: (Vertex v1, Vertex v2) => [Greskell Text] -> Walk Transform v1 v2 -- | Monomorphic version of gIn. gIn' :: (Vertex v) => [Greskell Text] -> Walk Transform v AVertex -- | .inE step. gInE :: (Vertex v, Edge e) => [Greskell Text] -> Walk Transform v e -- | Monomorphic version of gInE. gInE' :: (Vertex v) => [Greskell Text] -> Walk Transform v AEdge -- | .sideEffect step that takes a traversal. gSideEffect :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s -- | Monomorphic version of gSideEffect. The result walk is always -- SideEffect type. -- --
--   >>> toGremlin (source "g" & sV' [] & liftWalk &. gHas2 "name" "marko" &. gSideEffect' (gAddV' "toshio"))
--   "g.V().has(\"name\",\"marko\").sideEffect(__.addV(\"toshio\"))"
--   
gSideEffect' :: (ToGTraversal g, WalkType c, Split c SideEffect) => g c s e -> Walk SideEffect s s -- | .addV step with a label. gAddV :: Vertex v => Greskell Text -> Walk SideEffect a v -- | Monomorphic version of gAddV. gAddV' :: Greskell Text -> Walk SideEffect a AVertex -- | .drop step on Element. -- --
--   >>> toGremlin (source "g" & sV' [] &. gHas2 "name" "marko" & liftWalk &. gDrop)
--   "g.V().has(\"name\",\"marko\").drop()"
--   
gDrop :: Element e => Walk SideEffect e e -- | .drop step on Property. -- --
--   >>> toGremlin (source "g" & sE' [] &. gProperties ["weight"] & liftWalk &. gDropP)
--   "g.E().properties(\"weight\").drop()"
--   
gDropP :: Property p => Walk SideEffect (p a) (p a) -- | Projection from type s to type e used in -- .by step. You can also use gBy to construct -- ByProjection. data ByProjection s e [ByProjection] :: (ProjectionLike p, ToGreskell p) => p -> ByProjection (ProjectionLikeStart p) (ProjectionLikeEnd p) -- | Data types that mean a projection from one type to another. class ProjectionLike p where { type family ProjectionLikeStart p; type family ProjectionLikeEnd p; } -- | Comparison of type s used in .by step. You can also -- use gBy1 and gBy2 to construct ByComparator. data ByComparator s -- | Type s is projected to type e, and compared by the -- natural comparator of type e. [ByComparatorProj] :: ByProjection s e -> ByComparator s -- | Type s is compared by the Comparator comp. [ByComparatorComp] :: Comparator comp => Greskell comp -> ByComparator (CompareArg comp) -- | Type s is projected to type CompareArg comp, and -- compared by the Comparator comp. [ByComparatorProjComp] :: Comparator comp => ByProjection s (CompareArg comp) -> Greskell comp -> ByComparator s -- | .by step with 1 argument, used for projection. gBy :: (ProjectionLike p, ToGreskell p) => p -> ByProjection (ProjectionLikeStart p) (ProjectionLikeEnd p) -- | .by step with 1 argumernt, used for comparison. gBy1 :: (ProjectionLike p, ToGreskell p) => p -> ByComparator (ProjectionLikeStart p) -- | .by step with 2 arguments, used for comparison. gBy2 :: (ProjectionLike p, ToGreskell p, Comparator comp, ProjectionLikeEnd p ~ CompareArg comp) => p -> Greskell comp -> ByComparator (ProjectionLikeStart p) instance GHC.Show.Show Data.Greskell.GTraversal.GraphTraversalSource instance GHC.Show.Show (Data.Greskell.GTraversal.Walk c s e) instance GHC.Show.Show (Data.Greskell.GTraversal.GTraversal c s e) instance GHC.Show.Show (Data.Greskell.GTraversal.GraphTraversal c s e) instance Data.String.IsString (Data.Greskell.GTraversal.ByComparator s) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.GTraversal.ByProjection s e) instance Data.String.IsString (Data.Greskell.GTraversal.ByProjection s e) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.GTraversal.Walk Data.Greskell.GTraversal.Filter s e) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.GTraversal.GTraversal Data.Greskell.GTraversal.Filter s e) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.Greskell.Greskell (Data.Greskell.GTraversal.GraphTraversal Data.Greskell.GTraversal.Filter s e)) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.GTraversal.Walk Data.Greskell.GTraversal.Transform s e) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.GTraversal.GTraversal Data.Greskell.GTraversal.Transform s e) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.Greskell.Greskell (Data.Greskell.GTraversal.GraphTraversal Data.Greskell.GTraversal.Transform s e)) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.Graph.Key s e) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.Greskell.Greskell (Data.Greskell.Graph.T s e)) instance Data.Greskell.GTraversal.ProjectionLike (Data.Greskell.Greskell.Greskell (s -> e)) instance Data.Greskell.GTraversal.WalkType p => Data.Greskell.GTraversal.Split Data.Greskell.GTraversal.Filter p instance Data.Greskell.GTraversal.WalkType p => Data.Greskell.GTraversal.Split Data.Greskell.GTraversal.Transform p instance Data.Greskell.GTraversal.Split Data.Greskell.GTraversal.SideEffect Data.Greskell.GTraversal.SideEffect instance Data.Greskell.GTraversal.ToGTraversal Data.Greskell.GTraversal.GTraversal instance Data.Greskell.GTraversal.ToGTraversal Data.Greskell.GTraversal.Walk instance Data.Greskell.GTraversal.WalkType c => Data.Greskell.Greskell.ToGreskell (Data.Greskell.GTraversal.Walk c s e) instance Data.Greskell.GTraversal.WalkType c => Data.Greskell.GTraversal.Lift Data.Greskell.GTraversal.Filter c instance Data.Greskell.GTraversal.Lift Data.Greskell.GTraversal.Transform Data.Greskell.GTraversal.Transform instance Data.Greskell.GTraversal.Lift Data.Greskell.GTraversal.Transform Data.Greskell.GTraversal.SideEffect instance Data.Greskell.GTraversal.Lift Data.Greskell.GTraversal.SideEffect Data.Greskell.GTraversal.SideEffect instance Data.Greskell.GTraversal.WalkType Data.Greskell.GTraversal.SideEffect instance Data.Greskell.GTraversal.WalkType Data.Greskell.GTraversal.Transform instance Data.Greskell.GTraversal.WalkType Data.Greskell.GTraversal.Filter instance Data.Greskell.GTraversal.WalkType c => Control.Category.Category (Data.Greskell.GTraversal.Walk c) instance Data.Greskell.GTraversal.WalkType c => Data.Semigroup.Semigroup (Data.Greskell.GTraversal.Walk c s s) instance Data.Greskell.GTraversal.WalkType c => GHC.Base.Monoid (Data.Greskell.GTraversal.Walk c s s) instance GHC.Base.Functor (Data.Greskell.GTraversal.Walk c s) instance Data.Bifunctor.Bifunctor (Data.Greskell.GTraversal.Walk c) instance GHC.Base.Functor (Data.Greskell.GTraversal.GTraversal c s) instance Data.Bifunctor.Bifunctor (Data.Greskell.GTraversal.GTraversal c) instance Data.Greskell.Greskell.ToGreskell (Data.Greskell.GTraversal.GTraversal c s e) instance GHC.Base.Functor (Data.Greskell.GTraversal.GraphTraversal c s) instance Data.Bifunctor.Bifunctor (Data.Greskell.GTraversal.GraphTraversal c) -- | Data.Greskell is a Haskell support to use the Gremlin graph query -- language. For more information, see project README. module Data.Greskell