Does anybody know

I am C# developer using the Tinker pop nuget package v3.6.2 .I am struggling with a poblem with regex search. actually everytime I run my code it just goes for ever and nothing returns back until I shutdown the the app. Can anybody help me here: my code is looks like this var test1 = g.V().Has("names", TextP.Regex("^Majid*"));
Solution:
Just to summarize here, I think the failure is expected since you are using operators from 3.6.x that Neptune doesn't know how to deal with yet (soon though!). I do find it strange that these traversals dont get an immediate error when it encounters those though. I still would like to know how long you are waiting for the query to return and what exception it is returning with or if it hangs indefinitely (at least past the 2 minute default). I think if it is hanging indefinitely then there might...
Jump to solution
16 Replies
jessea
jessea2y ago
How many nodes do you have in the graph? Depending on the DB engine you are using, some text predicates may not be able to use an index-based search, and instead require a full search across the graph. This can be very slow with large graphs. The query you've written I believe will also attempt to find all matches exhaustively before returning the results. If you supply .limit(n) after the .has(), it will stop once it has found n matches.
Tomcat
TomcatOP2y ago
I only have 9 nodes with 5 edges
jessea
jessea2y ago
Interesting. This might be related to the C# library or the graph engine then. Which DB are you using? (e.g. Neptune, JanusGraph, etc.)
Tomcat
TomcatOP2y ago
Neptune I have tested it with TextP.Containing , ... and it works fine. only Regex has this issue I just realized the problem is looks like when I use .Next() or .HasNext() or .ToLiist() or etc . So the question is when I ran this query how can I convert the result to array ? var test1 = g.V().Has("names", TextP.Regex("^Majid")).ToList(); -> this fails var test1 = g.V().Has("names", TextP.Regex("^Majid")).HasNext(); -> fails
jessea
jessea2y ago
Neptune
Ah, Neptune does not yet support TinkerPop 3.6.0, which is crucially when TextP.regex was introduced: https://tinkerpop.apache.org/docs/current/reference/#a-note-on-predicates
jessea
jessea2y ago
In the official javadocs, each method includes a since field that indicates when that feature was introduced: https://tinkerpop.apache.org/javadocs/current/core/org/apache/tinkerpop/gremlin/process/traversal/TextP.html#regex(java.lang.String) Unfortunately I can't see where the current version is mentioned in the Neptune documentation itself, but you can check the version by curling your cluster endpoint or from the Neptune Notebook: https://stackoverflow.com/a/59595714/5100832
Stack Overflow
Where can I find out what version of Tinkerpop Gremlin, AWS Neptune...
I am trying to use .valueMap().with(WithOptions.tokens) in my query against AWS Neptune. I get MalformedQueryException. I suspect that this is a new feature in Gremlin 3.4.* I have not been abl...
spmallette
spmallette2y ago
Neptune support for 3.6.x is coming soon but...
actually everytime I run my code it just goes for ever and nothing returns back until I shutdown the the app
weird that you don't get an error at all on Neptune. i would have guessed you'd get a fairly immediate error.
Tomcat
TomcatOP2y ago
Thanks for the update @Jesse A hope they start to supporting soon. Yea actually it is weird, I tried to trap that in "try catch" but looks like it do nothing. as long as it does not any performance impact maybe it is ok but good to notice what is going on to that
Florian Hockmann
Just to be sure: You are actually using terminal steps like Next() or ToList(), right? Because I don't see them in your listing and that would explain why nothing really happens
Tomcat
TomcatOP2y ago
Actually yes when I start using these extensions then the application hangs and nothing happening
spmallette
spmallette2y ago
does it hang longer than the expected timeout?
Tomcat
TomcatOP2y ago
I haven't set any timeout for the connection but basically it takes very long, I never been that patient to see when/how it ends.
Florian Hockmann
But this only happens for TextP.Regex() or for all traversals, including a simple one like g.V([knownVertexId]).Next()?
spmallette
spmallette2y ago
Neptune has a 2 minute timeout by default, though i'd really expect it to fail immediately. i'd be curious as to what would happen if you waited the full 2 minutes.
Tomcat
TomcatOP2y ago
It works fine with other operators. even TextP.Containing(), ... are ok but Regex and NotRegex have issue. not sure how does TinkerPop doing this but if .ToList() is applying after Neptune so that is something between Neptune and C# but if it does happening on Neptune side then that should be Neptune issue.
Solution
spmallette
spmallette2y ago
Just to summarize here, I think the failure is expected since you are using operators from 3.6.x that Neptune doesn't know how to deal with yet (soon though!). I do find it strange that these traversals dont get an immediate error when it encounters those though. I still would like to know how long you are waiting for the query to return and what exception it is returning with or if it hangs indefinitely (at least past the 2 minute default). I think if it is hanging indefinitely then there might be a but we need to look into somewhere.
Want results from more Discord servers?
Add your server