TypeDB Papers
TypeQL: a Type-Theoretic and Polymorphic Query Language
Accepted for publication at ACM SIGMOD/PODS 2024
Read Announcement and Summary
Abstract: The paper explores a novel way of integrating typeful programming with performant database design. Centrally, the paper suggest to evolve the influential paradigm of Propositions as Types into principle of "Queries as Types". In other words, in TypeQL the user constructs types in order to formulate queries.
The motivation for our work is practical. Relational data modeling can often be restrictive as it provides no direct facility for modeling polymorphic types, reified relations, multi-valued attributes, and other common high-level structures in data. This creates many challenges in data modeling and engineering tasks, and has led to the rise of more flexible NoSQL databases, such as graph and document databases. In the absence of structured schemas, however, we can neither express nor validate the intention of data models, making long-term maintenance of databases substantially more difficult.
To resolve this dilemma, we argue that modern type theory can guide us in the development of powerful new high-level data models and query languages. To this end, we introduce a new polymorphic entity-relation-attribute (PERA) data model, grounded in type-theoretic principles and accessible through classical conceptual modeling, with a near-natural query language: TypeQL.