[ https://issues.apache.org/jira/browse/TINKERPOP-1139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332245#comment-15332245 ]
ASF GitHub Bot commented on TINKERPOP-1139: ------------------------------------------- GitHub user spmallette opened a pull request: https://github.com/apache/tinkerpop/pull/338 TINKERPOP-1139 Re-assigned step labels as appropriate in SubgraphStrategy. https://issues.apache.org/jira/browse/TINKERPOP-1139 Step labels were not being re-written to replaced steps or to the subgraph filter steps and so traversals using .as('a') and the like were failing. Runs nicely with 'mvn clean install -DincludeNeo4j` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1139 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/338.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #338 ---- commit a41971eca60bbafbd2e32309385a3499cd61faad Author: Stephen Mallette <sp...@genoprime.com> Date: 2016-06-15T18:15:53Z Re-assigned step labels as appropriate in SubgraphStrategy. Step labels were not being re-written to replaced steps or to the subgraph filter steps and so traversals using .as('a') and the like were failing. ---- > [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep > (as("b")) > -------------------------------------------------------------------------------- > > Key: TINKERPOP-1139 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1139 > Project: TinkerPop > Issue Type: Bug > Components: neo4j > Affects Versions: 3.1.0-incubating > Reporter: Martijn Maas > Fix For: 3.1.3 > > > I am using the Neo4jGraph with the following SubgraphStrategy: > {code} > SubgraphStrategy.build().vertexCriterion(has("isLatest", true)).create(); > {code} > I have 2 traversals. This one working works: > {code} > Map<String, Long> languageCounts = > searchResult.as("a").inE("isCreatedBy").outV().outE("hasWorkLanguage").inV().as("b").dedup("a", > "b") > .has("wwlanguage_name").<String>groupCount() > .by("wwlanguage_name").next(); > {code} > This translates to: > {code} > [Neo4jGraphStep([],vertex)@[a], > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > VertexStep(IN,[isCreatedBy],edge), > TraversalFilterStep([AndStep([[EdgeVertexStep(IN), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), > EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), > VertexStep(OUT,[hasWorkLanguage],edge), > TraversalFilterStep([AndStep([[EdgeVertexStep(IN), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), > EdgeVertexStep(IN)@[b], TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), > DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))] > {code} > This one fails: > {code} > Map<String, Long> languageCounts = > searchResult.as("a").in("isCreatedBy").out("hasWorkLanguage").as("b") > .dedup("a", > "b").has("wwlanguage_name") > .<String>groupCount().by("wwlanguage_name").next(); > {code} > This translates to: > {code} > [Neo4jGraphStep([],vertex)@[a], > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > VertexStep(IN,[isCreatedBy],edge), > TraversalFilterStep([AndStep([[EdgeVertexStep(IN), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), > EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), > VertexStep(OUT,[hasWorkLanguage],edge), > TraversalFilterStep([AndStep([[EdgeVertexStep(IN), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), EdgeVertexStep(IN), > TraversalFilterStep([HasStep([isLatest.eq(true)])]), > TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), > DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))] > {code} > The failing query misses the '@[b]' of the last EdgeVertexStep(IN). -- This message was sent by Atlassian JIRA (v6.3.4#6332)