The following examples of Gremlin queries and responses in a Gremlin-Groovy environment are relative to a graph representation of the MovieLens dataset.
Emit the first 10 maps (i.e. top 10).Gremlin supports declarative graph pattern matching similar to SPARQL.
Due to this simple requirement, there exists various Gremlin dialects including Gremlin-Groovy, Gremlin-Scala, Gremlin-Clojure, etc.
These steps are sufficient to provide general purpose computing and what is typically required to express the common motifs of any graph traversal query.
Given that Gremlin is a language, an instruction set, and a virtual machine, it is possible to design another traversal language that compiles to the Gremlin traversal machine (analogous to how Scala compiles to the JVM).
For instance, the popular SPARQL graph pattern match language can be compiled to execute on the Gremlin machine.