Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1139

[Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep (as("b"))

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-incubating
    • Fix Version/s: 3.1.3, 3.2.1
    • Component/s: neo4j
    • Labels:
      None

      Description

      I am using the Neo4jGraph with the following SubgraphStrategy:

      SubgraphStrategy.build().vertexCriterion(has("isLatest", true)).create();
      

      I have 2 traversals. This one working works:

      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();
      

      This translates to:

      [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))]
      

      This one fails:

      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();
      

      This translates to:

      [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))]
      

      The failing query misses the '@[b]' of the last EdgeVertexStep(IN).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                spmallette Stephen Mallette
                Reporter:
                mm33 Martijn Maas
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: