Published using Google Docs
Direct Mapping
Updated automatically every 5 minutes

1) Introduction

This document defines a default mapping from a relational database to RDF, which defines an RDF graph representation of the data in a relational database.  The default mapping can be considered as the mapping to be used when an RDB2RDF system maps a relational database to RDF without any customization.

2) Preliminaries: Generating IRIs

In the process of translating relational data into RDF, the default mapping must create IRIs identifying each tuple and the attributes in the different tables. A stem IRI should be the start point, such as http://www.example.com/DB. The following IRIs must be created:

3) The output of the default mapping

In this section, we give a description of the different components of the RDF triples that are generated by the default mappings when translating information from a relational database. In the next section, we give a detailed description of the steps in the generation of these RDF triples, which includes all the cases that are considered in the default mapping in order to properly represent the information stored in the keys and foreign keys of a relational database.

The default mapping translates each table in a relational database into RDF, considering the schema and the tuples of the table. Each tuple in the relational database produces a set of triples with a subject, predicate and object composed as follows:

4) The translation process: A detailed description

The default mapping of RDB to RDF must consider all the possible combinations of keys and foreign keys in relational databases [cite tirmizi, sequeda & miranker]. Next, we show how the default mapping works, and how the possible combinations of keys and foreign keys are taken into consideration in this mappings.

4.1) The first step of the translation process: Representing the information in primary keys

 

In its first step, the default mapping considers each table in a relational database separately, generating an RDF triple from each tuple in the table according to the following two cases:

Table has a primary key: Each column that is not part of a foreign key and with a non-null value in the tuple generates a “Literal Triple” (as described in Section 3). The subject of this triple is the “Tuple IRI” for the tuple generated according to the rule “Table with a primary key” in Section 2.

Table does not have a primary key: Each column that is not part of a foreign key and with a non-null value in the tuple generates a “Literal Triple” (as described in Section 3). The subject of this triple is the “Tuple IRI” for the tuple generated according to the rule “Table without a primary key” in Section 2.

4.2) The second step of the translation process: Representing the information in foreign keys

+++ AQUI QUEDE +++

Each relational tuple is mapped to RDF as a Reference Triples. The subject of the triple is a Tuple IRI depending if it is in case 4.1, 4.2 or 4.3. The object of the triple is a Tuple IRI from the case “Table with single primary key” for the referenced table.

 

4.5) Table with a composite Foreign Key

Each relational tuple is mapped to RDF as a Reference Triples. The subject of the triple is a Tuple IRI depending if it is in case 4.1, 4.2 or 4.3. The object of the triple is a Tuple IRI from the case “Table with composite primary key” for the referenced table.

4.6) Table with attribute that is a Primary Key and Foreign Key

....

4.7) Table is a binary relation (only 2 attributes that are the PK, each attribute is a FK)

....

4.8) Other cases

....

5) Rules for Direct Mapping RDB to RDF