graph icon indicating copy to clipboard operation
graph copied to clipboard

Where to store and how to load sample data on remote gremlin server

Open andrew-aernos opened this issue 5 years ago • 2 comments

I've followed the steps Chapter 7. INTRODUCING GREMLIN SERVER on setting up the gremlin console on a remote server and connected to it with

gremlin> :remote connect tinkerpop.server conf/remote.yaml session
==>Configured localhost/127.0.0.1:8182-[49767b47-89d7-4984-9a37-6eeb6d551be7]
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182]-[49767b47-89d7-4984-9a37-6eeb6d551be7] - type ':remote console' to return to local mode

tried this resulted in file not found. How might I download the script to remote?

gremlin> :load load-air-routes-graph.groovy

tried this resulted in No such property: ToInputStream

gremlin> graph.io(IoCore.graphml()).reader().create().readGraph(ToInputStream.from("url", "https://github.com/krlawrence/graph/raw/master/sample-data/air-routes.graphml"), graph);

My current hurdle is I'm trying to figure out how to 1) download the data with the Gremlin console on remote, 2) retrieve it and load it into the graph.

Thanks for this great work @krlawrence

andrew-aernos avatar Dec 13 '19 19:12 andrew-aernos

If you are just using a Gremlin Server you can have the data loaded from the server side scripts as in the example in section 7.6.

krlawrence avatar Dec 13 '19 19:12 krlawrence

There is also this comment in the official TinkerPop documentation that points out that the file must be accessible on the server:

Remote Gremlin Console users or Gremlin Language Variant (GLV) users (e.g. gremlin-python) who utilize the io()-step should recall that their read() or write() operation will occur on the server and not locally and therefore the file specified for import/export must be something accessible by the server.

I should probably add some text to the book that points this out. I also need to add coverage of the new g.io() way of loading data. That is captured in issue #115

krlawrence avatar Dec 13 '19 20:12 krlawrence