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

Cole Greer commented on TINKERPOP-2502:
---------------------------------------

Breaking this JIRA into 2 asks, the first is looking to "start" a 
GraphTraversalSource without using any start steps. I have a concern there 
about opening a path for users to build some nonsense which don't contain 
proper start-steps. Also I'm wondering if this could be achieved without a 
start() method by constructing a new DefaultGraphTraversal 
(https://github.com/apache/tinkerpop/blob/077e3eb22c463545c3fc974944d4bf1d5d6a32fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/DefaultGraphTraversal.java#L33)

In terms of extracting the start steps into a common ancestor interface for 
GraphTraversalSource and GraphTraversal, I'm unsure if that's an abstraction 
that many users would find helpful as I don't expect concrete classes to solely 
implement that interface and not one of it's child interfaces. It's also not 
necessarily a trivial extraction as the generics differ somewhat between the 
start and mid traversal form of most steps.

Based on the above concerns and the lack of traction for a long time, I'm going 
to close this JIRA for now. If you would still like to pursue such a change, 
please feel free to reopen the JIRA and we can further discuss how an ideal 
solution could take shape.

> Consistent start API for anonymous and regular traversals
> ---------------------------------------------------------
>
>                 Key: TINKERPOP-2502
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2502
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.4.9
>            Reporter: Christopher Smith
>            Priority: Minor
>
> I am writing a graph-based application and am taking advantage of the 
> method-based nature of Gremlin to librarify some of my common usage patterns. 
> However, I'm encountering a frustrating problem where I frequently need to be 
> able to attach the same traversal steps to either a real 
> {{GraphTraversalSource}} or an anonymous traversal (usually for some nested 
> reason like a coalesced conditional insert).
> The methods on {{__}} are mostly static, but I can call {{__.start()}} to 
> obtain a live {{GraphTraversal}} object and then proceed from there (invoking 
> {{GraphTraversal#addV}}, for example). {{GraphTraversalSource}}, however, 
> requires me to invoke the method {{GraphTraversalSource#addV}} to get 
> started, and there's no common base type. I think I could theoretically use 
> something like {{inject()}}, but that seems particularly odd.
> It would be helpful to either have both {{GraphTraversal}} and 
> {{GraphTraversalSource}} implement a common interface holding the "start 
> opcodes" or to have a {{GraphTraversalSource#start()}} method that could be 
> used to obtain a "blank" traversal.



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

Reply via email to