Skip to content


Subversion checkout URL

You can clone with
Download ZIP


drachimera edited this page · 324 revisions

Gremlin is a graph traversal language. The documentation herein will provide all the information necessary to understand how to use Gremlin for graph query, analysis, and manipulation. Gremlin works over those graph databases/frameworks that implement the Blueprints property graph data model. For example: TinkerGraph, Neo4j, OrientDB, DEX, Rexster, and Sail RDF Stores. 1

Please join the Gremlin users group at for all TinkerPop related discussions. Finally, if you are a Gremlin user, please add to the Gremlin in the Wild wiki page with your specific Gremlin uses cases.

g = new Neo4jGraph('/tmp/neo4j')

// calculate basic collaborative filtering for vertex 1
m = [:]
m.sort{a,b -> a.value <=> b.value}

// calculate the primary eigenvector (eigenvector centrality) of a graph
m = [:]; c = 0;
g.V.out.groupCount(m).loop(2){c++ < 1000}
m.sort{a,b -> a.value <=> b.value}

The Graph Traversal Programming Pattern (Presentation introducing graph traversal)
Gremlin Tutorial 1 (Screencast of Gremlin 0.7)
Gremlin Tutorial 2 (Presentation of Gremlin 1.1)

Gremlin Cookbook (User Contributed Recipes)

1 Gremlin documentation is up to date with the current Gremlin codebase, not with the latest Gremlin release.

Note: to get a local copy of this Gremlin wiki, instructions are available.

Something went wrong with that request. Please try again.