Gremlin support in NodeJS

154 views
Skip to first unread message

Brijesh Gopal

unread,
May 7, 2017, 10:03:12 PM5/7/17
to Gremlin-users
Hi All,

I am new to Gremlin and hence please pardon my ignorance.

We are evaluating our options for a new project which uses Orient for Graph. Any recommendations on a Node project that works with Gremlin?
I could not find many options in my search.

Thanks,
Brijesh

Jean-Baptiste Musso

unread,
May 8, 2017, 5:06:40 AM5/8/17
to gremli...@googlegroups.com
Welcome to Gremlin and JavaScript Brijesh,

If you're looking for a generic TinkerPop 3 Gremlin Server client written in Node.js, you can use https://www.npmjs.com/package/gremlin. It's meant to work with any TinkerPop3 implementation via Gremlin Server and it should work out of the box with OrientDB TP3 implementation (see: https://github.com/orientechnologies/orientdb-gremlin)
 
OrientDB has an official Node.js driver (https://github.com/orientechnologies/orientjs) but it doesn't seem to support sending Gremlin queries yet. See this open issue: https://github.com/orientechnologies/orientjs/issues/11.

Using either solutions, you'll most likely find useful to use https://github.com/jbmusso/gremlin-template-string which helps you generate Gremlin query objects (script + bound params) using ES6 template strings. Not mandatory, but useful if your JavaScript runtime support them, and/or if you're using a JS-to-JS transpiler such as Babel.

Jean-Baptiste

--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/f32f1650-1896-4a79-8926-43ea5e1d30c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zoltan

unread,
Jun 21, 2018, 12:32:36 PM6/21/18
to Gremlin-users
Hi Jean-Baptiste,

I can't get the current javascript driver (https://www.npmjs.com/package/gremlin) to work with the OrientDB TP3 implementation. I've already inserted a few vertices and edges into the "testdb" using the preconfigured gremlin console that came with OrientDB. Could you please help me out a bit, what am I doing wrong?

const gremlin = require("gremlin");
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection

const graph = new gremlin.structure.Graph()
const g = graph.traversal().withRemote(new DriverRemoteConnection('ws://localhost:8182/testdb'));

g.V().toList().then(function(data) {
   console.log(data)
}).catch(function(err) {
   console.log(err)
})


Thanks,
Zoltan


2017. május 8., hétfő 11:06:40 UTC+2 időpontban Jean-Baptiste Musso a következőt írta:
Welcome to Gremlin and JavaScript Brijesh,

If you're looking for a generic TinkerPop 3 Gremlin Server client written in Node.js, you can use https://www.npmjs.com/package/gremlin. It's meant to work with any TinkerPop3 implementation via Gremlin Server and it should work out of the box with OrientDB TP3 implementation (see: https://github.com/orientechnologies/orientdb-gremlin)
 
OrientDB has an official Node.js driver (https://github.com/orientechnologies/orientjs) but it doesn't seem to support sending Gremlin queries yet. See this open issue: https://github.com/orientechnologies/orientjs/issues/11.

Using either solutions, you'll most likely find useful to use https://github.com/jbmusso/gremlin-template-string which helps you generate Gremlin query objects (script + bound params) using ES6 template strings. Not mandatory, but useful if your JavaScript runtime support them, and/or if you're using a JS-to-JS transpiler such as Babel.

Jean-Baptiste

On Mon, May 8, 2017 at 3:17 AM, Brijesh Gopal <brij...@gmail.com> wrote:
Hi All,

I am new to Gremlin and hence please pardon my ignorance.

We are evaluating our options for a new project which uses Orient for Graph. Any recommendations on a Node project that works with Gremlin?
I could not find many options in my search.

Thanks,
Brijesh

--
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.
Reply all
Reply to author
Forward
0 new messages