Modern applications often manage time-varying data. Despite decades of research on temporal databases, which culminated in the addition of temporal data operations into the SQL:2011 standard, temporal data query and manipulation operations are unavailable in most mainstream database management systems, leaving developers with the unenviable task of implementing such functionality from scratch. In this paper, we extend \emph{language-integrated query} to support writing temporal queries and updates in a uniform host language, with the language performing the required rewriting to emulate temporal capabilities automatically on any standard relational database. We introduce two core languages, $\lambda_{\mathsf{TLINQ}}$ and $\lambda_{\mathsf{VLINQ}}$, for manipulating transaction time and valid time data respectively, and formalise existing implementation strategies by giving provably correct semantics-preserving translations into a non-temporal core language, $\lambda_{\mathsf{LINQ}}$. We show how existing work on query normalisation supports a surprisingly simple implementation strategy for \emph{sequenced joins}. We implement our approach in the Links programming language, and describe a non-trivial case study based on curating COVID-19 statistics.
翻译:尽管对时间数据库进行了数十年的研究,最终将时间数据操作添加到SQL:2011标准中,但大多数主流数据库管理系统都无法进行时间数据查询和操作操作,使开发者无法从头开始执行这种功能。在本文件中,我们扩展了emph{语言综合查询},以支持以统一的主机语言编写时间查询和更新,用语言进行所要求的重新写作,在任何标准的关系数据库中自动模仿时间能力。我们引入了两种核心语言,即$\lambda{mathsf{TLIN}$和$\lambda{mathsf{VLIN}$,分别用于操纵交易时间和有效时间数据,并通过将精准的语义保留翻译成非时间核心语言,将现有执行战略正规化。 $\lambda{mathsf{LIN}$。我们展示了现有的查询正常化工作如何支持为\emph{后继连环的连环化执行战略。我们实施了基于链接的C- 19 案例研究,我们实施了基于 Crial- trial 的Cismainal vi 案例研究。