how to ignore case of edge label while traversing

376 views
Skip to first unread message

Praneeth Dogiparthi

unread,
Feb 27, 2019, 10:48:30 AM2/27/19
to Gremlin-users
Hi,

suppose i have two edges one with label FOLLOW and Follow can i tell gremlin to ignore case while traversing if yes how can i do it and is it possible to ignore case when using has 

example 

.has("gender", "MALE")


.has("gender", "Male")


i need to ignore cases.

Stephen Mallette

unread,
Mar 7, 2019, 6:57:46 AM3/7/19
to gremli...@googlegroups.com
Sorry, just noticing that no one answered this one. There is nothing in TinkerPop that allows that sort of thing at this time. There are predicates for specific graph providers that would allow this (like, DSE Graph's token() predicates I think are case insensitive and I suppose any graph providers regex options could be written to match however you'd like). 

While TinkerPop recently introduced TextP 


it does not yet contain case-insensitive or regex options. We've struggled with how to allow for a regex, as there are so many different dialects of that search language. On the other hand, in recent times, I've felt like we set a precedence with math() step to simply choose a "dialect" and say, "that's what we support". Perhaps the next time regex is discussed we can commit to it.



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/0ad787df-99e7-4fa0-b434-019572f47cd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Kuppitz

unread,
Mar 8, 2019, 10:52:49 AM3/8/19
to gremli...@googlegroups.com
Generally, it's a good idea to normalize the values at write-time. It costs almost no time to .toUpperCase() String values at write-time; doing a case-insensitive search, on the other hand, will have a big impact on the overall performance (as you usually read more often than you write).

Cheers,
Daniel


Nivas Umapathy

unread,
Mar 11, 2019, 3:59:57 AM3/11/19
to Gremlin-users
There is a liker(string) which can take a regex. You can do a case insensitive like on this.
Reply all
Reply to author
Forward
0 new messages