[
https://issues.apache.org/jira/browse/TINKERPOP-1280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15262480#comment-15262480
]
Marko A. Rodriguez commented on TINKERPOP-1280:
-----------------------------------------------
Ha. Yea, because there is no {{select}}, {{where}}, {{match}}, etc. step in the
first traversal, {{TraverserRequirement.LABELED_PATH}} is not a requirement as
{{as("a")}} does nothing. However, if your {{program()}} requires it,
{{TraversalVertexProgram}} doesn't know that cause {{program()}} is like a
lambda... it can't introspect into the program to know what it needs.
There is no easy solution to this. The hack is to do something like
{{where(as("a"))}} like you do above, or we add the following:
{code}
g = g.withRequirement(LABELED_PATH)
g.V().as("a")....
{code}
I'm sort of scared of adding {{withRequirement}} as there are a couple of
tickets out there about getting rid of the concept of requrements.... :). In
short, this is sort of a stalemate with no obvious solution besides the manual
hack.
> VertexPrograms should declare traverser requirements
> ----------------------------------------------------
>
> Key: TINKERPOP-1280
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1280
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.0-incubating
> Reporter: Daniel Kuppitz
>
> VertexPrograms should declare their {{TraverserRequirement}} which can then
> be propagated by the {{program()}} step. Most VPs (at least the ones I have
> written so far) rely on (labeled) path information and thus will fail if the
> actual traversal doesn't use any other steps with the same traverser
> requirements. I keep running into this issue whenever I write a new VP.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)