Beyond Foreign-Key Connectivity: Semantic Relationship Representation for Relational Deep Learning
Abstract
Relational databases encode information through tables and primary--foreign key constraints. Although recent Relational Deep Learning (RDL) approaches represent these databases as heterogeneous graphs, a foreign-key connection primarily specifies structural connectivity between records. Its semantic interpretation may involve additional information that is not explicitly represented by connectivity alone. This paper introduces a conceptual framework for constructing relationship-aware representations from relational databases. The framework distinguishes three complementary aspects: (i) schema-defined relationship semantics, including endpoint types and foreign-key roles; (ii) association entities and explicitly available relationship-level attributes; and (iii) contextual information describing the temporal and structural circumstances of a connection. We formulate a Relationship Representation Construction (RRC) protocol that maps relational schema elements and database records to node representations, relationship descriptors, and contextual representations. A key principle of the protocol is semantic ownership: attributes are assigned to records, relationships, or context according to their meaning, rather than merely their physical location in a database table. Ambiguous attributes are not automatically promoted to relationship features. The resulting representations can be incorporated into existing relational graph learning architectures through relationship-conditioned message passing. The proposed framework is complementary to recent work on relational message passing, graph transformers, and task-dependent graph construction. We discuss its conceptual foundations, illustrate the construction protocol using a multi-table database, and identify research questions and empirical evaluations required to establish its potential benefits.
Figures & tables
| Database element | Representation | Reason |
|---|---|---|
| Customer.segment | Node feature | Describes a customer record. |
| Order.total_amount | Node feature | Describes an order record. |
| Product.category | Node feature | Describes a product record. |
| OrderItem.quantity | Association-node feature or edge attribute | Depends on whether OrderItem is retained as a node or collapsed into a relationship. |
| Customer–Order FK | Schema-level relationship descriptor | Identifies the semantic role of the connection. |
| Order date | Node feature and potentially temporal context | The date belongs to the order; it may additionally inform temporal modeling. |
| Approach | Main emphasis | Perspective of this framework |
|---|---|---|
| Relational Deep Learning [ 1 ] | Representing relational databases as heterogeneous graphs and learning over their structure. | Provides the underlying relational graph setting; we focus on the construction of semantic relationship representations. |
| RelGNN [ 2 ] | Atomic routes and composite message passing for relational dependencies. | Complementary focus on the semantic decomposition of information associated with relationships. |
| Relational Graph Transformer [ 3 ] | Transformer-based learning with multiple relational and structural information components. | Emphasizes explicit semantic ownership and mapping of relationship information. |
| Edge-Conditioned Convolution [ 5 ] | Conditioning graph filters on edge information. | Provides a possible family of operators for using the constructed relationship representation. |
| Task-dependent graph construction [ 4 ] | Adapting graph structure to downstream tasks. | Addresses what information describes a given relationship, rather than primarily which connections should exist. |