Hello,

TinkerPop3 made a stance against TinkerPop2 and said: "there are no such thing 
as lambdas --- lambdas are traversals!"

Next --- the mutation steps in TinkerPop3 are sorta clunky and ugly. Moreover, 
people want mid-traversal parameterization. That is, something like:

addV(T.label, select("a").label())

This got us to thinking. EVERYTHING IS A TRAVERSAL. There are no such things a 
primitives. Gremlin works with only one type of object -- Traversal. While this 
sounds crazy, its actual realization into TinkerPop 3.1.0 would be simple. 
However, our mutation steps as we have them now, would be @Deprecated. :( 
Everything else would stay the same. :) Ignoring the general theory of 
"EVERYTHING IS A TRAVERSAL," lets look at a practical day one ramification.

Here is the thread of thought:
        https://issues.apache.org/jira/browse/TINKERPOP3-799

Here is a break down of what of what we propose for TinkerPop 3.1.0.

addV("person").property("name","marko")
addV("person").property("name",select("a").by("name"))
addE("likes").from("a").to("b")
addE("knows").from(select("a").in("likes")).to(select("b").in("employees"))
addE("likes").from(select("a").in("likes")).to("a")
addE("likes").from("a").to("b").property(select("a").by("key"),select("a").by("value"))
out(select("a").label())

In short, every step's parameters can be traversals which are evaluated at 
runtime. Thus, the query is parameterized by the traverser. Psychedelic.

For now, I'm not so interested in out(select("a").label()) as much as in 
cleaning up the mutation steps (property(), addV(), addE()) as this is where 
people seem to want this type of runtime parameterization and where our current 
GraphTraversal API is weak.

If anyone has any thoughts on the matter, please espouse them. 

*** Note for vendors. I know Titan, so I will show how this is crazy for Titan 
and hopefully other vendors see the complexity. When a user does 
out(select("a").label()), then Titan's vertex-centric index step will NOT have 
the edge label at compile-time, but will have to compute for each and every 
traverser. I have already created a very nice object called "Parameters" which 
makes this easy, but still…….. This is also why I just want to focus on the 
mutation steps for now as those are not vendor optimized (as far as I know) and 
it provides us the most bang for our buck.

Thanks,
Marko.

http://markorodriguez.com

Reply via email to