In the relational model a relation over a set of attributes is defined to be a (finite) subset of the Cartesian product of the attribute domains, separately from the functional dependencies that the relation must satisfy in order to be consistent. In this paper we propose to include the functional dependencies in the definition of a relation by introducing a data model based on a graph in which the nodes are attributes, or Cartesian products of attributes, and the edges are the functional dependencies. Such a graph actually represents the datasets of an application and their relationships, so we call it an application context or simply context. We define a database over a context $\mathcal C$ to be a function $\delta$ that associates each node $X$ of $\mathcal C$ with a finite set of values $\delta(X)$ from the domain of $X$ and each edge $e: X \to Y$ with a total function $\delta(e): \delta(X) \to \delta(Y)$. We combine the nodes and edges of a context using a functional algebra in order to define queries; and the set of all well-formed expressions of this algebra is the query language of the context. A relation over attributes $A_1, \ldots, A_n$ is then defined as a query whose paths form a tree with leaves $A_1, \ldots, A_n$ and whose root is the key. The main contributions of this paper are as follows: (a) we introduce a novel graph database model, called the context model, (b) we show that a consistent relational database can be embedded in the context model as a view over the context induced by its functional dependencies, (c) we define analytic queries in the query language of a context in a seamless manner - in contrast to the relational model where analytic queries are defined outside the relational algebra, and (d) we show that the context model can be used as a user-friendly interface to a relational database for data analysis purposes.
翻译:在关系模型中,属性集上的关系被定义为属性域笛卡尔积的(有限)子集,这与关系为保持一致性所必须满足的函数依赖关系是分开处理的。本文提出将函数依赖纳入关系的定义,通过引入一种基于图的数据模型来实现:图中节点表示属性或属性的笛卡尔积,边表示函数依赖。这种图实际代表了应用的数据集及其相互关系,因此我们称之为应用语境或简称为语境。我们将语境 $\mathcal C$ 上的数据库定义为函数 $\delta$,该函数将 $\mathcal C$ 的每个节点 $X$ 关联到 $X$ 域上的有限值集 $\delta(X)$,并将每条边 $e: X \to Y$ 关联到全函数 $\delta(e): \delta(X) \to \delta(Y)$。我们利用函数代数组合语境的节点和边以定义查询;该代数所有良构表达式的集合即构成语境的查询语言。基于属性 $A_1, \ldots, A_n$ 的关系被定义为路径构成树的查询,其中叶子节点为 $A_1, \ldots, A_n$,根节点为键。本文的主要贡献如下:(a) 提出一种新颖的图数据库模型,称为语境模型;(b) 证明一致的关系数据库可作为基于其函数依赖所诱导语境的视图嵌入语境模型;(c) 在语境查询语言中无缝定义分析型查询——这与关系模型中将分析型查询定义在关系代数之外的做法形成对比;(d) 表明语境模型可作为面向关系数据库的用户友好型数据分析接口。