Daniel Weber created TINKERPOP-3223:
---------------------------------------

             Summary: Argument to SubgraphStrategy.Builder.edges changes 
semantics when used along vertices
                 Key: TINKERPOP-3223
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3223
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.7.5, 3.8.0
         Environment: Gremlin Console, Windows 11
GremlinServer on Docker.
            Reporter: Daniel Weber


Setup: Any TinkerGraph with vertices and edges with long-Ids.

The arguments to SubgraphStrategy.Builder.vertices and edges are supposed to be 
predicate-traversals, i.e. edges and vertices are only to be considered part of 
the subgraph if the predicate traversal yields a result. This works for  

{{g.withStrategies(SubgraphStrategy.build().vertices(id().is(lt(42L))).create()).V()
 / .E()}}

{{and}}

{{g.withStrategies(SubgraphStrategy.build().edges(id().is(lt(4L))).create()).V()
 / .E()}}

however, if used together, the edges-traversal suddenly becomes somewhat of a 
failed cast on edges:

{{g.withStrategies(SubgraphStrategy.build().edges(id().is(lt(8L))).vertices(id().is(lt(4L))).create()).E()}}
 yields

class java.lang.Long cannot be cast to class 
org.apache.tinkerpop.gremlin.structure.Edge (java.lang.Long is in module 
java.base of loader 'bootstrap'; org.apache.tinkerpop.gremlin.structure.Edge is 
in unnamed module of loader 'app')

 

It does work, however, if the filter is made explicit: 

{{g.withStrategies(SubgraphStrategy.build().edges(filter(id().is(lt(8L)))).vertices(id().is(lt(4L))).create()).E()}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to