Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow reading from uniquely named traversals #2

Open
cmbaatz opened this issue Feb 16, 2021 · 10 comments
Open

Allow reading from uniquely named traversals #2

cmbaatz opened this issue Feb 16, 2021 · 10 comments

Comments

@cmbaatz
Copy link

cmbaatz commented Feb 16, 2021

Currently the engine only reads from a traversal bound to the variable "g". The ConfiguredGraphFactory in the janusgraph remote gremlin server will bind graph traversals to _traversal. At a minimum effort it would be great if the engine used one more environment variable to represent the graph traversal name. This should be a three line change and is relatively small cost. Ideally it would be nice if the engine would allow me to specify the graph/bound traversal I would like to work with at connection.

@IvanGDR
Copy link

IvanGDR commented Mar 7, 2021

Hi, did you manage to make it works using ConfiguredGraphManagement? if so can you share what you did please? I am having the following error: graphql.error.located_error.GraphQLLocatedError: 499: The traversal source [g] for alias [g] is not configured on the server.

@rrmerugu
Copy link
Member

rrmerugu commented Mar 8, 2021

@cmbaatz thanks pointing out. Do you think the below customisation should work? for this use case

from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from gremlin_python.structure.graph import Graph

traversal_name ="g" # <-- this should be customisable
g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin',traversal_name))

@IvanGDR should this work for your usecase too ?

@IvanGDR
Copy link

IvanGDR commented Mar 8, 2021 via email

@rrmerugu
Copy link
Member

rrmerugu commented Mar 8, 2021

Hi @IvanGDR ,

I made a patch for this, you can customise traversal source name in this patch. Can you give this a try, if this works fine. I will push this change to a release.

Here is the usage notes.

pip install git+https://github.com/invanalabs/invana-engine.git@refs/pull/5/head
export GREMLIN_TRAVERSAL_SOURCE=my_graph_traversal
export GREMLIN_SERVER_URL=ws://ip-address:8182/gremlin

invana-engine-start # this will start invana-engine server.

@cmbaatz
Copy link
Author

cmbaatz commented Mar 8, 2021

@rrmerugu
Thanks for the patch.

@rrmerugu
Copy link
Member

rrmerugu commented Mar 8, 2021

Hi @cmbaatz, did you try this code for your usecase ? I will release this patch, if this works fine for the use case discussed above.

@IvanGDR
Copy link

IvanGDR commented Mar 8, 2021 via email

@rrmerugu
Copy link
Member

@IvanGDR are you able make it work with the new patch ?

@IvanGDR
Copy link

IvanGDR commented Mar 16, 2021 via email

@IvanGDR
Copy link

IvanGDR commented Mar 16, 2021 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants