<?xml version="1.0" encoding="utf-8"?><!-- -*- mode: nxml; -*- -->
<?xml-stylesheet type="text/xsl" href="xmlspec.xsl"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.1//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd" [
<!ENTITY version "1.0">
<!ENTITY ne "≠">
<!ENTITY ouml "ö">
<!ENTITY times "×">
<!ENTITY order "£">
<!ENTITY le "≤">
<!ENTITY cellback "#d0d9fa">
<!ENTITY eacute "é">
<!ENTITY copy "©">
<!ENTITY sect "§">
<!ENTITY mdash "&#8212;">
<!ENTITY nbsp "&#160;">
]>
<spec w3c-doctype="wd">
  <header>
    <title>A Default Mapping of Relational Data to RDF</title>
    <w3c-designation>Internal Working Draft</w3c-designation>
    <w3c-doctype>Editor's Draft 30 October 2010</w3c-doctype>
    <!-- notice>Notice this!!</notice -->
    <publoc>
      $Id: alt.xml,v 1.9 2010/11/08 15:20:14 marenas Exp $
    </publoc>
    <prevlocs>
      <loc href="http://www.w3.org/2001/sw/rdb2rdf/directGraph/alt">http://www.w3.org/2001/sw/rdb2rdf/directGraph/alt</loc>
    </prevlocs>
    <latestloc>
      <loc href="http://www.w3.org/2001/sw/rdb2rdf/directGraph/alt">http://www.w3.org/2001/sw/rdb2rdf/directGraph/alt</loc>
    </latestloc>
    <authlist>
      <author>
	<name>Marcelo Arenas</name>
	<affiliation>Pontificia Universidad Cat&#243;lica de Chile</affiliation>
	<email href="mailto:marenas@ing.puc.cl">marenas@ing.puc.cl</email>
      </author>
      <author>
	<name>Eric Prud'hommeaux</name>
	<affiliation>W3C</affiliation>
	<email href="mailto:eric@w3.org">eric@w3.org</email>
      </author>
      <author>
	<name>Juan Sequeda</name>
	<affiliation>University of Texas at Austin</affiliation>
	<email href="mailto:jsequeda@cs.utexas.edu">jsequeda@cs.utexas.edu</email>
      </author>
    </authlist>
    <abstract>
      <p>
The need to share data with collaborators motivates custodians and users of relational databases (RDB) to expose relational data on the Web of Data.
This document defines a very simple <em>default mapping</em> from relational data to RDF.
This definition provides extension points for refinements within and outside of this document.
      </p>
    </abstract>
    <status>
      <p>
	<em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em>
      </p>
      <p>This is a <a href="http://www.w3.org/2005/10/Process-20051014/tr.html#RecsWD">Editors' Working Draft</a>.</p>
      <p>The documents produced by this Working Group are:</p>
      <ul>
	<li>RDB2RDF Mapping Language (R2RML) Specification</li>
	<li>RDB2RDF Mapping Language (R2RML) Conformance Tests</li>
      </ul>
      <p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a rel="disclosure" href="http://www.w3.org/2004/01/pp-impl/35463/status">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p>
    </status>
    <languages>
      <language>en</language>
    </languages>
    <revisiondesc>
      <p>
	<emph>Last Modified: $Id: alt.xml,v 1.9 2010/11/08 15:20:14 marenas Exp $</emph>
      </p>
    </revisiondesc>
  </header>
  <body>
    <div1 id="intro">
      <head>Introduction</head>
      <p>
Relational databases proliferate both because of their efficiency and their precise definitions, allowing for tools like SQL <bibref ref="SQL"/> to manipulate and examine the contents predictably and efficiently.
Resource Description Framework (RDF) <bibref ref="RDF"/> is a data format based on a web-scalable architecture for identification and interpretation of terms.
This document defines a mapping from relational representation to an RDF representation.
      </p>
      <p>
Strategies for mapping relational data to RDF abound.
The <em>direct mapping</em> defines a simple transformation, providing a basis for defining and comparing more intricate transformations.
This document includes an informal and a formal description of the transformation, as well as a number of refinements intended both to meet use cases and establish a pattern for defining extensions.
      </p>
    </div1>
    <div1 id="emp-addr">
      <head>Transformation Description (Informative)</head>
      <p>
This document defines a mapping from a relational database to RDF,
which defines an <a href="http://www.w3.org/TR/rdf-mt/#defgraph">RDF
Graph</a> representation of the data in a relational database. This is
called the <em>default mapping</em>, which can be considered as the
mapping to be used when an RDB2RDF system maps a relational database
to RDF without any customization.    
      </p>

      <div2 id="intro_example">
         <head>Transformation Example</head>
         <p>
Consider a relational database consisting of the following tables:
         </p>
         <xsd>
CREATE TABLE Addresses {
	ID INT, 
	city CHAR(10), 
	state CHAR(2), 
	PRIMARY KEY(ID)
}

CREATE TABLE People {
	ID INT, 
	fname CHAR(10), 
	addr INT, 
	PRIMARY KEY(ID), 
	FOREIGN KEY(addr) REFERENCES Addresses(ID)
}
         </xsd>
         <p>
This database is used to store information about people and the places
where they live. The following is an instance of the above relational
schema: 
         </p>
         <multicol>
	    <table class="nonRight" cellpadding="2" cellspacing="0" border="1">
	       <caption>People</caption>
	       <tbody>
	          <tr>
	             <th class="pk">PK</th>
	             <th></th>
	             <th><em>→ Addresses(ID)</em></th>
	          </tr>
	          <tr>
	             <th class="pk">ID</th>
	             <th>fname</th>
	             <th>addr</th>
	          </tr>
	          <tr>
	             <td onmouseover="hilight('emp-addr_t_7')"
		         onmouseout ="lolight('emp-addr_t_7')"
		         id="emp-addr_per7" class="pk">7</td>
	             <td onmouseover="hilight('emp-addr_t_Bob')"
		         onmouseout ="lolight('emp-addr_t_Bob')"
		         id="emp-addr_perBob">Bob</td>
	             <td onmouseover="hilight('emp-addr_t_ref18'); hilight('emp-addr_addr18')"
		         onmouseout ="lolight('emp-addr_t_ref18'); lolight('emp-addr_addr18')"
		         id="emp-addr_per18"><a href="#emp-addr_addr18">18</a></td>
	          </tr>
	          <tr>
	             <td onmouseover="hilight('emp-addr_t_8')"
		         onmouseout ="lolight('emp-addr_t_8')"
		         id="emp-addr_per8" class="pk">8</td>
	             <td onmouseover="hilight('emp-addr_t_Sue')"
		         onmouseout ="lolight('emp-addr_t_Sue')"
		         id="emp-addr_perSue" >Sue</td>
	             <td><em>NULL</em></td>
	          </tr>
	       </tbody>
	    </table>
 	    <table class="right" cellpadding="2" cellspacing="0" border="1">
	       <caption>Addresses</caption>
	       <tbody>
	          <tr>
	             <th class="pk">PK</th>
	             <th colspan="2"></th>
	          </tr>
	          <tr>
	             <th class="pk">ID</th>
	             <th>city</th>
	             <th>state</th>
 	          </tr>
	          <tr>
	             <td onmouseover="hilight('emp-addr_t_18')"
		         onmouseout ="lolight('emp-addr_t_18')"
		         id="emp-addr_addr18" class="pk">18</td>
                     <td onmouseover="hilight('emp-addr_t_Cambridge')"
		         onmouseout ="lolight('emp-addr_t_Cambridge')"
		         id="emp-addr_addrCamb">Cambridge</td>
	             <td onmouseover="hilight('emp-addr_t_MA')"
		         onmouseout ="lolight('emp-addr_t_MA')"
		         id="emp-addr_addrMA">MA</td>
  	          </tr>
	       </tbody>
	    </table>
         </multicol>
                  <p>
In the following sections, we explain how the default mapping
translates a relational database into an RDF graph. In
particular, we show that for the above relational schema and database
instance, the output of the default mapping is the 
following set of triples:
         </p>
         <turtle>
@base &lt;http://foo.example/DB/&gt; .
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .
@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .

<triple 
	id="emp-addr_type_7"        >&lt;People/ID=7&gt; &lt;rdf:type&gt; &lt;People&gt; .</triple>
<triple onmouseover="hilight('emp-addr_per7')"
	onmouseout ="lolight('emp-addr_per7')"
	id="emp-addr_t_7"        >&lt;People/ID=7&gt; &lt;People/ID&gt; 7 .</triple>
<triple onmouseover="hilight('emp-addr_perBob')"
	onmouseout ="lolight('emp-addr_perBob')"
	id="emp-addr_t_Bob"      >&lt;People/ID=7&gt; &lt;People/fname&gt; "Bob" .</triple>
<triple onmouseover="hilight('emp-addr_per18')"
	onmouseout ="lolight('emp-addr_per18')"
	id="emp-addr_t_ref18">&lt;People/ID=7&gt; &lt;People/addr&gt; &lt;Addresses/ID=18&gt; .</triple>

<triple 
	id="emp-addr_type_8"        >&lt;People/ID=8&gt; &lt;rdf:type&gt; &lt;People&gt; .</triple>
<triple onmouseover="hilight('emp-addr_per8')"
	onmouseout ="lolight('emp-addr_per8')"
	id="emp-addr_t_8"        >&lt;People/ID=8&gt; &lt;People/ID&gt; 8 .</triple>
<triple onmouseover="hilight('emp-addr_perSue')"
	onmouseout ="lolight('emp-addr_perSue')"
	id="emp-addr_t_Sue"      >&lt;People/ID=8&gt; &lt;People/fname&gt; "Sue" .</triple>

<triple 
	id="emp-addr_type_18"        >&lt;Addresses/ID=18&gt; &lt;rdf:type&gt; &lt;Addresses&gt; .</triple>
<triple onmouseover="hilight('emp-addr_addr18')"
	onmouseout ="lolight('emp-addr_addr18')"
	id="emp-addr_t_18"       >&lt;Addresses/ID=18&gt; &lt;Addresses/ID&gt; 18 .</triple>
<triple onmouseover="hilight('emp-addr_addrCamb')"
	onmouseout ="lolight('emp-addr_addrCamb')"
	id="emp-addr_t_Cambridge">&lt;Addresses/ID=18&gt; &lt;Addresses/city&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('emp-addr_addrMA')"
	onmouseout ="lolight('emp-addr_addrMA')"
	id="emp-addr_t_MA"       >&lt;Addresses/ID=18&gt; &lt;Addresses/state&gt; "MA" .</triple>
         </turtle>
         
         </div2>

      <div2 id="gen_iri">
         <head>Preliminaries: Generating <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">IRIs</a></head>
         <p>
In the process of translating relational data into RDF, the default
mapping must create <a
href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">IRIs</a>
for identifying tables, the columns in a table, and each row in a
table. In this document we define <code>http://foo.example/DB</code> as the base URI. All the examples in this document will contain relative URIs which are to be understood as relative to this base URI.
The following are the IRIs that need to be generated:
         </p>     
         <ulist id="rules_iri">
	    <item id="table_iri">
               <em>Table IRI:</em> 
The IRI that identifies a table is created by
concatenating the base IRI with the table name. Specifically, if
<code>base_IRI</code> is the base IRI and <code>table_name</code> is
the table name, then <code>base_IRI/table_name</code> is the Table IRI for
the table.
            </item>
	    <item id="column_iri">
               <em>Column IRI:</em> 
               <ulist>
                  <item id="column_iri_sc">
                     <em>Single-column IRI:</em>
The IRI that identifies a column of a table is created by
concatenating the base IRI with the table name and the column
name. Specifically, if <code>base_IRI</code> is the base IRI, 
<code>table_name</code> is the table name and <code>column_name</code>
is the column name, then <code>base_IRI/table_name/column_name</code>
is the Column IRI for the column.
                  </item>
                  <item id="column_iri_mc">
                     <em>Multi-column IRI:</em>
The IRI that identifies a sequence of two or more columns of a table
is created by concatenating the base IRI with the  table name and the
column names. Specifically, if <code>base_IRI</code> is the base IRI,
<code>table_name</code> is the table name and  <code>column_name_1</code>,
<code>column_name_2</code>, ..., <code>column_name_k</code> is a
sequence of k columns (k > 1), then
<code>base_IRI/table_name/column_name_1,column_name_2,...,column_name_k</code>
is the Column IRI for the columns.
                  </item>
               </ulist>
            </item>
            <item id="row_iri">
               <em>Row RDF Node:</em>
               <ulist>
                  <item id="row_iri_spk">
