spc16670
spc16670
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
No description
13 replies
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
There is only 660k nodes and 1.03 mln edges
13 replies
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
I have parked work on this as we are seeing many timeouts with other queries we run... We are running serverless and with timeout settings set to 30 minutes the queries still time out. The repeat loops seems to dive 6 levels deeps and then it just hangs... Our requirement is to discover all nodes a particular node can be connected to and Neptune does not seem to be fit for the task... Do we have to look at some Spark based solutions?
13 replies
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
I think intersect is not supported because I am not using the latest version of Neptune - I will try with a newer version
13 replies
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
I have come across several problems now - 1) it does not look like Neptune has support for intersect() 2) the values("types").fold() folds types for all nodes (on the frontier - is that how we say it) and I want to evaluate the types per local step, do I need to factor 'local' in somehow?
13 replies
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
Hi @triggan - thanks to your suggestions I think I have something that is working:
g.withSack([2]).V("A").
repeat(
inE("receives").outV().
filter(values("types").fold().intersect(sack()).unfold().aggregate("inter")).
inE("receives").outV().as("current").
choose(inE().hasLabel("receives").count().is(0), select("current"), inE("receives").
outV().filter(values("types").fold().intersect(select("inter")).unfold()).
inE("receives").outV()).
sack(assign).by(select("inter"))).
until(inE().hasLabel("receives").count().is(0))
g.withSack([2]).V("A").
repeat(
inE("receives").outV().
filter(values("types").fold().intersect(sack()).unfold().aggregate("inter")).
inE("receives").outV().as("current").
choose(inE().hasLabel("receives").count().is(0), select("current"), inE("receives").
outV().filter(values("types").fold().intersect(select("inter")).unfold()).
inE("receives").outV()).
sack(assign).by(select("inter"))).
until(inE().hasLabel("receives").count().is(0))
I just have to figure out how to supply the initial value and add some tests for edge cases.
13 replies
ATApache TinkerPop
Created by spc16670 on 6/12/2024 in #questions
Dynamically calculated values from last vertex to select outgoing edges for further traversal
Thank you - I would really appreciate help with this. I have found a good Gremlin tutorial online (for DataStax) and Kelvin's book is very much on my reading list, but my company is looking for quick answers at this stage and I can only see myself diving deep into gremlin once a decision has been made to indeed adopt Neptune for production use. Also, whatever query I am going to put together will be probably less performant than one devised by someone with Gremlin experience - so even if I arrive at a query that gives me the expected results I would still seek consultation on whether the query is traversing the graph in the most performant way.
13 replies