Implementing GraphQL as a Query Language for Deductive Databases in SWI–Prolog Using DCGs, Quasi Quotations, and Dicts
, and .
Proceedings of the 30th Workshop on (Constraint) Logic Programming (WLP 2016), (September 2016)

The methods to access large relational databases in a distributed system are well established: the relational query language SQL often serves as a low-level language for data access and manipulation, and in addition several endpoints are exposed by public interfaces using for example REST. Similarly to REST, GraphQL is the query protocol of an application layer developed by Facebook. It provides a unified interface between the client and the server for data fetching and manipulation. Using GraphQL's type system, it is possible to specify data handling of various sources and combine, e.g., relational with NoSQL databases. In contrast to REST, GraphQL provides a single endpoint and supports flexible queries over linked data. This makes GraphQL a perfect fit as an interface for deductive databases. In this paper, we give an introduction of GraphQL and a comparison to REST. Using language features recently added to SWI-Prolog 7, we have developed the Prolog library GraphQL.pl, which implements the GraphQL type system and query syntax as a domain-specific language with the help of DCGs. Using our library, the type system created for a deductive database can be validated, while the query system provides a unified interface for data access and introspection.
  • @falco.nogatz
  • @dietmar.seipel
This publication has not been reviewed yet.

rating distribution
average user rating0.0 out of 5.0 based on 0 reviews
    Please log in to take part in the discussion (add own reviews or comments).