<em>Row RDF Node for a row with a single-column primary key:</em> The IRI
that  identifies a row is created by concatenating the base IRI with
the table name, the column name of the primary key and the value of
the row in that column. 
Specifically, if
<code>base_IRI</code> is the base IRI, <code>table_name</code> is the
table name, <code>column_name</code> is the column name of the primary key and
<code>value</code> is the value of the row in that column, then  
<code>base_IRI/table_name/column_name=value</code>
is the Row RDF Node (or Row IRI) for the row.
                  </item> 
                  <item id="row_iri_mpk">
<em>Row RDF Node for a row with a multi-column primary key:</em> 
The IRI that  identifies a row is created by concatenating the base
IRI with the table name, the names of the columns that constitute the
primary key and the values of the row in those columns. Specifically,
if <code>base_IRI</code> is the 
base IRI, <code>table_name</code> is the table name,
<code>column_name_1</code>, <code>column_name_2</code>, ...,
<code>column_name_k</code> is the sequence of k columns (k > 1) that
constitute the primary key, and <code>value_1</code>,
<code>value_2</code>, ..., <code>value_k</code> is the sequence of
values of the columns that constitute the primary key of the row, then
<code>base_IRI/table_name/column_name_1=value_1,column_name_2=value_2,...,column_name_k=value_k</code>
is the Row RDF Node (or Row IRI) for the row.
                  </item> 
                  <item id="row_iri_bn">
<em>Row RDF Node for a row without a primary key:</em> A fresh <a
href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">Blank
Node</a> is created, which is used as the Row RDF Node for the row.

                  </item>
               </ulist>
            </item>
         </ulist>      
         <p>
For example, consider again the relational schema and the instance
given in Section <a href="#intro_example">Transformation Example</a>. Given the
base IRI <code>http://foo.example/DB</code>, the following are some
the IRIs that are used when translating the above relational data into
RDF.  
         </p>        
         <ulist>
            <item>
               <p>
For the table <em>People</em>, the following IRIs are considered
in the translation process:            
               </p>
               <ulist>
                  <item>
                     <p>
                        <em>Table IRI:</em>
                     </p>
                     <xsd>
&lt;People&gt; 
                     </xsd>
                  </item>
                  <item>  
                     <p>
                        <em>Column IRIs:</em>
                     </p>
                     <xsd>
&lt;People/ID&gt; 
&lt;People/fname&gt; 
&lt;People/addr&gt;  
                     </xsd>
                  </item>
                  <item>
                     <p>
                        <em>Row IRIs:</em>
                     </p>
                     <xsd>
&lt;People/ID=7&gt; 
&lt;People/ID=8&gt;
                     </xsd>
                  </item>
               </ulist> 
            </item>
            <item>
               <p>
For the table <em>Addresses</em>, the following IRIs are considered
in the translation process:            
               </p>
               <ulist>
                  <item>
                     <p>
                        <em>Table IRI:</em>
                     </p>
                     <xsd>
&lt;Addresses&gt; 
                     </xsd>
                  </item>
                  <item>
                     <p>
                        <em>Columns IRIs:</em>
                     </p>
                     <xsd>
&lt;Addresses/ID&gt; 
&lt;Addresses/city&gt;  
&lt;Addresses/state&gt; 
                     </xsd>
                  </item>
                  <item>
                     <p>
                        <em>Row IRI:</em>
                     </p>
                     <xsd>
&lt;Addresses/ID=18&gt;
                     </xsd>
                  </item>
               </ulist>
            </item>
         </ulist>
      </div2>


      <div2 id="output">
         <head>The Translation Process</head>
         <p>
In this section, we describe the three types of triples that are
generated by the default mapping when translating information from a
relational database, showing the different components of each one of
these types of triples. As shown below, the default mapping considers the
possible combinations of keys and foreign keys in relational databases
[<a href="#KEY-COMB">KEY-COMB</a>] when generating these triples. In
this section, we also present examples of the triples that are generated by
the default mapping when considering some of these combinations.
         </p>   
         <p>
The default mapping translates each table in a relational database
into RDF, considering the schema and the rows of the table. Each
row in the relational database produces a set of triples with a
subject, predicate and object composed as follows: 
         </p>
         <ulist>
         <item id="table_triple"> 
<em>Table Triples:</em> Each row in a table generates a triple with the following:  
               <ulist>
                  <item>
<em>Subject:</em> the <a href="#row_iri">Row RDF Node</a> for the row
                  </item>
                  <item> 
<em>Predicate:</em> the rdf:type property
                  </item>
                  <item>
<em>Object:</em> the <a href="#table_iri">Table IRI</a> for the table
                  </item>
               </ulist>
            </item>
            <item id="literal_triple"> 
<em>Literal Triples:</em> Each column with a non-null value, including
the column(s) that constitute the primary key, and that
either is not the only constituent of a foreign key or is the only
constituent of a foreign key that references a candidate key,
generates a triple with the following:  
               <ulist>
                  <item>
<em>Subject:</em> the <a href="#row_iri">Row RDF Node</a> for the row
                  </item>
                  <item> 
<em>Predicate:</em> the <a href="#column_iri">Column IRI</a> for the
column 
                  </item>
                  <item>
<em>Object:</em> an RDF Literal for the value of the row in the
column, with an XML Schema datatype corresponding to the SQL datatype
of that column [<a href="#sec-sql2xsd">SQL2XSD</a>]
                  </item>
               </ulist>
            </item>
            <item id="reference_triple"> 
<em>Reference Triples:</em> Columns that constitute a foreign key and with
non-null values in the row generate triples with the following: 
               <ulist>
                  <item> 
<em>Subject:</em> the <a href="#row_iri">Row RDF Node </a> for the row
                  </item>
                  <item> 
<em>Predicate:</em> the <a href="#column_iri">Column IRI</a> for the
columns that constitute the foreign key 
                  </item>
                  <item>
<em>Object:</em> the <a href="#row_iri">Row RDF Node</a> for the
corresponding referenced row (according to the foreign key) 
                  </item>
               </ulist>
            </item>
         </ulist>
         <p>
As an example of the above types of triples, we show how the 11 triples
in the example of Section <a href="#intro_example">Transformation
Example</a> are classified into the above categories:
         </p>
         <ulist>
            <item>
               <p>
Triples generated from table <em>People</em>:
               </p>
               <ulist>
                  <item id="tt_people">
                     <p>
                        <em><a href="#table_triple">Table Triples:</a></em>
                     </p>
                     <turtle>
<triple 
	id="emp-addr_type_7"        >&lt;People/ID=7&gt; &lt;rdf:type&gt; &lt;People&gt; .</triple>              
<triple 
	id="emp-addr_type_8"        >&lt;People/ID=8&gt; &lt;rdf:type&gt; &lt;People&gt; .</triple>
                     </turtle>
                  </item>
                  <item id="lt_people">
                     <p>
                        <em><a href="#literal_triple">Literal Triples:</a></em> 
                     </p>
                     <turtle>
<triple onmouseover="hilight('emp-addr_per7')"
	onmouseout ="lolight('emp-addr_per7')"
	id="emp-addr_t_7"        >&lt;People/ID=7&gt; &lt;People/ID&gt; 7 .</triple>
<triple onmouseover="hilight('emp-addr_perBob')"
	onmouseout ="lolight('emp-addr_perBob')"
	id="emp-addr_t_Bob"      >&lt;People/ID=7&gt; &lt;People/fname&gt; "Bob" .</triple>
<triple onmouseover="hilight('emp-addr_per8')"
	onmouseout ="lolight('emp-addr_per8')"
	id="emp-addr_t_8"        >&lt;People/ID=8&gt; &lt;People/ID&gt; 8 .</triple>
<triple onmouseover="hilight('emp-addr_perSue')"
	onmouseout ="lolight('emp-addr_perSue')"
	id="emp-addr_t_Sue"      >&lt;People/ID=8&gt; &lt;People/fname&gt; "Sue" .</triple>
                     </turtle>
                  </item>
                  <item id="rt_people">
                     <p>
                        <em><a href="#reference_triple">Reference Triple:</a></em> 
                     </p>
                     <turtle>
<triple onmouseover="hilight('emp-addr_per18')"
	onmouseout ="lolight('emp-addr_per18')"
	id="emp-addr_t_ref18">&lt;People/ID=7&gt; &lt;People/addr&gt; &lt;Addresses/ID=18&gt; .</triple>
                     </turtle>
                  </item>
               </ulist>
            </item> 
            <item>
               <p>
Triples generated from table <em>Addresses</em>:
               </p>
               <ulist>
                  <item id="tt_addresses">
                     <p>
                        <em><a href="#table_triple">Table Triple:</a></em>
                     </p>
                     <turtle>
<triple 
	id="emp-addr_type_18"        >&lt;Addresses/ID=18&gt; &lt;rdf:type&gt; &lt;Addresses&gt; .</triple>
                     </turtle>
                  </item>         
                  <item id="lt_addresses">
                     <p>
                        <em><a href="#literal_triple">Literal Triples:</a></em> 
                     </p>
                     <turtle>
<triple onmouseover="hilight('emp-addr_addr18')"
	onmouseout ="lolight('emp-addr_addr18')"
	id="emp-addr_t_18"       >&lt;Addresses/ID=18&gt; &lt;Addresses/ID&gt; 18 .</triple>
<triple onmouseover="hilight('emp-addr_addrCamb')"
	onmouseout ="lolight('emp-addr_addrCamb')"
	id="emp-addr_t_Cambridge">&lt;Addresses/ID=18&gt; &lt;Addresses/city&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('emp-addr_addrMA')"
	onmouseout ="lolight('emp-addr_addrMA')"
	id="emp-addr_t_MA"       >&lt;Addresses/ID=18&gt; &lt;Addresses/state&gt; "MA" .</triple>
                     </turtle>
                  </item>
               </ulist>
            </item> 
         </ulist>
	    <p>
More complex relational schemas include multi-column primary keys and
potentially  
incomplete foreign keys. Besides, SQL foreign keys may reference
primary or candidate keys in the referenced relations. Thus, as a
second example, assume that a table <em>Department</em> is
included in the relational schema given in Section <a
href="#intro_example">Transformation Example</a>, which is used to
store information about departments. Besides,
assume that columns <em>deptName</em> and <em>deptCity</em>
are added to the table <em>People</em>, for
storing the name of the department where a person works, and the city
where this department is located. The following is the schema of the
augmented database:
	   </p>
         <xsd>
CREATE TABLE Addresses {
	ID INT, 
	city CHAR(10), 
	state CHAR(2), 
	PRIMARY KEY(ID)
}

CREATE TABLE Deparment {
	ID INT, 
	name CHAR(10), 
	city CHAR(10), 
	manager INT, 
	PRIMARY KEY(ID), 
	UNIQUE (name, city), 
	FOREIGN KEY(manager) REFERENCES People(ID)
}

CREATE TABLE People {
	ID INT, 
	fname CHAR(10), 
	addr INT, 
	deptName CHAR(10), 
	deptCity CHAR(10), 
	PRIMARY KEY(ID), 
	FOREIGN KEY(addr) REFERENCES Addresses(ID), 
	FOREIGN KEY(deptName, deptCity) REFERENCES Department(name, city) 
}
         </xsd>	   
	 <p>  
