Gremlin is the graph traversal language that is used to interact with JanusGraph. Gremlin is being used by many graph databases these days. One method of putting Gremlin code in JanusGraph is to use Gremlin Console that is being provided by the JanusGraph which comes with JanusGraph plugin. The Gremlin console is a very useful interactive environment for directly writing Gremlin query to create graph schema, load data, administer graph, and retrieval traversal results.
Procedure
- Clone
JanusGraphfrom its GitHub repository JanusGraph GitHub Repo - Run
mvn clean install -DskipTests=truecommand on your console. You need to be inside Janusgraph folder to run this command.-DskipTest=truewould skip all the test from the build. If you want to run all tests, you can run it but it would take around 5 hours. It will take around 25 minutes to build even with-DskipTest=true. - Once step two completed successfully, navigate to bin folder.
binfolder only gets created when the step 2 gets completed successfully. - Run the
./gremlin.shcommand on your console. If your are not inside the bin folder. You can runbin/gremlin.shcommand from your console. - The console output looks like follows
Six plugins are activated by default, as shown. The Gremlin Server, tinker pop.server, is started so that commands can be issued to JanusGraph. The utilities plugin, tunkerpop.utilities provides various functions, helper methods and imports of external classes that are useful in Gremlin console.
Discover all Gremlin console commands with help. Console commands are not Gremlin language commands, but rather commands issue to Gremlin console for shell functionality. The Gremlin console is based on Groovy Language.
Copyright of gremlin image is © apache.org