Source-linked AI summary
Tree Databases
Nicolas Spyratos
TL;DR
Tree-database design raises the question of how to choose equivalent sets of trees and suitable design criteria. The paper defines operations for combining trees and demonstrates support for inheritance, consistent relational schemas, and tree-database interfaces to relational data.
Problem
Tree-database design raises the question of how to choose an equivalent set of trees and which criteria should guide that choice.
Source: §7 · p. 39Method
The paper defines operations for combining trees and maps relational schemas and instances into tree databases that can act as interfaces to relational data.
Source: §1 · p. 2, §6.3 · p. 37Results
The model supports inheritance, yields relational instances consistent with their dependencies, and can act as an interface to relational databases.
Source: §6.1 · p. 35, §6.2 · p. 36, §6.3 · p. 37Takeaways & Limitations
Tree-database interfaces can be tailored to specific users or groups by creating tree views.
Source: §6.3 · p. 37Designing efficient algorithms for tree restriction lies outside the paper’s scope and is part of the authors’ current research.
Source: §3.1 · p. 14
Abstract
from arXiv · showhide
We propose a novel database model whose basic structure is a labeled, directed tree with node identities. Intuitively, the root of the tree is seen as an object (or entity), the non-root nodes as attributes of the object and the semantics of each attribute is represented by the unique path leading from the root to the attribute. We define a tree database to be a set of such trees. The trees of the database can be combined to produce new trees using a set of operations on trees that we define in the paper. The query language of our model offers two types of queries, traversal queries and analytic queries. A query (whether traversal or analytic) is always defined over a tree, which is either a tree in the database or a tree derived from other trees using tree operations. The operations on trees and the query language are both defined using a simple functional algebra whose operations are: restriction of a function, composition of functions, pairing of functions and Cartesian product of sets. A distinctive feature of our model is that traversal queries and analytic queries are both defined within the same formal framework; and in fact, traversal queries serve as the building blocks for analytic queries. This is in sharp contrast to the relational model, where analytic queries are defined outside the relational algebra, in the form of SQL Group-by queries. Therefore our model supports data access and data analysis within the same formal framework. We demonstrate the expressive power of our model by showing: (a) how our model can support inheritance in a seamless manner, (b) how one can define consistent relational databases on top of a tree database - with the tree database playing the role of an underlying semantic layer and (c) how a tree database can be used as a user-friendly interface for accessing and analyzing relational data.
1 Introduction
The paper introduces a tree database model that organizes application data and relationships in labeled, directed trees, with a functional-algebra query language for both traversal and analysis. It presents tree operations and demonstrates the model’s expressive power for inheritance and relational-data access.
- A tree database is a set of labeled, directed trees with node identities, where roots represent entities, non-root nodes represent attributes, and paths define attribute semantics.Each node stores an application data set, and each edge stores a total function from its source node to its target node.Source: §1 · p. 2
- Tree composition combines compatible trees at a unique shared node, while the functional algebra provides Cartesian product, function restriction, composition, and pairing.Pairing functions with a common source constructs tuples from their outputs.Source: §1 · pp. 2–3
- Traversal queries return path compositions or pairings of paths with a common source; analytic queries group and measure with traversal queries before applying an aggregate.Analytic expressions can be paired when they share a source.Source: §1 · pp. 3–4
- Traversal and analytic queries share one formal framework, with traversal queries serving as building blocks for analysis, unlike SQL Group-by queries outside relational algebra.The model thus supports data access and analysis within the same framework.Source: §1 · p. 4
- The paper demonstrates that the model supports inheritance, consistent relational databases over a tree database as a semantic layer, and a user-friendly interface for relational data access and analysis.Source: §1 · pp. 4–5
- Graph databases make relationships directly traversable and flexible for connected data [6], whereas relational systems rely on query-time joins that can be costly, especially for many-to-many relationships.Graph traversal navigates from starting nodes to related nodes [1].Source: §1 · p. 5
2 The Formal Definition of a Tree Database
The section formalizes tree databases, the functional algebra used to manipulate their data, and integrity constraints that specify valid database instances.
2.1 Tree Database
- A tree over a universe is a finite directed labeled graph with one root, a unique root-to-node path, distinct labels, and unordered successor sets.Universe nodes may be simple or products of two or more universe elements; product-node domains are products of their factors’ domains.Source: §2.1 · p. 6
- A tree database is a finite set of trees in which roots may be simple or composite, non-root nodes are simple, and each simple universe node appears in the database.A simple node appears at most once per tree, may be shared across trees, and each tree node has an identity edge.Source: §2.1 · p. 6
- Each tree instance assigns finite nonempty domain subsets to nodes and total functions to edges, with identity functions on identity edges.Thus edge functions allow no nulls; a shared node may have different instances in different trees.Source: §2.1 · p. 7
2.2 The functional algebra
- The functional algebra combines Cartesian products and projections, restriction, pairing, and composition to provide the foundation for tree operations and queries.Restriction narrows a function to a subset of its source; pairing combines functions with a common source, and composition chains compatible functions.Source: §2.2 · pp. 7, 8, 10
- Expressions over a tree use its edges and functional-algebra operations, while path expressions compose the edges along a path.An expression evaluates by substituting the instance’s node and edge values and applying its operations; its value is a function from its source to its target.Source: §2.2 · pp. 8–9
- The functional algebra’s implied-function rules correspond to reflexivity, transitivity, and augmentation for functional dependencies, but the paper establishes only their soundness.A complete derivation system and detailed constraint inference are left to future work.Source: §2.2 · p. 9, §2.3 · pp. 11–12
2.3 Integrity constraints
- An inclusion constraint requires the instances of a shared node in two trees to satisfy subset containment.This can express, for example, that products delivered are among those available at the company.Source: §2.3 · p. 10
- A refinement constraint compares expressions with the same source by their induced partitions, and means one expression determines another.For two edges with the same source, refinement holds exactly when a unique function from the first target to the second composes with the first edge to give the second; it can express that each department has one manager.Source: §2.3 · p. 11
3 Operations on Trees
This section defines tree operations and expressions for deriving and querying trees from a database. The operations support reshaping trees, combining multiple trees, decomposition, and user-tailored views.
3.1 Tree restriction
- Tree restriction propagates a node’s subset through the tree while preserving total functions, and propagation terminates with an order-independent result.Restriction can be extended from paths and forks to trees; efficient algorithms for it are left to future work.Source: §3.1 · pp. 13–14
3.2 Tree composition
- Composing trees that share only the root of the second tree yields a tree rooted at the first tree’s root and enables paths that traverse multiple trees.For instances, composition intersects the datasets at the link; an empty intersection produces an empty tree, while a nonempty intersection is propagated through both trees.Source: §3.2 · pp. 14–16
3.3 Cartesian product of trees
- The Cartesian product combines two disjoint trees into a tree containing them as subtrees, using tree composition and set Cartesian products.For mutually disjoint trees, this operation is commutative and transitive.Source: §3.3 · p. 16
3.4 Tree projection
- Projection selects the subtree rooted at a node, and its complement composes with it to reconstruct the original tree.This decomposition lets view designers focus on smaller trees; the tree algebra comprises restriction, composition, and projection, with Cartesian product derived from them.Source: §3.4 · pp. 18–19
- A tree expression over D is a query whose answer is its evaluated tree; users first extract a tree, then issue traversal or analytic queries.The expression's value is obtained by performing its operations on operand trees.Source: §3.4 · p. 19
- Composition and Cartesian product create larger trees for multi-tree traversal, decomposition focuses on smaller database parts, and operations enable user-tailored views.Source: §3.4 · p. 19
3.5 Views
- A tree-database view is a named pair (V, TE), where TE is a tree expression over D serving as its definition.Source: §3.5 · p. 20
- If T1 is composable with T2 and T3, and T2 and T3 are disjoint, then T3 ◦(T2 ◦T1) = T2 ◦(T3 ◦T1).Source: §3.5 · p. 20
4 Traversal Queries
Traversal queries over database trees or trees derived from them pair path expressions sharing a source. Their answers are functions from that source to target values, and they induce relations whose functional dependencies help define consistent relational structures.
4 Traversal Queries
- A traversal query is one path expression or a pairing of path expressions with a common source and distinct targets.A path expression corresponds unambiguously to a path in the tree.Source: §4 · p. 21
- A query answer pairs the path-expression values into a function from the source to the product of its targets.An identity-edge query can read a node’s content.Source: §4 · p. 21
- Users specify a source, distinct descendant targets, and optional restrictions, which can be expressed through SQL-like select, from, and where clauses.The system verifies that selected targets are distinct descendants of the source in the tree defined by the from clause.Source: §4 · p. 22
- Each traversal query induces a relation schema keyed by its source, with each target attribute’s path expression providing its unique semantics.For each tree instance, the query answer induces a relation satisfying the functional dependencies from the source to each target.Source: §4 · p. 22
- The model treats functional dependencies as first-class query-building elements that dynamically build consistent relations, unlike the relational model’s static constraints.Relations are derived concepts in this model, whereas the relational model treats relations as first-class citizens.Source: §4 · p. 23
- Traversal queries can be evaluated directly, translated to another query engine, or rewritten into equivalent forms that can reuse prior results.Equivalence means returning the same answer in every database instance; rewriting rules are logical and independent of physical system state.Source: §4 · p. 23
5 Analytic queries
The section defines analytic queries within the functional algebra shared with traversal queries, using traversal for grouping and measuring and combining both expression types in mixed queries. It extends analytic expressions through pairing, restriction, evaluation strategies, and rewriting.
5 Analytic queries
- An analytic expression pairs same-source traversal queries for grouping and measuring with an aggregate applicable to the measure’s target; analytic queries may pair expressions with a common source.Traversal-query results can define user-specific grouping and measuring functions, and the common source need not be the tree root.Source: §5 · pp. 25–26
- Analytic-expression results can be restricted by subsets or functions of their values, including selecting suppliers whose category counts exceed the average.The paper notes that some such restrictions are unavailable in relational algebra, though some may be expressed with SQL GROUP BY HAVING.Source: §5 · p. 28
5.1 Evaluation of analytic expressions
- Analytic expressions can be translated to SQL GROUP BY, MapReduce, or SPARQL, while shared grouping or measuring queries can be evaluated only once across expressions.Direct evaluation is inefficient for large datasets; translating to existing engines enables query-engine optimization and a transparent mediator over underlying data.Source: §5.1 · pp. 28–29
5.2 Rewriting an Analytic Expression
- For associative aggregates, the composition rule rewrites a composed grouping query as nested analytic expressions, enabling recursive evaluation and sometimes avoiding relational joins.The paper also identifies incremental evaluation of analytic expressions on large datasets as an advantage; the rule does not apply directly to non-associative operations such as average.Source: §5.2 · pp. 29–30
- Rewriting a paired grouping query can derive separate analytic expressions for each component from an expression grouped by their joint result.The paper derives this pairing rule using projection and the composition rule, alongside rewriting the grouping or measuring traversal queries.Source: §5.2 · p. 31
- Analytic-expression rewriting uses pairing to derive separate summaries, such as branch totals and product totals, from totals grouped by branch and product.The rewriting rule expresses the new analytic expressions in terms of the already computed grouped result.Source: §5.2 · p. 31
5.3 Analytic queries
- Analytic queries are single expressions or pairings of expressions with a shared source and distinct targets, defined in the functional algebra alongside traversal queries.This contrasts with the relational model, where analytic queries are expressed outside relational algebra as SQL group-by queries.Source: §5.3 · p. 31
5.4 Mixed queries
- Mixed queries pair traversal and analytic expressions with a common source, offering principled combinations and forming the tree database query language.They can induce relations; grouping analytic expressions, such as sum and average, can make a mixed query less expensive to evaluate.Source: §5.4 · p. 32
6 Applications
The section presents three applications of tree databases: modeling inheritance, defining relational databases with tree-based attribute semantics, and providing an interface for relational data. It outlines how these applications are constructed and what constraints they require.
6.1 Inheritance
- One-to-one Isa edges and tree composition let a child tree inherit a parent’s attributes along unique paths, provided the inheritance constraints hold.The Isa edge maps each child entity to itself, and composition requires maintaining that identity constraint; the definition also requires matching root domains and an inclusion condition on database instances.Source: §6.1 · p. 33
- Inheritance reduces redundancy by organizing trees hierarchically, while Isa edges should form trees to avoid the diamond problem.The paper proposes either maintaining equality between the two inheritance paths during updates or requiring Isa edges to form one or more trees.Source: §6.1 · p. 35
6.2 Defining relations over a tree database
- Queries over a tree database induce relational schemas and consistent relations whose attribute expressions provide semantics, making the tree database an underlying semantic layer.Users can inspect an attribute’s expression through clickable table attributes; translating relational algebra or SQL queries over this layer is identified as ongoing research.Source: §6.2 · p. 36
6.3 A tree database as an interface
- Functional-dependency paths from each key form trees that define a tree database interface, with nodes and edges instantiated from relation and attribute-pair projections.The resulting interface can be tailored to users or groups through tree views.Source: §6.3 · pp. 37–38
7 Concluding remarks and perspectives
The paper presents a tree-based database model with traversal and analytic queries, and outlines how it can support inheritance and relational data access and analysis. Its concluding perspectives identify open directions in query rewriting, updates, inheritance, database design, relational theory, and system development.
Concluding remarks
- The model represents an application database as trees whose nodes are datasets and edges are total functions, supporting traversal and analytic queries over database or derived trees.The paper also outlines inheritance support and the use of tree databases as a semantic layer for consistent relational databases and as an interface for accessing and analyzing relational data.Source: §7 · p. 38
- The authors argue that sets of trees and tree operations offer more flexibility than a single graph and, to their knowledge, trees have not otherwise served as the basic conceptual database structure.The paper contrasts this model with its earlier single-rooted graph model [14].Source: §7 · p. 38
Query rewriting
- The functional algebra supports initial traversal and analytic query rewrites, but a complete system for optimizing their evaluation remains to be developed.The examples use composition distributing over pairing for traversal queries and the composition rule for analytic queries.Source: §7 · pp. 38–39
Updating
- Efficient update algorithms must propagate key-value changes across tree edges while preserving function totality and satisfying refinement, set-theoretic, and Isa-related constraints.The authors identify constraint-preserving tree database updates as a subject for further work.Source: §7 · p. 39
Inheritance
- The authors aim to generalize inheritance from disjoint trees to overlapping trees, using projections or decompositions to form webs of trees connected by Isa edges.In these webs, an Isa edge imports information between trees like a hyperlink; the authors target application-specific properties and environments such as organized multimedia collections.Source: §7 · p. 39
Tree database design
- Tree database design remains open: the authors ask how to use the tree algebra to find equivalent tree sets while balancing criteria such as small, understandable trees against larger application structures.They cite lossless decomposition as an example of a possible design criterion.Source: §7 · p. 39
Revisiting relational model theory
- Because the model treats functions as first-class and relations as derived, the authors propose revisiting relational functional-dependency and schema-design theory, building on their simulation of Armstrong’s axioms.They relate the model to NoSQL, particularly key-value databases [17] and, since each tree edge represents key-value pairs that could in principle be stored in a key-value store.Source: §7 · pp. 38–39
Data visualization
- Further work includes visualizing and exploring query results and implementing a full tree-database management system for storage, access, analysis, inheritance, relational data warehouses, and visualization.The visualization model follows concepts introduced in previous work [16].Source: §7 · p. 40