© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Apache TinkerPopAT
Apache TinkerPop•3y ago•
8 replies
Lyndon

Casting issue with Gremlin Java

I wrote the following query and I can't get it to compile, tried a ton of casting but it just isn't happy...

g.V(..).in(..).<some contraints that do not change it from a vertex).
        fold().project("visits", "form").
                    by(__.unfold().values("...").dedup().count()).
                    by(__.unfold().
                           repeat( __.in()).
                                    emit(__.<etc>))
                    
g.V(..).in(..).<some contraints that do not change it from a vertex).
        fold().project("visits", "form").
                    by(__.unfold().values("...").dedup().count()).
                    by(__.unfold().
                           repeat( __.in()).
                                    emit(__.<etc>))
                    

The problem is because of the fold it loses the type and then the type going into the repeat will not allow me to execute an in() step. I tried casting the unfold() and the in() to GraphTraversal<Vertex, Vertex> and variations of that with 1 vertex switched for Object. I cannot get this to compile. Anyone have any ideas on how to cast this properly?
Apache TinkerPop banner
Apache TinkerPopJoin
Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1,376Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Neptune, Gremlin Java & Bindings
Apache TinkerPopATApache TinkerPop / questions
13mo ago
Using java/gremlin inside python with Jpype!
Apache TinkerPopATApache TinkerPop / questions
15mo ago
`next(n)` with Gremlin JavaScript
Apache TinkerPopATApache TinkerPop / questions
2y ago
Gremlin Query timeout issue
Apache TinkerPopATApache TinkerPop / questions
12mo ago