jessea
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
For now, we're not going to handle cases where the final step is a
TraversalParent
with more than one child step, since I'm not sure we can easily cover all cases. All traversals are proxied through extractProjectKeysFromMapTraversal
which will guarantee the traversal actually returns a Map, so hopefully this should reduce the chance of running into one of those cases.16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
This is indeed much simpler! Since we have access to plain
GraphTraversal
instances, we don't even need to mock the GraphTraversalSource
. Thanks for the tips!16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
Gotcha, yeah this is more or less how we're doing it. Will try to simplify this and post an update when I get something concise working
16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
https://gist.github.com/JeeZeh/1a3030ce71595c5ec6c0cac9190abb9c
Here's what I have so far, but I think this could be greatly simplified with the snippet you provided with
getEndStep
16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
In your mocking example, you override a pre-defined termination step to do some tidy up (returning a mocked response in your case). I've been using this same block to return project keys gathered during the traversal
16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
VerificationStrategy
is probably a good fit for this otherwise (graph-permitting)16 replies
ATApache TinkerPop
•Created by jessea on 3/21/2023 in #questions
Extracting the ProjectStep of a GraphTraversal instance during unit testing
at execution timeIdeally even earlier, before we even have a graph to work against (since this requires developers to deploy the latest build to their developer accounts). Right now, I have this running as a unit test that pulls in all queries and their required keys, and analyses the GraphTraversal instances entirely offline.
16 replies
ATApache TinkerPop
•Created by moosasaadat on 2/21/2023 in #questions
repeat with times(1) causing timeout
We're on engine version 1.1.1.0
9 replies
ATApache TinkerPop
•Created by moosasaadat on 2/21/2023 in #questions
repeat with times(1) causing timeout
(adding to this - I work with @moosa - we're seeing this behaviour with Neptune)
9 replies
ATApache TinkerPop
•Created by Tomcat on 2/11/2023 in #questions
Does anybody know
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 curl
ing your cluster endpoint or from the Neptune Notebook: https://stackoverflow.com/a/59595714/510083222 replies
ATApache TinkerPop
•Created by Tomcat on 2/11/2023 in #questions
Does anybody know
NeptuneAh, 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-predicates22 replies
ATApache TinkerPop
•Created by Tomcat on 2/11/2023 in #questions
Does anybody know
Interesting. This might be related to the C# library or the graph engine then. Which DB are you using? (e.g. Neptune, JanusGraph, etc.)
22 replies
ATApache TinkerPop
•Created by Tomcat on 2/11/2023 in #questions
Does anybody know
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.22 replies
ATApache TinkerPop
•Created by jessea on 1/26/2023 in #questions
Limiting .path() results to a number of valid starting vertices
The
.filter(select('e').unfold())
serves to remove paths that couldn't be constructed, i.e. invalid neighbourhoods?34 replies