Introducing Scala Cypher DSL

Working with Neo4J and Scala at ThoughtWorks, I had a major qualm regarding the way we were interacting with the graph database using Cypher. Cypher is a declarative language, hence it is tricky to compose it programmatically. This is the reason why most of the ORMs (or micro-ORMs) for Neo4J are effective only for simple use cases. We observed that as the scale and complexity of our business logic started to increase, our code fragmented into two distinct flavors. There were Scala models and business implementations. And then there were string generation and manipulation methods to generate Cypher queries.

String-based queries have inherent issues like no type safety, minimal syntax checking, difficulty in composing directly proportional to complexity, etc.