[ 
https://issues.apache.org/jira/browse/TINKERPOP-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15812313#comment-15812313
 ] 

Daniel Kuppitz commented on TINKERPOP-1496:
-------------------------------------------

Back to the initial question of this ticket: I no longer think that every 
head-{{as()}} should / can be replaced with a {{select()}}. I've had a quick 
look though my latest answers on the mailing list and it didn't take long to 
find a traversal that uses a head-{{as()}} to label the current element:

{noformat}
g.V().emit(cyclicPath().or().not(both())).
        repeat(both()).until(cyclicPath()).
  aggregate("p").by(path()).cap("p").unfold().
  limit(local, 1).dedup().map(
    __.as("v").select("p").unfold().
    filter(unfold().where(eq("v"))).unfold().dedup().
    order().by(id, incr).fold()
  ).dedup()
{noformat}

I'm actually using this pattern quite often (mostly in {{map}}, {{filter}} and 
{{union}}).

> Should a head-as("x") always be a select("x")?
> ----------------------------------------------
>
>                 Key: TINKERPOP-1496
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1496
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.2.2
>            Reporter: Marko A. Rodriguez
>              Labels: breaking
>
> There are two steps that treat a head of {{as("x")}} as {{select("x")}}. 
> {code}
> match(as("x").out().as("y"), ...) => match(select("x").out().as("y"), ...)
> where(as("x").has("name")) => where(select("x").has("name"))
> {code}
> I don't like how these steps are "special" in this respect and I think that 
> it would be elegant if a head-{{as()}} has a consistent meaning for all inner 
> traversals.
> Thus, I'm wondering if we should make it such that EVERY head {{as("x")}} 
> gets translated to {{select("x")}}.
> {code}
> addE("knows").to(as("x").out("mother"))
> property("name", as("x").out("mother").values("name"))
> {code}
> I believe this would be backwards compatible in the sense that there really 
> isn't a reason why an inner traversal head-{{as()}} would be used to label. 
> Dunno -- definitely need [~dkuppitz]/etc. feedback.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to