[ 
https://issues.apache.org/jira/browse/TINKERPOP-3184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cole Greer closed TINKERPOP-3184.
---------------------------------
    Fix Version/s: 3.7.4
         Assignee: Cole Greer
       Resolution: Information Provided

> Please allow the path() step to take an optional from and to label
> ------------------------------------------------------------------
>
>                 Key: TINKERPOP-3184
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3184
>             Project: TinkerPop
>          Issue Type: Wish
>    Affects Versions: 3.7.4
>            Reporter: Martin Häusler
>            Assignee: Cole Greer
>            Priority: Major
>             Fix For: 3.7.4
>
>
> Hello,
> I am once again dealing with paths. I noticed that it is currently possible 
> to do the following:
> {code:java}
> traversal().V()
>    // ... navigation...
>    .path()
>    .unfold()
> {code}
> ... which is very neat. I was wondering if I can also get the path between a 
> label and the current vertex. Turns out, I can:
> {code:java}
> traversal().V()
>    // ... navigation ...
>    .as("from")
>    // ... navigation...
>    .flatMap ( t-> t.path().subPath("from", null).iterator())
> {code}
> That is very useful! But it's a shame that the functionality is locked behind 
> a lambda expression, which is not available in all scenarios. Moreover, 
> gremlin optimizes away the path information tracking if no "path()" step is 
> used in the query, so the lambda solution always requires some additional 
> artificial steps on top.
> My proposal would be to add the following overload to the "path()" method:
> {code:java}
> public default GraphTraversal<S, Path> path(String fromLabel, String toLabel)
> {code}
> ... which behaves exactly like the lambda above. Both "fromLabel" and 
> "toLabel" should accept NULL (same as "subPath(...)") which means start/end 
> of the path respectively. Therefore calling "path()" would be the same as 
> "path(null, null)".



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

Reply via email to