The following is an instance of the augmented relational schema:	   
         </p>
	   <multicol>
	      <table class="nonRight" cellpadding="2" cellspacing="0" border="1">
	         <caption>People</caption>
	         <tbody>
	            <tr>
                       <th class="pk">PK</th>
		       <th></th>
                       <th> → Addresses(ID)</th>
		       <th colspan="2">→ Department(name, city)</th>
	            </tr>
	            <tr>
		       <th class="pk">ID</th>
		       <th>fname</th>
		       <th>addr</th>
		       <th>deptName</th>
		       <th>deptCity</th>
	            </tr>
	            <tr>
		       <td onmouseover="hilight('multi-key_t_7');"
		           onmouseout ="lolight('multi-key_t_7');"
		           id="multi-key_per7" class="pk">7</td>
		       <td onmouseover="hilight('multi-key_t_Bob');"
		           onmouseout ="lolight('multi-key_t_Bob');"
		           id="multi-key_perBob">Bob</td>
		       <td onmouseover="hilight('multi-key_t_ref18'); hilight('multi-key_addr18')"
		           onmouseout ="lolight('multi-key_t_ref18'); lolight('multi-key_addr18')"
		           id="multi-key_per18"><a href="#multi-key_addr18">18</a></td>
		       <td onmouseover="hilight('multi-key_t_refaccounting'); hilight('multi-key_t_refaccCa'); hilight('multi-key_deptacc');"
		           onmouseout ="lolight('multi-key_t_refaccounting'); lolight('multi-key_t_refaccCa'); lolight('multi-key_deptacc');"
		           id="multi-key_peraccounting"><a href="#multi-key_deptacc">accounting</a></td>
		       <td onmouseover="hilight('multi-key_t_refCambridge'); hilight('multi-key_t_refaccCa'); hilight('multi-key_deptCam')"
		           onmouseout ="lolight('multi-key_t_refCambridge'); lolight('multi-key_t_refaccCa'); lolight('multi-key_deptCam')"
		           id="multi-key_perCambridge"><a href="#multi-key_deptCam">Cambridge</a></td>
	            </tr>
	            <tr>
                       <td onmouseover="hilight('multi-key_t_8');"
		           onmouseout ="lolight('multi-key_t_8');"
		           id="multi-key_per8" class="pk"><a id="multi-key_per8">8</a></td>
		       <td onmouseover="hilight('multi-key_t_Sue');"
		           onmouseout ="lolight('multi-key_t_Sue');"
		           id="multi-key_perSue">Sue</td>
		       <td><em>NULL</em></td>
		       <td><em>NULL</em></td>
		       <td><em>NULL</em></td>
	            </tr>
	         </tbody>
	     </table>
	     <table class="nonRight" cellpadding="2" cellspacing="0" border="1">
	        <caption>Addresses</caption>
	        <tbody>
	           <tr>
		      <th class="pk">PK</th>
		      <th colspan="2"></th>
	           </tr>
	           <tr>
		      <th class="pk">ID</th>
		      <th>city</th>
		      <th>state</th>
	           </tr>
	           <tr>
		      <td onmouseover="hilight('multi-key_t_18');"
		          onmouseout ="lolight('multi-key_t_18');"
		          id="multi-key_addr18" class="pk">18</td>
		      <td onmouseover="hilight('multi-key_t_Cambridge');"
		          onmouseout ="lolight('multi-key_t_Cambridge');"
		          id="multi-key_addrCamb">Cambridge</td>
		      <td onmouseover="hilight('multi-key_t_MA');"
		          onmouseout ="lolight('multi-key_t_MA');"
		          id="multi-key_addrMA">MA</td>
	           </tr>
	        </tbody>
	     </table>
	     <table class="right" cellpadding="2" cellspacing="0" border="1">
	        <caption>Department</caption>
	        <tbody>
	           <tr>
		      <th class="pk">PK</th>
		      <th colspan="2">Unique Key</th>
		      <th>→ People(ID)</th>
	           </tr>
	           <tr>
		      <th class="pk">ID</th>
		      <th>name</th>
		      <th>city</th>
		      <th>manager</th>
	           </tr>
	           <tr>
		      <td onmouseover="hilight('multi-key_t_23');"
		          onmouseout ="lolight('multi-key_t_23');"
		          id="multi-key_dept23" class="pk">23</td>
		      <td onmouseover="hilight('multi-key_t_accounting');"
		          onmouseout ="lolight('multi-key_t_accounting');"
		          id="multi-key_deptacc">accounting</td>
		      <td onmouseover="hilight('multi-key_t_DeptCam');"
		          onmouseout ="lolight('multi-key_t_DeptCam');"
		          id="multi-key_deptCam">Cambridge</td>
		      <td onmouseover="hilight('multi-key_t_ref8'); hilight('multi-key_per8')"
		          onmouseout ="lolight('multi-key_t_ref8'); lolight('multi-key_per8')"
		          id="multi-key_dept8"><a href="#multi-key_per8">8</a></td>
	           </tr>
	        </tbody>
	     </table>
	   </multicol>
           <p>
In this example, the default mapping generates the following <a
href="#table_triple">Table Triples:</a>
           </p>
      	   <turtle>
<triple> &lt;People/ID=7&gt; &lt;rdf:type&gt; &lt;People&gt; .</triple>
<triple> &lt;People/ID=8&gt; &lt;rdf:type&gt; &lt;People&gt; .</triple>
<triple> &lt;Addresses/ID=18&gt; &lt;rdf:type&gt; &lt;Addresses&gt; .</triple>
<triple class="new"> &lt;Department/ID=23&gt; &lt;rdf:type&gt; &lt;Department&gt; .</triple> 
            </turtle>
           <p>
The green triple above is generated by considering the new elements
in the augmented database. Moreover, the default mapping generates the
following <a href="#literal_triple">Literal Triples</a> in this example:
           </p>
      	   <turtle>
<triple onmouseover="hilight('multi-key_per7')"
	onmouseout ="lolight('multi-key_per7')"
	id="multi-key_t_7">&lt;People/ID=7&gt; &lt;People/ID&gt; 7 .</triple>
<triple onmouseover="hilight('multi-key_perBob')"
	onmouseout ="lolight('multi-key_perBob')"
	id="multi-key_t_Bob">&lt;People/ID=7&gt; &lt;People/fname&gt; "Bob" .</triple>
<triple onmouseover="hilight('multi-key_peraccounting')"
	onmouseout ="lolight('multi-key_peraccounting')"
	id="multi-key_t_refaccounting" class="new">&lt;People/ID=7&gt; &lt;People/deptName&gt; "accounting" .</triple>
<triple onmouseover="hilight('multi-key_perCambridge')"
	onmouseout ="lolight('multi-key_perCambridge')"
	id="multi-key_t_refCambridge" class="new">&lt;People/ID=7&gt; &lt;People/deptCity&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('multi-key_per8')"
	onmouseout ="lolight('multi-key_per8')"
	id="multi-key_t_8">&lt;People/ID=8&gt; &lt;People/ID&gt; 8 .</triple>
<triple onmouseover="hilight('multi-key_perSue')"
	onmouseout ="lolight('multi-key_perSue')"
	id="multi-key_t_Sue">&lt;People/ID=8&gt; &lt;People/fname&gt; "Sue" .</triple>

<triple onmouseover="hilight('multi-key_addr18')"
	onmouseout ="lolight('multi-key_addr18')"
	id="multi-key_t_18">&lt;Addresses/ID=18&gt; &lt;Addresses/ID&gt; 18 .</triple>
<triple onmouseover="hilight('multi-key_addrCamb')"
	onmouseout ="lolight('multi-key_addrCamb')"
	id="multi-key_t_Cambridge">&lt;Addresses/ID=18&gt; &lt;Addresses/city&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('multi-key_addrMA')"
	onmouseout ="lolight('multi-key_addrMA')"
	id="multi-key_t_MA">&lt;Addresses/ID=18&gt; &lt;Addresses/state&gt; "MA" .</triple>

<triple onmouseover="hilight('multi-key_dept23');"
	onmouseout ="lolight('multi-key_dept23');"
	id="multi-key_t_23" class="new">&lt;Department/ID=23&gt; &lt;Department/ID&gt; 23 .</triple>
<triple onmouseover="hilight('multi-key_deptacc');"
	onmouseout ="lolight('multi-key_deptacc');"
	id="multi-key_t_accounting" class="new">&lt;Department/ID=23&gt; &lt;Department/name&gt; "accounting" .</triple>
<triple onmouseover="hilight('multi-key_deptCam');"
	onmouseout ="lolight('multi-key_deptCam');"
	id="multi-key_t_DeptCam" class="new">&lt;Department/ID=23&gt; &lt;Department/city&gt; "Cambridge" .</triple>
            </turtle>
            <p>
The green triples above are generated by
considering the new elements in the augmented database. Notice that 
although <em>deptName</em> is a column of table <em>People</em>
that is part of a foreign key, the <a href="#literal_triple">Literal
Triple</a>
            </p>
            <turtle> 
<triple onmouseover="hilight('multi-key_peraccounting')"
	onmouseout ="lolight('multi-key_peraccounting')"
	id="multi-key_t_refaccounting">&lt;People/ID=7&gt; &lt;People/deptName&gt; "accounting" .</triple>
            </turtle>
            <p>
is generated by the default mapping because <em>deptName</em> is not
the sole column of a foreign key of table <em>People</em>.
            </p>
            <p>
In this example, the translation process concludes with the generation
of the following <a href="#reference_triple">Reference Triples:</a>
            </p>
  	    <turtle>
<triple onmouseover="hilight('multi-key_per18')"
	onmouseout ="lolight('multi-key_per18')"
	>&lt;People/ID=7&gt; &lt;People/addr&gt; &lt;Addresses/ID=18&gt; .</triple>
<triple onmouseover="hilight('multi-key_peraccounting'); hilight('multi-key_perCambridge')"
	onmouseout ="lolight('multi-key_peraccounting'); lolight('multi-key_perCambridge')" 
        class = "new"
	>&lt;People/ID=7&gt; &lt;People/deptName,deptCity&gt; &lt;Department/ID=23&gt; .</triple>
<triple onmouseover="hilight('multi-key_dept8');"
	onmouseout ="lolight('multi-key_dept8');"
        class = "new"
	>&lt;Department/ID=23&gt; &lt;Department/manager&gt; &lt;People/ID=8&gt; .</triple>
	    </turtle>            
            <p>
As in the previous cases, the green triples above are generated by
considering the new elements in the augmented database. Notice that 
the second triple above is generated by considering a foreign key
referencing a candidate key (instead of the primary key):
<em>(deptName, deptCity)</em> is a multi-column foreign key in the table
<em>People</em> which references the multi-column candidate key
<em>(name, city)</em> in the table <em>Department</em>.
            </p>
            <p>
As a third example, we note that primary keys may also be
composite. If the primary key for <em>Department</em> were
(<em>name</em>, <em>city</em>) instead of <em>ID</em> in the running
example, then the identifier for the only row in this table would be
<code>&lt;Department/name=accounting,city=Cambridge&gt;</code>,
and the following rows would have been generated by the default
mapping: 
            </p>
            <turtle>
<triple onmouseover="hilight('multi-key_dept23');"
	onmouseout ="lolight('multi-key_dept23');"
	id="multi-key_t_23">&lt;Department/name=accounting,city=Cambridge&gt; &lt;Department/ID&gt; 23 .</triple> 
<triple onmouseover="hilight('multi-key_deptacc');"
	onmouseout ="lolight('multi-key_deptacc');"
	id="multi-key_t_accounting">&lt;Department/name=accounting,city=Cambridge&gt; &lt;Department/name&gt; "accounting" .</triple>
<triple onmouseover="hilight('multi-key_deptCam');"
	onmouseout ="lolight('multi-key_deptCam');"
	id="multi-key_t_DeptCam">&lt;Department/name=accounting,city=Cambridge&gt; &lt;Department/city&gt; "Cambridge" .</triple>
            </turtle>
            <p>
As a final example, lets assume that a table <em>Tweets</em> is also
included in the database considered in this section, which keeps
track of tweets in Twitter. The following is the schema of this table:
             </p>
             <xsd>
CREATE TABLE Tweets {
	tweeter INT,
	when TIMESTAMP,
	text CHAR(140),
	FOREIGN KEY(tweeter) REFERENCES People(ID)
}
            </xsd> 
            <p>
