h$X       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                %Gremlin (Groovy/Java) utility classes Toshio Ito None ?greskell4org.apache.tinkerpop.gremlin.process.traversal.Order enum.greskellType for anonymous class of  Comparator interface.greskelljava.util.Comparator interface. compares two data of type  c.greskell.compare method.greskell .reversed method.greskell.thenComparing method. greskellType that is compatible with  %. You can construct a value of type  Greskell p using values of  PParameter p.1Note 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. greskell0org.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. greskellType for anonymous class of  Predicate interface.greskelljava.util.function.Predicate interface.A  p is a function that takes  p and returns .greskell.and method.greskell.or method.greskell.test method.greskell.nagate method.greskellP.not static method./toGremlin (pNot $ pEq $ 10 :: Greskell (P Int))"P.not(P.eq(10))"greskellP.eq static method.4toGremlin (pEq $ string "hoge" :: Greskell (P Text))"P.eq(\"hoge\")"greskellP.neq static method.greskellP.lt static method.greskellP.lte static method.greskellP.gt static method.greskellP.gte static method.greskellP.inside static method.-toGremlin (pInside 10 20 :: Greskell (P Int))"P.inside(10,20)"greskell P.outside static method.greskell P.between static method.greskellP.within static method.?toGremlin (pWithin ["foo", "bar", "hoge"] :: Greskell (P Text))$"P.within(\"foo\",\"bar\",\"hoge\")" greskell P.without static method.!greskelldecr order.toGremlin oDecr "Order.decr""greskellincr order.#greskellshuffle order.'greskellYou can construct Greskell (P a) from  Greskell a.*greskellOrder a compares the type a.$  !"#$   !"#Logic tree data structure Toshio Ito  Safe-Inferred8f+greskellA general-purpose logic tree structure. Only the leaf nodes have values of type a7. The tree is lazy both in value and spine (structure).,greskellLeaf node with value-greskell"and" logic operator.greskell"or" logic operator/greskell"not" logic operator0greskellRun the logic tree of  values to get the result.4greskell is ,. fl  rl appends the rl to the leaves of fl.+-/,.0+-/,.0Class of non-empty containers Toshio Ito  Safe-Inferred::greskell5Non-empty containers. Its cardinality is one or more.;greskell%Make a container with a single value.<greskellAppend two containers.=greskellConvert the container to  list.>greskell< is  from .?greskell< is  from .@greskell< is  from .:;<=:;<=:Property map, a map with Text keys and cardinality options Toshio Ito None  567$IAgreskellAn $ raised when looking up values from I.BgreskellThe I doesn't have the given key.Cgreskell1Failed to parse the value into the type that the D indicates. The  is the key, and the  is the error message.DgreskellA typed key for I.Egreskell*Type of the value associated with the key.Fgreskell representation of the key.Ggreskell"The "one or more" cardinality for I. J- method prepends the new value at the head.  on I9 appends the right items to the tail of the left items. N0 preserves the order of the items for each key.HgreskellThe single cardinality for I. J! method replaces the old value.  on I" prefers the items from the left I. N% prefers the first item for each key.Igreskell(A property map, which has text keys and v values. c specifies the cardinality of each item, and should be an instance of :.You can look up values from I using key types of D class.JgreskellInsert a key-value pair to I.. If it already has some items for that key, < method of the : type c determines its behavior.Kgreskell/Delete a key and all values associated with it.LgreskellLookup all items for the key (low-level function). If there is no item for the key, it returns an empty list.MgreskellList up all entries.NgreskellMake a I from list of entries.Ogreskell(Lookup the first value for the key from I.Pgreskell version of O/. If there is no value for the key, it throws B.Qgreskell#Lookup the value and parse it into a.Rgreskell Similar to Q, but this function converts a null result into .A null result is either (1) the key k is not found in the map, or (2) the key is found, but the value is null.Sgreskell version of Q.TgreskellLookup all items for the key. If there is no item for the key, it returns an empty list.Ugreskell'Look up the values and parse them into a.Vgreskell Similar to U, but this function accepts null results. If the key k is not found in the map, it returns an empty list. If the key k is found and null4s are included in the values, they are obtained as .Wgreskell%Make a human-readable description on A.Xgreskell!Convert the lookup result into a  . It throws A.Ygreskell!Convert the lookup result into a -. It fails with the description returned by W.\greskellMake a union of the two Is. If the two I/s share some keys, those values are merged by < method from :._greskell For simple , the " is returned without being parsed.ABCDEFGHIJKLMNOPQRSTUVWXYIOPQRSTUVJKLMNHGDEFABCWXYLabel string used in .as step Toshio Ito None' rgreskellr is just like  +, a Haskell representation of TinkerPop's P class. Unlike   , however, r keeps a label (t) inside. It is used in .where step.sgreskellA map keyed with t. Obtained from .select step, for example.tgreskellt a# represents a label string used in .as$ step pointing to the data of type a.wgreskell&Unsafely cast the phantom type of the t.xgreskellygreskell"Unsafely convert the phantom type.zgreskell Returns the  as a Gremlin string.{greskell|greskellYou can construct Greskell (LabeledP a) from  AsLabel a. ABCOPQSrstuvw tuvswOPQSABCr9Haskell counterpart of Gremlin graph structure data types Toshio Ito None '(5678>:?greskellAn entry in a .greskell3org.apache.tinkerpop.gremlin.process.traversal.Path interface.greskellNone 567E^greskell#This typeclass is for internal use.7GraphSON parser with a property key given from outside.greskellA , that can keep more than one values per key.; returns the first property associated with the given key.2 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.greskellA ! that has a single value per key.1 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.greskell8Common basic operations supported by maps of properties.greskell1Look up a property associated with the given key.greskell5Look up all properties associated with the given key.greskellPut a property into the map.greskell4Remove all properties associated with the given key.greskell!Return all properties in the map.greskellLookup a property value from a  by key.greskell(Lookup a list of property values from a  by key.greskellLookup a property  by the given key, and parse it.>In version 0.1.1.0 and before, this function took an argument m p (GraphSON Value)0. This has changed, because property types for AVertex etc have changed.greskell(Lookup a list of property values from a # by the given key, and parse them.>In version 0.1.1.0 and before, this function took an argument m p (GraphSON Value)0. This has changed, because property types for AVertex etc have changed.greskellLike , but this function 0s when there is no property with the given key.>In version 0.1.1.0 and before, this function took an argument m p (GraphSON Value)0. This has changed, because property types for AVertex etc have changed.greskell Create a  from list of s.greskell2In version 0.1.1.0 and before, the constraint was  FromJSON v. This has changed.greskell2In version 0.1.1.0 and before, the constraint was  FromJSON v. This has changed.Gremlin traversal/step types. Toshio Ito None '(2>?greskellVertex anchor for . It corresponds to .from or .to step following an .addE step.Type s is the input Vertex for the .addE step. Type e, is the type of the anchor Vertex that the  yields. So, .addE step creates an edge between s and e.greskellA  associated with an t. You can construct it by .greskellComparison of type s used in .by step. You can also use  and  to construct .greskellType s is projected to type e2, and compared by the natural comparator of type e.greskellType s is compared by the  comp.greskellType s is projected to type CompareArg comp, and compared by the  comp.greskellProjection from type s to type e used in .by step. You can also use  to construct .greskell;Data types that mean a projection from one type to another.greskell!The start type of the projection.greskellThe end type of the projection.greskell.emit modulator step.Type c is the  of the parent .repeat step. Type s% is the start (and end) type of the .repeat step.greskell.emit modulator without argument. It always emits the input traverser of type s.greskell.emit modulator with a sub-traversal as the predicate to decide if it emits the traverser.greskell.until or .times modulator step.Type c is the  of the parent .repeat step. Type s% is the start (and end) type of the .repeat step.greskell.times modulator.greskell.until modulator with a sub-traversal as the predicate to decide if the repetition should stop.greskell)Position of a step modulator relative to .repeat step.greskellModulator before the .repeat step.greskellModulator after the .repeat step.greskell)A label that points to a loop created by .repeat step. It can be used by .loops step to specify the loop.greskellA pattern for .match step.greskellA pattern with the starting .as# label followed by traversal steps.greskell Result of .match step.greskellGraphTraversalSource7 class object of TinkerPop. It is a factory object of s.greskell Relation of 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.greskell Relation of  s where one includes the other. from can be lifted to to , because to is more powerful than from.greskell.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 }greskellWalkType for steps without any side-effects. This includes transformations, reordring, injections and graph traversal actions.A  w is  type iff: gSideEffect w == gIdentityObviously, every  type  s are also  type.greskellWalkType 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  w is  type iff: 1(gSideEffect w == gIdentity) AND (gFilter w == w)If s w1 and w2 are  type, then 'gAnd [w1, w2] == w1 >>> w2 == w2 >>> w1greskellClass of phantom type markers to describe the effect of the walk/traversals.greskell+A chain of one or more Gremlin steps. Like , type s is the input, type e is the output, and type c# is a marker to describe the step.- represents a chain of method calls such as .has(x).outE(). Because this is not a Gremlin (Groovy) expression, we use bare , not  . is a . You can use functions from Control.Category to compose s. This is equivalent to making a chain of method calls in Gremlin. is not an , because it's difficult to define true equality between Gremlin method calls. If we define it naively, it might have conflict with  law.greskellTypes that can convert to .greskellLift  from to to. Use this for type matching.greskellUnsafely cast the start type s1 into s2.It is recommended that s2 is coercible to s1 in terms of . That is, if s2 can parse a , s1$ should also be able to parse that .greskellUnsafely cast the end type e1 into e2. See .greskellPhantom type for GraphTraversal% class. In greskell, we usually use  instead of  .greskellGraphTraversal* 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. is NOT a  . 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  law.greskellCreate  from a varible name in GremlintoGremlin $ source "g""g"greskell.V() method on .greskellMonomorphic version of .toGremlin (source "g" & sV' (map (fmap ElementID . gvalueInt) ([1,2,3] :: [Int]))) "g.V(1,2,3)"greskell.E() method on .greskellMonomorphic version of .toGremlin (source "g" & sE' (map (fmap ElementID . gvalueInt) ([1] :: [Int])))"g.E(1)"greskell.addV() method on .greskellMonomorphic version of .(toGremlin (source "g" & sAddV' "person")"g.addV(\"person\")"greskellUnsafely create # from the given raw Gremlin script.,toGremlin $ unsafeGTraversal "g.V().count()""g.V().count()"greskell Apply the  to the . In Gremlin, this means calling a chain of methods on the Traversal object.2toGremlin (source "g" & sV' [] &. gValues ["age"])"g.V().values(\"age\")"greskellSame as  with arguments flipped.2toGremlin (gValues ["age"] $. sV' [] $ source "g")"g.V().values(\"age\")"greskell Similar to  , but for .greskell Similar to  , but for .greskell.iterate method on GraphTraversal. is not a  because it's usually used to terminate the method chain of Gremlin steps. The returned ( outputs nothing, thus its end type is ().toGremlin (source "g" & sAddV' "person" &. gProperty "name" "marko" & gIterate);"g.addV(\"person\").property(\"name\",\"marko\").iterate()"greskellUnsafely create a , that represents a single method call on a GraphTraversal.toGremlin (source "g" & sV' [] &. unsafeWalk "valueMap" ["'foo'", "'bar'"])"g.V().valueMap('foo','bar')"greskellOptionally modulate the main  with some modulating s.toGremlin (source "g" & sV' [] &. modulateWith (unsafeWalk "path" []) [unsafeWalk "by" ["'name'"], unsafeWalk "by" ["'age'"]])#"g.V().path().by('name').by('age')"greskell .identity step.greskellMonomorphic version of .greskell.filter step that takes a traversal.>> gAs label_b) )4 [ mPattern label_b (gHas2' key_age 25) ] in toGremlin (source "g" & sV' [] &. gMatch patterns &. gSelectN label_a label_b []):}"g.V().match(__.as(\"a\").out().as(\"b\"),__.as(\"b\").has(\"age\",25)).select(\"a\",\"b\")"greskell.is step of simple equality.toGremlin (source "g" & sV' [] &. gValues ["age" :: Key AVertex Int] &. gIs 30)"g.V().values(\"age\").is(30)"greskellMonomorphic version of .greskell.is step with predicate  .toGremlin (source "g" & sV' [] &. gValues ["age" :: Key AVertex Int] &. gIsP (pLte 30))%"g.V().values(\"age\").is(P.lte(30))"greskellMonomorphic version of .greskell.has step with one argument..toGremlin (source "g" & sV' [] &. gHas1 "age")"g.V().has(\"age\")"greskellMonomorphic version of .greskell.has step with two arguments.toGremlin (source "g" & sV' [] &. gHas2 "age" (31 :: Greskell Int))"g.V().has(\"age\",31)"greskellMonomorphic verson of .greskell.has step with two arguments and   type.toGremlin (source "g" & sV' [] &. gHas2P "age" (pBetween (30 :: Greskell Int) 40))%"g.V().has(\"age\",P.between(30,40))"greskellMonomorphic version of .greskell .hasLabel step.5toGremlin (source "g" & sV' [] &. gHasLabel "person")"g.V().hasLabel(\"person\")"greskellMonomorphic version of .greskell .hasLabel step with  ' type. Supported since TinkerPop 3.2.7.>> gIs 3) Nothing (gOut' []))"g.V().repeat(\"the_loop\",__.out()).until(__.loops(\"the_loop\").is(3))"greskell.local step.toGremlin (source "g" & sV' [] &. gLocal ( gOut' [] >>> gLimit 3 )) "g.V().local(__.out().limit(3))"greskell.union step.(let key_age = ("age" :: Key AVertex Int)6let key_birth_year = ("birth_year" :: Key AVertex Int)toGremlin (source "g" & sV' [] &. gUnion [gValues [key_age], gValues [key_birth_year]]);"g.V().union(__.values(\"age\"),__.values(\"birth_year\"))"greskell .coalesce step.Like ,  always modifies path history.toGremlin (source "g" & sV' [] &. gCoalesce [gOut' [], gIn' []])""g.V().coalesce(__.out(),__.in())"greskell.choose step with if-then-else style.(let key_age = ("age" :: Key AVertex Int)toGremlin (source "g" & sV' [] &. gChoose3 (gHas2' key_age 30) (gIn' []) (gOut' []))3"g.V().choose(__.has(\"age\",30),__.in(),__.out())"greskell.barrier step.greskell.dedup step without argument..dedup step is  because the filtering decision depends on the sequence (order) of input elements.1toGremlin (source "g" & sV' [] &. gDedup Nothing)"g.V().dedup()"(let key_age = ("age" :: Key AVertex Int)>toGremlin (source "g" & sV' [] &. gDedup (Just $ gBy key_age))"g.V().dedup().by(\"age\")"greskell.dedup> step with at least one argument. The tuple specified by the t,s is used as the criterion of deduplication.&let label_a = ("a" :: AsLabel AVertex)&let label_b = ("b" :: AsLabel AVertex)toGremlin (source "g" & sV' [] &. gAs label_a &. gOut' [] &. gAs label_b &. gDedupN label_a [label_b] Nothing)4"g.V().as(\"a\").out().as(\"b\").dedup(\"a\",\"b\")"greskell.by+ step with 1 argument, used for projection.greskell.by+ step with 1 argument, used for comparison.greskell.by, step with 2 arguments, used for comparison.greskell.order step.(let key_age = ("age" :: Key AVertex Int)8toGremlin (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)" is an ', meaning projection by the given key.1toGremlin (source "g" & sV' [] &. gOrder ["age"])"g.V().order().by(\"age\")"greskell.by step associated with an t.greskell.flatMap step..flatMap! step is at least as powerful as , even if the child walk is  type. This is because .flatMap1 step always modifies the path of the Traverser.toGremlin (source "g" & sV' [] &. gFlatMap (gOut' ["knows"] >>> gOut' ["created"]))3"g.V().flatMap(__.out(\"knows\").out(\"created\"))"greskellMonomorphic version of .greskell.V step.For each input item, .V step emits vertices selected by the argument (or all vertices if the empty list is passed.)greskellMonomorphic version of .greskell .constant step.toGremlin (source "g" & sV' [] &. gConstant (10 :: Greskell Int))"g.V().constant(10)"greskell.unfold step.Note that we use  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.3toGremlin (source "g" & sV' [] &. gFold &. gUnfold)"g.V().fold().unfold()"greskell.as step..as step is - because it adds the label to the traverser.greskell.values step.:toGremlin (source "g" & sV' [] &. gValues ["name", "age"]) "g.V().values(\"name\",\"age\")"greskell .properties step.6toGremlin (source "g" & sV' [] &. gProperties ["age"])"g.V().properties(\"age\")"greskell.id step.greskell.label step.greskell .valueMap step.4toGremlin (source "g" & sV' [] &. gValueMap KeysNil)"g.V().valueMap()"toGremlin (source "g" & sV' [] &. gValueMap ("name" -: "age" -: KeysNil))""g.V().valueMap(\"name\",\"age\")"greskell.select step with one argument.greskell.select# step with more than one arguments.greskell.select$ step with one argument followed by .by step.greskell.select/ step with more than one arguments followed by .by step.greskell.project step.&let name_label = ("a" :: AsLabel Text)+let name_key = ("name" :: Key AVertex Text)&let count_label = ("b" :: AsLabel Int)toGremlin (source "g" & sV' [] &. gProject (gByL name_label name_key) [gByL count_label (gOut' [] >>> gCount), gByL "c" tId])"g.V().project(\"a\",\"b\",\"c\").by(\"name\").by(__.out().count()).by(T.id)"greskell.path step without modulation.greskell.path step with one or more .by modulations.4let inE = (gInE' [] :: Walk Transform AVertex AEdge)toGremlin (source "g" & sV' [] &. gOut' [] &. gPathBy "name" [gBy $ inE >>> gValues ["relation"]])"g.V().out().path().by(\"name\").by(__.inE().values(\"relation\"))"greskell.fold step.greskell.count step.greskell.out stepgreskellMonomorphic version of .toGremlin (source "g" & sV' [fmap ElementID $ gvalueInt (8 :: Int)] &. gOut' ["knows"])"g.V(8).out(\"knows\")"greskell.outE stepgreskellMonomorphic version of .greskell.outV step.greskellMonomorphic version of .greskell.in stepgreskellMonomorphic version of .greskell.inE step.greskellMonomorphic version of .greskell.inV step.greskellMonomorphic version of .greskell .sideEffect step that takes a traversal.greskellMonomorphic version of . The result walk is always  type.toGremlin (source "g" & sV' [] & liftWalk &. gHas2 "name" "marko" &. gSideEffect' (gAddV' "toshio"))?"g.V().has(\"name\",\"marko\").sideEffect(__.addV(\"toshio\"))"greskell.addV step with a label.greskellMonomorphic version of .greskell.drop step on .toGremlin (source "g" & sV' [] &. gHas2 "name" "marko" & liftWalk &. gDrop)&"g.V().has(\"name\",\"marko\").drop()"greskell.drop step on .toGremlin (source "g" & sE' [] &. gProperties ["weight"] & liftWalk &. gDropP)%"g.E().properties(\"weight\").drop()"greskellSimple  .property' step. It adds a value to the property.toGremlin (source "g" & sV' [] & liftWalk &. gProperty "age" (20 :: Greskell Int))"g.V().property(\"age\",20)"greskell .property step for .1let key_location = "location" :: Key AVertex Text:let key_since = "since" :: Key (AVertexProperty Text) Text9let key_score = "score" :: Key (AVertexProperty Text) InttoGremlin (source "g" & sV' [] & liftWalk &. gPropertyV (Just cList) key_location "New York" [key_since =: "2012-09-23", key_score =: 8])"g.V().property(list,\"location\",\"New York\",\"since\",\"2012-09-23\",\"score\",8)"greskell.from step with a traversal.greskell.to step with a traversal.greskell.addE' step. Supported since TinkerPop 3.1.0.)let key_name = "name" :: Key AVertex TexttoGremlin (source "g" & sV' [] & liftWalk &. gAddE' "knows" (gFrom $ gV' [] >>> gHas2 key_name "marko"))<"g.V().addE(\"knows\").from(__.V().has(\"name\",\"marko\"))"toGremlin (source "g" & sV' [] &. gHas2 key_name "marko" & liftWalk &. gAddE' "knows" (gTo $ gV' [])):"g.V().has(\"name\",\"marko\").addE(\"knows\").to(__.V())"greskellMonomorphic version of .greskell(Unsafely convert input and output types.greskellUnsafely convert output type.greskell is an Iterator.greskellUnwrap  data constructor.greskell(Unsafely convert input and output types.greskellUnsafely convert output type.greskell(Unsafely convert input and output types.greskellUnsafely convert output typegreskell Based on  and .  is .greskell Based on .  is .greskell is .greskellThe  is first converted to , and it's converted to .greskell To convert a  to ), it calls its static method version on __ class.greskell. in the child walk remains in the parent walk.greskell= effect in the child walk is rolled back in the parent walk.greskellReturn Gremlin String literal.greskell#Projection by literal property key.greskell by literal property key.greskellvariable name of greskell vertex IDsgreskell vertex IDsgreskelledge IDsgreskelledge IDsgreskell vertex labelgreskellstep method name (e.g. "outE")greskellstep method argumentsgreskell the main greskellthe modulating sgreskellthe P argument for .where step.greskell optional .by modulation following the .where step.greskellthe starting label of .where.greskellthe P argument for .where step.greskell optional .by modulation following the .where step.greskell property keygreskell property keygreskellpredicate on the property valuegreskellpredicate on Element label.greskell&predicate on the VertexProperty's key.greskell'predicate on the VertexProperty's valuegreskellmingreskellmaxgreskellLabel for the loop.greskell.until or .times modulator. You can use , ,  to make this argument.greskell.emit modulator. You can use , , ,  to make this argument.greskellRepeated traversalgreskellRepeat count. If it's less than or equal to 0, the repeated traversal is never executed.greskellthe predicate traversal.greskellThe traversal executed if the predicate traversal outputs something.greskellThe traversal executed if the predicate traversal outputs nothing.greskell.Max number of traversers kept at this barrier.greskell.by- modulator. If specified, the result of type e, is used as the criterion of deduplication.greskell following .by steps.greskell property keysgreskell edge labelsgreskell edge labelsgreskell edge labelsgreskell edge labelsgreskell edge labelsgreskell edge labelsgreskellkey of the propertygreskellvalue of the propertygreskell,optional cardinality of the vertex property.greskellkey of the vertex propertygreskellvalue of the vertex propertygreskell1optional meta-properties for the vertex property.1000 Binder monad to make binding between Gremlin variables and JSON values Toshio Ito None greskell7Binding between Gremlin variable names and JSON values.greskell newBind (10 :: Int) <*> newBind "hoge"4let ((var_int, var_str), binding) = runBinder bindertoGremlin var_int"__v0"toGremlin var_str"__v1"/sortBy (comparing fst) $ HashMap.toList binding-[("__v0",Number 10.0),("__v1",String "hoge")]greskell7Create a new Gremlin variable bound to the given value. The value v/ is kept in the monadic context. The returned ' is a Gremlin variable pointing to the v. The Gremlin variable is guaranteed to be unique in the current monadic context.greskellExecute the given  monad to obtain .greskell Create a new t. The returned t< is guaranteed to be unique in the current monadic context.greskell bound valuegreskellvariable /Extra utility functions implemented by Greskell Toshio Ito None ?ĹgreskellMake a series of  .property9 steps to write the given key-value pairs as properties.let binder = (writePropertyKeyValues [("age", (21 :: Int))] :: Binder (Walk SideEffect AVertex AVertex))&let (walk, binding) = runBinder bindertoGremlin walk&"__.property(\"age\",__v0).identity()"/sortBy (comparing fst) $ HashMap.toList binding[("__v0",Number 21.0)]greskellMake a series of  .property> steps to write the given key-value pairs as properties. Use  and  to make a  within .'let keyAge = ("age" :: Key AVertex Int)*let keyName = ("name" :: Key AVertex Text)let (walk, binding) = runBinder $ writeKeyValues <$> sequence [keyAge <=:> 21, keyName <=:> "Josh"]toGremlin walk>"__.property(\"age\",__v0).property(\"name\",__v1).identity()"/sortBy (comparing fst) $ HashMap.toList binding-[("__v0",Number 21.0),("__v1",String "Josh")]greskellMake a series of  .property- steps to write all properties in the given I.greskellLike 4, but this one takes a real value, binds it into a Greskell value and returns .greskellLike =, but this one is for an optional property. If the value is , it's equivalent to . If the value is  , it returns .7let keyNName = ("nickname" :: Key AVertex (Maybe Text))8let keyCompany = ("company" :: Key AVertex (Maybe Text))let (walk, binding) = runBinder $ writeKeyValues <$> sequence [keyNName <=?> Nothing, keyCompany <=?> Just "foobar.com"]toGremlin walk*"__.property(\"company\",__v0).identity()"/sortBy (comparing fst) $ HashMap.toList binding[("__v0",String "foobar.com")]greskell The result  emits the input elements as-is when there is at least one input element. If there is no input element, it runs the body traversal once and outputs its result.You can use this function to implement "upsert" a vertex (i.e. add a vertex if not exist).let getMarko = (source "g" & sV' [] &. gHas2 "name" "marko" :: GTraversal Transform () AVertex)let upsertMarko = (liftWalk getMarko &. gWhenEmptyInput (gAddV "person" >>> gProperty "name" "marko") :: GTraversal SideEffect () AVertex) See also: -https://stackoverflow.com/questions/46027444/greskellthe body traversalgreskellthe result walk QRUVY QRUVY 0Haskell binding for Gremlin graph query language Toshio Ito NoneK  !"#ABCDEFEGHIJKLMNOPQRSTUVWXYrstuvw    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~^                E'greskell-1.2.0.1-KirQdhoHk4lEWzBAthliXFData.Greskell.GremlinData.Greskell.LogicData.Greskell.NonEmptyLikeData.Greskell.PMapData.Greskell.AsLabelData.Greskell.GraphData.Greskell.Graph.PropertyMapData.Greskell.GTraversalData.Greskell.BinderData.Greskell.Extra Data.GreskellOrder ComparatorA unComparatorA Comparator CompareArgcCompare cReversedcThenComparingPLike PParameterP PredicateA unPredicateA Predicate PredicateArgpAndpOrpTestpNegatepNotpEqpNeqpLtpLtepGtpGtepInsidepOutsidepBetweenpWithinpWithoutoDecroIncroShuffle$fPredicatePredicateA$fGraphSONTypedP $fPredicateP$fPLikeP$fComparatorComparatorA$fGraphSONTypedOrder$fComparatorOrderLogicLeafAndOrNotrunBool$fTraversableLogic$fFoldableLogic $fMonadLogic$fApplicativeLogic$fFunctorLogic $fShowLogic $fEqLogic $fOrdLogic$fGenericLogic NonEmptyLike singletonappend toNonEmpty$fNonEmptyLikeLast$fNonEmptyLikeFirst$fNonEmptyLikeNonEmptyPMapLookupException PMapNoSuchKeyPMapParseErrorPMapKey PMapValuekeyTextMultiSinglePMap pMapInsert pMapDelete pMapLookup pMapToList pMapFromListlookuplookupMlookupAs lookupAs' lookupAsM lookupList lookupListAs lookupListAs'pMapDecribeError pMapToThrow pMapToFail$fAsIteratorPMap $fMonoidPMap$fSemigroupPMap$fFromGraphSONPMap$fGraphSONTypedPMap $fPMapKeyText$fExceptionPMapLookupException$fShowPMapLookupException$fEqPMapLookupException$fOrdPMapLookupException $fShowMulti $fEqMulti $fOrdMulti$fFunctorMulti$fSemigroupMulti$fFoldableMulti$fTraversableMulti$fNonEmptyLikeMulti$fFromGraphSONMulti $fShowPMap$fEqPMap $fFunctorPMap$fFoldablePMap$fTraversablePMapLabeledP SelectedMapAsLabel unAsLabelunsafeCastAsLabel$fPMapKeyAsLabel$fFunctorAsLabel$fToGreskellAsLabel$fIsStringAsLabel$fPLikeLabeledP $fShowAsLabel $fEqAsLabel $fOrdAsLabel$fHashableAsLabel PathEntrypeLabelspeObjectPathunPathAVertexPropertyavpIdavpLabelavpValue APropertyapKeyapValueAEdgeaeIdaeLabelAVertexavIdavLabelKeysKeysNilKeysConsKeyValue KeyNoValueKeyunKey CardinalityTProperty propertyKey propertyValueEdgeVertexElementElementPropertyElementPropertyContainer ElementData elementId elementLabel ElementID unElementIDunsafeCastElementIDtIdtKeytLabeltValuecListcSetcSinglekey unsafeCastKey=: singletonKeys-: pathToPMap makePathEntry$fFunctorElementID$fGraphSONTypedT $fPMapKeyKey$fToGreskellKey $fIsStringKey $fFunctorKey $fMonoidKeys$fSemigroupKeys$fFromGraphSONAVertex$fFromJSONAVertex$fGraphSONTypedAVertex$fVertexAVertex$fElementDataAVertex$fFromGraphSONAEdge$fFromJSONAEdge$fGraphSONTypedAEdge $fEdgeAEdge$fElementDataAEdge$fTraversableAProperty$fFoldableAProperty$fFunctorAProperty$fGraphSONTypedAProperty$fPropertyAProperty$fFromGraphSONAProperty$fFromJSONAProperty$fElementAEdge$fTraversableAVertexProperty$fFoldableAVertexProperty$fFunctorAVertexProperty$fPropertyAVertexProperty$fElementAVertexProperty$fElementDataAVertexProperty$fGraphSONTypedAVertexProperty$fFromGraphSONAVertexProperty$fFromJSONAVertexProperty$fElementAVertex$fTraversablePathEntry$fFoldablePathEntry$fFunctorPathEntry$fFromGraphSONPath$fFromJSONPath$fAsIteratorPath$fGraphSONTypedPath $fShowPath$fEqPath $fOrdPath $fFunctorPath$fFoldablePath$fTraversablePath$fSemigroupPath $fMonoidPath$fShowPathEntry $fEqPathEntry$fOrdPathEntry$fShowAVertexProperty$fEqAVertexProperty$fShowAProperty $fEqAProperty$fOrdAProperty $fShowAEdge $fEqAEdge $fShowAVertex $fEqAVertex $fShowKey$fEqKey$fShowElementID $fEqElementID$fGenericElementID$fToJSONElementID$fFromJSONElementID$fFromGraphSONElementID$fHashableElementIDFromGraphSONWithKeyPropertyMapListPropertyMapSingle PropertyMap lookupOne putPropertyremoveProperty allPropertieslookupOneValuelookupListValues parseOneValueparseListValuesparseNonEmptyValuesfromProperties$fTraversablePropertyMapGeneric$fFoldablePropertyMapGeneric$fFunctorPropertyMapGeneric$fMonoidPropertyMapGeneric$fSemigroupPropertyMapGeneric$fPropertyMapPropertyMapSingle$fPropertyMapPropertyMapList$$fFromGraphSONWithKeyAVertexProperty$fFromGraphSONWithKeyAProperty$fFromGraphSONPropertyMapList$fFromJSONPropertyMapList$fFromGraphSONPropertyMapSingle$fFromJSONPropertyMapSingle$fShowPropertyMapList$fEqPropertyMapList$fSemigroupPropertyMapList$fMonoidPropertyMapList$fFunctorPropertyMapList$fFoldablePropertyMapList$fTraversablePropertyMapList$fShowPropertyMapSingle$fEqPropertyMapSingle$fSemigroupPropertyMapSingle$fMonoidPropertyMapSingle$fFunctorPropertyMapSingle$fFoldablePropertyMapSingle$fTraversablePropertyMapSingle$fShowPropertyMapGeneric$fEqPropertyMapGeneric AddAnchorLabeledByProjection ByComparatorByComparatorProjByComparatorCompByComparatorProjComp ByProjectionProjectionLikeProjectionLikeStartProjectionLikeEnd RepeatEmit RepeatEmitT RepeatUntil RepeatTimes RepeatUntilT RepeatPos RepeatHead RepeatTail RepeatLabel unRepeatLabel MatchPattern MatchResultGraphTraversalSourceSplitLift SideEffect TransformFilterWalkTypeWalk ToGTraversal toGTraversalliftWalkunsafeCastStart unsafeCastEndGraphTraversal GTraversal unGTraversalsourcesVsV'sEsE'sAddVsAddV'unsafeGTraversal&.$.<$.><*.>gIterate unsafeWalk modulateWith gIdentity gIdentity'gFilter gCyclicPath gCyclicPath' gSimplePath gSimplePath'gWhereP1 gWhereP1'gWhereP2 gWhereP2'mPatterngMatchgIsgIs'gIsPgIsP'gHas1gHas1'gHas2gHas2'gHas2PgHas2P' gHasLabel gHasLabel' gHasLabelP gHasLabelP'gHasIdgHasId'gHasIdPgHasIdP'gHasKeygHasKey'gHasKeyP gHasKeyP' gHasValue gHasValue' gHasValueP gHasValueP'gAndgOrgNotgRangegLimitgTailgSkipgRepeatgTimes gUntilHead gUntilTail gEmitHead gEmitTail gEmitHeadT gEmitTailTgLoopsgLocalgUnion gCoalescegChoose3gBarriergDedupgDedupNgBygBy1gBy2gOrdergByLgFlatMap gFlatMap'gVgV' gConstantgUnfoldgAsgValues gPropertiesgIdgLabel gValueMapgSelect1gSelectN gSelectBy1 gSelectByNgProjectgPathgPathBygFoldgCountgOutgOut'gOutEgOutE'gOutVgOutV'gIngIn'gInEgInE'gInVgInV' gSideEffect gSideEffect'gAddVgAddV'gDropgDropP gProperty gPropertyVgFromgTogAddEgAddE'$fBifunctorGraphTraversal$fFunctorGraphTraversal$fAsIteratorGraphTraversal$fToGreskellGTraversal$fBifunctorGTraversal$fFunctorGTraversal$fBifunctorWalk $fFunctorWalk $fMonoidWalk$fSemigroupWalk$fCategoryTYPEWalk$fWalkTypeFilter$fWalkTypeTransform$fWalkTypeSideEffect$fLiftSideEffectSideEffect$fLiftTransformSideEffect$fLiftTransformTransform $fLiftFilterc$fToGreskellWalk$fToGTraversalWalk$fToGTraversalGTraversal$fSplitSideEffectSideEffect$fSplitTransformp$fSplitFilterp$fToGreskellRepeatLabel$fProjectionLikeGreskell$fProjectionLikeGreskell0$fProjectionLikeKey$fProjectionLikeGreskell1$fProjectionLikeGTraversal$fProjectionLikeWalk$fProjectionLikeGreskell2$fProjectionLikeGTraversal0$fProjectionLikeWalk0$fIsStringByProjection$fProjectionLikeByProjection$fIsStringByComparator $fShowMWalk$fShowRepeatPos $fEqRepeatPos$fOrdRepeatPos$fEnumRepeatPos$fBoundedRepeatPos$fShowRepeatLabel$fEqRepeatLabel$fOrdRepeatLabel$fIsStringRepeatLabel$fShowGraphTraversalSource $fShowWalk$fShowGTraversal$fShowGraphTraversal $fMonoidMWalk$fSemigroupMWalk$fShowRepeatEmit$fShowRepeatUntilBindingBindernewBind runBinder newAsLabel$fFunctorBinder$fApplicativeBinder $fMonadBinder $fShowBinderS $fEqBinderSwritePropertyKeyValueswriteKeyValueswritePMapProperties<=:><=?>gWhenEmptyInputghc-prim GHC.TypesBoolbaseGHC.Basepure<*>NonEmpty<> SemigroupGHC.Exception.Type Exception text-1.2.3.2Data.Text.InternalTextStringexceptions-0.10.4Control.Monad.Catch MonadThrow GHC.MaybeNothingControl.Monad.Fail MonadFail,greskell-core-0.1.3.6-IhqJ3SOuUei4i7XGUhuZ2iData.Greskell.GraphSON.GValueGValueData.Greskell.GreskellGreskellfailControl.CategoryCategory GHC.ClassesEqData.Greskell.GraphSON FromGraphSON Data.Functor<$>Just Data.StringIsStringData.Greskell.AsIterator AsIteratormemptyid>>>$aeson-1.5.5.1-1rNAUITis5V5JglxiRxZ0YData.Aeson.Types.InternalParserunsafeMethodCall unsafeFunCall toGremlinLazy toGremlin gvalueIntgvaluevalueIntvaluenumbersinglelistfalsetruestringunsafeGreskellLazyunsafeGreskellGreskellReturn ToGreskell toGreskell IteratorItemparseJSONViaGValue.: parseEitherparseUnwrapListparseUnwrapAll parseGraphSONData.Greskell.GMaptoList unGMapEntryparseToGMapEntryunGMap parseToGMapparseToFlattenedMap FlattenedMapunFlattenedMapGMapgmapFlat gmapValue GMapEntrygmapEntryValue gmapEntryFlat gmapEntryKey typedGValue'nonTypedGValue GValueBodyGNullGBoolGNumberGStringGObjectGArrayData.Greskell.GraphSON.CoreparseTypedGraphSONtypedGraphSON' typedGraphSONnonTypedGraphSONGraphSONgsonType gsonValue$Data.Greskell.GraphSON.GraphSONTyped GraphSONTyped gsonTypeFor