Neo4j is a high performance, open-source graph database written in Java and Scala.
But of course, you can use and extend it from other JVM Languages, like Kotlin.
I've been using Kotlin on and off since 2012, that's when I wrote my first article about this pragmatic and clean programming language.
Today I want to demonstrate in 4 examples how you can use Neo4j with Kotlin.
In preparation for KotlinConf 2017 we started to gather community activity of the Kotlin community in a Neo4j graph.
You can see tweets, GitHub projects, StackOverflow questions and answers and meetup events in this database of developer activity.
After showing some examples we will explore how to query that database using a Kotlin driver for Neo4j.
Then we'll look at the Kotlin + Spring (Data) demo app, that shows community members who get a lot of praise on a Twitter wall.
My main Kotlin project over the last year has been the GraphQL extension for Neo4j.
So we'll have a look at how we can extend Neo4j with a custom HTTP API and how we integrate the GraphQL-Java library using Kotlin.
This extension manages a GraphQL schema to translate GraphQL queries to Neo4js native query language Cypher.
Another way to extend Neo4j is with user-defined procedures and functions which (with a small trick) are really easy to implement with Kotlin too.
We'll take a look at the procedures and functions we expose as part of the neo4j-graphql extension.