Skip to content
/ mogwai Public

Write custom, user-defined Gremlin steps in Jython or any JVM language.

Notifications You must be signed in to change notification settings

espeed/mogwai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mogwai is a library that helps you write custom, user-defined Gremlin steps in 
Jython or any JVM language.  

A Jython example is provided. 

To try the example, download the latest Jython 
(http://www.jython.org/downloads.html) and copy it to 

$ cp jython2.5.2/jython.jar gremlin/target/gremlin-*-standalone/lib/jython.jar

You need modify your environment so that you can run Gremlin scripts from any 
directory. 


Add these lines to your .bash_profile: 

export CLASSPATH=$CLASSPATH:/home/james/projects/mogwai;
export JYTHONPATH=$JYTHONPATH:/home/james/projects/mogwai;

alias jython="/home/james/jython2.5.2/bin/jython"
alias gremlin="/home/james/gremlin/gremlin.sh"

$ source .bash_profile


And you need updated gremlin.sh scripts that will enable you to run gremlin.sh 
from any directory while not overriding your CLASSPATH.

Copy the updated scripts to your Gremlin directory:

$ cp mogwai/scripts/gremlin.sh /home/james/gremlin/gremlin.sh
$ cp mogwai/scripts/gremlin.sh.2 /home/james/gremlin/target/gremlin-*-standalone/bin/gremlin.sh


Compile the Java factory and interface:

$ javac mogwai/factories/JythonFactory.java
$ javac mogwai/interfaces/GizmoType.java


Once that's done, run the example Groovy script:

$ gremlin -e mogwai/examples/gizmo.groovy 
Gizmo

Gremlin steps...
Gizmo
25
marko


If you see the marko, then success -- it works.

- James Thornton, http://jamesthornton.com



About

Write custom, user-defined Gremlin steps in Jython or any JVM language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published