Is it possible to walk 2 different graphs using custom TraversalStrategy in Gremlin?
I have 2 different graphs in 2 different Neptune cluster. Both of them can have few reference vertices referring to vertex in other graph. e.g. As we walk through graph A and reach a reference vertex (referring to vertex in graph B), we should be able to traverse normally further inside Graph B and get the results of the query. Basically Graph A + Graph B should act as single virtual graph.
Solution:
At this time, there would be no easy way to do this and I don't think a custom
TraversalStrategy
would help in any way i can imagine. Maybe the closest thing I can imagine would be to subgraph the two graphs with their references vertices and merge them to a single TinkerGraph in your application and then run additional queries on that directly. I'm not sure that suits a lot of use cases we hear about though in relation to this feature so that suggestion may not be helpful. cc/ @Dave Bechberg...Solution
spmallette•94d ago
At this time, there would be no easy way to do this and I don't think a custom
TraversalStrategy
would help in any way i can imagine. Maybe the closest thing I can imagine would be to subgraph the two graphs with their references vertices and merge them to a single TinkerGraph in your application and then run additional queries on that directly. I'm not sure that suits a lot of use cases we hear about though in relation to this feature so that suggestion may not be helpful. cc/ @Dave BechbergerDave•94d ago
I don't know if it would be quite as seamless as that but I have done some previous POC work on the ability to federate queries across graphs that could be applicable here
RN•93d ago
Can you share some codepointers or docs for this?
Dave•93d ago
This only ever got as far as the POC stage but here is the custom procedure call that I wrote https://github.com/bechbd/tinkerpop/blob/query_federation/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/services/TinkerQueryFederationFactory.java
GitHub
tinkerpop/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gr...
Apache TinkerPop - a graph computing framework. Contribute to bechbd/tinkerpop development by creating an account on GitHub.
RN•90d ago
I am thinking of 2 approaches but not sure if it will work -
1. extending
DefaultGraphTraversal
and overriding out()
to return traversal from other graph/cluster.
2. Writing a custom traversal strategy and manipulate steps to change the cluster that they query when required.
Will any of above approach work? cc: @spmallette @Dave Bechbergerspmallette•90d ago
i dont think either of those will work. when you work with Neptune (or any remote graph), the traversal is sent to the server for execution. Steps like
out()
and any strategies are executed there, not locally. You're code will have no effect in that context.
i suppose you could take an extreme approach to extending DefaultGraphTraversal
to make it do some special things with various Cluster
connectivity but i don't see how you would do it with any simple code changes that fit into the model of how TinkerPop currently works. it would be a lot of work that would require significant knowledge of the code base i think.RN•90d ago
Got it, so currently what can be the way forward on this? One approach is the Subgraph as you have mentioned earlier, any other approach apart from this that comes to your mind?
spmallette•90d ago
I can't really think of anything besides that one given the way TinkerPop currently works. For this to really work, TinkerPop needs some features defined for federated query which is what Dave was experimenting with.
Dave•90d ago
I think you would need to write a custom procedure, which is the path I experimented with, in order to do this.
spmallette•89d ago
could that really help though without Neptune (or any remote graph) implementing the functionality of that
call()
step?Dave•89d ago
Yeah if you are using a provider like that then neither a strategy or the
call()
step approach would work. I think the only way to do it is what you pointed to about mergeing into a TinkergraphApache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1.3KMembers
View on DiscordWant results from more Discord servers?
More PostsSideEffect a variable, Use it later after BarrierStep?I seek a query that builds a list and then needs to both sum the list's mapped values and divide theMemory issue on repeatI am traversing all nodes occuring in the same cluster given one of the nodes in that cluster.
SurpWhich database should i use for my DJ set planning software?Hi, i want to develop a software that lets DJs plan a set (i.e. playlist) and i'm wondering if graphHow will i add unique values to the vertices or edge properties in NeptuneI can't get a doc regarding adding unique data through gremlin. Is there any way to do it, other thaNot getting result in hasId() but id().is() worksI don't get any response using g.V().hasId(48). But when i use g.V().id().is(48). it shows output. Sdotnet `Enumeration has not started. Call MoveNext` if I try to enumerate over a resultI recently try to use gremlin to created a graph and query this graph. Currently I get it working toI can't create an edge in aws neptune using gremlin. I can create vertices. but not edge.import { driver, process as gremlinProcess, structure } from "gremlin";
async function checkOut() {Iterating over responsesI've got a query akin to this in a python application using `gremlin-python`:
```
t = traversal().wAWS Neptune updating gremlin driver to 3.6.2 introduced many bugs to working queriesAfter updating Amazon Neptune engine version from 1.2.0.2 to 1.2.1.0 and the Gremlin.Net (C# nuget) vertex-label-with-given-name-does-not-existERROR with Janusgraph 0.5.3vertex-label-with-given-name-does-not-exist
ERROR with Janusgraph 0.5.3 while adding labels to vertiDocumentation states there should be a mid-traversal .E() step?Just wondering if I'm missing something, or if the docs are mistaken. It's possible to do a mid-travDisabling strategies via string in remote driverIs there a way to disable a strategy in a providers implementation without a reference to the class?LazyBarrierStrategy/NoOpBarrierStep incompatible with path-tracking👋🏻 Hi all!
In this JanusGraph post (https://discord.com/channels/981533699378135051/1195313165278Is there a way to store the tinkerpop graph in DynamoDB?AWS provides Neptue graph database but problem with it is that it is not distributed and can't be hoConnection to Azure cosmos db using GoHi All, Asking this as a newbie to Graphs databases in general.
I have been trying to connect to an I met a man with seven wives, each of which had seven sacks.I met a man with seven wives, each of which had seven sacks. Now, suppose I have shipping container May I suggest a new topic-channel for us? Like "really-big-data" or "pagination"?Related to https://discord.com/channels/838910279550238720/1100527694342520963/1100853192922759244 aIntegration tests for AWS Neptune DBdo we have any Testcontainers for AWS Neptune for writing integration tests in java applicationsG.V() IDE can't visualize path().by(valueMap()) queryHi @G.V() - Gremlin IDE (Arthur) sorry if this is a duplicate question. I am playing around with G.VBeginner Gremlin QuestionsHello - I am trying to do an Advent of Code challenge as a graph problem to learn some Gremlin, and