Skip to content

cruftlab/gremlin-console-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Gremlin Console

This Docker image contains the Gremlin Console (running on Java 8). It also allows configuration via the /conf directory, and has another volume mounted, where you can export and import data.

Run the console

To run the console, and mount the configuration and data directories (~/temp/gremlin-conf/ and ~/temp/gremlin-data, respectively), run the following command:

docker run -v ~/temp/gremlin-data:/opt/gremlin/data -v ~/temp/gremlin-conf:/opt/gremlin/conf/extra  --rm -it cruftlab/gremlin-console

Configuration volume

You can mount configurations in the /opt/gremlin/data/extra volume. Here are a few examples of what you can do:

Data volume

You can use the data volume to export and import data to your database. In the following examples ~/temp/gremlin-data is mounted to /opt/gremlin/data.

Read the docs for more information on how to use this volume, or read the examples below.

Export graph

To export the "Modern" graph as GraphSON, run the following command in the console:

graph = TinkerFactory.createModern()
graph.io(graphson()).writeGraph("data/tinkerpop-modern.json")

The "Modern" graph will now be available in GraphSON format in ~/temp/gremlin-data/tinkerpop-modern.json

Import graph

To import a graph from a GraphSON file, stored under ~/temp/gremlin-data/my-graph.json, run the following command in the console:

graph = TinkerGraph.open();
graph.io(graphson()).readGraph("data/my-graph.json");