The following is an instance of table <em>Tweets</em>: 
            </p>
	    <multicol>
	       <table class="nonRight" cellpadding="2" cellspacing="0" border="1">
	          <caption>Tweets</caption>
	          <tbody>
	             <tr>
		        <th colspan="1">→ People(ID)</th>
		        <th colspan="2"></th>
	             </tr>
	             <tr>
		        <th>tweeter</th>
		        <th>when</th>
		        <th>text</th>
	             </tr>
	             <tr>
		        <td onmouseover="hilight('no-pk_t_a7')"
		            onmouseout ="lolight('no-pk_t_a7')"
		            id="no-pk_tweeta7" class="fk"><a href="#person7">7</a></td>
		        <td onmouseover="hilight('no-pk_t_adt')"
		            onmouseout ="lolight('no-pk_t_adt')"
		            id="no-pk_tweetadt">2010-08-30T01:33</td>
		        <td onmouseover="hilight('no-pk_t_atext')"
		            onmouseout ="lolight('no-pk_t_atext')"
		            id="no-pk_tweetatext">I really like lolcats.</td>
	             </tr>
	             <tr>
		        <td onmouseover="hilight('no-pk_t_b7')"
		            onmouseout ="lolight('no-pk_t_b7')"
		            id="no-pk_tweetb7" class="fk"><a href="#person7">7</a></td>
		        <td onmouseover="hilight('no-pk_t_bdt')"
		            onmouseout ="lolight('no-pk_t_bdt')"
		            id="no-pk_tweetbdt">2010-08-30T09:01</td>
		        <td onmouseover="hilight('no-pk_t_btext')"
		            onmouseout ="lolight('no-pk_t_btext')"
		            id="no-pk_tweetbtext">I take it back.</td>
	             </tr>
	          </tbody>
	       </table>
	    </multicol>
            <p>
Given that table <em>Tweets</em> does not have a primary key, each
row in this table is identified by a Blank Node. In fact, when
translating the above table the default mapping will
generate the following triples: 
            </p>
            <turtle>
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

<triple onmouseover="hilight('no-pk_tweetadt')"
	onmouseout ="lolight('no-pk_tweetadt')"
	id="no-pk_t_adt">_:a &lt;Tweets/when&gt; "2010-08-30T01:33"^^xsd:dateTime .</triple>
<triple onmouseover="hilight('no-pk_tweetatext')"
	onmouseout ="lolight('no-pk_tweetatext')"
	id="no-pk_t_atext">_:a &lt;Tweets/text&gt; "I really like lolcats." .</triple>

<triple onmouseover="hilight('no-pk_tweetbdt')"
	onmouseout ="lolight('no-pk_tweetbdt')"
	id="no-pk_t_bdt">_:b &lt;Tweets/when&gt; "2010-08-30T09:01"^^xsd:dateTime .</triple>
<triple onmouseover="hilight('no-pk_tweetbtext')"
	onmouseout ="lolight('no-pk_tweetbtext')"
	id="no-pk_t_btext">_:b &lt;Tweets/text&gt; "I take it back." .</triple>
	    </turtle>
         

            <p>
We conclude this section by showing the output of the default
mapping in the complete example:
            </p>
  	    <turtle>
@base &lt;http://foo.example/DB/&gt; .
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

<triple onmouseover="hilight('multi-key_per7')"
	onmouseout ="lolight('multi-key_per7')"
	>&lt;People/ID=7&gt; &lt;People/ID&gt; 7 .</triple>
<triple onmouseover="hilight('multi-key_perBob')"
	onmouseout ="lolight('multi-key_perBob')"
	>&lt;People/ID=7&gt; &lt;People/fname&gt; "Bob" .</triple>
<triple onmouseover="hilight('multi-key_per18')"
	onmouseout ="lolight('multi-key_per18')"
	>&lt;People/ID=7&gt; &lt;People/addr&gt; &lt;Addresses/ID=18&gt; .</triple>
<triple onmouseover="hilight('multi-key_peraccounting')"
	onmouseout ="lolight('multi-key_peraccounting')"
	>&lt;People/ID=7&gt; &lt;People/deptName&gt; "accounting" .</triple>
<triple onmouseover="hilight('multi-key_perCambridge')"
	onmouseout ="lolight('multi-key_perCambridge')"
	>&lt;People/ID=7&gt; &lt;People/deptCity&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('multi-key_peraccounting'); hilight('multi-key_perCambridge')"
	onmouseout ="lolight('multi-key_peraccounting'); lolight('multi-key_perCambridge')"
	>&lt;People/ID=7&gt; &lt;People/deptName,deptCity&gt; &lt;Department/ID=23&gt; .</triple>
<triple onmouseover="hilight('multi-key_per8')"
	onmouseout ="lolight('multi-key_per8')"
	>&lt;People/ID=8&gt; &lt;People/ID&gt; 8 .</triple>
<triple onmouseover="hilight('multi-key_perSue')"
	onmouseout ="lolight('multi-key_perSue')"
	>&lt;People/ID=8&gt; &lt;People/fname&gt; "Sue" .</triple>

<triple onmouseover="hilight('multi-key_addr18')"
	onmouseout ="lolight('multi-key_addr18')"
	>&lt;Addresses/ID=18&gt; &lt;Addresses/ID&gt; 18 .</triple>
<triple onmouseover="hilight('multi-key_addrCamb')"
	onmouseout ="lolight('multi-key_addrCamb')"
	>&lt;Addresses/ID=18&gt; &lt;Addresses/city&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('multi-key_addrMA')"
	onmouseout ="lolight('multi-key_addrMA')"
	>&lt;Addresses/ID=18&gt; &lt;Addresses/state&gt; "MA" .</triple>

<triple onmouseover="hilight('multi-key_dept23');"
	onmouseout ="lolight('multi-key_dept23');"
	>&lt;Department/ID=23&gt; &lt;Department/ID&gt; 23 .</triple>
<triple onmouseover="hilight('multi-key_deptacc');"
	onmouseout ="lolight('multi-key_deptacc');"
	>&lt;Department/ID=23&gt; &lt;Department/name&gt; "accounting" .</triple>
<triple onmouseover="hilight('multi-key_deptCam');"
	onmouseout ="lolight('multi-key_deptCam');"
	>&lt;Department/ID=23&gt; &lt;Department/city&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('multi-key_dept8');"
	onmouseout ="lolight('multi-key_dept8');"
	>&lt;Department/ID=23&gt; &lt;Department/manager&gt; &lt;People/ID=8&gt; .</triple>

<triple onmouseover="hilight('no-pk_tweeta7')"
	onmouseout ="lolight('no-pk_tweeta7')"
	>_:a &lt;Tweets/tweeter&gt; &lt;People/ID=7&gt; .</triple>
<triple onmouseover="hilight('no-pk_tweetadt')"
	onmouseout ="lolight('no-pk_tweetadt')"
	>_:a &lt;Tweets/when&gt; "2010-08-30T01:33"^^xsd:dateTime .</triple>
<triple onmouseover="hilight('no-pk_tweetatext')"
	onmouseout ="lolight('no-pk_tweetatext')"
	>_:a &lt;Tweets/text&gt; "I really like lolcats." .</triple>
<triple onmouseover="hilight('no-pk_tweetb7')"
	onmouseout ="lolight('no-pk_tweetb7')"
	>_:b &lt;Tweets/tweeter&gt; &lt;People/ID=7&gt; .</triple>
<triple onmouseover="hilight('no-pk_tweetbdt')"
	onmouseout ="lolight('no-pk_tweetbdt')"
	>_:b &lt;Tweets/when&gt; "2010-08-30T09:01"^^xsd:dateTime .</triple>
<triple onmouseover="hilight('no-pk_tweetbtext')"
	onmouseout ="lolight('no-pk_tweetbtext')"
	>_:b &lt;Tweets/text&gt; "I take it back." .</triple>
	   </turtle>
        
         
      </div2>

    </div1>
    <div1 id="default_mapping_rules">
      <head>Default Mapping as Rules</head>
      <p>
      In this section, we formally present the Default Mapping as
rules in Datalog syntax. The left hand side of each rule is the RDF
Triple output. The right hand side of each rule consists of a sequence of
predicates from the relational database and built-in predicates. The
built-in predicates are:        
      <ulist>
               <item id="generateTableIRI">generateTableIRI(x, y): Given a table name x, it generates the <a href="#table_iri">Table IRI</a> y
               </item>
               <item id="generateColumnIRI">generateColumnIRI(x, y,
z): Given a table name x and a non-empty list of columns y, it generates the <a href="#column_iri">Column IRI</a> z
               </item>
               <item
id="generateRowIRI">generateRowIRI(x, y<sub>1</sub>,
y<sub>2</sub>, z): Given a table name x, a non-empty list
y<sub>1</sub> of columns and a non-empty list y<sub>2</sub> of values
(for the columns in y<sub>1</sub>), it generates the <a
href="#row_iri">Row RDF Node</a> (or Row IRI) z.   
               </item>
               <item
id="generateRowBlankNode">generateRowBlankNode(x, y, z):
Given a table name x without a primary key and the list y of values
for a row of table x, it generates the <a href="#row_iri">Row RDF
Node</a> z for the row (which is a <a
href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">Blank
Node</a> in this case).
               </item>
            </ulist>
      
       </p>
       <p>
Consider again the example from Section <a href="#intro_example">Transformation
Example</a>. It should be noticed that in the rules presented in
this section, a formula of the form Addresses(x, y, z) indicates that
variables x, y 
and z are used to store the values of a row in the three columns of
the table
Addresses (according to the order specified in the schema of the
table, that is, x, y and z store the values of ID, city and state,
respectively). Moreover, double quotes are used in the rules to refer
to the string with the name of a table or a column. For example, a
formula of the form  generateRowIRI("Addresses", ["ID"], [x], p) is
used to generate the <a href="#row_iri">Row RDF Node</a> (or Row IRI)
 p for the row of table "Addresses" whose value in the primary key
"ID" is the value stored in the variable x.
       </p>

       <div2 id="rules_table_triples">
	<head>Generating Table Triples</head>
	<div3 id="rules_table_triples_single_pk">
		<head>Table has a single-column primary key</head>
		<p>
	Assume that r(a, b<sub>1</sub>, ..., b<sub>n</sub>) is a table
with columns a, b<sub>1</sub>, ..., b<sub>n</sub> and such that [a] is
the primary key of r. Then the following is the default mapping rule
to generate <a href="#table_triple">Table Triples</a> from r:	
                </p>
		<p>
		<xsd>
Triple(s, "rdf:type", o) ← r(x, y<sub>1</sub>, ..., y<sub>n</sub>), generateRowIRI("r", ["a"], [x], s), generateTableIRI("r", o)   
		</xsd>
		</p>
		
		
	</div3>
	
	<div3 id="rules_table_triples_multi_pk">
		<head>Table has a multi-column primary key</head>
		<p>
	Assume that r(a<sub>1</sub>, ..., a<sub>m</sub>,
b<sub>1</sub>, ..., b<sub>n</sub>) is a table with columns
a<sub>1</sub>, ..., a<sub>m</sub>, b<sub>1</sub>, ..., b<sub>n</sub>
and such that [a<sub>1</sub>, ..., a<sub>m</sub>] is the primary key
of r (m > 1). Then the following is the default mapping rule to generate <a
href="#table_triple">Table Triples</a> from r:	 
	</p>
	
		<p>
		<xsd>
		
Triple(s, "rdf:type", o) ← r(x<sub>1</sub>, ..., x<sub>m</sub>, y<sub>1</sub>, ..., y<sub>n</sub>), generateRowIRI("r", ["a<sub>1</sub>", ..., "a<sub>m</sub>"], [x<sub>1</sub>, ..., x<sub>m</sub>], s), generateTableIRI("r", o)
		</xsd>
		</p>
	</div3>
	
	<div3 id="rules_table_triples_no_pk">
		<head>Table does not have a primary key</head>
		<p>
	Assume that r(b<sub>1</sub>, ..., b<sub>n</sub>) is a table with columns b<sub>1</sub>, ..., b<sub>n</sub> and such that r does not have a primary key. Then the following is the default mapping rule
to generate <a href="#table_triple">Table Triples</a> from r:	
	</p>
	
		<p>
		<xsd>
		
Triple(s, "rdf:type", o) ← r(y<sub>1</sub>, ..., y<sub>n</sub>), generateRowBlankNode("r", [y<sub>1</sub>, ..., y<sub>n</sub>], s), generateTableIRI("r", o)   
		
		</xsd>
		</p>
	</div3>






      </div2>
      
      <div2 id="rules_literal_triples">
	<head>Generating Literal Triples</head>
	<div3 id="rules_literal_triples_single_pk">
		<head>Table has a single-column primary key</head>
		<p>
	Assume that r(a, b<sub>1</sub>, ..., b<sub>n</sub>) is a table
with columns a, b<sub>1</sub>, ..., b<sub>n</sub> and such that [a] is
the primary key of r. Then if a is not the only constituent of a
foreign key of r or is the only  constituent of a foreign key of r that references a candidate key, the
default mapping includes the following rule for r and a to
generate <a href="#literal_triple">Literal Triples:</a>
                </p>
		<xsd>
		
