invana-engine icon indicating copy to clipboard operation
invana-engine copied to clipboard

Allow reading from uniquely named traversals

Open cmbaatz opened this issue 4 years ago • 10 comments

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.

cmbaatz avatar Feb 16 '21 19:02 cmbaatz

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.

IvanGDR avatar Mar 07 '21 15:03 IvanGDR

@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 ?

rrmerugu avatar Mar 08 '21 05:03 rrmerugu

Hi Ravi,This complete makes sense, having the option to customise it. Great. ThanksIvan-------- Original message --------From: Ravi Raja Merugu [email protected]Date: Mon, 8 Mar 2021, 05:09To: invanalabs/invana-engine [email protected]Cc: IvanGDR [email protected], Mention [email protected]Subject: Re: [invanalabs/invana-engine] Allow reading from uniquely named traversals (#2) @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 ?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

IvanGDR avatar Mar 08 '21 08:03 IvanGDR

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.

rrmerugu avatar Mar 08 '21 08:03 rrmerugu

@rrmerugu Thanks for the patch.

cmbaatz avatar Mar 08 '21 12:03 cmbaatz

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.

rrmerugu avatar Mar 08 '21 12:03 rrmerugu

Ravi, will try this tonight, at work now!!! Looks promising!!!!

Chadwick .- lets us know if it worked for you!!!!!

Ivan

On Mon, 8 Mar 2021 at 12:05, Ravi Raja Merugu [email protected] wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/invanalabs/invana-engine/issues/2#issuecomment-792711528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCDBOMW4SAUFD5A7G375M3TCS4RFANCNFSM4XXBLWAQ .

IvanGDR avatar Mar 08 '21 12:03 IvanGDR

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

rrmerugu avatar Mar 16 '21 04:03 rrmerugu

Hi Ravi,

I have tried it several times and did not manage to get this up and running unfortunately.

I double checked I can connect remotely to the janusgraph/gremlin server from my anaconda environment. Connection can be established.

One question, from invana studio I should always use:

http://IP:PORT/graphql

My doubt is about the “graphql” wording, I should use always that or the name of my graph?

I will keep trying

Regards,

Ivan

On 16 Mar 2021, at 4:59 am, Ravi Raja Merugu @.***> wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

IvanGDR avatar Mar 16 '21 10:03 IvanGDR

By any chance Chadwick back to you and confirmed it works for him?

Cheers

Ivan

On 16 Mar 2021, at 4:59 am, Ravi Raja Merugu @.***> wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

IvanGDR avatar Mar 16 '21 10:03 IvanGDR