You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Christopher Smith (Jira)" <ji...@apache.org> on 2021/01/07 07:43:00 UTC
[jira] [Created] (TINKERPOP-2502) Consistent start API for
anonymous and regular traversals
Christopher Smith created TINKERPOP-2502:
--------------------------------------------
Summary: 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
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.3.4#803005)