Triple(s, p, x) ← r(x, y<sub>1</sub>, ..., y<sub>n</sub>), generateRowIRI("r", ["a"], [x], s), generateColumnIRI("r", ["a"], p)  
		
		</xsd>
                <p>
Moreover, for every b<sub>j</sub> (1 ≤ j ≤ n)
that is not the only constituent of a foreign key of r or is the only
constituent of a foreign key of r that references a candidate key, the
default mapping includes the following rule for r and b<sub>j</sub> to
generate <a href="#literal_triple">Literal Triples:</a>
	</p>
	
		<p>
		<xsd>
		
Triple(s, p, y<sub>j</sub>) ← r(x, y<sub>1</sub>, ..., y<sub>n</sub>), generateRowIRI("r", ["a"], [x], s), generateColumnIRI("r", ["b<sub>j</sub>"], p)  
		
		</xsd>
		</p>
		
		
	</div3>
	
	<div3 id="rules_literal_triples_multi_pk">
		<head>Table has a multi-column primary key</head>
		<p>
	Assume that r(a<sub>1</sub>, ..., a<sub>m</sub>, b<sub>1</sub>, ..., b<sub>n</sub>)
is a table with columns a<sub>1</sub>, ..., a<sub>m</sub>, b<sub>1</sub>, ..., b<sub>n</sub>
and such that [a<sub>1</sub>, ..., a<sub>m</sub>] is the primary key
of r (m > 1). Then
for every a<sub>j</sub> (1 ≤ j ≤ m) that is not the only constituent of a
foreign key of r or is the only constituent of a foreign key of r that
references a candidate key, the default mapping includes the following
rule for r and a<sub>j</sub> to generate <a href="#literal_triple">Literal Triples:</a>
	</p>
		<xsd>
		
Triple(s, p, x<sub>j</sub>) ← r(x<sub>1</sub>, ..., x<sub>m</sub>, y<sub>1</sub>, ..., y<sub>n</sub>), generateRowIRI("r", ["a<sub>1</sub>", ..., "a<sub>m</sub>"], [x<sub>1</sub>, ..., x<sub>m</sub>], s), generateColumnIRI("r", ["a<sub>j</sub>"], p)
		</xsd>
		<p>
Moreover, for every b<sub>j</sub> (1 ≤ j ≤ n) that is not the only constituent of a
foreign key of r or is the only constituent of a foreign key of r that
references a candidate key, the default mapping includes the following
rule for r and b<sub>j</sub> to generate <a href="#literal_triple">Literal Triples:</a>
	</p>
		<xsd>
		
Triple(s, p, y<sub>j</sub>) ← r(x<sub>1</sub>, ..., x<sub>m</sub>, y<sub>1</sub>, ..., y<sub>n</sub>), generateRowIRI("r", ["a<sub>1</sub>", ..., "a<sub>m</sub>"], [x<sub>1</sub>, ..., x<sub>m</sub>], s), generateColumnIRI("r", ["b<sub>j</sub>"], p)
		</xsd>
	</div3>
	
	<div3 id="rules_literal_triples_no_pk">
		<head>Table does not have a primary key</head>
		<p>
	Assume that r(b<sub>1</sub>, ..., b<sub>n</sub>) is a table with columns
b<sub>1</sub>, ..., b<sub>n</sub> and such that r does not have a primary
key. Then for every b<sub>j</sub> (1 ≤ j ≤ n) that is not the only
constituent of a foreign key of r or is the only constituent of a
foreign key of r that references a candidate key, the default mapping
includes the following rule for r and b<sub>j</sub> to
generate <a href="#literal_triple">Literal Triples:</a>
	</p>
	
		<p>
		<xsd>
		
Triple(s, p, y<sub>j</sub>) ← r(y<sub>1</sub>, ..., y<sub>n</sub>), generateRowBlankNode("r", [y<sub>1</sub>, ..., y<sub>n</sub>], s), generateColumnIRI("r", ["b<sub>j</sub>"], p)  
		
		</xsd>
		</p>
	</div3>
	
	
	<p>
	
	
	</p>      
	</div2>
	<div2 id="rules_reference_triples">
	<head>Generating Reference Triples</head>

<p>
To-Do: Work in progress
</p>
	</div2>
    </div1>
    
    
    
    <div1 id="notation">
      <head>Notation for this Document</head>

      <div2 id="types">
	<head>Notation for Types</head>
	<p><term>A </term> <termdef id="T_type">a type</termdef></p>
	<p><term>A ⊔ B </term> <termdef id="T_disjoint_union">disjoint union of A and B</termdef></p>
	<p><term>( A, B ) </term> <termdef id="T_tuple">tuple (Cartesian product) of types A and B</termdef></p>
	<p><term>[ A ] </term> <termdef id="T_list">list of elements of type A</termdef></p>
	<p><term>{ A } </term> <termdef id="T_set">set of elements of type A</termdef></p>
	<p><term>{ A→B } </term> <termdef id="T_map">map of elements of type A to elements of type B</termdef></p>
      </div2>
      <div2 id="injectors">
	<head>Notation for Injectors</head>
	<p><term>a </term> <termdef id="inj_instance">an instance of an A</termdef></p>
	<p><term>( a1, b1 ) </term> <termdef id="inj_tuple">a tuple with elements a1 and b1</termdef></p>
	<p><term>[ a1, a2 ] </term> <termdef id="inj_list">list with elements a1 and a2</termdef></p>
	<p><term>{ a1, a2 } </term> <termdef id="inj_set">set with elements a1 and a2</termdef></p>
	<p><term>{ a1→b1, a2→b2 } </term> <termdef id="inj_map">map with elements with key a1 mapped to b1 and key a2 mapped to b2</termdef></p>
      </div2>
      <div2 id="accessors">
	<head>Accessor Functions</head>
	<p><term>AB[a] </term> <termdef id="map_get">in a map of A to B, the instance of B for a given A</termdef></p>
      </div2>
    </div1>
    <div1 id="models">
      <head>Data Model Definition (Normative)</head>

      <div class="syntaxmenu">
	<p>The buttons below can be used to show or hide the available syntaxes.</p>
	<form action="">
	  <p>
	    <input id="hide-fs" onclick="display('setnotation','none');      set_display_by_id('hide-fs', 'none'); set_display_by_id('show-fs', '');" value="Hide Set-Style Syntax" type="button"/>
	    <input id="show-fs" onclick="display('setnotation','table-row');      set_display_by_id('hide-fs', '');       set_display_by_id('show-fs', 'none');" style="display: none;" value="Show Set-Style Syntax" type="button"/>
	    <input style="display: none;" id="hide-rs" onclick="display('english', 'none');      set_display_by_id('hide-rs', 'none');       set_display_by_id('show-rs', '');" value="Hide English Syntax" type="button"/>
	    <input id="show-rs" onclick="display('english', 'table-row');      set_display_by_id('hide-rs', '');       set_display_by_id('show-rs', 'none');" style="" value="Show English Syntax" type="button"/>
	    <!-- input style="display: none;" id="hide-ts" onclick="display('prolog', 'none');      set_display_by_id('hide-ts', 'none');       set_display_by_id('show-ts', '');" value="Hide Prolog Syntax" type="button"/>
	    <input id="show-ts" onclick="display('prolog', 'table-row');      set_display_by_id('hide-ts', '');       set_display_by_id('show-ts', 'none');" style="" value="Show Prolog Syntax" type="button"/>
	    <input style="display: none;" id="hide-ms" onclick="display('ml', 'none');            set_display_by_id('hide-ms', 'none');             set_display_by_id('show-ms', '');" value="Hide Ml Syntax" type="button"/>
	    <input id="show-ms" onclick="display('ml','table-row');      set_display_by_id('hide-ms', '');       set_display_by_id('show-ms', 'none');" style="" value="Show Ml Syntax" type="button"/ -->
	    <input style="display: none;" id="hide-xs" onclick="display('scala', 'none');      set_display_by_id('hide-xs', 'none');       set_display_by_id('show-xs', '');" value="Hide Scala Syntax" type="button"/>
	    <input id="show-xs" onclick="display('scala', 'table-row');      set_display_by_id('hide-xs', '');       set_display_by_id('show-xs', 'none');" style="" value="Show Scala Syntax" type="button"/>
	  </p>
	</form>
      </div>

      <div2 id="Rel">
	<head>Relational Model Definition (Normative)</head>
	<p>
Starting with a traditional model of a relational database we define a Relation (a table) which has a name, a Header, Body and primary/foreign key details.
The Body contains maps from attribute names to values and the Header provides the datatypes to interpret those values.
	</p><!-- \M-x replace-regexp num="[0-9]+" num="\#" (replace-regexp "num=\"[0-9]+\"" "num=\"#\"")  num="0" -->
	<scrap lang="ebnf">
	  <head>Relational Definition</head>
	  <prod id="Rel-Database" num="1">
	    <lhs>Database</lhs>
	    <rhs>{ <nt def="Rel-Relation">RelName</nt> → <nt def="Rel-Relation">Relation</nt> }</rhs>
	    <english>A <dfn>relational database</dfn> is a mapping of relation name to relation.</english>
	    <scala>  case class Database( m:Map[RelName, Relation] )</scala>
	  </prod>
	  <prod id="Rel-Relation" num="2">
	    <lhs>Relation</lhs>
	    <rhs>( <nt def="Rel-Header">Header</nt>, [<nt def="Rel-CandidateKey">CandidateKey</nt>], <nt def="Rel-PrimaryKey">PrimaryKey</nt>:<nt def="Rel-CandidateKey">CandidateKey</nt>, <nt def="Rel-ForeignKeys">ForeignKeys</nt>, <nt def="Rel-Body">Body</nt> )</rhs>
	    <english>A <dfn>relation</dfn> has a header, a list of candidate keys, a primary key (of type candidate key), a mapping of foreign keys, and a body.</english>
	    <scala>  case class Relation (header:Header, body:Body, candidates:List[CandidateKey], pk:Option[CandidateKey], fks:ForeignKeys)</scala>
	  </prod>
	  <prod id="Rel-Header" num="3">
	    <lhs>Header</lhs>
	    <rhs>{ <nt def="Rel-AttrName">AttrName</nt> → <nt def="Rel-SQLDatatype">SQLDatatype</nt> }</rhs>
	    <english>A <dfn>header</dfn> is a mapping from attribute name to SQL datatype.</english>
	    <scala>  case class Header (types:Map[AttrName, SQLDatatype])</scala>
	  </prod>
	  <prod id="Rel-CandidateKey" num="4">
	    <lhs>CandidateKey</lhs>
	    <rhs>[ <nt def="Rel-AttrName">AttrName</nt> ]</rhs>
	    <english>A <dfn>candidate key</dfn> is a list of attribute names.</english>
	    <scala>  type CandidateKey = List[AttrName]</scala>
	  </prod>
	  <prod id="Rel-ForeignKeys" num="5">
	    <lhs>ForeignKeys</lhs>
	    <rhs>{ [<nt def="Rel-AttrName">AttrName</nt>] → ( <nt def="Rel-Relation">Relation</nt>, [<nt def="Rel-AttrName">AttrName</nt>] ) }</rhs>
	    <english><dfn>Foreign keys</dfn> is a mapping from a list of attribute names to a relation and a list of attribute names.</english>
	    <scala>  type ForeignKeys = Map[AttrName, Target]
  case class Target (rel:RelName, attrs:CandidateKey)</scala>
	  </prod>
	  <prod id="Rel-SQLDatatype" num="6">
	    <lhs>SQLDatatype</lhs>
	    <rhs>{ INT | FLOAT | DATE | TIME | TIMESTAMP | CHAR | VARCHAR | STRING }</rhs>
	    <english>An <dfn>SQL datatype</dfn> is an INT, FLOAT, DATE, TIME, TIMESTAMP, CHAR, VARCHAR or STRING as defined in the SQL specification [@@].</english>
	    <scala>  sealed abstract class SQLDatatype
  case class SQLInt () extends SQLDatatype
  case class SQLFloat () extends SQLDatatype
  …
  case class SQLString () extends SQLDatatype
