[ 
https://issues.apache.org/jira/browse/TINKERPOP-1391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette updated TINKERPOP-1391:
----------------------------------------
             Assignee: Daniel Kuppitz
    Affects Version/s: 3.1.3
        Fix Version/s: 3.1.4
          Component/s: process

[~arikc] note that the workaround for now would be to write your traversal as:

{code}
gremlin> g.V().hasLabel('GROUP').where(__.outE("PART_OF").count().is(0))
==>v[0]
{code}

Looks like a bug in the traversal strategies:

{code}
gremlin> 
g.V().hasLabel('GROUP').where(__.outE().hasLabel("PART_OF").count().is(eq(0))).explain()
==>Traversal Explanation
==================================================================================================================================================================================================
Original Traversal                 [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]

ConnectiveStrategy           [D]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
IdentityRemovalStrategy      [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
IncidentToAdjacentStrategy   [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
AdjacentToIncidentStrategy   [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
FilterRankingStrategy        [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
MatchPredicateStrategy       [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
RepeatUnrollStrategy         [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
HasStep([~label.eq(PART_OF)]), CountGlobalStep, IsStep(eq(0))])]
RangeByIsCountStrategy       [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
NotStep(![HasStep([~label.eq(PART_OF)])])])]
PathRetractionStrategy       [O]   [GraphStep(vertex,[]), 
HasStep([~label.eq(GROUP)]), TraversalFilterStep([VertexStep(OUT,edge), 
NotStep(![HasStep([~label.eq(PART_OF)])])])]
TinkerGraphStepStrategy      [P]   [TinkerGraphStep(vertex,[~label.eq(GROUP)]), 
TraversalFilterStep([VertexStep(OUT,edge), 
NotStep(![HasStep([~label.eq(PART_OF)])])])]
ProfileStrategy              [F]   [TinkerGraphStep(vertex,[~label.eq(GROUP)]), 
TraversalFilterStep([VertexStep(OUT,edge), 
NotStep(![HasStep([~label.eq(PART_OF)])])])]
StandardVerificationStrategy [V]   [TinkerGraphStep(vertex,[~label.eq(GROUP)]), 
TraversalFilterStep([VertexStep(OUT,edge), 
NotStep(![HasStep([~label.eq(PART_OF)])])])]

Final Traversal                    [TinkerGraphStep(vertex,[~label.eq(GROUP)]), 
TraversalFilterStep([VertexStep(OUT,edge), 
NotStep(![HasStep([~label.eq(PART_OF)])])])]
{code}

{{NotStep}} shoudl be wrapped around {{VertexStep}} and {{HasStep}}. It should 
generate this:

{code}
gremlin> g.V().hasLabel('GROUP').where(__.outE().not(hasLabel("PART_OF"))) // 
what it does
gremlin> g.V().hasLabel('GROUP').where(__.not(outE().hasLabel("PART_OF"))) // 
what it should do
==>v[0]
{code}



> issue with where filter
> -----------------------
>
>                 Key: TINKERPOP-1391
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1391
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.1.3
>            Reporter: Arik Cohen
>            Assignee: Daniel Kuppitz
>             Fix For: 3.1.4
>
>
> Graph g = TinkerGraph.open();
> g.addVertex(T.label,"GROUP","name","Acme");
>     
> List<Vertex> list = g.traversal()
>                                .V()
>                                .hasLabel("GROUP")
>                                
> .where(__.outE().hasLabel("PART_OF").count().is(0))
>                                .toList();
>     
> Assert.assertEquals(1, list.size()); // actual size is 0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to