I have the following query which works without any issues with TinkerGraph, JanusGraph and Neo4j-Gremlin:
g.V().has('Account','address','0x0').
out('sent').has('eventName','Transfer').as('t1').
out('received_by').has('type','EOA').has('status','Active').as('a2').
out('sent').has('eventName','Transfer').as('t2').
where('t1',eq('t2')).by('address').
where('t1',eq('t2')).by('amount').
out('received_by').has('type','EOA').has('status','Active').as('a3').
select('a3','a2').
by('address').
group().
by('a3').
by('a2').
unfold().
where(select(values).limit(local,2).count(local).is(gte(2).and(lte(1000))))
But with DataStax Graph I get the following error:
java.util.LinkedHashMap cannot be cast to org.apache.tinkerpop.gremlin.structure.Element
I know the issue is after the select but I haven't been able to figure out in which point is really failing. Any ideas would help. Thanks.
DataStax Graph 6.8.1 uses an early release of TinkerPop 3.4.5. That release does not contain the full release feature that allows by(String)
to work on a Map
. You should be able to re-write your traversal to:
g.V().has('Account','address','0x0').
out('sent').has('eventName','Transfer').as('t1').
out('received_by').has('type','EOA').has('status','Active').as('a2').
out('sent').has('eventName','Transfer').as('t2').
where('t1',eq('t2')).by('address').
where('t1',eq('t2')).by('amount').
out('received_by').has('type','EOA').has('status','Active').as('a3').
select('a3','a2').
by('address').
group().
by(select('a3')).
by(select('a2').fold()).
unfold().
where(select(values).limit(local,2).count(local).is(gte(2).and(lte(1000))))