Skip to content

Gremlin Grammar School

When we step into the land of graph databases we find ourselves in a whole new world of technology. We have abandoned tables and replaced them with vertices and edges. We have abandoned the joining of tables as the primary means of unifying data and replaced it with graph traversing. Most importantly, we have abandoned SQL. Without our modern data processing conveniences, we are reduced to cavemen. How are newcomers suppose to move comfortably into the world of graphs and discover the many advantages that graph databases have to offer?

At Gremlin grammar school, students evolve from primitive graph users to fancy hatted men of the guild. Students are exposed to a unique, developer-friendly graph theory foundation. This foundation is not taught like an outdated university course. Instead, it is taught using modern, real-world examples based on Gremlin. Gremlin is a graph traversal language that allows developers to express complex graph traversals in a concise, simple language. With Gremlin querying, ranking, recommendation, and much more are only a few lines of code away. To master Gremlin, this grammar school will mix lecture and hands-on problem-solving.

1. Querying: We will start with basic querying. Simple examples include: “Who are Marko’s collaborators and what are their primary development languages?” and “how many projects import Blueprints?”

// basic query
g.idx(T.v)[[type:'project']].out('imports')[[name:'Blueprints']].count()

2. Ranking: Next, we will learn how to separate the wheat from the chaff as we explore the numerous ways to rank vertices (see property graph algorithms). From the standard centrality algorithms taught in graph textbooks, we will explore their uses, variations, and optimizations in real-world situations.

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

3. Recommendation: Finally, we will expand our repertoire with a deep dive into heterogenous recommendation engines, graph sampling, multi-path weighting, filtering, and more.

// basic collaborative filtering
m = [:]; g.v(1).out('liked').in('liked').out('liked').groupCount(m)
m.sort{a,b -> a.value <=> b.value}

Gremlin is a useful tool for realizing the simplicity of the graph traversal pattern and its numerous applications to real-world problems. Get ready to graduate.

[Services → Workshops → Gremlin Grammar School]
Follow

Get every new post delivered to your Inbox.

Join 53 other followers