Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts

The methods to access large relational databases in a distributed system are well established: the relational query language SQL often serves as a language for data access and manipulation, and in addition public interfaces are exposed using communication protocols like REST. Similarly to REST, Grap...

Full description

Bibliographic Details
Main Authors: Falco Nogatz, Dietmar Seipel
Format: Article
Language:English
Published: Open Publishing Association 2017-01-01
Series:Electronic Proceedings in Theoretical Computer Science
Online Access:http://arxiv.org/pdf/1701.00626v1
id doaj-baab6f00b6404d99b14aaacc669a569a
record_format Article
spelling doaj-baab6f00b6404d99b14aaacc669a569a2020-11-25T00:10:54ZengOpen Publishing AssociationElectronic Proceedings in Theoretical Computer Science2075-21802017-01-01234Proc. WLP 2015/'16/WFLP'16425610.4204/EPTCS.234.4:5Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and DictsFalco NogatzDietmar SeipelThe methods to access large relational databases in a distributed system are well established: the relational query language SQL often serves as a language for data access and manipulation, and in addition public interfaces are exposed using communication protocols like 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 to combine, e.g., relational with NoSQL databases. In contrast to REST, GraphQL provides a single API endpoint and supports flexible queries over linked data. GraphQL can also be used 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 definite clause grammars (DCG), quasi quotations, and dicts. 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.http://arxiv.org/pdf/1701.00626v1
collection DOAJ
language English
format Article
sources DOAJ
author Falco Nogatz
Dietmar Seipel
spellingShingle Falco Nogatz
Dietmar Seipel
Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts
Electronic Proceedings in Theoretical Computer Science
author_facet Falco Nogatz
Dietmar Seipel
author_sort Falco Nogatz
title Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts
title_short Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts
title_full Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts
title_fullStr Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts
title_full_unstemmed Implementing GraphQL as a Query Language for Deductive Databases in SWI-Prolog Using DCGs, Quasi Quotations, and Dicts
title_sort implementing graphql as a query language for deductive databases in swi-prolog using dcgs, quasi quotations, and dicts
publisher Open Publishing Association
series Electronic Proceedings in Theoretical Computer Science
issn 2075-2180
publishDate 2017-01-01
description The methods to access large relational databases in a distributed system are well established: the relational query language SQL often serves as a language for data access and manipulation, and in addition public interfaces are exposed using communication protocols like 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 to combine, e.g., relational with NoSQL databases. In contrast to REST, GraphQL provides a single API endpoint and supports flexible queries over linked data. GraphQL can also be used 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 definite clause grammars (DCG), quasi quotations, and dicts. 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.
url http://arxiv.org/pdf/1701.00626v1
work_keys_str_mv AT falconogatz implementinggraphqlasaquerylanguagefordeductivedatabasesinswiprologusingdcgsquasiquotationsanddicts
AT dietmarseipel implementinggraphqlasaquerylanguagefordeductivedatabasesinswiprologusingdcgsquasiquotationsanddicts
_version_ 1725406370283388928