Skip to content

The Benefits of Gremlin

okram edited this page Sep 13, 2010 · 34 revisions

Before diving into the specifics of Gremlin, its good to know what you are getting yourself into. Moreover, its important to know if Gremlin can be of use to you. Below is a list of a few key reasons to use Gremlin.

  • Gremlin is useful for manually working with your graph: You can use the Gremlin console like a file system prompt (see Getting Started). You can navigate the graph, update a vertex’s properties, add an edge, remove a vertex, etc. This is handy for graph maintenance and ensuring the integrity of your data. There is nothing worse that realizing that its not your code, but your data that is bugged.
  • Gremlin allows you to query a graph: You will notice that many types of queries can be expressed in Gremlin in a much more succinct and understandable manner. If you are building an application that requires a graph query, then it might be best to use the Gremlin evaluator in your application to perform such queries for you.
  • Gremlin can express complex graph traversals succinctly: Similar to what was stated previously, Gremlin can express in a few lines of code what it would take many, many lines of code in Java to express (see User Defined Paths). Moreover, Gremlin’s language was designed to represent complex graph traversals. Even today’s graph databases and packages lack what can be elegantly expressed in Gremlin.
  • Gremlin is useful for exploring and learning about graphs: There are many add-ons/connectors for Gremlin that make it a unique environment for playing with graphs. Gremlin comes with a connector to the JUNG algorithms package (see Working with JUNG Algorithms), to the SPARQL query language (see Sesame SAIL Quad Store), etc.
  • Gremlin allows you to explore the Semantic Web/Web of Data: Gremlin can be used with RDF graphs. Moreover, Gremlin has a connector to LinkedData SAIL which allows you to work with the Semantic Web/Web of Data in real-time.
  • Gremlin is useful to ensure that you are not tied to a particular graph backend: Gremlin can be used over various graph databases. Thus, you can make use of your same Gremlin code regardless of changing you graph database (see Blueprints]
  • Gremlin is extensible and can be oriented to your particular use case: It is possible to extend Gremlin with new functions and paths defined natively in Gremlin or in Java. Moreover, its possible to add other graph backends by implementing the graph interfaces provided by Blueprints.

1 This is not completely true. There are a few tweaks here and there you may have to do to make sure your same Gremlin code will work identically over different backends. For example, each graph database has its own unique open() function to create a connection to the graph.