</scala>
	  </prod>
	  <prod id="Rel-Body" num="7">
	    <lhs>Body</lhs>
	    <rhs>[ <nt def="Rel-Tuple">Tuple</nt> ]</rhs>
	    <english>A <dfn>body</dfn> is a list of (potentially duplicate) tuples.</english>
	    <scala>  type Body = Set[Tuple]</scala>
	  </prod>
	  <prod id="Rel-Tuple" num="8">
	    <lhs>Tuple</lhs>
	    <rhs>{ <nt def="Rel-AttrName">AttrName</nt> → <nt def="Rel-CellValue">CellValue</nt> }</rhs>
	    <english>A <dfn>tuple</dfn> is a mapping from attribute name to cell value.</english>
	    <scala>  case class Tuple (m:Map[AttrName, CellValue])</scala>
	  </prod>
	  <prod id="Rel-CellValue" num="9">
	    <lhs>CellValue</lhs>
	    <rhs>value | Null</rhs>
	    <english>A <dfn>cell value</dfn> is a scalar value in some SQL datatype, or SQL NULL.</english>
	    <scala>  abstract class CellValue
  case class LexicalValue (s:String) extends CellValue
  case class ␀ () extends CellValue</scala>
	  </prod>
	</scrap>
      </div2>
      <div2 id="RDFdef">
	<head>RDF Model Definition (Non-normative)</head>
	<p>
	  Per <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#section-rdf-graph">RDF Concepts and Abstract Syntax</a>, an RDF graph is a set of triples of a subject, predicate and object.
	  The subject may be an IRI or a blank node, the predicate must be an IRI and the object may be an IRI, blank node, or an RDF literal.
	</p>
	<p>
	  This section recapitulates for convience the formal definition of RDF.
	</p>
	<scrap lang="ebnf">
	  <head>RDF Definition</head>
	  <prod id="RDF-Graph" num="10">
	    <lhs>Graph</lhs>
	    <rhs>{ <nt def="RDF-Triple">Triple</nt> }</rhs>
	    <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-graph">RDF graph</a></dfn> is a set of RDF triples.</english>
	    <scala>  type RDFGraph = Set[Triple]</scala>
	  </prod>
	  <prod id="RDF-Triple" num="11">
	    <lhs>Triple</lhs>
	    <rhs>( Subject, Predicate, Object )</rhs>
	    <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-triple">RDF triple</a></dfn> contains a subject, predicate and object.</english>
	    <scala>  case class Triple (s:Subject, p:IRI, o:Object)</scala>
	  </prod>
	  <prod id="RDF-Subject" num="12">
	    <lhs>Subject</lhs>
	    <rhs><nt def="RDF-IRI">IRI</nt> | <nt def="RDF-BlankNode">BlankNode</nt></rhs>
	    <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-subject">subject</a></dfn> is an IRI or a blank node.</english>
	    <scala>  sealed abstract class Node <span class="comment">// factor out IRIs and BNodes</span>
  case class NodeIRI(i:IRI) extends Node
  case class NodeBNode(b:BNode) extends Node

  sealed abstract class Subject
  case class SubjectNode(n:Node) extends Subject
</scala>
	  </prod>
	  <prod id="RDF-Predicate" num="13">
	    <lhs>Predicate</lhs>
	    <rhs><nt def="RDF-IRI">IRI</nt></rhs>
	    <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-predicate">predicate</a></dfn> is an IRI.</english>
	    <scala>  sealed abstract class Predicate
  case class PredicateIRI(i:IRI) extends Predicate</scala>
	  </prod>
	  <prod id="RDF-Object" num="14">
	    <lhs>Object</lhs>
	    <rhs><nt def="RDF-IRI">IRI</nt> | <nt def="RDF-BlankNode">BlankNode</nt> | <nt def="RDF-Literal">Literal</nt></rhs>
	    <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-object">object</a></dfn> is an IRI, a blank node, or a literal.</english>
	    <scala>  sealed abstract class Object
  case class ObjectNode(n:Node) extends Object
  case class ObjectLiteral (n:Literal) extends Object</scala>
	  </prod>
	  <prod id="RDF-IRI" num="15">
	    <lhs>IRI</lhs>
	    <rhs><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">RDF URI-reference</a> as subsequently <a href="http://www.w3.org/TR/rdf-sparql-query/#docTerminology">restricted by SPARQL</a></rhs>
	    <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-">IRI</a></dfn> is an <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">RDF URI reference</a> as subsequently <a href="http://www.w3.org/TR/rdf-sparql-query/#docTerminology">restricted by SPARQL</a>.</english>
	    <scala>  case class IRI(iri:String)</scala>
	  </prod>
	  <prod id="RDF-BlankNode" num="16">
	    <lhs>BlankNode</lhs>
	    <rhs><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">RDF blank node</a></rhs>
	    <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">blank node</a></dfn> is an arbitrary term used only to establish graph connectivity.</english>
	    <scala>  case class BNode(label:String)</scala>
	  </prod>
	  <prod id="RDF-Literal" num="17">
	    <lhs>Literal</lhs>
	    <rhs><nt def="RDF-PlainLiteral">PlainLiteral</nt> | <nt def="RDF-TypedLiteral">TypedLiteral</nt></rhs>
	    <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-literal">literal</a></dfn> is either a plain literal or a typed literal.</english>
	    <scala>  sealed abstract class Literal
  case class LiteralTyped(i:TypedLiteral) extends Literal
  case class LiteralPlain(b:PlainLiteral) extends Literal</scala>
	  </prod>
	  <prod id="RDF-PlainLiteral" num="18">
	    <lhs>PlainLiteral</lhs>
	    <rhs>(lexicalForm) | (lexicalForm, langageTag).</rhs>
	    <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-plain-literal">plain literal</a></dfn> has a <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-lexical-form">lexical form</a> and an optional <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-language-identifier">language tag</a>.</english>
	    <scala>  case class PlainLiteral(value:String, langtag:Option[String])</scala>
	  </prod>
	  <prod id="RDF-TypedLiteral" num="19">
	    <lhs>TypedLiteral</lhs>
	    <rhs>(lexicalForm, IRI).</rhs>
	    <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-typed-literal">typed literal</a></dfn> has a <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-lexical-form">lexical form</a> and a <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-datatype-URI">datatype IRI</a>.</english>
	    <scala>  case class TypedLiteral(value:String, datatype:IRI)</scala>
	  </prod>
	</scrap>
      </div2>
    </div1>

    <div1 id="alg">
      <head>Direct Mapping Definition (Normative)</head>
      <p>
