Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.Greskell
Description
Data.Greskell is a Haskell support to use the Gremlin graph query language. For more information, see project README.
This module re-exports most modules from greskell and greskell-core packages. The following modules are excluded from re-export:
- Data.Greskell.Extra: extra utility functions.
- Data.Greskell.NonEmptyLike: NonEmptyLike class, which is a class of non-empty containers.
- Data.Greskell.Logic: Logic type, which is a general-purpose logic tree data structure.
- Data.Greskell.Graph.PropertyMap: deprecated PropertyMap class.
- Data.Greskell.GTraversal.Gen: an experimental module that has generalized versions of Gremlin traversals defined in Data.Greskell.GTraversal.
Synopsis
- class ToGreskell a where
- type GreskellReturn a
- toGreskell :: a -> Greskell (GreskellReturn a)
- type family GreskellReturn a
- data Greskell a
- number :: Scientific -> Greskell Scientific
- list :: [Greskell a] -> Greskell [a]
- string :: Text -> Greskell Text
- value :: Value -> Greskell Value
- unsafeGreskell :: Text -> Greskell a
- unsafeGreskellLazy :: Text -> Greskell a
- true :: Greskell Bool
- false :: Greskell Bool
- single :: Greskell a -> Greskell [a]
- valueInt :: Integral a => a -> Greskell Value
- gvalue :: Value -> Greskell GValue
- gvalueInt :: Integral a => a -> Greskell GValue
- toGremlin :: ToGreskell a => a -> Text
- toGremlinLazy :: ToGreskell a => a -> Text
- unsafeFunCall :: Text -> [Text] -> Greskell a
- unsafeMethodCall :: Greskell a -> Text -> [Text] -> Greskell b
- module Data.Greskell.Binder
- class Lift from to where
- newtype GTraversal c s e = GTraversal {
- unGTraversal :: Greskell (GraphTraversal c s e)
- data GraphTraversal c s e
- class ToGTraversal g where
- toGTraversal :: WalkType c => g c s e -> GTraversal c s e
- liftWalk :: (WalkType from, WalkType to, Lift from to) => g from s e -> g to s e
- unsafeCastStart :: WalkType c => g c s1 e -> g c s2 e
- unsafeCastEnd :: WalkType c => g c s e1 -> g c s e2
- data Walk c s e
- data GraphTraversalSource
- class WalkType t where
- showWalkType :: Proxy t -> String
- data Filter
- data Transform
- data SideEffect
- class Split c p where
- data RepeatUntil c s where
- RepeatTimes :: Greskell Int -> RepeatUntil c s
- RepeatUntilT :: (WalkType cc, WalkType c, Split cc c) => GTraversal cc s e -> RepeatUntil c s
- data RepeatEmit c s where
- RepeatEmit :: RepeatEmit c s
- RepeatEmitT :: (WalkType cc, WalkType c, Split cc c) => GTraversal cc s e -> RepeatEmit c s
- data RepeatPos
- newtype RepeatLabel = RepeatLabel {}
- data MatchPattern where
- MatchPattern :: AsLabel a -> Walk Transform a b -> MatchPattern
- data MatchResult
- data AddAnchor s e
- data ByProjection s e where
- ByProjection :: (ProjectionLike p, ToGreskell p) => p -> ByProjection (ProjectionLikeStart p) (ProjectionLikeEnd p)
- class ProjectionLike p where
- type ProjectionLikeStart p
- type ProjectionLikeEnd p
- data ByComparator s where
- ByComparatorProj :: ByProjection s e -> ByComparator s
- ByComparatorComp :: Comparator comp => Greskell comp -> ByComparator (CompareArg comp)
- ByComparatorProjComp :: Comparator comp => ByProjection s (CompareArg comp) -> Greskell comp -> ByComparator s
- data LabeledByProjection s where
- LabeledByProjection :: AsLabel a -> ByProjection s a -> LabeledByProjection s
- (<*.>) :: Applicative f => f (Walk c b d) -> f (GTraversal c a b) -> f (GTraversal c a d)
- source :: Text -> Greskell GraphTraversalSource
- sV :: Vertex v => [Greskell (ElementID v)] -> Greskell GraphTraversalSource -> GTraversal Transform () v
- sV' :: [Greskell (ElementID AVertex)] -> Greskell GraphTraversalSource -> GTraversal Transform () AVertex
- sE :: Edge e => [Greskell (ElementID e)] -> Greskell GraphTraversalSource -> GTraversal Transform () e
- sE' :: [Greskell (ElementID AEdge)] -> Greskell GraphTraversalSource -> GTraversal Transform () AEdge
- sAddV :: Vertex v => Greskell Text -> Greskell GraphTraversalSource -> GTraversal SideEffect () v
- sAddV' :: Greskell Text -> Greskell GraphTraversalSource -> GTraversal SideEffect () AVertex
- (&.) :: GTraversal c a b -> Walk c b d -> GTraversal c a d
- ($.) :: Walk c b d -> GTraversal c a b -> GTraversal c a d
- (<$.>) :: Functor f => Walk c b d -> f (GTraversal c a b) -> f (GTraversal c a d)
- gIterate :: WalkType c => GTraversal c s e -> GTraversal c s ()
- unsafeGTraversal :: Text -> GTraversal c s e
- unsafeWalk :: WalkType c => Text -> [Text] -> Walk c s e
- modulateWith :: WalkType c => Walk c s e -> [Walk c e e] -> Walk c s e
- gIdentity :: WalkType c => Walk c s s
- gIdentity' :: Walk Filter s s
- gFilter :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s
- gCyclicPath :: WalkType c => Walk c a a
- gCyclicPath' :: Walk Filter a a
- gSimplePath :: WalkType c => Walk c a a
- gSimplePath' :: Walk Filter a a
- gIs :: WalkType c => Greskell v -> Walk c v v
- gIs' :: Greskell v -> Walk Filter v v
- gIsP :: WalkType c => Greskell (P v) -> Walk c v v
- gIsP' :: Greskell (P v) -> Walk Filter v v
- gHas1 :: (WalkType c, Element s) => Key s v -> Walk c s s
- gHas1' :: Element s => Key s v -> Walk Filter s s
- gHas2 :: (WalkType c, Element s) => Key s v -> Greskell v -> Walk c s s
- gHas2' :: Element s => Key s v -> Greskell v -> Walk Filter s s
- gHas2P :: (WalkType c, Element s) => Key s v -> Greskell (P v) -> Walk c s s
- gHas2P' :: Element s => Key s v -> Greskell (P v) -> Walk Filter s s
- gHasLabel :: (Element s, WalkType c) => Greskell Text -> Walk c s s
- gHasLabel' :: Element s => Greskell Text -> Walk Filter s s
- gHasLabelP :: (Element s, WalkType c) => Greskell (P Text) -> Walk c s s
- gHasLabelP' :: Element s => Greskell (P Text) -> Walk Filter s s
- gHasId :: (Element s, WalkType c) => Greskell (ElementID s) -> Walk c s s
- gHasId' :: Element s => Greskell (ElementID s) -> Walk Filter s s
- gHasIdP :: (Element s, WalkType c) => Greskell (P (ElementID s)) -> Walk c s s
- gHasIdP' :: Element s => Greskell (P (ElementID s)) -> Walk Filter s s
- gHasKey :: (Element (p v), Property p, WalkType c) => Greskell Text -> Walk c (p v) (p v)
- gHasKey' :: (Element (p v), Property p) => Greskell Text -> Walk Filter (p v) (p v)
- gHasKeyP :: (Element (p v), Property p, WalkType c) => Greskell (P Text) -> Walk c (p v) (p v)
- gHasKeyP' :: (Element (p v), Property p) => Greskell (P Text) -> Walk Filter (p v) (p v)
- gHasValue :: (Element (p v), Property p, WalkType c) => Greskell v -> Walk c (p v) (p v)
- gHasValue' :: (Element (p v), Property p) => Greskell v -> Walk Filter (p v) (p v)
- gHasValueP :: (Element (p v), Property p, WalkType c) => Greskell (P v) -> Walk c (p v) (p v)
- gHasValueP' :: (Element (p v), Property p) => Greskell (P v) -> Walk Filter (p v) (p v)
- gAnd :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => [g c s e] -> Walk p s s
- gOr :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => [g c s e] -> Walk p s s
- gNot :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s
- gWhereP1 :: WalkType c => Greskell (LabeledP a) -> Maybe (ByProjection a b) -> Walk c a a
- gWhereP1' :: Greskell (LabeledP a) -> Maybe (ByProjection a b) -> Walk Filter a a
- gWhereP2 :: WalkType c => AsLabel a -> Greskell (LabeledP a) -> Maybe (ByProjection a b) -> Walk c x x
- gWhereP2' :: AsLabel a -> Greskell (LabeledP a) -> Maybe (ByProjection a b) -> Walk Filter x x
- gOrder :: [ByComparator s] -> Walk Transform s s
- gRange :: Greskell Int -> Greskell Int -> Walk Transform s s
- gLimit :: Greskell Int -> Walk Transform s s
- gTail :: Greskell Int -> Walk Transform s s
- gSkip :: Greskell Int -> Walk Transform s s
- gRepeat :: (ToGTraversal g, WalkType c) => Maybe RepeatLabel -> Maybe (RepeatPos, RepeatUntil c s) -> Maybe (RepeatPos, RepeatEmit c s) -> g c s s -> Walk c s s
- gTimes :: Greskell Int -> Maybe (RepeatPos, RepeatUntil c s)
- gUntilHead :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatUntil c s)
- gUntilTail :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatUntil c s)
- gEmitHead :: Maybe (RepeatPos, RepeatEmit c s)
- gEmitTail :: Maybe (RepeatPos, RepeatEmit c s)
- gEmitHeadT :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatEmit c s)
- gEmitTailT :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatEmit c s)
- gLoops :: Maybe RepeatLabel -> Walk Transform s Int
- gLocal :: (ToGTraversal g, WalkType c) => g c s e -> Walk c s e
- gUnion :: (ToGTraversal g, WalkType c) => [g c s e] -> Walk c s e
- gCoalesce :: (ToGTraversal g, Split cc c, Lift Transform c, WalkType c, WalkType cc) => [g cc s e] -> Walk c s e
- gChoose3 :: (ToGTraversal g, Split cc c, WalkType cc, WalkType c) => g cc s ep -> g c s e -> g c s e -> Walk c s e
- gBarrier :: WalkType c => Maybe (Greskell Int) -> Walk c s s
- gDedup :: Maybe (ByProjection s e) -> Walk Transform s s
- gDedupN :: AsLabel a -> [AsLabel a] -> Maybe (ByProjection a e) -> Walk Transform s s
- gFlatMap :: (Lift Transform c, Split cc c, ToGTraversal g, WalkType c, WalkType cc) => g cc s e -> Walk c s e
- gFlatMap' :: ToGTraversal g => g Transform s e -> Walk Transform s e
- gV :: Vertex v => [Greskell (ElementID v)] -> Walk Transform s v
- gV' :: [Greskell (ElementID AVertex)] -> Walk Transform s AVertex
- gConstant :: Greskell a -> Walk Transform s a
- gProject :: LabeledByProjection s -> [LabeledByProjection s] -> Walk Transform s (PMap Single GValue)
- gAs :: AsLabel a -> Walk Transform a a
- gValues :: Element s => [Key s e] -> Walk Transform s e
- gProperties :: (Element s, Property p, ElementProperty s ~ p) => [Key s v] -> Walk Transform s (p v)
- gId :: Element s => Walk Transform s (ElementID s)
- gLabel :: Element s => Walk Transform s Text
- gValueMap :: Element s => Keys s -> Walk Transform s (PMap (ElementPropertyContainer s) GValue)
- gElementMap :: Element s => Keys s -> Walk Transform s (PMap Single GValue)
- gSelect1 :: AsLabel a -> Walk Transform s a
- gSelectN :: AsLabel a -> AsLabel b -> [AsLabel c] -> Walk Transform s (SelectedMap GValue)
- gSelectBy1 :: AsLabel a -> ByProjection a b -> Walk Transform s b
- gSelectByN :: AsLabel a -> AsLabel a -> [AsLabel a] -> ByProjection a b -> Walk Transform s (SelectedMap b)
- gUnfold :: AsIterator a => Walk Transform a (IteratorItem a)
- gPath :: Walk Transform s (Path GValue)
- gPathBy :: ByProjection a b -> [ByProjection a b] -> Walk Transform s (Path b)
- gFold :: Walk Transform a [a]
- gCount :: Walk Transform a Int
- gOut :: (Vertex v1, Vertex v2) => [Greskell Text] -> Walk Transform v1 v2
- gOut' :: Vertex v => [Greskell Text] -> Walk Transform v AVertex
- gOutE :: (Vertex v, Edge e) => [Greskell Text] -> Walk Transform v e
- gOutE' :: Vertex v => [Greskell Text] -> Walk Transform v AEdge
- gOutV :: (Edge e, Vertex v) => Walk Transform e v
- gOutV' :: Edge e => Walk Transform e AVertex
- gIn :: (Vertex v1, Vertex v2) => [Greskell Text] -> Walk Transform v1 v2
- gIn' :: Vertex v => [Greskell Text] -> Walk Transform v AVertex
- gInE :: (Vertex v, Edge e) => [Greskell Text] -> Walk Transform v e
- gInE' :: Vertex v => [Greskell Text] -> Walk Transform v AEdge
- gInV :: (Edge e, Vertex v) => Walk Transform e v
- gInV' :: Edge e => Walk Transform e AVertex
- gMatch :: Logic MatchPattern -> Walk Transform a MatchResult
- mPattern :: (WalkType c, Lift c Transform) => AsLabel a -> Walk c a b -> Logic MatchPattern
- gSideEffect :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s
- gSideEffect' :: (ToGTraversal g, WalkType c, Split c SideEffect) => g c s e -> Walk SideEffect s s
- gAddV :: Vertex v => Greskell Text -> Walk SideEffect a v
- gAddV' :: Greskell Text -> Walk SideEffect a AVertex
- gAddE :: (Vertex vs, Vertex ve, Edge e) => Greskell Text -> AddAnchor vs ve -> Walk SideEffect vs e
- gAddE' :: Greskell Text -> AddAnchor AVertex AVertex -> Walk SideEffect AVertex AEdge
- gFrom :: ToGTraversal g => g Transform s e -> AddAnchor s e
- gTo :: ToGTraversal g => g Transform s e -> AddAnchor s e
- gDrop :: Element e => Walk SideEffect e e
- gDropP :: Property p => Walk SideEffect (p a) (p a)
- gProperty :: Element e => Key e v -> Greskell v -> Walk SideEffect e e
- gPropertyV :: (Vertex e, vp ~ ElementProperty e, Property vp, Element (vp v)) => Maybe (Greskell Cardinality) -> Key e v -> Greskell v -> [KeyValue (vp v)] -> Walk SideEffect e e
- gBy :: (ProjectionLike p, ToGreskell p) => p -> ByProjection (ProjectionLikeStart p) (ProjectionLikeEnd p)
- gBy1 :: (ProjectionLike p, ToGreskell p) => p -> ByComparator (ProjectionLikeStart p)
- gBy2 :: (ProjectionLike p, ToGreskell p, Comparator comp, ProjectionLikeEnd p ~ CompareArg comp) => p -> Greskell comp -> ByComparator (ProjectionLikeStart p)
- gByL :: (ProjectionLike p, ToGreskell p) => AsLabel (ProjectionLikeEnd p) -> p -> LabeledByProjection (ProjectionLikeStart p)
- class Predicate p where
- data P a
- newtype PredicateA a = PredicateA {
- unPredicateA :: a -> Bool
- class ToGreskell (PParameter p) => PLike p where
- type PParameter p
- class Comparator c where
- type CompareArg c
- cCompare :: Greskell c -> Greskell (CompareArg c) -> Greskell (CompareArg c) -> Greskell Int
- cReversed :: Greskell c -> Greskell c
- cThenComparing :: Greskell c -> Greskell c -> Greskell c
- newtype ComparatorA a = ComparatorA {
- unComparatorA :: a -> a -> Int
- data Order a
- pNot :: PLike p => Greskell p -> Greskell p
- pEq :: PLike p => PParameter p -> Greskell p
- pNeq :: PLike p => PParameter p -> Greskell p
- pLt :: PLike p => PParameter p -> Greskell p
- pLte :: PLike p => PParameter p -> Greskell p
- pGt :: PLike p => PParameter p -> Greskell p
- pGte :: PLike p => PParameter p -> Greskell p
- pInside :: PLike p => PParameter p -> PParameter p -> Greskell p
- pOutside :: PLike p => PParameter p -> PParameter p -> Greskell p
- pBetween :: PLike p => PParameter p -> PParameter p -> Greskell p
- pWithin :: PLike p => [PParameter p] -> Greskell p
- pWithout :: PLike p => [PParameter p] -> Greskell p
- oDesc :: Greskell (Order a)
- oAsc :: Greskell (Order a)
- oDecr :: Greskell (Order a)
- oIncr :: Greskell (Order a)
- oShuffle :: Greskell (Order a)
- class Property p where
- propertyKey :: p v -> Text
- propertyValue :: p v -> v
- newtype Key a b = Key {}
- data KeyValue a where
- class Element e => Edge e
- class Element v => Vertex v
- data Cardinality
- data T a b
- class ElementData e => Element e where
- type ElementProperty e :: Type -> Type
- type ElementPropertyContainer e :: Type -> Type
- class ElementData e where
- elementId :: e -> ElementID e
- elementLabel :: e -> Text
- newtype ElementID e = ElementID {}
- data Keys a where
- newtype Path a = Path {}
- data PathEntry a = PathEntry {}
- data AVertex = AVertex {}
- data AEdge = AEdge {}
- data AVertexProperty v = AVertexProperty {}
- data AProperty v = AProperty {}
- key :: Text -> Key a b
- unsafeCastElementID :: ElementID a -> ElementID b
- tId :: Element a => Greskell (T a (ElementID a))
- tKey :: (Element (p v), Property p) => Greskell (T (p v) Text)
- tLabel :: Element a => Greskell (T a Text)
- tValue :: (Element (p v), Property p) => Greskell (T (p v) v)
- cList :: Greskell Cardinality
- cSet :: Greskell Cardinality
- cSingle :: Greskell Cardinality
- unsafeCastKey :: Key a1 b1 -> Key a2 b2
- (=:) :: Key a b -> Greskell b -> KeyValue a
- singletonKeys :: Key a b -> Keys a
- toGremlinKeys :: Keys a -> [Text]
- (-:) :: Key a b -> Keys a -> Keys a
- pathToPMap :: Path a -> PMap Multi a
- makePathEntry :: [AsLabel a] -> a -> PathEntry a
- data Parser a
- class FromGraphSON a where
- parseGraphSON :: GValue -> Parser a
- class GraphSONTyped a where
- gsonTypeFor :: a -> Text
- data GraphSON v = GraphSON {}
- data GValueBody
- data GValue
- parseEither :: FromGraphSON a => GValue -> Either String a
- (.:) :: FromGraphSON a => KeyMap GValue -> Key -> Parser a
- nonTypedGraphSON :: v -> GraphSON v
- typedGraphSON :: GraphSONTyped v => v -> GraphSON v
- typedGraphSON' :: Text -> v -> GraphSON v
- parseTypedGraphSON :: (GraphSONTyped v, FromJSON v) => Value -> Parser (GraphSON v)
- nonTypedGValue :: GValueBody -> GValue
- typedGValue' :: Text -> GValueBody -> GValue
- parseUnwrapAll :: FromJSON a => GValue -> Parser a
- parseUnwrapList :: (IsList a, i ~ Item a, FromGraphSON i) => GValue -> Parser a
- parseJSONViaGValue :: FromGraphSON a => Value -> Parser a
- data GMapEntry k v = GMapEntry {
- gmapEntryFlat :: !Bool
- gmapEntryKey :: !k
- gmapEntryValue :: !v
- data GMap (c :: Type -> Type -> Type) k v = GMap {}
- newtype FlattenedMap (c :: Type -> Type -> Type) k v = FlattenedMap {
- unFlattenedMap :: c k v
- toList :: forall (c :: Type -> Type -> Type) k v. (IsList (c k v), Item (c k v) ~ (k, v)) => GMap c k v -> [GMapEntry k v]
- singleton :: forall (c :: Type -> Type -> Type) k v. (IsList (c k v), Item (c k v) ~ (k, v)) => GMapEntry k v -> GMap c k v
- parseToFlattenedMap :: forall (c :: Type -> Type -> Type) k v s. (IsList (c k v), Item (c k v) ~ (k, v)) => (s -> Parser k) -> (s -> Parser v) -> Vector s -> Parser (FlattenedMap c k v)
- parseToGMap :: (IsList (c k v), Item (c k v) ~ (k, v)) => (s -> Parser k) -> (s -> Parser v) -> (KeyMap s -> Parser (c k v)) -> Either (KeyMap s) (Vector s) -> Parser (GMap c k v)
- unGMap :: GMap c k v -> c k v
- parseToGMapEntry :: FromJSONKey k => (s -> Parser k) -> (s -> Parser v) -> Either (KeyMap s) (Vector s) -> Parser (GMapEntry k v)
- unGMapEntry :: GMapEntry k v -> (k, v)
- module Data.Greskell.AsIterator
- module Data.Greskell.AsLabel
- module Data.Greskell.PMap
Documentation
class ToGreskell a where #
Something that can convert to Greskell
.
Methods
toGreskell :: a -> Greskell (GreskellReturn a) #
Instances
type family GreskellReturn a #
type of return value by Greskell.
Instances
type GreskellReturn RepeatLabel Source # | |
Defined in Data.Greskell.GTraversal | |
type GreskellReturn (AsLabel a) Source # | |
Defined in Data.Greskell.AsLabel | |
type GreskellReturn (Greskell a) | |
Defined in Data.Greskell.Greskell | |
type GreskellReturn (Key a b) Source # | |
Defined in Data.Greskell.Graph | |
type GreskellReturn (GTraversal c s e) Source # | |
Defined in Data.Greskell.GTraversal | |
type GreskellReturn (Walk c s e) Source # | |
Defined in Data.Greskell.GTraversal |
Gremlin expression of type a
.
Greskell
is essentially just a piece of Gremlin script with a
phantom type. The type a
represents the type of data that the
script is supposed to evaluate to.
Eq
and Ord
instances compare Gremlin scripts, NOT the values
they evaluate to.
Instances
number :: Scientific -> Greskell Scientific #
Arbitrary precision number literal, like "123e8".
string :: Text -> Greskell Text #
Create a String literal in Gremlin script. The content is automatically escaped.
Unsafely create a Greskell
of arbitrary type. The given Gremlin
script is printed as-is.
Same as unsafeGreskell
, but it takes lazy Text
.
single :: Greskell a -> Greskell [a] #
Make a list with a single object. Useful to prevent the Gremlin Server from automatically iterating the result object.
valueInt :: Integral a => a -> Greskell Value #
Integer literal as Value
type.
Since: greskell-core-0.1.2.0
gvalueInt :: Integral a => a -> Greskell GValue #
Integer literal as GValue
type.
Since: greskell-core-0.1.2.0
toGremlin :: ToGreskell a => a -> Text #
Create a readable Gremlin script from Greskell
.
toGremlinLazy :: ToGreskell a => a -> Text #
Unsafely create a Greskell
that calls the given function with
the given arguments.
Arguments
:: Greskell a | target object |
-> Text | method name |
-> [Text] | arguments |
-> Greskell b | return value of the method call |
Unsafely create a Greskell
that calls the given object method
call with the given target and arguments.
module Data.Greskell.Binder
class Lift from to where Source #
Relation of WalkType
s where one includes the other. from
can
be lifted to to
, because to
is more powerful than from
.
Instances
WalkType c => Lift Filter c Source # | |
Lift SideEffect SideEffect Source # | |
Defined in Data.Greskell.GTraversal Methods showLift :: Proxy SideEffect -> Proxy SideEffect -> String Source # | |
Lift Transform SideEffect Source # | |
Defined in Data.Greskell.GTraversal | |
Lift Transform Transform Source # | |
newtype GTraversal c s e Source #
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.
Constructors
GTraversal | |
Fields
|
Instances
data GraphTraversal c s e Source #
Phantom type for GraphTraversal
class. In greskell, we usually
use GTraversal
instead of Greskell
GraphTraversal
.
Instances
class ToGTraversal g where Source #
Types that can convert to GTraversal
.
Methods
toGTraversal :: WalkType c => g c s e -> GTraversal c s e Source #
liftWalk :: (WalkType from, WalkType to, Lift from to) => g from s e -> g to s e Source #
Lift WalkType
from
to to
. Use this for type matching.
unsafeCastStart :: WalkType c => g c s1 e -> g c s2 e Source #
Unsafely cast the start type s1
into s2
.
It is recommended that s2
is coercible to s1
in terms of
FromGraphSON
. That is, if s2
can parse a GValue
, s1
should also be able to parse that GValue
.
Since: 1.0.0.0
unsafeCastEnd :: WalkType c => g c s e1 -> g c s e2 Source #
Unsafely cast the end type e1
into e2
. See
unsafeCastStart
.
Since: 1.0.0.0
Instances
ToGTraversal GTraversal Source # | |
Defined in Data.Greskell.GTraversal Methods toGTraversal :: WalkType c => GTraversal c s e -> GTraversal c s e Source # liftWalk :: (WalkType from, WalkType to, Lift from to) => GTraversal from s e -> GTraversal to s e Source # unsafeCastStart :: WalkType c => GTraversal c s1 e -> GTraversal c s2 e Source # unsafeCastEnd :: WalkType c => GTraversal c s e1 -> GTraversal c s e2 Source # | |
ToGTraversal Walk Source # | To convert a |
Defined in Data.Greskell.GTraversal Methods toGTraversal :: WalkType c => Walk c s e -> GTraversal c s e Source # liftWalk :: (WalkType from, WalkType to, Lift from to) => Walk from s e -> Walk to s e Source # unsafeCastStart :: WalkType c => Walk c s1 e -> Walk c s2 e Source # unsafeCastEnd :: WalkType c => Walk c s e1 -> Walk c s e2 Source # |
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 Walk
s. 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.
Instances
data GraphTraversalSource Source #
GraphTraversalSource
class object of TinkerPop. It is a factory
object of GraphTraversal
s.
Instances
Show GraphTraversalSource Source # | |
Defined in Data.Greskell.GTraversal Methods showsPrec :: Int -> GraphTraversalSource -> ShowS # show :: GraphTraversalSource -> String # showList :: [GraphTraversalSource] -> ShowS # |
class WalkType t where Source #
Class of phantom type markers to describe the effect of the walk/traversals.
Instances
WalkType Filter Source # | |
Defined in Data.Greskell.GTraversal | |
WalkType SideEffect Source # | |
Defined in Data.Greskell.GTraversal Methods showWalkType :: Proxy SideEffect -> String Source # | |
WalkType Transform Source # | |
Defined in Data.Greskell.GTraversal |
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.
(gSideEffect w == gIdentity) AND (gFilter w == w)
If Walk
s w1
and w2
are Filter
type, then
gAnd [w1, w2] == w1 >>> w2 == w2 >>> w1
Instances
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
Instances
data SideEffect Source #
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 }
Instances
WalkType SideEffect Source # | |
Defined in Data.Greskell.GTraversal Methods showWalkType :: Proxy SideEffect -> String Source # | |
Lift SideEffect SideEffect Source # | |
Defined in Data.Greskell.GTraversal Methods showLift :: Proxy SideEffect -> Proxy SideEffect -> String Source # | |
Lift Transform SideEffect Source # | |
Defined in Data.Greskell.GTraversal | |
Split SideEffect SideEffect Source # |
|
Defined in Data.Greskell.GTraversal Methods showSplit :: Proxy SideEffect -> Proxy SideEffect -> String Source # |
class Split c p where Source #
Relation of WalkType
s 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.
Instances
WalkType p => Split Filter p Source # | |
Split SideEffect SideEffect Source # |
|
Defined in Data.Greskell.GTraversal Methods showSplit :: Proxy SideEffect -> Proxy SideEffect -> String Source # | |
WalkType p => Split Transform p Source # |
|
data RepeatUntil c s where Source #
.until
or .times
modulator step.
Type c
is the WalkType
of the parent .repeat
step. Type s
is the start (and end) type of the .repeat
step.
Since: 1.0.1.0
Constructors
RepeatTimes :: Greskell Int -> RepeatUntil c s |
|
RepeatUntilT :: (WalkType cc, WalkType c, Split cc c) => GTraversal cc s e -> RepeatUntil c s |
|
Instances
Show (RepeatUntil c s) Source # | |
Defined in Data.Greskell.GTraversal Methods showsPrec :: Int -> RepeatUntil c s -> ShowS # show :: RepeatUntil c s -> String # showList :: [RepeatUntil c s] -> ShowS # |
data RepeatEmit c s where Source #
.emit
modulator step.
Type c
is the WalkType
of the parent .repeat
step. Type s
is the start (and end) type of the .repeat
step.
Since: 1.0.1.0
Constructors
RepeatEmit :: RepeatEmit c s |
|
RepeatEmitT :: (WalkType cc, WalkType c, Split cc c) => GTraversal cc s e -> RepeatEmit c s |
|
Instances
Show (RepeatEmit c s) Source # | |
Defined in Data.Greskell.GTraversal Methods showsPrec :: Int -> RepeatEmit c s -> ShowS # show :: RepeatEmit c s -> String # showList :: [RepeatEmit c s] -> ShowS # |
Position of a step modulator relative to .repeat
step.
Since: 1.0.1.0
Constructors
RepeatHead | Modulator before the |
RepeatTail | Modulator after the |
Instances
Bounded RepeatPos Source # | |
Enum RepeatPos Source # | |
Defined in Data.Greskell.GTraversal Methods succ :: RepeatPos -> RepeatPos # pred :: RepeatPos -> RepeatPos # fromEnum :: RepeatPos -> Int # enumFrom :: RepeatPos -> [RepeatPos] # enumFromThen :: RepeatPos -> RepeatPos -> [RepeatPos] # enumFromTo :: RepeatPos -> RepeatPos -> [RepeatPos] # enumFromThenTo :: RepeatPos -> RepeatPos -> RepeatPos -> [RepeatPos] # | |
Show RepeatPos Source # | |
Eq RepeatPos Source # | |
Ord RepeatPos Source # | |
newtype RepeatLabel Source #
A label that points to a loop created by .repeat
step. It can
be used by .loops
step to specify the loop.
Since: 1.0.1.0
Constructors
RepeatLabel | |
Fields |
Instances
data MatchPattern where Source #
A pattern for .match
step.
Since: 1.2.0.0
Constructors
MatchPattern :: AsLabel a -> Walk Transform a b -> MatchPattern | A pattern with the starting |
data MatchResult Source #
Result of .match
step.
Since: 1.2.0.0
data ByProjection s e where Source #
Projection from type s
to type e
used in .by
step. You can
also use gBy
to construct ByProjection
.
Constructors
ByProjection :: (ProjectionLike p, ToGreskell p) => p -> ByProjection (ProjectionLikeStart p) (ProjectionLikeEnd p) |
Instances
IsString (ByProjection s e) Source # | Projection by literal property key. |
Defined in Data.Greskell.GTraversal Methods fromString :: String -> ByProjection s e # | |
ProjectionLike (ByProjection s e) Source # | |
Defined in Data.Greskell.GTraversal Associated Types type ProjectionLikeStart (ByProjection s e) Source # type ProjectionLikeEnd (ByProjection s e) Source # | |
type ProjectionLikeEnd (ByProjection s e) Source # | |
Defined in Data.Greskell.GTraversal | |
type ProjectionLikeStart (ByProjection s e) Source # | |
Defined in Data.Greskell.GTraversal |
class ProjectionLike p Source #
Data types that mean a projection from one type to another.
Associated Types
type ProjectionLikeStart p Source #
The start type of the projection.
type ProjectionLikeEnd p Source #
The end type of the projection.
Instances
data ByComparator s where Source #
Comparison of type s
used in .by
step. You can also use
gBy1
and gBy2
to construct ByComparator
.
Constructors
ByComparatorProj :: ByProjection s e -> ByComparator s | Type |
ByComparatorComp :: Comparator comp => Greskell comp -> ByComparator (CompareArg comp) | Type |
ByComparatorProjComp :: Comparator comp => ByProjection s (CompareArg comp) -> Greskell comp -> ByComparator s | Type |
Instances
IsString (ByComparator s) Source # |
|
Defined in Data.Greskell.GTraversal Methods fromString :: String -> ByComparator s # |
data LabeledByProjection s where Source #
A ByProjection
associated with an AsLabel
. You can construct
it by gByL
.
Since: 1.0.0.0
Constructors
LabeledByProjection :: AsLabel a -> ByProjection s a -> LabeledByProjection s |
(<*.>) :: Applicative f => f (Walk c b d) -> f (GTraversal c a b) -> f (GTraversal c a d) infixr 0 Source #
Arguments
:: Text | variable name of |
-> Greskell GraphTraversalSource |
Create GraphTraversalSource
from a varible name in Gremlin
Arguments
:: Vertex v | |
=> [Greskell (ElementID v)] | vertex IDs |
-> Greskell GraphTraversalSource | |
-> GTraversal Transform () v |
.V()
method on GraphTraversalSource
.
Arguments
:: [Greskell (ElementID AVertex)] | vertex IDs |
-> Greskell GraphTraversalSource | |
-> GTraversal Transform () AVertex |
Monomorphic version of sV
.
Arguments
:: Edge e | |
=> [Greskell (ElementID e)] | edge IDs |
-> Greskell GraphTraversalSource | |
-> GTraversal Transform () e |
.E()
method on GraphTraversalSource
.
Arguments
:: [Greskell (ElementID AEdge)] | edge IDs |
-> Greskell GraphTraversalSource | |
-> GTraversal Transform () AEdge |
Monomorphic version of sE
.
Arguments
:: Vertex v | |
=> Greskell Text | vertex label |
-> Greskell GraphTraversalSource | |
-> GTraversal SideEffect () v |
.addV()
method on GraphTraversalSource
.
Since: 0.2.0.0
sAddV' :: Greskell Text -> Greskell GraphTraversalSource -> GTraversal SideEffect () AVertex Source #
Monomorphic version of sAddV
.
Since: 0.2.0.0
(&.) :: GTraversal c a b -> Walk c b d -> GTraversal c a d infixl 1 Source #
Apply the Walk
to the GTraversal
. In Gremlin, this means
calling a chain of methods on the Traversal object.
($.) :: Walk c b d -> GTraversal c a b -> GTraversal c a d infixr 0 Source #
Same as &.
with arguments flipped.
(<$.>) :: Functor f => Walk c b d -> f (GTraversal c a b) -> f (GTraversal c a d) infixr 0 Source #
gIterate :: WalkType c => GTraversal c s e -> GTraversal c s () Source #
.iterate
method on GraphTraversal
.
gIterate
is not a Walk
because it's usually used to terminate
the method chain of Gremlin steps. The returned GTraversal
outputs nothing, thus its end type is ()
.
Since: 1.1.0.0
unsafeGTraversal :: Text -> GTraversal c s e Source #
Unsafely create GTraversal
from the given raw Gremlin script.
Arguments
:: WalkType c | |
=> Text | step method name (e.g. "outE") |
-> [Text] | step method arguments |
-> Walk c s e |
Unsafely create a Walk
that represents a single method call on
a GraphTraversal
.
gFilter :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s Source #
.filter
step that takes a traversal.
gCyclicPath :: WalkType c => Walk c a a Source #
.cyclicPath
step.
Since: 1.0.1.0
gCyclicPath' :: Walk Filter a a Source #
Monomorphic version of gCyclicPath
.
Since: 1.0.1.0
gSimplePath :: WalkType c => Walk c a a Source #
.simplePath
step.
Since: 1.0.1.0
gSimplePath' :: Walk Filter a a Source #
Monomorphic version of gSimplePath
.
Since: 1.0.1.0
.has
step with one argument.
gHas2 :: (WalkType c, Element s) => Key s v -> Greskell v -> Walk c s s Source #
.has
step with two arguments.
gHas2' :: Element s => Key s v -> Greskell v -> Walk Filter s s Source #
Monomorphic verson of gHas2
.
Arguments
:: (WalkType c, Element s) | |
=> Key s v | property key |
-> Greskell (P v) | predicate on the property value |
-> Walk c s s |
.has
step with two arguments and P
type.
gHas2P' :: Element s => Key s v -> Greskell (P v) -> Walk Filter s s Source #
Monomorphic version of gHas2P
.
gHasLabel' :: Element s => Greskell Text -> Walk Filter s s Source #
Monomorphic version of gHasLabel
.
.hasLabel
step with P
type. Supported since TinkerPop 3.2.7.
gHasLabelP' :: Element s => Greskell (P Text) -> Walk Filter s s Source #
Monomorphic version of gHasLabelP
.
gHasId' :: Element s => Greskell (ElementID s) -> Walk Filter s s Source #
Monomorphic version of gHasId
.
gHasIdP :: (Element s, WalkType c) => Greskell (P (ElementID s)) -> Walk c s s Source #
.hasId
step with P
type. Supported since TinkerPop 3.2.7.
gHasIdP' :: Element s => Greskell (P (ElementID s)) -> Walk Filter s s Source #
Monomorphic version of gHasIdP
.
gHasKey :: (Element (p v), Property p, WalkType c) => Greskell Text -> Walk c (p v) (p v) Source #
.hasKey
step. The input type should be a VertexProperty.
gHasKey' :: (Element (p v), Property p) => Greskell Text -> Walk Filter (p v) (p v) Source #
Monomorphic version of gHasKey
.
Arguments
:: (Element (p v), Property p, WalkType c) | |
=> Greskell (P Text) | predicate on the VertexProperty's key. |
-> Walk c (p v) (p v) |
.hasKey
step with P
type. Supported since TinkerPop 3.2.7.
gHasKeyP' :: (Element (p v), Property p) => Greskell (P Text) -> Walk Filter (p v) (p v) Source #
Monomorphic version of gHasKeyP
.
gHasValue :: (Element (p v), Property p, WalkType c) => Greskell v -> Walk c (p v) (p v) Source #
.hasValue
step. The input type should be a VertexProperty.
gHasValue' :: (Element (p v), Property p) => Greskell v -> Walk Filter (p v) (p v) Source #
Monomorphic version of gHasValue
.
Arguments
:: (Element (p v), Property p, WalkType c) | |
=> Greskell (P v) | predicate on the VertexProperty's value |
-> Walk c (p v) (p v) |
.hasValue
step with P
type. Supported since TinkerPop 3.2.7.
gHasValueP' :: (Element (p v), Property p) => Greskell (P v) -> Walk Filter (p v) (p v) Source #
Monomorphic version of gHasValueP
.
gAnd :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => [g c s e] -> Walk p s s Source #
.and
step.
gOr :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => [g c s e] -> Walk p s s Source #
.or
step.
gNot :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s Source #
.not
step.
Arguments
:: WalkType c | |
=> Greskell (LabeledP a) | the |
-> Maybe (ByProjection a b) | optional |
-> Walk c a a |
.where
step with P
argument only.
If the ByProjection
argument is Nothing
, comparison is
performed on the type a
. You have to ensure that the comparator
included in the LabeledP
argument can handle the type
a
. Usually this means the type a
should implement Java's
Comparable
interface (this is true for most Java classes).
If the ByProjection
argument is given, comparison is performed on
the projected values of type b
. So, the type b
should implement
Java's Comparable
interface.
Since: 1.2.0.0
gWhereP1' :: Greskell (LabeledP a) -> Maybe (ByProjection a b) -> Walk Filter a a Source #
Monomorphic version of gWhereP1
.
Since: 1.2.0.0
Arguments
:: WalkType c | |
=> AsLabel a | the starting label of |
-> Greskell (LabeledP a) | the |
-> Maybe (ByProjection a b) | optional |
-> Walk c x x |
.where
step with the starting label and P
arguments. See also
gWhereP1
.
Since: 1.2.0.0
gWhereP2' :: AsLabel a -> Greskell (LabeledP a) -> Maybe (ByProjection a b) -> Walk Filter x x Source #
Monomorphic version of gWhereP2
.
Since: 1.2.0.0
Arguments
:: [ByComparator s] | following |
-> Walk Transform s s |
.order
step.
ByComparator
is an IsString
, meaning projection by the given
key.
Arguments
:: (ToGTraversal g, WalkType c) | |
=> Maybe RepeatLabel | Label for the loop. |
-> Maybe (RepeatPos, RepeatUntil c s) |
|
-> Maybe (RepeatPos, RepeatEmit c s) |
|
-> g c s s | Repeated traversal |
-> Walk c s s |
.repeat
step.
Since: 1.0.1.0
Arguments
:: Greskell Int | Repeat count. If it's less than or equal to 0, the repeated traversal is never executed. |
-> Maybe (RepeatPos, RepeatUntil c s) |
.times
modulator before the .repeat
step. It always returns
Just
.
Since: 1.0.1.0
gUntilHead :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatUntil c s) Source #
.until
modulator before the .repeat
step. It always returns
Just
.
Since: 1.0.1.0
gUntilTail :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatUntil c s) Source #
.until
modulator after the .repeat
step. It always returns
Just
.
Since: 1.0.1.0
gEmitHead :: Maybe (RepeatPos, RepeatEmit c s) Source #
.emit
modulator without argument before the .repeat
step. It
always returns Just
.
Since: 1.0.1.0
gEmitTail :: Maybe (RepeatPos, RepeatEmit c s) Source #
.emit
modulator without argument after the .repeat
step. It
always returns Just
.
Since: 1.0.1.0
gEmitHeadT :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatEmit c s) Source #
.emit
modulator with a sub-traversal argument before the
.repeat
step. It always returns Just
.
Since: 1.0.1.0
gEmitTailT :: (ToGTraversal g, WalkType c, WalkType cc, Split cc c) => g cc s e -> Maybe (RepeatPos, RepeatEmit c s) Source #
.emit
modulator with a sub-traversal argument after the
.repeat
step. It always returns Just
.
Since: 1.0.1.0
gUnion :: (ToGTraversal g, WalkType c) => [g c s e] -> Walk c s e Source #
.union
step.
Since: 1.0.1.0
gCoalesce :: (ToGTraversal g, Split cc c, Lift Transform c, WalkType c, WalkType cc) => [g cc s e] -> Walk c s e Source #
Arguments
:: (ToGTraversal g, Split cc c, WalkType cc, WalkType c) | |
=> g cc s ep | the predicate traversal. |
-> g c s e | The traversal executed if the predicate traversal outputs something. |
-> g c s e | The traversal executed if the predicate traversal outputs nothing. |
-> Walk c s e |
.choose
step with if-then-else style.
Since: 1.0.1.0
Arguments
:: WalkType c | |
=> Maybe (Greskell Int) | Max number of traversers kept at this barrier. |
-> Walk c s s |
.barrier
step.
Since: 1.0.1.0
Arguments
:: Maybe (ByProjection s e) |
|
-> Walk Transform s s |
.dedup
step without argument.
.dedup
step is Transform
because the filtering decision depends
on the sequence (order) of input elements.
Since: 1.0.1.0
gDedupN :: AsLabel a -> [AsLabel a] -> Maybe (ByProjection a e) -> Walk Transform s s Source #
.dedup
step with at least one argument. The tuple specified by
the AsLabel
s is used as the criterion of deduplication.
Since: 1.0.1.0
gFlatMap :: (Lift Transform c, Split cc c, ToGTraversal g, WalkType c, WalkType cc) => g cc s e -> Walk c s e Source #
gFlatMap' :: ToGTraversal g => g Transform s e -> Walk Transform s e Source #
Monomorphic version of gFlatMap
.
Since: 1.1.0.0
gV :: Vertex v => [Greskell (ElementID v)] -> Walk Transform s v Source #
.V
step.
For each input item, .V
step emits vertices selected by the
argument (or all vertices if the empty list is passed.)
Since: 0.2.0.0
gV' :: [Greskell (ElementID AVertex)] -> Walk Transform s AVertex Source #
Monomorphic version of gV
.
Since: 0.2.0.0
gProject :: LabeledByProjection s -> [LabeledByProjection s] -> Walk Transform s (PMap Single GValue) Source #
.project
step.
Since: 1.0.0.0
gProperties :: (Element s, Property p, ElementProperty s ~ p) => [Key s v] -> Walk Transform s (p v) Source #
.properties
step.
gValueMap :: Element s => Keys s -> Walk Transform s (PMap (ElementPropertyContainer s) GValue) Source #
.valueMap
step.
Since: 1.0.0.0
gElementMap :: Element s => Keys s -> Walk Transform s (PMap Single GValue) Source #
.elementMap
step.
Since: 2.0.1.0
gSelectN :: AsLabel a -> AsLabel b -> [AsLabel c] -> Walk Transform s (SelectedMap GValue) Source #
.select
step with more than one arguments.
Since: 0.2.2.0
gSelectBy1 :: AsLabel a -> ByProjection a b -> Walk Transform s b Source #
.select
step with one argument followed by .by
step.
Since: 0.2.2.0
gSelectByN :: AsLabel a -> AsLabel a -> [AsLabel a] -> ByProjection a b -> Walk Transform s (SelectedMap b) Source #
.select
step with more than one arguments followed by .by
step.
Since: 0.2.2.0
gUnfold :: AsIterator a => Walk Transform a (IteratorItem a) Source #
.unfold
step.
Note that we use AsIterator
here because basically the .unfold
step does the same thing as IteratorUtils.asIterator
function in
Tinkerpop. However, Tinkerpop's implementation of .unfold
step
doesn't necessarily use asIterator
, so there may be some corner
cases where asIterator
and .unfold
step behave differently.
Since: 1.0.1.0
gPathBy :: ByProjection a b -> [ByProjection a b] -> Walk Transform s (Path b) Source #
.path
step with one or more .by
modulations.
Since: 1.1.0.0
.out
step
Monomorphic version of gOut
.
.outE
step
gOutE' :: Vertex v => [Greskell Text] -> Walk Transform v AEdge Source #
Monomorphic version of gOutE
.
.in
step
.inE
step.
Monomorphic version of gInE
.
gMatch :: Logic MatchPattern -> Walk Transform a MatchResult Source #
.match
step.
If the top-level Logic
of the argument is And
, the
patterns are directly passed to the .match
step arguments.
The result of .match
step, MatchResult
, is an opaque
type. Basically you should not use it. Instead, you should use
gSelectN
etc to access the path history labels inside the
MatchPattern
.
See also: https://groups.google.com/g/gremlin-users/c/HVtldzV0Xk8
Since: 1.2.0.0
mPattern :: (WalkType c, Lift c Transform) => AsLabel a -> Walk c a b -> Logic MatchPattern Source #
A convenient function to make a MatchPattern
wrapped by
Leaf
.
Since: 1.2.0.0
gSideEffect :: (ToGTraversal g, WalkType c, WalkType p, Split c p) => g c s e -> Walk p s s Source #
.sideEffect
step that takes a traversal.
gSideEffect' :: (ToGTraversal g, WalkType c, Split c SideEffect) => g c s e -> Walk SideEffect s s Source #
Monomorphic version of gSideEffect
. The result walk is always
SideEffect
type.
gAddE :: (Vertex vs, Vertex ve, Edge e) => Greskell Text -> AddAnchor vs ve -> Walk SideEffect vs e Source #
.addE
step. Supported since TinkerPop 3.1.0.
Since: 0.2.0.0
gAddE' :: Greskell Text -> AddAnchor AVertex AVertex -> Walk SideEffect AVertex AEdge Source #
Monomorphic version of gAddE
.
Since: 0.2.0.0
gFrom :: ToGTraversal g => g Transform s e -> AddAnchor s e Source #
.from
step with a traversal.
Since: 0.2.0.0
gTo :: ToGTraversal g => g Transform s e -> AddAnchor s e Source #
.to
step with a traversal.
Since: 0.2.0.0
Arguments
:: Element e | |
=> Key e v | key of the property |
-> Greskell v | value of the property |
-> Walk SideEffect e e |
Simple .property
step. It adds a value to the property.
Since: 0.2.0.0
Arguments
:: (Vertex e, vp ~ ElementProperty e, Property vp, Element (vp v)) | |
=> Maybe (Greskell Cardinality) | optional cardinality of the vertex property. |
-> Key e v | key of the vertex property |
-> Greskell v | value of the vertex property |
-> [KeyValue (vp v)] | optional meta-properties for the vertex property. |
-> Walk SideEffect e e |
.property
step for Vertex
.
Since: 0.2.0.0
gBy :: (ProjectionLike p, ToGreskell p) => p -> ByProjection (ProjectionLikeStart p) (ProjectionLikeEnd p) Source #
.by
step with 1 argument, used for projection.
gBy1 :: (ProjectionLike p, ToGreskell p) => p -> ByComparator (ProjectionLikeStart p) Source #
.by
step with 1 argument, used for comparison.
gBy2 :: (ProjectionLike p, ToGreskell p, Comparator comp, ProjectionLikeEnd p ~ CompareArg comp) => p -> Greskell comp -> ByComparator (ProjectionLikeStart p) Source #
.by
step with 2 arguments, used for comparison.
gByL :: (ProjectionLike p, ToGreskell p) => AsLabel (ProjectionLikeEnd p) -> p -> LabeledByProjection (ProjectionLikeStart p) Source #
.by
step associated with an AsLabel
.
Since: 1.0.0.0
class Predicate p where Source #
java.util.function.Predicate
interface.
A Predicate
p
is a function that takes PredicateArg
p
and
returns Bool
.
Minimal complete definition
Nothing
Associated Types
type PredicateArg p Source #
Methods
pAnd :: Greskell p -> Greskell p -> Greskell p Source #
.and
method.
pOr :: Greskell p -> Greskell p -> Greskell p Source #
.or
method.
pTest :: Greskell p -> Greskell (PredicateArg p) -> Greskell Bool Source #
.test
method.
pNegate :: Greskell p -> Greskell p Source #
.nagate
method.
Instances
Predicate (P a) Source # | |
Defined in Data.Greskell.Gremlin Associated Types type PredicateArg (P a) Source # | |
Predicate (PredicateA a) Source # | |
Defined in Data.Greskell.Gremlin Associated Types type PredicateArg (PredicateA a) Source # Methods pAnd :: Greskell (PredicateA a) -> Greskell (PredicateA a) -> Greskell (PredicateA a) Source # pOr :: Greskell (PredicateA a) -> Greskell (PredicateA a) -> Greskell (PredicateA a) Source # pTest :: Greskell (PredicateA a) -> Greskell (PredicateArg (PredicateA a)) -> Greskell Bool Source # pNegate :: Greskell (PredicateA a) -> Greskell (PredicateA a) Source # |
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.
Instances
PLike (P a) Source # | You can construct |
Defined in Data.Greskell.Gremlin Associated Types type PParameter (P a) Source # | |
Predicate (P a) Source # | |
Defined in Data.Greskell.Gremlin Associated Types type PredicateArg (P a) Source # | |
GraphSONTyped (P a) Source # | |
Defined in Data.Greskell.Gremlin Methods gsonTypeFor :: P a -> Text # | |
type PParameter (P a) Source # | |
Defined in Data.Greskell.Gremlin | |
type PredicateArg (P a) Source # | |
Defined in Data.Greskell.Gremlin |
newtype PredicateA a Source #
Type for anonymous class of Predicate
interface.
Constructors
PredicateA | |
Fields
|
Instances
Predicate (PredicateA a) Source # | |
Defined in Data.Greskell.Gremlin Associated Types type PredicateArg (PredicateA a) Source # Methods pAnd :: Greskell (PredicateA a) -> Greskell (PredicateA a) -> Greskell (PredicateA a) Source # pOr :: Greskell (PredicateA a) -> Greskell (PredicateA a) -> Greskell (PredicateA a) Source # pTest :: Greskell (PredicateA a) -> Greskell (PredicateArg (PredicateA a)) -> Greskell Bool Source # pNegate :: Greskell (PredicateA a) -> Greskell (PredicateA a) Source # | |
type PredicateArg (PredicateA a) Source # | |
Defined in Data.Greskell.Gremlin |
class ToGreskell (PParameter p) => PLike p Source #
Type that is compatible with P
. You can construct a value of
type Greskell p
using values of PParameter p
.
Note that the type of constuctor arguments (i.e. GreskellReturn (PParameter p)
)
should implement Java's Comparable
interface. This is true for most types,
so greskell doesn't have any explicit constraint about it.
Since: 1.2.0.0
Associated Types
type PParameter p Source #
Instances
PLike (LabeledP a) Source # | You can construct |
Defined in Data.Greskell.AsLabel Associated Types type PParameter (LabeledP a) Source # | |
PLike (P a) Source # | You can construct |
Defined in Data.Greskell.Gremlin Associated Types type PParameter (P a) Source # |
class Comparator c where Source #
java.util.Comparator
interface.
Comparator
compares two data of type CompareArg
c
.
Minimal complete definition
Nothing
Associated Types
type CompareArg c Source #
Methods
cCompare :: Greskell c -> Greskell (CompareArg c) -> Greskell (CompareArg c) -> Greskell Int Source #
.compare
method.
cReversed :: Greskell c -> Greskell c Source #
.reversed
method.
cThenComparing :: Greskell c -> Greskell c -> Greskell c Source #
.thenComparing
method.
Instances
Comparator (ComparatorA a) Source # | |
Defined in Data.Greskell.Gremlin Associated Types type CompareArg (ComparatorA a) Source # Methods cCompare :: Greskell (ComparatorA a) -> Greskell (CompareArg (ComparatorA a)) -> Greskell (CompareArg (ComparatorA a)) -> Greskell Int Source # cReversed :: Greskell (ComparatorA a) -> Greskell (ComparatorA a) Source # cThenComparing :: Greskell (ComparatorA a) -> Greskell (ComparatorA a) -> Greskell (ComparatorA a) Source # | |
Comparator (Order a) Source # |
|
Defined in Data.Greskell.Gremlin Associated Types type CompareArg (Order a) Source # |
newtype ComparatorA a Source #
Type for anonymous class of Comparator
interface.
Constructors
ComparatorA | |
Fields
|
Instances
Comparator (ComparatorA a) Source # | |
Defined in Data.Greskell.Gremlin Associated Types type CompareArg (ComparatorA a) Source # Methods cCompare :: Greskell (ComparatorA a) -> Greskell (CompareArg (ComparatorA a)) -> Greskell (CompareArg (ComparatorA a)) -> Greskell Int Source # cReversed :: Greskell (ComparatorA a) -> Greskell (ComparatorA a) Source # cThenComparing :: Greskell (ComparatorA a) -> Greskell (ComparatorA a) -> Greskell (ComparatorA a) Source # | |
type CompareArg (ComparatorA a) Source # | |
Defined in Data.Greskell.Gremlin |
org.apache.tinkerpop.gremlin.process.traversal.Order
enum.
Instances
Comparator (Order a) Source # |
|
Defined in Data.Greskell.Gremlin Associated Types type CompareArg (Order a) Source # | |
GraphSONTyped (Order a) Source # | |
Defined in Data.Greskell.Gremlin Methods gsonTypeFor :: Order a -> Text # | |
type CompareArg (Order a) Source # | |
Defined in Data.Greskell.Gremlin |
pInside :: PLike p => PParameter p -> PParameter p -> Greskell p Source #
P.inside
static method.
pOutside :: PLike p => PParameter p -> PParameter p -> Greskell p Source #
P.outside
static method.
pBetween :: PLike p => PParameter p -> PParameter p -> Greskell p Source #
P.between
static method.
oDecr :: Greskell (Order a) Source #
decr
order.
Note that decr
was removed in TinkerPop 3.5.0. Use oDesc
instead.
oIncr :: Greskell (Order a) Source #
incr
order.
Note that incr
was removed in TinkerPop 3.5.0. Use oAsc
instead.
class Property p where Source #
org.apache.tinkerpop.gremlin.structure.Property
interface in a
TinkerPop graph.
Methods
propertyKey :: p v -> Text Source #
Get key of this property.
propertyValue :: p v -> v Source #
Get value of this property.
Instances
Property AProperty Source # | |
Defined in Data.Greskell.Graph | |
Property AVertexProperty Source # | |
Defined in Data.Greskell.Graph Methods propertyKey :: AVertexProperty v -> Text Source # propertyValue :: AVertexProperty v -> v Source # |
A property key accessing value b
in an Element a
. In Gremlin,
it's just a String type.
Since greskell-1.0.0.0, Key
is newtype of Text
. Before that, it
was newtype of Greskell
Text
.
Instances
Functor (Key a) Source # | Unsafely convert the value type |
IsString (Key a b) Source # | |
Defined in Data.Greskell.Graph Methods fromString :: String -> Key a b # | |
Show (Key a b) Source # | |
Eq (Key a b) Source # | |
ProjectionLike (Key s e) Source # | |
Defined in Data.Greskell.GTraversal Associated Types type ProjectionLikeStart (Key s e) Source # type ProjectionLikeEnd (Key s e) Source # | |
PMapKey (Key a b) Source # | Since: 1.0.0.0 |
ToGreskell (Key a b) Source # | Return Gremlin String literal. |
Defined in Data.Greskell.Graph Associated Types type GreskellReturn (Key a b) # Methods toGreskell :: Key a b -> Greskell (GreskellReturn (Key a b)) # | |
type ProjectionLikeEnd (Key s e) Source # | |
Defined in Data.Greskell.GTraversal | |
type ProjectionLikeStart (Key s e) Source # | |
Defined in Data.Greskell.GTraversal | |
type PMapValue (Key a b) Source # | |
Defined in Data.Greskell.Graph | |
type GreskellReturn (Key a b) Source # | |
Defined in Data.Greskell.Graph |
class Element e => Edge e Source #
org.apache.tinkerpop.gremlin.structure.Edge
interface in a
TinkerPop graph.
Instances
Edge AEdge Source # | |
Defined in Data.Greskell.Graph |
class Element v => Vertex v Source #
org.apache.tinkerpop.gremlin.structure.Vertex
interface in a
TinkerPop graph.
Instances
Vertex AVertex Source # | |
Defined in Data.Greskell.Graph |
data Cardinality Source #
org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality
enum.
Since: 0.2.0.0
org.apache.tinkerpop.gremlin.structure.T
enum.
T
is a token to get data b
from an Element a
.
Instances
ProjectionLike (Greskell (T s e)) Source # | |
Defined in Data.Greskell.GTraversal Associated Types type ProjectionLikeStart (Greskell (T s e)) Source # type ProjectionLikeEnd (Greskell (T s e)) Source # | |
GraphSONTyped (T a b) Source # | |
Defined in Data.Greskell.Graph Methods gsonTypeFor :: T a b -> Text # | |
type ProjectionLikeEnd (Greskell (T s e)) Source # | |
Defined in Data.Greskell.GTraversal | |
type ProjectionLikeStart (Greskell (T s e)) Source # | |
Defined in Data.Greskell.GTraversal |
class ElementData e => Element e Source #
org.apache.tinkerpop.gremlin.structure.Element
interface in a
TinkerPop graph.
Since greskell-1.0.0.0, ElementData
is a super-class of
Element
.
Associated Types
type ElementProperty e :: Type -> Type Source #
type ElementPropertyContainer e :: Type -> Type Source #
Container type of the properties of the Element
. It should be
of NonEmptyLike
class.
Since: 1.0.0.0
Instances
Element AEdge Source # | |
Defined in Data.Greskell.Graph | |
Element AVertex Source # | |
Defined in Data.Greskell.Graph | |
Element (AVertexProperty v) Source # | |
Defined in Data.Greskell.Graph Associated Types type ElementProperty (AVertexProperty v) :: Type -> Type Source # type ElementPropertyContainer (AVertexProperty v) :: Type -> Type Source # |
class ElementData e where Source #
Types that keep reference to TinkerPop graph Elements.
Since: 1.0.0.0
Methods
elementId :: e -> ElementID e Source #
ID of this Element.
elementLabel :: e -> Text Source #
Label of this Element.
Instances
ElementData AEdge Source # | Since: 1.0.0.0 |
ElementData AVertex Source # | Since: 1.0.0.0 |
ElementData (AVertexProperty v) Source # | Since: 1.0.0.0 |
Defined in Data.Greskell.Graph Methods elementId :: AVertexProperty v -> ElementID (AVertexProperty v) Source # elementLabel :: AVertexProperty v -> Text Source # |
ID of a graph element e
(vertex, edge and vertex property).
Although the internal of ElementID
is exposed, you should treat it as an opaque value. That's
because it depends on graph implementation.
Since: 1.0.0.0
Constructors
ElementID | |
Fields |
Instances
Functor ElementID Source # | Unsafely convert the element type. |
FromJSON (ElementID e) Source # | |
Defined in Data.Greskell.Graph | |
ToJSON (ElementID e) Source # | |
Generic (ElementID e) Source # | |
Show (ElementID e) Source # | |
Eq (ElementID e) Source # | |
FromGraphSON (ElementID e) Source # | |
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser (ElementID e) # | |
Hashable (ElementID e) Source # | |
Defined in Data.Greskell.Graph | |
type Rep (ElementID e) Source # | |
Defined in Data.Greskell.Graph |
Heterogeneous list of Key
s. It keeps the parent type a
, but
discards the value type b
.
Since: 1.0.0.0
org.apache.tinkerpop.gremlin.process.traversal.Path
interface.
Since: 1.1.0.0
Instances
Foldable Path Source # | |
Defined in Data.Greskell.Graph Methods fold :: Monoid m => Path m -> m # foldMap :: Monoid m => (a -> m) -> Path a -> m # foldMap' :: Monoid m => (a -> m) -> Path a -> m # foldr :: (a -> b -> b) -> b -> Path a -> b # foldr' :: (a -> b -> b) -> b -> Path a -> b # foldl :: (b -> a -> b) -> b -> Path a -> b # foldl' :: (b -> a -> b) -> b -> Path a -> b # foldr1 :: (a -> a -> a) -> Path a -> a # foldl1 :: (a -> a -> a) -> Path a -> a # elem :: Eq a => a -> Path a -> Bool # maximum :: Ord a => Path a -> a # | |
Traversable Path Source # | |
Functor Path Source # | |
FromGraphSON a => FromJSON (Path a) Source # | |
Defined in Data.Greskell.Graph | |
Monoid (Path a) Source # | |
Semigroup (Path a) Source # | |
Show a => Show (Path a) Source # | |
Eq a => Eq (Path a) Source # | |
Ord a => Ord (Path a) Source # | |
AsIterator (Path a) Source # |
|
Defined in Data.Greskell.Graph Associated Types type IteratorItem (Path a) # | |
FromGraphSON a => FromGraphSON (Path a) Source # | |
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser (Path a) # | |
GraphSONTyped (Path a) Source # | |
Defined in Data.Greskell.Graph Methods gsonTypeFor :: Path a -> Text # | |
type IteratorItem (Path a) Source # | |
Defined in Data.Greskell.Graph |
An entry in a Path
.
Since: 1.1.0.0
Instances
Foldable PathEntry Source # | |
Defined in Data.Greskell.Graph Methods fold :: Monoid m => PathEntry m -> m # foldMap :: Monoid m => (a -> m) -> PathEntry a -> m # foldMap' :: Monoid m => (a -> m) -> PathEntry a -> m # foldr :: (a -> b -> b) -> b -> PathEntry a -> b # foldr' :: (a -> b -> b) -> b -> PathEntry a -> b # foldl :: (b -> a -> b) -> b -> PathEntry a -> b # foldl' :: (b -> a -> b) -> b -> PathEntry a -> b # foldr1 :: (a -> a -> a) -> PathEntry a -> a # foldl1 :: (a -> a -> a) -> PathEntry a -> a # toList :: PathEntry a -> [a] # length :: PathEntry a -> Int # elem :: Eq a => a -> PathEntry a -> Bool # maximum :: Ord a => PathEntry a -> a # minimum :: Ord a => PathEntry a -> a # | |
Traversable PathEntry Source # | |
Defined in Data.Greskell.Graph | |
Functor PathEntry Source # | |
Show a => Show (PathEntry a) Source # | |
Eq a => Eq (PathEntry a) Source # | |
Ord a => Ord (PathEntry a) Source # | |
Defined in Data.Greskell.Graph |
General vertex type you can use for Vertex
class.
Constructors
AVertex | |
Instances
FromJSON AVertex Source # | |
Defined in Data.Greskell.Graph | |
Show AVertex Source # | |
Eq AVertex Source # | |
Element AVertex Source # | |
Defined in Data.Greskell.Graph | |
ElementData AVertex Source # | Since: 1.0.0.0 |
Vertex AVertex Source # | |
Defined in Data.Greskell.Graph | |
FromGraphSON AVertex Source # | |
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser AVertex # | |
GraphSONTyped AVertex Source # | |
Defined in Data.Greskell.Graph Methods gsonTypeFor :: AVertex -> Text # | |
type ElementProperty AVertex Source # | |
Defined in Data.Greskell.Graph | |
type ElementPropertyContainer AVertex Source # | |
Defined in Data.Greskell.Graph |
General edge type you can use for Edge
class.
Instances
FromJSON AEdge Source # | |
Defined in Data.Greskell.Graph | |
Show AEdge Source # | |
Eq AEdge Source # | |
Edge AEdge Source # | |
Defined in Data.Greskell.Graph | |
Element AEdge Source # | |
Defined in Data.Greskell.Graph | |
ElementData AEdge Source # | Since: 1.0.0.0 |
FromGraphSON AEdge Source # | |
Defined in Data.Greskell.Graph Methods parseGraphSON :: GValue -> Parser AEdge # | |
GraphSONTyped AEdge Source # | |
Defined in Data.Greskell.Graph Methods gsonTypeFor :: AEdge -> Text # | |
type ElementProperty AEdge Source # | |
Defined in Data.Greskell.Graph | |
type ElementPropertyContainer AEdge Source # | |
Defined in Data.Greskell.Graph |
data AVertexProperty v Source #
General vertex property type you can use for VertexProperty.
If you are not sure about the type v
, just use GValue
.
Constructors
AVertexProperty | |
Instances
General simple property type you can use for Property
class.
If you are not sure about the type v
, just use GValue
.
Instances
unsafeCastElementID :: ElementID a -> ElementID b Source #
Unsafely cast the phantom type of ElementID
.
Since: 1.0.0.0
cList :: Greskell Cardinality Source #
list
Cardinality.
Since: 0.2.0.0
cSet :: Greskell Cardinality Source #
set
Cardinality.
Since: 0.2.0.0
cSingle :: Greskell Cardinality Source #
single
Cardinality.
Since: 0.2.0.0
unsafeCastKey :: Key a1 b1 -> Key a2 b2 Source #
Unsafely cast the type signature of the Key
.
Since: 1.0.0.0
Make a PathEntry
.
Since: 1.1.0.0
A JSON parser. N.B. This might not fit your usual understanding of
"parser". Instead you might like to think of Parser
as a "parse result",
i.e. a parser to which the input has already been applied.
Instances
MonadFail Parser | |
Defined in Data.Aeson.Types.Internal | |
MonadFix Parser | Since: aeson-2.1.0.0 |
Defined in Data.Aeson.Types.Internal | |
Alternative Parser | |
Applicative Parser | |
Functor Parser | |
Monad Parser | |
MonadPlus Parser | |
Monoid (Parser a) | |
Semigroup (Parser a) | |
class FromGraphSON a where #
Types that can be constructed from GValue
. This is analogous to
FromJSON
class.
Instances of basic types are implemented based on the following rule.
- Simple scalar types (e.g.
Int
andText
): useparseUnwrapAll
. - List-like types (e.g.
[]
,Vector
andSet
): useparseUnwrapList
. - Map-like types (e.g.
HashMap
andMap
): parse intoGMap
first, then unwrap theGMap
wrapper. That way, all versions of GraphSON formats are handled properly. - Trivial wrapper types (e.g.
Identity
): just parse the item inside. - Other types: see the individual instance documentation.
Note that Char
does not have FromGraphSON
instance. This is
intentional. As stated in the document of
AsIterator
, using Value
in greskell
is an error in most cases. To prevent you from using Value
,
Char
(and thus Value
) don't have FromGraphSON
instances.
Since: greskell-core-0.1.2.0
Methods
parseGraphSON :: GValue -> Parser a #
Instances
class GraphSONTyped a where #
Types that have an intrinsic type ID for gsonType
field.
Instances
Wrapper for "typed JSON object" introduced in GraphSON version 2. See http://tinkerpop.apache.org/docs/current/dev/io/#graphson
This data type is useful for encoding/decoding GraphSON text.
Note that encoding of the "g:Map" type is inconsistent between GraphSON v1 and v2, v3. To handle the encoding, use Data.Greskell.GMap.
Constructors
GraphSON | |
Instances
Foldable GraphSON | |
Defined in Data.Greskell.GraphSON.Core Methods fold :: Monoid m => GraphSON m -> m # foldMap :: Monoid m => (a -> m) -> GraphSON a -> m # foldMap' :: Monoid m => (a -> m) -> GraphSON a -> m # foldr :: (a -> b -> b) -> b -> GraphSON a -> b # foldr' :: (a -> b -> b) -> b -> GraphSON a -> b # foldl :: (b -> a -> b) -> b -> GraphSON a -> b # foldl' :: (b -> a -> b) -> b -> GraphSON a -> b # foldr1 :: (a -> a -> a) -> GraphSON a -> a # foldl1 :: (a -> a -> a) -> GraphSON a -> a # elem :: Eq a => a -> GraphSON a -> Bool # maximum :: Ord a => GraphSON a -> a # minimum :: Ord a => GraphSON a -> a # | |
Traversable GraphSON | |
Defined in Data.Greskell.GraphSON.Core | |
Functor GraphSON | |
FromJSON v => FromJSON (GraphSON v) | If the given |
Defined in Data.Greskell.GraphSON.Core | |
ToJSON v => ToJSON (GraphSON v) | If |
Generic (GraphSON v) | |
Show v => Show (GraphSON v) | |
Eq v => Eq (GraphSON v) | |
Ord v => Ord (GraphSON v) | |
Defined in Data.Greskell.GraphSON.Core | |
Hashable v => Hashable (GraphSON v) | Since: greskell-core-0.1.2.0 |
Defined in Data.Greskell.GraphSON.Core | |
type Rep (GraphSON v) | |
Defined in Data.Greskell.GraphSON.Core type Rep (GraphSON v) = D1 ('MetaData "GraphSON" "Data.Greskell.GraphSON.Core" "greskell-core-1.0.0.4-KAm6RheK3EmHcOeOwENZyn" 'False) (C1 ('MetaCons "GraphSON" 'PrefixI 'True) (S1 ('MetaSel ('Just "gsonType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "gsonValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 v))) |
data GValueBody #
Constructors
GObject !(KeyMap GValue) | |
GArray !(Vector GValue) | |
GString !Text | |
GNumber !Scientific | |
GBool !Bool | |
GNull |
Instances
An Aeson Value
wrapped in GraphSON
wrapper type. Basically
this type is the Haskell representaiton of a GraphSON-encoded
document.
This type is used to parse GraphSON documents. See also
FromGraphSON
class.
Since: greskell-core-0.1.2.0
Instances
FromJSON GValue | Parse |
Defined in Data.Greskell.GraphSON.GValue | |
ToJSON GValue | Reconstruct |
Generic GValue | |
Show GValue | |
Eq GValue | |
FromGraphSON GValue | |
Defined in Data.Greskell.GraphSON Methods parseGraphSON :: GValue -> Parser GValue # | |
Hashable GValue | |
Defined in Data.Greskell.GraphSON.GValue | |
type Rep GValue | |
Defined in Data.Greskell.GraphSON.GValue type Rep GValue = D1 ('MetaData "GValue" "Data.Greskell.GraphSON.GValue" "greskell-core-1.0.0.4-KAm6RheK3EmHcOeOwENZyn" 'True) (C1 ('MetaCons "GValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (GraphSON GValueBody)))) |
parseEither :: FromGraphSON a => GValue -> Either String a #
Parse GValue
into FromGraphSON
.
Since: greskell-core-0.1.2.0
(.:) :: FromGraphSON a => KeyMap GValue -> Key -> Parser a #
Like Aeson's .:
, but for FromGraphSON
.
Since: greskell-core-1.0.0.0
nonTypedGraphSON :: v -> GraphSON v #
typedGraphSON :: GraphSONTyped v => v -> GraphSON v #
Create a GraphSON
with its type ID.
typedGraphSON' :: Text -> v -> GraphSON v #
Create a GraphSON
with the given type ID.
parseTypedGraphSON :: (GraphSONTyped v, FromJSON v) => Value -> Parser (GraphSON v) #
Parse GraphSON v
, but it checks gsonType
. If gsonType
is
Nothing
or it's not equal to gsonTypeFor
, the Parser
fails.
nonTypedGValue :: GValueBody -> GValue #
Create a GValue
without "@type" field.
Since: greskell-core-0.1.2.0
Arguments
:: Text | "@type" field. |
-> GValueBody | |
-> GValue |
Create a GValue
with the given "@type" field.
Since: greskell-core-0.1.2.0
parseUnwrapAll :: FromJSON a => GValue -> Parser a #
Unwrap the given GValue
with unwrapAll
, and just parse the
result with parseJSON
.
Useful to implement FromGraphSON
instances for scalar types.
Since: greskell-core-0.1.2.0
parseUnwrapList :: (IsList a, i ~ Item a, FromGraphSON i) => GValue -> Parser a #
Extract GArray
from the given GValue
, parse the items in the
array, and gather them by fromList
.
Useful to implement FromGraphSON
instances for IsList
types.
Since: greskell-core-0.1.2.0
parseJSONViaGValue :: FromGraphSON a => Value -> Parser a #
Implementation of parseJSON
based on parseGraphSON
. The input
Value
is first converted to GValue
, and it's parsed to the
output type.
Since: greskell-core-0.1.2.0
Haskell representation of Map.Entry
type.
Basically GraphSON encodes Java's Map.Entry
type as if it were a
Map
with a single entry. Thus its encoded form is either a JSON
object or a flattened key-values, as explained in GMap
.
In old versions of TinkerPop, Map.Entry
is encoded as a JSON
object with "key" and "value" fields. FromJSON
instance of
GMapEntry
supports this format as well, but ToJSON
instance
doesn't support it.
Constructors
GMapEntry | |
Fields
|
Instances
data GMap (c :: Type -> Type -> Type) k v #
Haskell representation of g:Map
type.
GraphSON v1 and v2 encode Java Map
type as a JSON Object, while
GraphSON v3 encodes it as an array of flattened keys and values
(like FlattenedMap
.) GMap
type handles both encoding schemes.
Constructors
GMap | |
Instances
Foldable (c k) => Foldable (GMap c k) | |
Defined in Data.Greskell.GMap Methods fold :: Monoid m => GMap c k m -> m # foldMap :: Monoid m => (a -> m) -> GMap c k a -> m # foldMap' :: Monoid m => (a -> m) -> GMap c k a -> m # foldr :: (a -> b -> b) -> b -> GMap c k a -> b # foldr' :: (a -> b -> b) -> b -> GMap c k a -> b # foldl :: (b -> a -> b) -> b -> GMap c k a -> b # foldl' :: (b -> a -> b) -> b -> GMap c k a -> b # foldr1 :: (a -> a -> a) -> GMap c k a -> a # foldl1 :: (a -> a -> a) -> GMap c k a -> a # elem :: Eq a => a -> GMap c k a -> Bool # maximum :: Ord a => GMap c k a -> a # minimum :: Ord a => GMap c k a -> a # | |
Traversable (c k) => Traversable (GMap c k) | |
Functor (c k) => Functor (GMap c k) | |
(FromJSON k, FromJSON v, IsList (c k v), Item (c k v) ~ (k, v), FromJSON (c k v)) => FromJSON (GMap c k v) | Use |
Defined in Data.Greskell.GMap | |
(ToJSON k, ToJSON v, IsList (c k v), Item (c k v) ~ (k, v), ToJSON (c k v)) => ToJSON (GMap c k v) | |
Show (c k v) => Show (GMap c k v) | |
Eq (c k v) => Eq (GMap c k v) | |
AsIterator (GMap c k v) | |
Defined in Data.Greskell.AsIterator Associated Types type IteratorItem (GMap c k v) # | |
(FromGraphSON k, FromGraphSON v, IsList (c k v), Item (c k v) ~ (k, v), Traversable (c k), FromJSON (c k GValue)) => FromGraphSON (GMap c k v) | Use |
Defined in Data.Greskell.GraphSON Methods parseGraphSON :: GValue -> Parser (GMap c k v) # | |
GraphSONTyped (GMap c k v) | Map to "g:Map". |
Defined in Data.Greskell.GMap Methods gsonTypeFor :: GMap c k v -> Text # | |
type IteratorItem (GMap c k v) | |
Defined in Data.Greskell.AsIterator |
newtype FlattenedMap (c :: Type -> Type -> Type) k v #
JSON encoding of a map as an array of flattened key-value pairs.
ToJSON
instance of this type encodes the internal map as an array
of keys and values. FromJSON
instance of this type parses that
flattened map.
Constructors
FlattenedMap | |
Fields
|
Instances
toList :: forall (c :: Type -> Type -> Type) k v. (IsList (c k v), Item (c k v) ~ (k, v)) => GMap c k v -> [GMapEntry k v] #
singleton :: forall (c :: Type -> Type -> Type) k v. (IsList (c k v), Item (c k v) ~ (k, v)) => GMapEntry k v -> GMap c k v #
Arguments
:: forall (c :: Type -> Type -> Type) k v s. (IsList (c k v), Item (c k v) ~ (k, v)) | |
=> (s -> Parser k) | key parser |
-> (s -> Parser v) | value parser |
-> Vector s | input vector of flattened key-values. |
-> Parser (FlattenedMap c k v) |
General parser for FlattenedMap
.
Arguments
:: (IsList (c k v), Item (c k v) ~ (k, v)) | |
=> (s -> Parser k) | key parser |
-> (s -> Parser v) | value parser |
-> (KeyMap s -> Parser (c k v)) | object parser |
-> Either (KeyMap s) (Vector s) | input object or flattened key-values. |
-> Parser (GMap c k v) |
General parser for GMap
.
Arguments
:: FromJSONKey k | |
=> (s -> Parser k) | key parser |
-> (s -> Parser v) | value parser |
-> Either (KeyMap s) (Vector s) | input object or flattened key-values |
-> Parser (GMapEntry k v) |
General parser for GMapEntry
.
unGMapEntry :: GMapEntry k v -> (k, v) #
Get the key-value pair from GMapEntry
.
module Data.Greskell.AsIterator
module Data.Greskell.AsLabel
module Data.Greskell.PMap