Table of Contents
Fetching ...

The Context Model: A Graph Database Model

Nicolas Spyratos

TL;DR

The paper presents the context model, a graph-based data model where a single root context captures application data sets as nodes and functional edges encode relationships, enabling both navigation (traversal) and aggregation (analytic) within one formal framework. It formalizes contexts, databases over contexts, and a unified four-operation functional algebra (Cartesian product, restriction, composition, pairing) along with integrity constraints, and it defines how expressions evaluate to functions over a database. It demonstrates expressiveness by showing relational databases can be defined as views over a context and by detailing how analytic queries can be rewritten and composed within this framework, bridging graph-based query capabilities with relational semantics. The work lays a foundation for semantic-rich views, mediator-style translations to external engines, and future directions in updates and visualization of context-based data analysis.

Abstract

We propose a novel database model whose basic structure is a labeled, directed, acyclic graph with a single root, in which the nodes represent the data sets of an application and the edges represent functional relationships among the data sets. We call such a graph an application context or simply context. The query language of a context consists of two types of queries, traversal queries and analytic queries. Both types of queries are defined using a simple functional algebra whose operations are functional restriction, composition of functions, pairing of functions and Cartesian product of sets. Roughly speaking, traversal queries parallel relational algebra queries, whereas analytic queries parallel SQL Group-by queries. In other words, in our model, traversal queries and analytic queries, are both defined within the same formal framework - in contrast to the relational model, where analytic queries are defined outside the relational algebra. Therefore a distinctive feature of our model is that it supports data management and data analytics within the same formal framework. We demonstrate the expressive power of our model by showing: (a) how a relational database can be defined as a view over a context, with the context playing the role of an underlying semantic layer; (b) how an analytic query over a context can be rewritten at two orthogonal levels: at the level of the traversal queries that do the grouping and measuring, and at the level of the analytic query itself; and (c) how a context can be used as a user-friendly interface for querying relations and analysing relational data.

The Context Model: A Graph Database Model

TL;DR

The paper presents the context model, a graph-based data model where a single root context captures application data sets as nodes and functional edges encode relationships, enabling both navigation (traversal) and aggregation (analytic) within one formal framework. It formalizes contexts, databases over contexts, and a unified four-operation functional algebra (Cartesian product, restriction, composition, pairing) along with integrity constraints, and it defines how expressions evaluate to functions over a database. It demonstrates expressiveness by showing relational databases can be defined as views over a context and by detailing how analytic queries can be rewritten and composed within this framework, bridging graph-based query capabilities with relational semantics. The work lays a foundation for semantic-rich views, mediator-style translations to external engines, and future directions in updates and visualization of context-based data analysis.

Abstract

We propose a novel database model whose basic structure is a labeled, directed, acyclic graph with a single root, in which the nodes represent the data sets of an application and the edges represent functional relationships among the data sets. We call such a graph an application context or simply context. The query language of a context consists of two types of queries, traversal queries and analytic queries. Both types of queries are defined using a simple functional algebra whose operations are functional restriction, composition of functions, pairing of functions and Cartesian product of sets. Roughly speaking, traversal queries parallel relational algebra queries, whereas analytic queries parallel SQL Group-by queries. In other words, in our model, traversal queries and analytic queries, are both defined within the same formal framework - in contrast to the relational model, where analytic queries are defined outside the relational algebra. Therefore a distinctive feature of our model is that it supports data management and data analytics within the same formal framework. We demonstrate the expressive power of our model by showing: (a) how a relational database can be defined as a view over a context, with the context playing the role of an underlying semantic layer; (b) how an analytic query over a context can be rewritten at two orthogonal levels: at the level of the traversal queries that do the grouping and measuring, and at the level of the analytic query itself; and (c) how a context can be used as a user-friendly interface for querying relations and analysing relational data.
Paper Structure (6 sections, 4 theorems, 4 figures)

This paper contains 6 sections, 4 theorems, 4 figures.

Key Result

lemma thmcounterlemma

Let $X, Y, Z$ be three sets, and let $f: X \to Y$ and $g: X \to Z$ be two functions with common source. Then the following hold: $\pi_Y \circ (f \wedge g)= f$ and $\pi_Z \circ (f \wedge g)= g$

Figures (4)

  • Figure 1: Example of context definition
  • Figure 2: Representing the dependency $\{Sup, Cat\} \to Unitprice$
  • Figure 3: (a) Two contexts sharing an edge (b) the two contexts as sub-contexts of a larger context
  • Figure 4: Illustrating lemma \ref{['BasicLemma']}

Theorems & Definitions (11)

  • definition thmcounterdefinition: Context
  • definition thmcounterdefinition: Database
  • definition thmcounterdefinition: Functional algebra
  • lemma thmcounterlemma
  • definition thmcounterdefinition: Product of functions
  • lemma thmcounterlemma
  • definition thmcounterdefinition: Expression over $\mathcal{C}$
  • lemma thmcounterlemma
  • definition thmcounterdefinition: Equality constraint
  • definition thmcounterdefinition: Refinement constraint
  • ...and 1 more