The direct mapping is a formula for creating an RDF graph from the tuples in a relation.
A <emph id="stem">stem</emph> IRI defines a web space for the labels in this graph; all labels are generated by appending to the stem.
The functions <code>scalar</code> and <code>reference</code> extract the non-Null scalar and reference attributes respectively.
      </p>

      <scrap>
	  <prod id="direct-references" num="20">
	    <lhs>references(T, R)</lhs>
	    <rhs>{ K ∣ ∄(T(A) = Null ∣ A ∈ K) ∧ K ≠ R.<nt def="Rel-PrimaryKey">PrimaryKey</nt> ∣ K ∈ R.<nt def="Rel-ForeignKeys">ForeignKeys</nt> }</rhs>
	    <english>The <dfn>references</dfn> function returns the attributes in any of a relation's foreign keys.</english>
	    <scala>  def references (t:Tuple, r:Relation):Set[List[AttrName]] = {
    val allFKs:Set[List[AttrName]] = r.fks.keySet
    val nulllist:Set[AttrName] = t.nullAttributes(r.header)
    val nullFKs:Set[List[AttrName]] = allFKs.flatMap(a =&gt; {
      val int:Set[AttrName] = nulllist &amp; a.toSet
      if (int.toList.length == 0) None else List(a)
    })

    /** Check to see if r's primary key is a hierarchical key.
     * http://www.w3.org/2001/sw/rdb2rdf/directGraph/#rule3 */
    if (r.pk.isDefined &amp;&amp; r.fks.contains(r.pk.get))
      r.fks.keySet -- nullFKs - r.fks(r.pk.get).attrs
    else
      r.fks.keySet -- nullFKs
  }</scala>
	  </prod>
	  <prod id="direct-scalars" num="21">
	    <lhs>scalars(T)</lhs>
	    <rhs>{ A in T ∣ A ≠ Null ∧ [A] ∉ <nt def="direct-references">references</nt>(T) }</rhs>
	    <english>The <dfn>scalars</dfn> function returns the attributes which are NOT in any of a relation's foreign keys.</english>
	    <scala>  def scalars (t:Tuple, r:Relation):Set[AttrName] = {
    val allAttrs:Set[AttrName] = r.header.keySet
    val nulllist:Set[AttrName] = t.nullAttributes(r.header)
    val refs = references(t, r) filter (a => a.length == 1) map (a => a(0))
    allAttrs -- refs -- nulllist
  }</scala>
	  </prod>
      </scrap>

      <p>
	Each tuple in a relation with some candidate key can be uniquely identified by values of that key.
	A <a href="#direct-KeyMap">KeyMap</a>(R) maps the candidate keys in a relation to a map of key values to the subject nodes assigned to each tuple.
      </p>

      <scrap>
	  <prod id="direct-KeyMap" num="22">
	    <lhs>KeyMap</lhs>
	    <rhs>{ <nt def="directR">CandidateKey</nt> → { [<nt def="directR">CellValue</nt>] → <nt def="Subject">RDF Node</nt> } }</rhs>
	    <english>A <dfn>KeyMap</dfn> is a map from candidate key to a map from list of cell values to RDF nodes.</english>
	    <scala>  type KeyMap = Map[CandidateKey, Map[List[CellValue], Node]]</scala>
	  </prod>
	  <prod id="direct-NodeMap" num="23">
	    <lhs>NodeMap</lhs>
	    <rhs>{ <nt def="directR">CandidateKey</nt> → <nt def="KeyMap">KeyMap</nt> }</rhs>
	    <english>A <dfn>NodeMap</dfn> is a map from relation name to key map.</english>
	    <scala>  type NodeMap = Map[RelName, KeyMap]</scala>
	  </prod>
      </scrap>

      <p>
	The function <a href="#direct-directDB">directDB</a>(DB) computes a NodeMap for each relation with one or more candidate keys.
	The function <a href="#direct-directR">directR</a>(R) maps the Tuples in a Relation R to an RDF graph.
	The following definitions assume the existance of some StemIRI U and Database DB.
      </p>

      <scrap>
	  <prod id="direct-directDB" num="24">
	    <lhs>directDB()</lhs>
	    <rhs>{ <nt def="directR">directR</nt>(R, M) ∣ R ∈ DB }</rhs>
	    <english>The <dfn>directDB</dfn> of a database DB is a set of RDF triples (<a href="#RDF-Graph">RDF graph</a>) created by calling directR on each relation in DB.</english>
	    <scala>  def directDB (u:StemIRI, db:Database) : RDFGraph = {
    val idxables = db.keySet filter { rn =&gt; !db(rn).candidates.isEmpty }
    val nodeMap = idxables map {rn =&gt; rn -&gt; relation2KeyMap(u, db(rn))}
    db.keySet.flatMap(rn =&gt; directR(u, db(rn), nodeMap, db))
  }</scala>
	  </prod>
	  <prod id="direct-directR" num="25">
	    <lhs>directR(R, M)</lhs>
	    <rhs>{ <nt def="directT">directT</nt>(T, R, M) ∣ T ∈ R.Body }</rhs>
	    <english>The <dfn>directR</dfn> of a relation is a set of RDF triples created by calling directT on each tuple in the body of the database.</english>
	    <scala>  def directR (u:StemIRI, r:Relation, nodes:NodeMap, db:Database) : RDFGraph =
    body(r).flatMap(t => directT(u, t, r, nodes, db))</scala>
	  </prod>
	  <prod id="direct-directT" num="26">
	    <lhs>directT(T, R, M)</lhs>
	    <rhs>{ <nt def="directS">directS</nt>(S, T, R, M) ∣ S = subject(T, R, M) }</rhs>
	    <english>The <dfn>directT</dfn> of a tuple in a relation is a set of RDF triples created by calling directS with an S created by the function <code>subject</code>.</english>
	    <scala>  def directT (u:StemIRI, t:Tuple, r:Relation, nodes:NodeMap, db:Database) : Set[Triple] = {
    val s = subject(t, r, nodes, db)
    directS(u, s, t, r, nodes, db)
  }</scala>
	  </prod>
	  <prod id="direct-subject" num="27">
	    <lhs>subject(T, R, M)</lhs>
	    <rhs><code>if</code> (pk(R) = ∅) <code>then</code> new blank node <code>else</code> <nt def="subject">nodemap</nt>(R, T[pk(R)]) !! ultimate referent of hierarchical key</rhs>
	    <english>The <dfn>subject</dfn> identifier for a tuple in a relation is fresh blank node, if there is no primary key, or the IRI returned from nodemap of that primary key's attribute values in that tuple.</english>
	    <scala>  def subject (t:Tuple, r:Relation, nodes:NodeMap, db:Database):Node =
    if (r.candidates.size &gt; 0) {
      // Known to have at least one key, so take the first one.
      val k = r.candidates(0)
      val vs = t.lexvaluesNoNulls(k)
      nodes.ultimateReferent(r.name, k, vs, db)
    } else
      /** Table has no candidate keys. */
      freshbnode()</scala>
	  </prod>
	  <prod id="direct-directS" num="28">
	    <lhs>directS(S, T, R, M)</lhs>
	    <rhs>{ <nt def="directL">directL</nt>(S, R, A) ∣ A ∈ scalars(T, R) } ∪ { <nt def="directL">directN</nt>(S, As, T, M) ∣ As ∈ references(T, R) }</rhs>
	    <english>The <dfn>directS</dfn> of a subect, tuple and relation is the set of RDF triples created by:
	    <ul>
	      <li>calling directL on each scalar attribute in T,</li>
	      <li>calling directN on each foreign key in T</li>
	    </ul>
	    </english>
	    <scala>  def directS (u:StemIRI, s:Node, t:Tuple, r:Relation, nodes:NodeMap, db:Database) : Set[Triple] = {
    references(t, r).map(as =&gt; directN(u, s, as, r, t, nodes)) ++
    scalars(t, r).map(a =&gt; directL(u, r.name, s, a, r.header, t))
  }</scala>
	  </prod>
	  <prod id="direct-directL" num="29">
	    <lhs>directL(S, R, A)</lhs>
	    <rhs><nt def="RDF-triple">triple</nt>(S, <nt def="base-predicatemap">predicatemap</nt>(R, [A]), <nt def="base-literalmap">literalmap</nt>(A))</rhs>
	    <english>The <dfn>directL</dfn> of a subject, relation and attribute is the RDF triple with that subject, the predicate returned from predicatemap, and the object returned from literalmap.</english>
	    <scala>  def directL (u:StemIRI, rn:RelName, s:Node, a:AttrName, h:Header, t:Tuple) : Triple = {
    val p = predicatemap (u, rn, List(a))
    val l = t.lexvalue(a).get
    val o = literalmap(l, h.sqlDatatype(a))
    Triple(s, p, o)
  }</scala>
	  </prod>
	  <prod id="direct-directN" num="30">
	    <lhs>directN(S, R, As)</lhs>
	    <rhs><nt def="RDF-triple">triple</nt>(S, <nt def="base-predicatemap">predicatemap</nt>(R, As), <nt def="base-nodemap">nodemap</nt>(R, As))</rhs>
	    <english>The <dfn>directN</dfn> of a subject, relation and list of attributes is the RDF triple with that subject, a predicate returned from predicatemap, and the object returned by nodemap of the list of attributes.</english>
	    <scala>  def directN (u:StemIRI, s:Node, as:List[AttrName], r:Relation, t:Tuple, nodes:NodeMap) : Triple = {
    val p = predicatemap (u, r.name, as)
    val ls:List[LexicalValue] = t.lexvaluesNoNulls(as)
    val target = r.fks(as)
    val o:Object = nodes(target.rel)(target.attrs)(ls)
    Triple(s, p, o)
  }</scala>
	  </prod>
      </scrap>

      <p>
	In the interest of keeping the generated RDF graph <a href="http://www.jenitennison.com/blog/node/136">linked-data-friendly</a> and in deference to the resolution of <a href="http://www.w3.org/2001/tag/issues.html#httpRange-14">W3C Tag issue httpRange-14</a>, the generated node and predicate labels can come in two flavors, hash or slash.
      </p>
      <scrap>
	<prod id="base-nodemap" num="31">
	  <lhs>nodemap(R, As)</lhs>
	  <rhs><nt def="RDF-IRI">IRI</nt>(<nt def="stem">stem</nt> + "/" + UE(R.name) + "/" + (join('_', UE(A.name) + "." + UE(A.value)) ∣ A ∈ As ) + "#_")</rhs>
	  <english>A <dfn>nodemap</dfn> is a concatonation, with punctuation as separators, of a stem IRI, url-encoded relation name, and the attribute name/value pairs in the list of attributes.</english>
	  <scala>  def nodemap (u:StemIRI, rn:RelName, as:List[AttrName], ls:List[LexicalValue]) : IRI = {
    val pairs:List[String] = as.zip(ls).map(x =&gt; UE(x._1) + "." + UE(x._2.s))
    u + ("/" + UE(rn) + "/" + pairs.mkString("_") + "#_")
  }</scala>
	  <tip><a class="tooltip">RDF Graph (set of triples)</a></tip>
	</prod>
	<prod id="base-predicatemap" num="32">
	  <lhs>predicatemap(R, As)</lhs>
	  <rhs><nt def="RDF-IRI">IRI</nt>(<nt def="stem">stem</nt> + "/" + (join('_', UE(A.name)) ∣ A ∈ As ) "#" As.name)</rhs>
	  <english>A <dfn>predicatemap</dfn> is a concatonation, with punctuation as separators, of a stem IRI, url-encoded relation name, and the attribute names the list of attributes.</english>
	  <scala>  def predicatemap (u:StemIRI, rn:RelName, as:List[AttrName]) : IRI =
    u + ("/" + UE(rn) + "#" + as.mkString("_"))</scala>
	</prod>
	<!-- 
	<prod id="base-nodemap" num="33">
	  <lhs>nodemap(R, A)</lhs>
	  <rhs><nt def="hash-nodemap">hash-nodemap</nt>(R, A) | <nt def="slash-nodemap">slash-nodemap</nt>(R, A)</rhs>
	</prod>
	<prod id="base-predicatemap" num="34">
	  <lhs>predicatemap(R, A)</lhs>
	  <rhs><nt def="hash-predicatemap">hash-predicatemap</nt>(R, A) | <nt def="slash-predicatemap">slash-predicatemap</nt>(R, A)</rhs>
	</prod>
	<prod id="hash-nodemap" num="35">
	  <lhs>hash-nodemap(R, A)</lhs>
	  <rhs><nt def="RDF-IRI">IRI</nt>(<nt def="stem">stem</nt> + "/" + R.name "/" A.name + "." + A.value + "#_")</rhs>
	</prod>
	<prod id="hash-predicatemap" num="36">
	  <lhs>hash-predicatemap(R, A)</lhs>
	  <rhs><nt def="RDF-IRI">IRI</nt>(<nt def="stem">stem</nt> + "/" + R.name "#" A.name)</rhs>
	</prod>
	<prod id="slash-nodemap" num="37">
	  <lhs>slash-nodemap(R, A)</lhs>
	  <rhs><nt def="RDF-IRI">IRI</nt>(<nt def="stem">stem</nt> + "/" + R.name "/" A.name + "." + A.value)</rhs>
	</prod>
	<prod id="slash-predicatemap" num="38">
	  <lhs>slash-predicatemap(R, A)</lhs>
	  <rhs><nt def="RDF-IRI">IRI</nt>(<nt def="stem">stem</nt> + "/" + R.name "/" A.name)</rhs>
	</prod>
	-->
      </scrap>

      <p>
	<code>literalmap</code> produces RDF literal with XSD datatypes with this type mapping TM:
      </p>
      <scrap>
	<prod id="base-literalmap" num="39">
	  <lhs>literalmap(A)</lhs>
	  <rhs><nt def="RDF-Literal">Literal</nt>(A[V], SQL2XSD[A]) ∣ SQL2XSD is the mapping from SQL datatypes to XML datatypes below:</rhs>
	</prod>
      </scrap>
      <table cellpadding="2" cellspacing="0" border="1">
	<thead>
	  <tr><th>SQL		</th><th>XSD                                       </th></tr>
	</thead>
	<tbody>
	  <tr><td>INT		</td><td>http://www.w3.org/TR/xmlschema-2/#integer </td></tr>
	  <tr><td>FLOAT		</td><td>http://www.w3.org/TR/xmlschema-2/#float   </td></tr>
	  <tr><td>DATE		</td><td>http://www.w3.org/TR/xmlschema-2/#date	   </td></tr>
	  <tr><td>TIME		</td><td>http://www.w3.org/TR/xmlschema-2/#time	   </td></tr>
	  <tr><td>TIMESTAMP	</td><td>http://www.w3.org/TR/xmlschema-2/#dateTime</td></tr>
	  <tr><td>CHAR		</td><td>http://www.w3.org/TR/xmlschema-2/#string  </td></tr>
	  <tr><td>VARCHAR	</td><td>http://www.w3.org/TR/xmlschema-2/#string  </td></tr>
	  <tr><td>STRING	</td><td>http://www.w3.org/TR/xmlschema-2/#string  </td></tr>
	</tbody>
      </table>

      <p>
	<code>UE</code> (url-encode) is the conventional url encoding used for e.g. HTML CGI forms:
      </p>
      <scrap>
	<prod id="base-UE" num="40">
	  <lhs>UE(T)</lhs>
	  <rhs>url-encode T per <a href="http://www.w3.org/TR/wsdl#_http:urlEncoded">WSDL urlEncoded</a>.</rhs>
	</prod>
      </scrap>

    </div1>

    <!-- div1 id="extend">
      <head>Extending the Direct Mapping</head>
      <p>
	The direct mapping is extensible, producing more triples in the direct graph.
	Below are some useful extensions.
      </p>
      <div2 id="WithType">
	<head>Type Annotations (Normative)</head>
	<p>
	  In some circumstances, it is useful to extend the direct mapping to include triples for the primary key attributes.
	  This supplements the <a href="#emp-addr">Employees/Addresses example</a> with the following triples:
	</p>
	<turtle>
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

&lt;People/ID.7#_&gt; a &lt;http://foo.example/DB#People&gt; .
&lt;People/ID.8#_&gt; a &lt;http://foo.example/DB#People&gt; .
&lt;Addresses/ID.18#_&gt; a &lt;http://foo.example/DB#Addresses&gt; .
	</turtle>
	<p>
	  This graph is defined by adding a <code>directP(R, S)</code> function which asserts a triple with a predicate <code>rdf:type</code>:
	</p>
	<scrap>
	  <prod num="41">
	    <lhs>directT(R, T)</lhs>
	    <rhs>{ directL(R, S, A) ∣ A ∈ scalar(T) } ∪ { directN(R, S, A) ∣ A ∈ reference(T) }  ∪ { directP(R, S) } ∣ S = nodemap(R, T[pk(R)])</rhs>
	    <english></english>
	  </prod>
	  <prod num="42">
	    <lhs>directP(R, S)</lhs>
	    <rhs>triple(S, rdf:type, typemap(R))</rhs>
	    <english></english>
	  </prod>
	  <prod num="43">
	    <lhs>typemap(R)</lhs>
	    <rhs>IRI(stem + "#" + R.name)</rhs>
	    <english></english>
	  </prod>
	</scrap>
      </div2>
      <div2 id="ManyToMany">
	<head>Many to Many Mappings (Normative)</head>
	<table class="nonRight" cellpadding="2" cellspacing="0" border="1">
	  <caption>People</caption>
	  <tbody>
	    <tr>
	      <th class="pk">PK</th>
	      <th colspan="1"></th>
	    </tr>
	    <tr>
	      <th class="pk">ID</th>
	      <th>fname</th>
	    </tr>
	    <tr>
	      <td class="pk" id="person7b">7</td>
	      <td>Bob</td>
	    </tr>
	    <tr>
	      <td class="pk">8</td>
	      <td>Sue</td>
	    </tr>
	  </tbody>
	</table>
	<table class="nonRight" cellpadding="2" cellspacing="0" border="1">
	  <caption>Addresses</caption>
	  <tbody>
	    <tr>
	      <th class="pk">PK</th>
	      <th colspan="2"></th>
	    </tr>
	    <tr>
	      <th class="pk">ID</th>
	      <th>City</th>
	      <th>State</th>
	    </tr>
	    <tr>
	      <td class="pk" id="addr18c">18</td>
	      <td>Cambridge</td>
	      <td>MA</td>
	    </tr>
	    <tr>
	      <td class="pk" id="addr19b">19</td>
	      <td>Cambridge</td>
	      <td>UK (yeah, not a state...)</td>
	    </tr>
	  </tbody>
	</table>
	<table class="right" cellpadding="2" cellspacing="0" border="1">
	  <caption>Per2Addr</caption>
	  <tbody>
	    <tr>
	      <th class="pk">PK</th>
	      <th colspan="1"></th>
	    </tr>
	    <tr>
	      <th class="pk">person</th>
	      <th>addr</th>
	    </tr>
	    <tr>
	      <td class="pk"><a href="#person7b">7</a></td>
	      <td><a href="#addr18b">18</a></td>
	    </tr>
	    <tr>
	      <td class="pk"><a href="#person7b">7</a></td>
	      <td><a href="#addr19b">19</a></td>
	    </tr>
	  </tbody>
	</table>
	<p>
	  In some circumstances, it is useful to extend the direct mapping to include triples for the primary key attributes.
	  This supplements the <a href="#emp-addr">Employees/Addresses example</a> with the following triples:
	</p>
	<turtle>
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

