Giter VIP home page Giter VIP logo

Comments (5)

michaelnchin avatar michaelnchin commented on June 3, 2024

Hi @adhalanay, thank you for submitting an issue!

%% gremlin graph = TinkerFactory.createModern() g = traversal().withEmbedded(graph)

Some initial clarification - the TinkerPop tutorial examples referenced are in Gremlin Groovy (Java-based) syntax. Groovy is just one of many Gremlin Language Variants available for use with TinkerPop. Graph-notebook is Python based, and therefore instead utilizes the Gremlin Python GLV, which may not work with certain Groovy commands/syntax.

When using the %%gremlin magic, it's not necessary to manually generate a traversal source, as this is handled under the covers by the Gremlin Python Client responsible for creating the websocket connection to Gremlin Server, as seen here. The traversal source is set to g by default, but if desired, you can change this via the gremlin -> traversal_source field in %%graph_notebook_config. Once you're happy with this configuration, you can start submitting queries directly via %%gremlin, or batch loading data using %seed.

I would recommend checking out our tutorial for setting up graph-notebook with Gremlin Server, which has additional instructions and considerations for initial setup: https://github.com/aws/graph-notebook/tree/main/additional-databases/gremlin-server.

from graph-notebook.

adhalanay avatar adhalanay commented on June 3, 2024

@michaelnchin Thank you for you reply. So if I understand correctly after instantiating a graph g is the corresponding traversal. But when I try a query like g.V() I get an empty reply instead of the six vertices.

As a side note a similar query works very good with JanusGraph.

from graph-notebook.

michaelnchin avatar michaelnchin commented on June 3, 2024

The new graph you're instantiating via the graph = TinkerFactory.createModern() command exists in memory, but is not assigned to or accessible via the traversal source g, due to the second command g = traversal().withEmbedded(graph) failing to run.

Since it hasn't been re-assigned to a different graph, g instead remains as the default traversal source for the empty default graph created by Gremlin Server - this empty graph is where your queries are currently being routed to.

TBH, the %%gremlin magic is only intended for running straight Gremlin queries. Other TinkerPop actions would be better executed via external means, like Gremlin Console, or even writing Gremlin Python code in the same Jupyter instance where you're using graph-notebook.

from graph-notebook.

adhalanay avatar adhalanay commented on June 3, 2024

So if I understand correctly one should use Gremlin Python instead of Gremlin Groovy. I think it is safe to close the bug now.

from graph-notebook.

michaelnchin avatar michaelnchin commented on June 3, 2024

Thanks @adhalanay - please feel free to re-open if you have additional questions 👍

from graph-notebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.