You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Andrea C (Jira)" <ji...@apache.org> on 2025/05/20 16:44:00 UTC

[jira] [Commented] (TINKERPOP-3159) from modulator for tree step

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

Andrea C commented on TINKERPOP-3159:
-------------------------------------

This does seem like it would be a useful feature and hopefully not difficult to implement given how the `path` step supports similar functionality with `to` and `from`.

> from modulator for tree step
> ----------------------------
>
>                 Key: TINKERPOP-3159
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3159
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: language
>    Affects Versions: 3.7.3
>            Reporter: Christopher Smith
>            Priority: Major
>
> I have a reusable query fragment in a business application that starts at a "user" vertex and enumerates some various resources the user has access to, using {{tree()}} to report structure. However, the {{tree}} step always reports the entire traverser path from {{{}g.V(){}}}, with no way to limit it—\{{sideEffect}}, {{{}local{}}}, and so on either don't reset it or entirely clear the history. I would like to be able to use {{from}} on {{tree}} in the same manner as on {{path}} so that I could do this:
> {code:java}
> def resources(GraphTraversal<?, Vertex> userVertex) {
>   userVertex.as('user')
>     .out('Controls').as('widgets')
>     .out('Contains').as('parts')
>     // blah blah
>     .tree('resourceTree').from('user')
>     .project //...
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)