top | item 10105710

The Gremlin Graph Traversal Language

23 points| okram | 10 years ago |slideshare.net

14 comments

order
[+] liorn|10 years ago|reply
Python developer here. Here's my rant.

I've been using OrientDB (one of the leading Graph databases) for the last few months; it's been a horrible experience to get it working with Python, as the official Python OrientDB driver is essentially a very thin wrapper around the binary protocol.

Using Gremlin would actually be nice, and save me a lot of nasty queries, but it seems like there is no python ecosystem for it. The presentation mentions "Gremlin-Python". A quick Google search brings up these results:

1. "Bulbs" (http://bulbflow.com/download/) - it's a dead project, last commit being 10 months ago. Look at https://github.com/espeed/bulbs

2. "Gremlin-Python" - https://github.com/pokitdok/gremlin-python . Dead project (last commit 6 months ago), and requires one to install Jython.

I would love to know if I've missed something - did anyone get Python to nicely work with Gremlin?

[+] jlarocco|10 years ago|reply
I don't think no commits in 10 and 6 months is a very good indication of whether or not the projects are dead.

Assuming they just wrap other libraries, there's usually not much to screw up, so I wouldn't expect them to be heavily committed to, except for after a release of the underlying library.

[+] vangale|10 years ago|reply
I'm also needing graph db with Python. I thought I'd go with ArangoDB instead of OrientDB but the Arango python bindings also don't strike me as really stable. So now I'm thinking of using Blazegraph instead. The restful interface should be pretty easy from Python and I'm thinking SPARQL is actually going to be a much better query language for my end users.
[+] fxbois|10 years ago|reply
Anyone could mention some benefits of Gremlin over Cypher ?
[+] okram|10 years ago|reply
Gremlin is an Apache Software Foundation query language and as such, can be used by any graph system (Titan, Neo4j, OrientDB, etc.). It is not bound to a particular vendor.

Gremlin has a natural compilation to the common distributed vertex-centric computing model (bulk synchronous parallel for graphs). Thus, Gremlin works for both OLTP (graph databases) and OLAP (graph processors). The Apache distribution provides OLAP connectivity to Apache Hadoop, Spark, and Giraph.

Gremlin supports both imperative path expressions and declarative pattern matching.

Gremlin can be embedded in any host language. No "fat string" with result set. The user's database query code and data manipulation code are in the same language. There exists Gremlin-Java8, Gremlin-Groovy, Gremlin-Scala, Gremlin-Clojure, Gremlin-PHP, etc.

Gremlin is Turing Complete. Most any complex enough language is. However, Gremlin is related to a Turing Machine by a very simply mapping.

See http://arxiv.org/abs/1508.03843 for detailed specifics of the aforementioned benefits.

[+] tacone|10 years ago|reply
Not, benefits, differences.

Gremlin is an imperative "language", Cypher is declarative. The first lets you specify what will be performed, the latter describes the wished result and lets the query optimizer translate it to actual operations to retrieve it.

In a way, with Gremlin you have the absolute freedom on how to perform the traversal. With Cypher, you're working at a higher level with all the advantages of such approach (think SQL).

[+] yubozhao|10 years ago|reply
It is more useful for manually working with graph. You have more control of what happens and build complex graph traversals. Also, it is not tied to any graph db. Gremlin is part of Tinkerpop, a graph framework, http://tinkerpop.incubator.apache.org/
[+] jkot|10 years ago|reply
Multiple implementations? Cypher only has Neo4j.