[
https://issues.apache.org/jira/browse/TINKERPOP-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15320661#comment-15320661
]
Daniel Kuppitz commented on TINKERPOP-1329:
-------------------------------------------
I think we talked about it before. This would be really cool, I often miss a
better way to refer to previous values. Your second query is a classic example
(Find people known by marko who are older than him). The shortest query I can
currently come up with is this one:
{code}
g.V().has("name",
"marko").as("a").out("knows").as("b").filter(select("a","b").by("age").where("a",
lt("b")))
{code}
Maybe we can your proposed query a step further:
{code}
// instead of
g.V().has("name","marko").as("a").out("knows").has("age",gt(select("a").values("age"))
// we could do
g.V().has("name","marko").as("a").out("knows").where(gt("a")).by("age")
{code}
But maybe this is getting too abstract.
> Use Parameters in more steps than just the MutationStep library.
> ----------------------------------------------------------------
>
> Key: TINKERPOP-1329
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1329
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.1
> Reporter: Marko A. Rodriguez
>
> {{Parameters}} was introduced to provide more expressivity in the mutation
> API. With {{Parameters}}, a step parameter need not be a direct object, but
> could, instead, but a traversal which yields the direct object. For instance:
> {code}
> g.V().as("a").out().addV("person").property("age",select("a").values("age"))
> {code}
> That is, the new person age is the age of whatever vertex was labeled "a."
> This ability to parameterize steps with runtime traversals is powerful and
> should be used more throughout Gremlin. For instance, it would be cool to be
> able to do things like below:
> {code}
> g.V().outE().as("e").inV().out(select("e").label())
> g.V().as("a").out().has("age",gt(select("a").values("age"))
> g.V().groupCount().by(label)
> .order(local).by(values,decr)
> .select(keys).unfold().limit(1)
> V().hasLabel(__.label())
> {code}
> I think the steps that can best use {{Parameters}} include:
> * {{Mutating}}-steps (**done**)
> * {{HasStep}}
> * {{VertexStep}} (out(), in(), outE(), etc.)
> * ??
> [~dkuppitz] What do you think given your experience?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)