arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1701.00626cs.DBcs.PL
收藏

在SWI-Prolog中使用DCG、类引用和Dict实现GraphQL作为演绎数据库的查询语言

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

Falco Nogatz, Dietmar Seipel

摘要:

在分布式系统中访问大型关系数据库的方法已经很成熟:关系查询语言SQL通常用作数据访问和操作的语言,此外,公共接口使用REST等通信协议公开。与REST类似,GraphQL是Facebook开发的应用层的查询协议。它为客户端和服务器之间的数据获取和操作提供了一个统一的接口。使用GraphQL的类型系统,可以指定各种源的数据处理并组合,例如,与NoSQL数据库的关系。与REST相比,GraphQL提供了单个API端点,并支持对链接数据的灵活查询。GraphQL也可以用作演绎数据库的接口。在本文中,我们介绍了GraphQL,并与REST进行了比较。使用最近添加到SWI-Prolog 7的语言功能,我们开发了Prolog库GraphQL.pl,它实现了GraphQL类型系统和查询语法,作为一种特定于域的语言,并借助定子句语法(DCG),准引号和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, 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