Porting TinkerPop3 to JavaScript: Gremlin graph traversals in Node.js and the browser

865 views
Skip to first unread message

Jean-Baptiste Musso

unread,
Nov 11, 2014, 12:11:56 PM11/11/14
to gremli...@googlegroups.com
Hi TinkerPop,

I started porting gremlin-core and tinkergraph-gremlin from Java to JavaScript:
These two libraries are basically 1:1 ports of the Java codebase to JavaScript. They allow you to create/manipulate an in-memory graph database as well as execute traversals directly in Node.js/browser environments, without the need to set up a remote graph database.

This is great for playing around and experiment with graph databases in a lightweight environment (basically, most browsers). For example, GremlinDocs.com could ultimately offer a simple console and allow newcomers to try in-memory graph traversals without the need to setup a remote server.

gremlin-core-js also allows you to manipulate third-party graph libraries with the Gremlin API you’re already familiar with, providing a working adapter for that library exists. I’ve started developing such an adapter for the Sigma.js graph visualization library: https://github.com/gulthor/gremlin-sigma.

All of this could also be coupled with D3.js. Developing an extra adapter should be fairly trivial for most of the work is done in gremlin-core-js.

For now, TinkerGraph code is pretty much fully ported to JavaScript. gremlin-core-js needs a lot more work : most basic steps are working and chain able (V, out, outV, outE, in, inV, inE, both, bothV, bothE, next, forEach), but the more advanced steps require a bit of work. Feel free to open issues, discuss or send send pull requests.

Was fun digging into the Java source code!

Cheers,

Jean-Baptiste

Stephen Mallette

unread,
Nov 11, 2014, 12:16:20 PM11/11/14
to gremli...@googlegroups.com
Thanks, JB....I think TinkerGraph in js is interesting because it would then seem possible to host it inside of Nashorn in the Gremlin Server.  I'm not sure that offers any practical application, but i find it an "interesting" idea nonetheless.

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/407c0e38-8a0c-4551-98a7-f16a24e5dbcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Frantz

unread,
Feb 12, 2015, 3:53:29 PM2/12/15
to gremli...@googlegroups.com
This is appealing for a few reasons.  I like the idea of having subgraphs become the base data type for client communication.  Also, if UI developers can start writing Gremlin, it can make for a more seamless technology stack.

Jean-Baptiste Musso

unread,
Feb 14, 2015, 9:59:00 AM2/14/15
to gremli...@googlegroups.com
Thanks Matt.

This may prove to be useful with upcoming Facebook GraphQL which was announced recently (along with Relay). Very interesting piece of engineering there:

Combined with the expressiveness of Gremlin, this should be a very powerful way to build applications based on graph databases.

Jean-Baptiste
Reply all
Reply to author
Forward
0 new messages