arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1009.1166cs.DBmath.CT
收藏

函数数据迁移

Functorial Data Migration

David I. Spivak

摘要:

在本文中,我们提出了一个简单的数据库定义语言:范畴和函子。数据库模式是一个小范畴,实例是其上的一个集值函子,我们证明了模式的态射诱导出三个“数据迁移函子”,它们以规范的方式将实例从一个模式转换到另一个模式。这些函子同时对所有表的投影、联合和连接进行参数化,可以用来代替合取和析取查询。我们还展示了如何通过在模式和函数式程序设计语言的类型类别之间引入函式连接来连接数据库和函数式编程语言。我们以大量的例子来激励定义,并在接近尾声时,我们提供了一个字典,使人们可以将数据库概念转换为范畴理论概念,反之亦然。

英文摘要:

In this paper we present a simple database definition language: that of categories and functors. A database schema is a small category and an instance is a set-valued functor on it. We show that morphisms of schemas induce three "data migration functors", which translate instances from one schema to the other in canonical ways. These functors parameterize projections, unions, and joins over all tables simultaneously and can be used in place of conjunctive and disjunctive queries. We also show how to connect a database and a functional programming language by introducing a functorial connection between the schema and the category of types for that language. We begin the paper with a multitude of examples to motivate the definitions, and near the end we provide a dictionary whereby one can translate database concepts into category-theoretic concepts and vice-versa.

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

↑