Parsing graphs: applying parser combinators to graph traversals

  • Authors:
  • Daniel Kröni;Raphael Schweizer

  • Affiliations:
  • University of Applied Sciences Northwestern Switzerland, Windisch, Switzerland;University of Applied Sciences Northwestern Switzerland, Windisch, Switzerland

  • Venue:
  • Proceedings of the 4th Workshop on Scala
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Connected data such as social networks or business process interactions are frequently modeled as graphs, and increasingly often, stored in graph databases. In contrast to relational databases where SQL is the proven query language, there is no established counterpart for graph databases. One way to explore and extract data from a graph database is to specify the structure of paths (partial traversals) through the graph. We show how such traversals can be expressed by combining graph navigation primitives with familiar grammar constructions such as sequencing, choice and repetition -- essentially applying the idea of parser combinators to graph traversals. The result is trails [6], a Scala combinator library that provides an implementation for the neo4j graph database [7] and for the generic graph API blueprints [8].