Running a Neo4j Cypher Introduction Workshop

Last night I ran a very successful workshop at the Friends of Neo4j Stockholm meetup group. The format was based on a workshop that I attended in San Francisco while the World Cup was going on and was based around investigating a dataset of previous World Cup matches. Roughly the format was:

  • A short presentation introducing the Cypher query language
  • A one to two hour section allowing people to apply what they’ve learned in the Neo4j web console by formulating questions and creating queries to answer those questions
  • A presentation section where participants are invited up to present

During the World Cup, Mark Needham and the Neo4j team put together a great resource website sharing results and information about the dataset which can be loading via this GitHub repository.

Beforehand

Before the workshop I had asked people to install Neo4j and set up either the World Cup dataset or a Summer Olympics dataset which I had also created for their use. Both datasets had instructions and load scripts to make it easy to set up.

The Presentation

I used a slideshow from Max De Marzi which I updated for Neo4j 2.x and simplified for an introduction session. You can see my slideshow here.

I also improvised a bit as I presented. One of the biggest things that I wish I had put in was an introduction to Neo4j concepts:

  • Nodes
    • Hold properties (key-value stores)
    • Have zero or more “labels” (somewhat analogous to SQL tables)
  • Relationships
    • Also hold properties
    • Have exactly one “type” (describing how/why the relationship is connecting the nodes)
    • Always specify a direction from one node to another
    • Relationships can be queried in either direction or without regard to direction without a performance cost

I also discussed a number of other issues which aren’t explicitly laid out in the presentation:

  • I talked about Neo4j internal IDs and how they shouldn’t be used for long-term identification of nodes (as future versions of Neo4j may shuffle them around for performance)
  • I explained parameters and talked about why they should be used (for performance and to prevent injection vulnerabilities)
  • I paused briefly to ask for questions after introducing each new concept

The Working Session

As much as I love to hear myself talk, I really enjoyed walking around and checking in with people and answering their questions. I can very hard to address every possible concern, but it’s much better to see how people try to do things and help them as they go. For example, in my presentation I mentioned Neo4j’s syntax for matching values:

MATCH (p:Person {name: 'Jim'})

… works the same as …

MATCH (p:Person) WHERE p.name = 'Jim'

Of course I forgot to explain that this syntax is only for exact matches and doesn’t work for things like regular expressions or IN clauses.

Project Presentations

When I attended the World Cup workshop in San Francisco there were a few nice presentations about what people had been working on. During my session nobody wanted to present. Everybody was very engaged in working on their queries, however, so I didn’t push it.

Conclusion

The workshop was a really fun way to get people using Neo4j really quickly. It can feel a bit strange to simply give people some datasets and ask them to do something with it, but the freedom to be creative helped both the participants and me be really excited about working with Neo4j. I look forward to doing more workshops again in the future!

2024

Let Your Database Update You with EctoWatch

Elixir allows application developers to create very parallel and very complex systems. Tools like Phoenix PubSub and LiveView thrive on this property of the ...

Back to Top ↑

2023

Back to Top ↑

2021

How Far Can I Push a GenServer?

I’ve been using Elixir for a while and I’ve implemented a number of GenServers. But while I think I mostly understand the purpose of them, I’ve not gotten t...

Why I Love Lodash

I love Lodash, but I’m not here to tell you to use Lodash. It’s up to you to decide if a tool is useful for you or your project. It will come down to the n...

Back to Top ↑

2020

Structuring an Elixir+Phoenix App

I’ve mix phx.new ed many applications and when doing so I often start with wondering how to organize my code. I love how Phoenix pushes you to think about th...

Back to Top ↑

2015

Analyzing Ruby’s ObjectSpace with Neo4j

Recently the continuous builds for the neo4j Ruby gem failed for JRuby because the memory limit had been reached. I wanted to see if I could use my favorite...

Master Data Management Scoring Examples

A while ago my colleague Michael suggested to me that I draw out some examples of how my record linkage algorithm did it’s thing. In order to do that, I’ve ...

Loading SQL to Neo4j Like Magic

When using neo4j for the first time, most people want to import data from another database to start playing around. There are a lot of options including LOA...

Back to Top ↑

2014

Analyzing Twitter with Neo4j and Rails

Having recently become interested in making it easy to pull data from Twitter with neo4apis-twitter I also decided that I wanted to be able to visualize an...

neo4apis

I’ve been reading a few interesting analyses of Twitter data recently such as this #gamergate analysis by Andy Baio. I thought it would be nice to have a ...

Normalizing Religion in Ireland

When I told the people of Northern Ireland that I was an atheist, a woman in the audience stood up and said, ‘Yes, but is it the God of the Catholics or t...

Back to Top ↑