&lt;People/ID.7#_&gt; &lt;People#ID&gt; 7 .
&lt;People/ID.7#_&gt; &lt;People#fname&gt; "Bob" .
&lt;People/ID.7#_&gt; &lt;People#addr&gt; &lt;Addresses/ID.18#_&gt; .
&lt;People/ID.7#_&gt; &lt;People#addr&gt; &lt;Addresses/ID.19#_&gt; .
&lt;People/ID.8#_&gt; &lt;People#ID&gt; 8 .&lt;People/ID.8#_&gt; &lt;People#fname&gt; "Sue" .

&lt;Addresses/ID.18#_&gt; &lt;Addresses#ID&gt; 18 .
&lt;Addresses/ID.18#_&gt; &lt;Addresses#city&gt; "Cambridge" .
&lt;Addresses/ID.18#_&gt; &lt;Addresses#state&gt; "MA" .
&lt;Addresses/ID.19#_&gt; &lt;Addresses#ID&gt; 19 .&lt;Addresses/ID.19#_&gt; &lt;Addresses#city&gt; "Cambridge" .
&lt;Addresses/ID.19#_&gt; &lt;Addresses#state&gt; "UK" .
	</turtle>
	<p>
	  The Many to Many graph is defined by overloading <code>directR</code>.
	  This definition follows the <code>direct mapping</code> for all relations which are not many-to-many, and defines a single triple in each many-to-many relation.
	</p>
	<scrap>
	  <prod id="manytomany-directR" num="44">
	    <lhs>manytomany(R)</lhs>
	    <rhs>{ R ∣ R has exactly two attributes (X, Y), being foreign keys to RX.PKX and RY.PKY respectively }</rhs>
	    <english></english>
	  </prod>
	  <prod id="many2many-directDB" num="45">
	    <lhs>directDB(db)</lhs>
	    <rhs>{ <nt def="directR">directR</nt>(r) ∣ r ∉ manytomany(db.R) } ∪ { <nt def="directR">repeatpropertyR</nt>(r) ∣ r ∈ manytomany(db.R) }</rhs>
	    <english></english>
	  </prod>
	  <prod id="manytomany-repeatpropertyR" num="46">
	    <lhs>repeatpropertyR(R)</lhs>
	    <rhs>{ <nt def="repeatpropertyT">repeatpropertyT</nt>(R, T) ∣ T ∈ R.Body }</rhs>
	    <english></english>
	  </prod>
	  <prod id="many2many-repeatpropertyT" num="47">
	    <lhs>repeatpropertyT(R, T)</lhs>
	    <rhs><nt def="RDF-triple">triple</nt>(<nt def="base-nodemap">nodemap</nt>(RX, PKX), <nt def="base-predicatemap">predicatemap</nt>(R, Y), <nt def="base-nodemap">nodemap</nt>(RY, PKY))</rhs>
	    <english></english>
	  </prod>
	</scrap>

      </div2>
    </div1 -->

    <div1 id="refs">
      <head>References</head>
    </div1>
  </body>
  <back>
    <blist>
      <bibl id="SPARQL" href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL Query Language for RDF, Eric Prud'hommeaux and Andy Seaborne 2008.</bibl>
      <bibl id="SQL" href="http://en.wikipedia.org/wiki/SQL">SQL.<ednote><edtext>need a better reference here</edtext></ednote></bibl>
      <bibl id="RDF" href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">Resource Description Framework (RDF): Concepts and Abstract Syntax, G. Klyne, J. J. Carroll,  Editors, W3C Recommendation, 10 February 2004</bibl>
      <bibl id="ReuseableIDs" href="http://esw.w3.org/topic/Rdb2RdfXG/ReusableIdentifier">Reusable Identifiers in the RDB2RDF mapping language, Michael Hausenblas and Themis Palpanas, 2009.</bibl>
      <bibl id="URI" href="http://tools.ietf.org/html/rfc3986">RFC3986 - Uniform Resource Identifier (URI): Generic Syntax</bibl>
      <bibl id="KEY-COMB" href="http://www.springerlink.com/content/mv58805364k31734/">Translating SQL Applications to the Semantic Web. Syed H. Tirmizi, Juan F. Sequeda, and Daniel P. Miranker, 2008</bibl>
    </blist>
        <div1 id="sec-sql2xsd">
      <head>Mapping SQL Datatypes to XML Schema datatype</head>
      <table cellpadding="2" cellspacing="0" border="1">
	<thead>
	  <tr><th>SQL		</th><th>XSD                                       </th></tr>
	</thead>
	<tbody>
	  <tr><td>INT		</td><td>http://www.w3.org/TR/xmlschema-2/#integer </td></tr>
	  <tr><td>FLOAT		</td><td>http://www.w3.org/TR/xmlschema-2/#float   </td></tr>
	  <tr><td>DATE		</td><td>http://www.w3.org/TR/xmlschema-2/#date	   </td></tr>
	  <tr><td>TIME		</td><td>http://www.w3.org/TR/xmlschema-2/#time	   </td></tr>
	  <tr><td>TIMESTAMP	</td><td>http://www.w3.org/TR/xmlschema-2/#dateTime</td></tr>
	  <tr><td>CHAR		</td><td>http://www.w3.org/TR/xmlschema-2/#string  </td></tr>
	  <tr><td>VARCHAR	</td><td>http://www.w3.org/TR/xmlschema-2/#string  </td></tr>
	  <tr><td>STRING	</td><td>http://www.w3.org/TR/xmlschema-2/#string  </td></tr>
	</tbody>
      </table>
    </div1>
    <div1 id="sec-cvsLog">
      <head>CVS History</head>
      <div2 id="sec-cvsLog-meat">
	<pre>
$Log: alt.xml,v $
Revision 1.9  2010/11/08 15:20:14  marenas
- with some corrections in Section 3
- with new built-in predicates generateRowIRI and generateRowBlankNode

Revision 1.8  2010/11/07 00:00:36  marenas
changing URL in "Latest version" and "Previous version"

Revision 1.7  2010/11/06 23:36:33  marenas
more rules in section 3

Revision 1.6  2010/11/06 22:13:32  marenas
simplifying section 2
adding section 3: mapping rules in Datalog

Revision 1.5  2010/11/05 00:36:26  marenas
eliminating redundancy from Section 2.3

Revision 1.4  2010/11/04 21:19:58  marenas
Eliminating redundancy from Section Transformation Description
Adding Tuple IRI
Changing to SQL notation (tuple -> row, attribute -> column)

Revision 1.3  2010/11/04 18:31:15  marenas
reorganizing Section Transformation Description

Revision 1.2  2010/10/30 03:39:01  marenas
New version of Section Transformation Description

Revision 1.1  2010/10/25 18:12:46  eric
copied from Overview.xml

Revision 1.42  2010/10/17 13:46:48  eric
+ SQL constraints

Revision 1.41  2010/10/12 14:21:36  eric
~ renumbered

Revision 1.40  2010/10/12 12:14:52  eric
+ SQL for example 1

Revision 1.39  2010/10/11 03:12:21  eric
~ prettied up mutual-hilights

Revision 1.38  2010/10/10 22:09:55  eric
+ pfkexception

Revision 1.37  2010/10/10 14:25:41  eric
~ re-worked front-loaded informative rules

Revision 1.36  2010/10/10 11:59:01  eric
~ prettied-up pre@class=turtle
~ experimenting with new presentation of transformation rules
~ validated XSLT output

Revision 1.35  2010/10/09 15:12:40  eric
+ crosslinks for hier-tabl

Revision 1.34  2010/10/09 14:52:31  eric
+ crosslinks for ref-no-pk

Revision 1.33  2010/10/09 13:45:17  eric
~ symmetric xrefs between tables and triples for emp-addr and multi-key

Revision 1.32  2010/10/08 21:59:54  eric
+ hilights

Revision 1.31  2010/09/29 19:53:37  eric
~ align with https://dvcs.w3.org/hg/stemGraph/

Revision 1.30  2010/09/29 15:13:18  eric
~ align with https://dvcs.w3.org/hg/stemGraph/rev/75cf39ef7d74

Revision 1.29  2010/09/29 03:34:55  eric
+ 2nd gen hierarchical example

Revision 1.28  2010/09/28 03:10:53  eric
validation

Revision 1.27  2010/09/28 03:08:52  eric
+ hierarchical (untested)

Revision 1.26  2010/09/27 21:49:18  eric
~ XML validation (per xsltproc)

Revision 1.25  2010/09/27 21:46:42  eric
~ fixed reference table name

Revision 1.24  2010/09/27 18:48:46  eric
+ noticed another key in ref-no-pk

Revision 1.23  2010/09/27 18:13:03  eric
+ ref-no-pk

Revision 1.22  2010/09/27 14:50:44  eric
+ NodeMap
+ a rough pass on &lt;scala&gt;scala code&lt;/scala&gt;

Revision 1.21  2010/09/26 04:50:07  eric
~ fix load state for syntax display

Revision 1.20  2010/09/25 18:40:39  eric
+ some tips

Revision 1.19  2010/09/24 16:34:02  eric
+ some tips

Revision 1.18  2010/09/24 16:00:53  eric
+ some tips

Revision 1.17  2010/09/24 15:50:41  eric
+ buttons for different languages

Revision 1.16  2010/09/07 12:14:44  eric
~ fixed pk invocation errors per  mid:04C1B62C-42A5-424C-974B-6E894ED7B11A@cyganiak.de

Revision 1.15  2010/08/30 18:37:19  eric
+ <a href="#no-pk">Empty (Non-existent) Primary Keys</a> section

Revision 1.14  2010/08/30 14:05:45  eric
+ fks

Revision 1.13  2010/08/30 13:27:01  eric
~ content-free prettying-up

Revision 1.12  2010/08/23 14:24:22  eric
~ simplified per Richard's suggestions

Revision 1.11  2010/07/18 21:33:21  eric
~ proof-reading for an <a href="http://www.w3.org/mid/20100718213135.GC18491@w3.org">explanatory email</a>

Revision 1.10  2010/07/12 23:15:42  eric
~ typos revealed when geeking with Sandro

Revision 1.9  2010/06/15 15:23:43  eric
~ validating

Revision 1.8  2010/06/15 14:33:59  eric
~ s/Heading/Header/ per <a href="http://www.googlefight.com/index.php?lang=en_GB&amp;word1=relational+heading&amp;word2=relational+header">google fight</a>

Revision 1.7  2010/06/15 14:27:08  eric
~ s/∀/∣/g per cygri's comment

Revision 1.6  2010/06/07 15:49:34  eric
+ <a href="#extend">Extending the Direct Mapping</a> section

Revision 1.5  2010/06/07 14:35:18  eric
+ finished mappings

Revision 1.4  2010/06/03 23:02:58  eric
~ SNAPSHOT

Revision 1.3  2010/06/03 13:06:00  eric
+ start on literal map

Revision 1.2  2010/06/03 12:43:30  eric
~ made algebra all symboly

Revision 1.1  2010/06/02 15:03:34  eric
CREATED

	</pre>
      </div2>
    </div1>
  </back>
</spec>
       
