© 2026 Hedgehog Software, LLC

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

Need help to implement a generic gremlin query with Apache thinkerPop Java.

Hi Everyone,

From the UI I will get one DSL query, I'm converting that into a Gremlin query. and I'm executing this gremlin query with the help of a Graph traversal source and I'm returning the query response back to UI. For now, I gave a chance to the user he can search with only three attributes (name, type, and system) so based on these three I implemented multiple gremlin queries and if else conditions. yesterday I got a new requirement for business people who want to search with multiple attributes. in these scenarios, I need to implement queries in a generic way.
if I have three properties data I'm executing like this with Java code.
String name ="john";
List<String> typeList = new ArrayList();
List<String> systemList = new ArrayList();
List<Map<Object, Object>> node = g.V().has("name", name).has("type", P.within(typeList)).has("system", P.within(systemList ))
.local(.properties().group().by(.key()).by(__.value())).dedup().toList();

now my requirement is, I need to execute the same query with hundreds of properties. instead of writing multiple if else conditions based on property availability. is there any generic way to handle this kind of scenario.

Thanks.
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

Help with a gremlin query..
Apache TinkerPopATApache TinkerPop / questions
6mo ago
How to to get total count for pagination with gremlin query using java Apache thinker pop
Apache TinkerPopATApache TinkerPop / questions
3y ago
Casting issue with Gremlin Java
Apache TinkerPopATApache TinkerPop / questions
3y ago
Neptune, Gremlin Java & Bindings
Apache TinkerPopATApache TinkerPop / questions
13mo ago