Today's database systems have shown to be capable of supporting AI applications that demand a lot of data processing. To this end, these systems incorporate powerful querying languages that go far beyond the mere retrieval of data, and provide sophisticated facilities for data processing as well. In the case of SQL, the language has been even demonstrated to be Turing-complete in some implementations of the language. In the area of NoSQL databases, a widely adopted one nowadays is the MongoDB database. Queries in MongoDB databases are represented as sequential stages within an aggregation pipeline where each stage defines a transformation of the input data, and passes the transformed data to the next stage. But aggregation queries tend to become rather large for more complex computational problems, lack organization into re-usable pieces, and are thus hard to debug and maintain. We propose a new database querying language called Mongolog which is syntactically a subset of the Prolog language, and we define its operational semantics through translations into aggregation pipelines. To this end, we make use of and extend the formal framework of the MQuery language which characterizes the aggregation framework set-theoretically.
翻译:今天的数据库系统已经证明能够支持需要大量数据处理的AI应用。 为此,这些系统包含强大的查询语言,这些语言远远超过单纯的数据检索,并为数据处理提供了复杂的设施。在SQL的情况下,这些语言甚至在某些语言的实施中被证明是图灵性的。在NOSQL数据库领域,一个广泛采用的新数据库是MongoDB数据库。MongoDB数据库中的查询作为一个聚合管道的相继阶段,每个阶段都界定输入数据的转换,并将转换的数据传送到下一个阶段。但是,对于更复杂的计算问题,汇总查询往往变得相当大,缺乏组织性,因此难以调试和维护。我们提议一个新的数据库,查询语言叫做Mongolog,这是Prolog语的一个合成子,我们通过将它转换成聚合管道来定义其操作的语义。为此,我们使用并扩展了构成聚合框架的MQuery语言的正式框架。