Starting the Gremlin console

Starting the Gremlin console for an interactive environment.

Gremlin is the query language used to interact with DSE Graph. One method of
inputting Gremlin code is to use the Gremlin console. The Gremlin console is a
useful interactive environment for directly inputting Gremlin to create graph
schema, load data, administer graph, and retrieve traversal results. The Gremlin
Console is an interface to the Gremlin Server that can interact with DSE Graph.

Procedure

Start the Gremlin console using the dse command and passing
the additional command gremlin-console:

Three plugins are activated by default, as shown. The Gremlin Server,
tinkerpop.server, is started so that commands can be
issued to DSE Graph. The utilities plugin,
tinkerpop.utilities, provides various functions, helper
methods and imports of external classes that are useful in Gremlin console.
TinkerGraph, an in-memory graph that is used as an intermediary for some
graph operations is started with tinkerpop.tinkergraph. The
Gremlin console automatically connects to the remote Gremlin
Server.

Note: The Gremlin console packaged with DataStax Enterprise does
not allow plugin installation like the Gremlin console packaged with
Apache TinkerPop.

Tip: Use -V to display all lines when loading a
file, to discover which line of code causes an error.

Run the Gremlin console with the host:port option to specify a
specific host and port:

bin/dse gremlin-console 127.0.0.1:8182

Any hostname or IP
address will work to specify the host.

Run Gremlin console with the -e flag to execute one or more
scripts:

$ bin/dse gremlin-console -e test1.groovy -e test2.groovy

If the scripts run successfully, the command will return with the prompt
after execution. If errors occur, the standard output will show the
errors.

If you prefer to have Gremlin console open at the script completion, run
Gremlin console with the -i flag instead of the
-e flag:

$ bin/dse gremlin-console -i test1.groovy -i test2.groovy

If the scripts run successfully, the command will return with the
Gremlin console prompt after execution. If errors occur, the console will show
the errors.

Discover all Gremlin console commands with help. Console commands are not
Gremlin language commands, but rather commands issued to the Gremlin console for
shell functionality. The Gremlin console is based on the Groovy shell.

DataStax is a registered trademark of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Cassandra are trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.