Skip to content

Learning Dependencies

okram edited this page Jan 14, 2011 · 19 revisions

Gremlin is part of a larger eco-system of technologies. The primary technologies to understand when using Gremlin are itemized below.

  • Groovy: The host language for Gremlin.
  • Blueprints: The library to interact with the underlying graph databases.
  • Pipes: The library to lazily traverse a graph.

Groovy

Groovy is a dynamic language that serves as a superset of Java. It provide metaprogramming facilities through the Java Reflection API and as such, easily supports the creation of domain specific languages.

Gremlin is a particular DSL that manipulates the MetaClass of various objects. Beyond that, Gremlin is full Groovy. All constructs such as variable setting, looping, branching, closures, currying, etc. are all provided to Gremlin through the Groovy language. Finally, Groovy works seamlessly with Java and vice versa. The benefit of this is that Gremlin developers are able to easily use the Java API in the algorithms.

Here is a collection of introductory texts on Groovy that may be helpful:

Blueprints

Blueprints can be considered the JDBC of the graph database community. It provides a set of interfaces that when implemented, yield a Blueprints-enabled graph database. The TinkerPop graph stack is all predicated on Blueprints and the database that support Blueprints.

Given that Gremlin is based on Groovy, its possible to make use of the Blueprints API from within Gremlin/Groovy. In this way, all the utilities provided in Blueprints are easily accessible. In essence, Gremlin is a shorthand notation for many of the access patterns used when dealing with Blueprints.

Pipes

Pipes is a data flow framework written in Java with extensions to support data flow processing of Blueprints-enabled graph databases. Pipes boasts a lazy evaluation model that yields memory efficient graph traversal algorithms. When coding in Pipes, in Java, code can be very verbose. Gremlin simplifies this process by compiling its shorthand notation down to Pipes. In essence, Gremlin is a Pipes compiler with Groovy as a handy host language for adding extra computational components.