REST vs WebSockets and tool choice confusion

661 views
Skip to first unread message

Avery Regier

unread,
Dec 17, 2017, 5:57:45 PM12/17/17
to Gremlin-users
So there's multiple protocols out there for connecting to Gremlin servers, but it seems only one can be used with a given Gremlin server.

REST and Websockets are both available, but you can seemingly use only one at a time for a given server. 
AWS Neptune only supports REST, and does not support variables or multiple statements.
The javascript-console supports only WebSockets.  However, there is an 'AJAX' plugin that sends stuff over HTTP.  It is unclear if this supports REST.
There is another JavaScript based visualization tool, that does support REST but needs variables and maybe multiple statements too.
There is mention of using a proxy of some kind server-side to translate from WebSockets to REST, but I can't find any such project.

Don't get me started on the various serializers for which there is little documentation on how to actually connect a client to them, and all the NullPointers that occur when you get anything wrong.  
Oops, I got started..

So...  What kind of toolchain is actually supported to be able to consistently visualize a graph against Neptune, Tinkerpop reference implementation, Titan, etc?

I'd be happy just to get a way to visualize Neptune.  What's the simplest path forward?  Is there a missing project out there?

Thanks,
Avery



Stephen Mallette

unread,
Dec 18, 2017, 7:22:32 AM12/18/17
to Gremlin-users
REST and Websockets are both available, but you can seemingly use only one at a time for a given server. 

You can use them together with the WsAndHttpChannelizer configuration:


AWS Neptune only supports REST

I haven't worked with Neptune, but I don't think that's true. Their documentation shows how to connect with the drivers:


That's the TinkerPop java driver, but if that works I don't see why other language drivers would fail to work.

various serializers for which there is little documentation on how to actually connect a client to them

Typically, you don't need to mess with the serializations too much. Basically, if you don't mix/match TinkerPop versions there shouldn't usually be a problem. The other general rule of thumb is that if you have your client configured with a particular serializer, you have to make sure the server has the same one configured.

What kind of toolchain is actually supported to be able to consistently visualize a graph against Neptune, Tinkerpop reference implementation, Titan, etc?

Graph visualization is a toolset unto itself and as you've found, TinkerPop doesn't focus on that aspect of working with graphs. I think that your options include:

1. Use the Gephi plugin: http://tinkerpop.apache.org/docs/current/reference/#gephi-plugin  - For Neptune, which you connect in the console via :remote,  that would mean having to return a subgraph to the console and then sending that to Gephi.
2. Extract subgraphs from Neptune and then save them as GraphML to be imported into the various tools out there that support that format like Gephi, Cytoscape, etc.
3. I don't know the JS libraries/tools you are referring to, but there are many more low level libraries that allow for development of graph visualization applications - you could certainly use the TinkerPop drivers to connect to Neptune and use results to generate a graph.

 

--
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/fbb7efd6-e9a2-457b-90af-8cc37b1f87da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Dale

unread,
Dec 18, 2017, 7:49:56 AM12/18/17
to gremli...@googlegroups.com

Here's a small list of viz tools that should work with Gremlin Server.
https://cambridge-intelligence.com/keylines/ (Follow the JanusGraph instructions)
https://linkurio.us/ (Follow the JanusGraph instructions)



Robert Dale

Avery Regier

unread,
Dec 18, 2017, 11:00:10 AM12/18/17
to Gremlin-users
https://github.com/bricaud/graphexp needs variables which Neptune does not support.

Robert Dale

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

--
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.

Avery Regier

unread,
Dec 18, 2017, 4:08:22 PM12/18/17
to Gremlin-users
To make sure, I tested out Neptune with websockets directly using wscat.  It won't even connect.

-Avery
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Stephen Mallette

unread,
Dec 18, 2017, 4:17:22 PM12/18/17
to Gremlin-users
I don't think you can expect that to work. Gremlin Server (and thus Neptune) expose a sub-protocol within the websocket protocol and if that's not supported I don't think other tools that just use websockets will work. Let me ask this....does the Gremlin Console connect to Neptune? if so, the websocket connection is available, because the console uses the TinkerPop java driver which in turn uses websockets and the subprotocol.

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/6c83f6f3-86c1-48ab-9618-451babe4307c%40googlegroups.com.

Robert Dale

unread,
Dec 18, 2017, 5:10:01 PM12/18/17
to gremli...@googlegroups.com
Sounds like you have basic connectivity issues that only Amazon can solve.


Robert Dale

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/6c83f6f3-86c1-48ab-9618-451babe4307c%40googlegroups.com.

Avery Regier

unread,
Dec 19, 2017, 10:54:00 AM12/19/17
to Gremlin-users
Correct. I guess what I'm needing is that the javascript gremlin driver code give an option to use REST as the transport.  

Stephen Mallette

unread,
Dec 19, 2017, 1:39:47 PM12/19/17
to Gremlin-users
None of the drivers support REST. REST is just REST. Use any standard REST client API for that, though you will only be allowed to submit scripts that way - no GLV usage and thus no Gremlin native to the language you want to use.

--
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.

josh....@pearson.com

unread,
Jan 12, 2018, 6:04:11 PM1/12/18
to Gremlin-users
I ran into some problems trying to use https://github.com/bricaud/graphexp to visualize data in Neptune. The problems were related to the scripts graphexp uses and the configuration of the gremlin server in the Neptune database. The Neptune gremlin server does not allow multiple commands in a single script. I couldn't figure out if I could change the settings in the Neptune gremlin server, so I've forked and updated the graphexp project so that it will request data via single commands with a configuration change.

My fork is here: https://github.com/jwalton922/graphexp. I've submitted a pull request a few minutes ago as well, but I don't know if that will get merged or not.

Here's a sample of what the configuration file should look like for the graphexp visualization to work with Neptune: https://github.com/jwalton922/graphexp/blob/defaultNeptuneConf/scripts/graphConf.js

Note the following changes that are different than the default : 
const SINGLE_COMMANDS_AND_NO_VARS = true;
const COMMUNICATION_METHOD = "GraphSON3"


On Tuesday, December 19, 2017 at 11:39:47 AM UTC-7, Stephen Mallette wrote:
None of the drivers support REST. REST is just REST. Use any standard REST client API for that, though you will only be allowed to submit scripts that way - no GLV usage and thus no Gremlin native to the language you want to use.
On Tue, Dec 19, 2017 at 10:53 AM, Avery Regier <avery....@gmail.com> wrote:
Correct. I guess what I'm needing is that the javascript gremlin driver code give an option to use REST as the transport.  

On Monday, December 18, 2017 at 3:17:22 PM UTC-6, Stephen Mallette wrote:
I don't think you can expect that to work. Gremlin Server (and thus Neptune) expose a sub-protocol within the websocket protocol and if that's not supported I don't think other tools that just use websockets will work. Let me ask this....does the Gremlin Console connect to Neptune? if so, the websocket connection is available, because the console uses the TinkerPop java driver which in turn uses websockets and the subprotocol.

On Mon, Dec 18, 2017 at 4:08 PM, Avery Regier <avery....@gmail.com> wrote:
To make sure, I tested out Neptune with websockets directly using wscat.  It won't even connect.

-Avery

On Monday, December 18, 2017 at 6:22:32 AM UTC-6, Stephen Mallette wrote:
REST and Websockets are both available, but you can seemingly use only one at a time for a given server. 

You can use them together with the WsAndHttpChannelizer configuration:


AWS Neptune only supports REST

I haven't worked with Neptune, but I don't think that's true. Their documentation shows how to connect with the drivers:


That's the TinkerPop java driver, but if that works I don't see why other language drivers would fail to work.

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