<s>
Gremlin	B-Language
is	O
a	O
graph	B-Algorithm
traversal	I-Algorithm
language	O
and	O
virtual	B-Architecture
machine	I-Architecture
developed	O
by	O
Apache	B-Language
TinkerPop	I-Language
of	O
the	O
Apache	O
Software	O
Foundation	O
.	O
</s>
<s>
Gremlin	B-Language
works	O
for	O
both	O
OLTP-based	O
graph	B-Application
databases	I-Application
as	O
well	O
as	O
OLAP-based	O
graph	O
processors	O
.	O
</s>
<s>
Gremlin	B-Language
's	O
automata	B-Application
and	O
functional	B-Language
language	I-Language
foundation	O
enable	O
Gremlin	B-Language
to	O
naturally	O
support	O
:	O
imperative	B-Application
and	O
declarative	B-Language
querying	O
;	O
host	O
language	O
agnosticism	O
;	O
user-defined	O
domain	B-Language
specific	I-Language
languages	I-Language
;	O
an	O
extensible	O
compiler/optimizer	O
,	O
single	O
-	O
and	O
multi-machine	O
execution	O
models	O
;	O
hybrid	O
depth	O
-	O
and	O
breadth-first	O
evaluation	O
with	O
Turing	B-Algorithm
Completeness	I-Algorithm
.	O
</s>
<s>
As	O
an	O
explanatory	O
analogy	O
,	O
Apache	B-Language
TinkerPop	I-Language
and	O
Gremlin	B-Language
are	O
to	O
graph	B-Application
databases	I-Application
what	O
the	O
JDBC	B-Language
and	O
SQL	B-Language
are	O
to	O
relational	O
databases	O
.	O
</s>
<s>
Likewise	O
,	O
the	O
Gremlin	B-Language
traversal	O
machine	O
is	O
to	O
graph	O
computing	O
as	O
what	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
is	O
to	O
general	O
purpose	O
computing	O
.	O
</s>
<s>
Gremlin	B-Language
is	O
an	O
Apache2-licensed	B-Application
graph	B-Algorithm
traversal	I-Algorithm
language	O
that	O
can	O
be	O
used	O
by	O
graph	O
system	O
vendors	O
.	O
</s>
<s>
There	O
are	O
typically	O
two	O
types	O
of	O
graph	O
system	O
vendors	O
:	O
OLTP	B-General_Concept
graph	B-Application
databases	I-Application
and	O
OLAP	B-Application
graph	O
processors	O
.	O
</s>
<s>
The	O
table	O
below	O
outlines	O
those	O
graph	O
vendors	O
that	O
support	O
Gremlin	B-Language
.	O
</s>
<s>
The	O
following	O
examples	O
of	O
Gremlin	B-Language
queries	O
and	O
responses	O
in	O
a	O
Gremlin-Groovy	O
environment	O
are	O
relative	O
to	O
a	O
graph	O
representation	O
of	O
the	O
dataset	O
.	O
</s>
<s>
Gremlin	B-Language
supports	O
declarative	B-Language
graph	O
pattern	O
matching	O
similar	O
to	O
SPARQL	B-Language
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
following	O
query	O
below	O
uses	O
Gremlin	B-Language
's	O
match( )	O
-step	O
.	O
</s>
<s>
Gremlin	B-Language
is	O
a	O
virtual	B-Architecture
machine	I-Architecture
composed	O
of	O
an	O
instruction	B-General_Concept
set	I-General_Concept
as	O
well	O
as	O
an	O
execution	O
engine	O
.	O
</s>
<s>
An	O
analogy	O
is	O
drawn	O
between	O
Gremlin	B-Language
and	O
Java	B-Language
.	O
</s>
<s>
The	O
following	O
traversal	O
is	O
a	O
Gremlin	B-Language
traversal	O
in	O
the	O
Gremlin-Java8	O
dialect	O
.	O
</s>
<s>
The	O
Gremlin	B-Language
language	O
(	O
i.e.	O
</s>
<s>
the	O
fluent-style	O
of	O
expressing	O
a	O
graph	B-Algorithm
traversal	I-Algorithm
)	O
can	O
be	O
represented	O
in	O
any	O
host	O
language	O
that	O
supports	O
function	B-Application
composition	I-Application
and	O
function	O
nesting	O
.	O
</s>
<s>
Due	O
to	O
this	O
simple	O
requirement	O
,	O
there	O
exists	O
various	O
Gremlin	B-Language
dialects	O
including	O
Gremlin-Groovy	O
,	O
Gremlin-Scala	O
,	O
Gremlin-Clojure	O
,	O
etc	O
.	O
</s>
<s>
The	O
above	O
Gremlin-Java8	O
traversal	O
is	O
ultimately	O
compiled	O
down	O
to	O
a	O
step	O
sequence	O
called	O
a	O
traversal	O
.	O
</s>
<s>
The	O
steps	O
are	O
the	O
primitives	O
of	O
the	O
Gremlin	B-Language
graph	B-Algorithm
traversal	I-Algorithm
machine	O
.	O
</s>
<s>
The	O
Gremlin	B-Language
instruction	B-General_Concept
set	I-General_Concept
is	O
approximately	O
30	O
steps	O
.	O
</s>
<s>
These	O
steps	O
are	O
sufficient	O
to	O
provide	O
general	O
purpose	O
computing	O
and	O
what	O
is	O
typically	O
required	O
to	O
express	O
the	O
common	O
motifs	O
of	O
any	O
graph	B-Algorithm
traversal	I-Algorithm
query	O
.	O
</s>
<s>
Given	O
that	O
Gremlin	B-Language
is	O
a	O
language	O
,	O
an	O
instruction	B-General_Concept
set	I-General_Concept
,	O
and	O
a	O
virtual	B-Architecture
machine	I-Architecture
,	O
it	O
is	O
possible	O
to	O
design	O
another	O
traversal	O
language	O
that	O
compiles	O
to	O
the	O
Gremlin	B-Language
traversal	O
machine	O
(	O
analogous	O
to	O
how	O
Scala	B-Application
compiles	O
to	O
the	O
JVM	B-Language
)	O
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
popular	O
SPARQL	B-Language
graph	O
pattern	O
match	O
language	O
can	O
be	O
compiled	O
to	O
execute	O
on	O
the	O
Gremlin	B-Language
machine	O
.	O
</s>
<s>
In	O
Gremlin-Java8	O
,	O
the	O
SPARQL	B-Language
query	O
above	O
would	O
be	O
represented	O
as	O
below	O
and	O
compile	O
to	O
the	O
identical	O
Gremlin	B-Language
step	O
sequence	O
(	O
i.e.	O
</s>
<s>
The	O
Gremlin	B-Language
graph	B-Algorithm
traversal	I-Algorithm
machine	O
can	O
execute	O
on	O
a	O
single	O
machine	O
or	O
across	O
a	O
multi-machine	O
compute	O
cluster	O
.	O
</s>
<s>
Execution	O
agnosticism	O
allows	O
Gremlin	B-Language
to	O
run	O
over	O
both	O
graph	B-Application
databases	I-Application
(	O
OLTP	B-General_Concept
)	O
and	O
graph	O
processors	O
(	O
OLAP	B-Application
)	O
.	O
</s>
