Contains text predicate using gremlin-javascript

244 views
Skip to first unread message

boardth...@gmail.com

unread,
May 29, 2018, 3:50:11 PM5/29/18
to Gremlin-users
Hi all

I'm using the official Tinkerpop gremlin-javascript GLV (3.2.9) to access AWS Neptune.

Seeing as the gremlin-javascript GLV does not support lambdas, is there a non-lambda way of achieving the equivalent of the following:

g.V().filter({ it.getProperty("foo").contains("search") })

thanks,
Dean

Stephen Mallette

unread,
Jun 1, 2018, 11:21:02 AM6/1/18
to Gremlin-users
I'm not aware of one besides some trickery:


scroll down to the "between" trick. I think we're reaching a point though where there is enough text/geo search implementations out there that we might try to generalize some expressions for these things in TinkerPop. A few weeks ago, someone on the list sounded like they were going to collect some examples for us to evaluate, but I haven't seen that show up yet.

--
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/ab0f4d5e-082a-424c-8d34-31d37647249d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

boardth...@gmail.com

unread,
Jun 1, 2018, 12:46:47 PM6/1/18
to Gremlin-users
Yes, I came across that while looking for a solution.  It did help me with `startsWith` but I'm still left with no `contains`.

Kelvin Lawrence

unread,
Jun 1, 2018, 1:21:03 PM6/1/18
to Gremlin-users
I too think it would be good if we could add some additional text comparison predicates to TinkerPop and maybe even some support for regular expressions Stephen. Of course, as you have stated before, there is more than one REGEX syntax that could be selected. Perhaps copying what Titan/JanusGraph provides might be a reasonable approach as a start?

Cheers,
Kelvin

Stephen Mallette

unread,
Jun 1, 2018, 1:44:39 PM6/1/18
to Gremlin-users
I imagine that it would boil down to the JanusGraph predicates as they are sufficiently generic but I think I'd still like to examine what all the graphs offer out there. As for regex, we may leak some portability i suppose by having it, but I'm not sure I see that as a big issue. I think others have felt more strongly about that leak, so perhaps we still don't have consensus to move forward with that. 

Reply all
Reply to author
Forward
0 new messages