<?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 Direct Mapping of Relational Data to RDF</title>
    <w3c-designation>Internal Working Draft</w3c-designation>
    <w3c-doctype>Editor's Draft</w3c-doctype>
    <!-- notice>Notice this!!</notice -->
    <publoc>
      $Id: Overview.xml,v 1.37 2011/11/15 17:08:34 eric Exp $
    </publoc>
    <prevlocs>
      <loc href="http://www.w3.org/TR/2011/WD-rdb-direct-mapping-20110324/">http://www.w3.org/TR/2011/WD-rdb-direct-mapping-20110324/</loc>
    </prevlocs>
    <latestloc>
      <loc href="http://www.w3.org/TR/rdb-direct-mapping/">http://www.w3.org/TR/rdb-direct-mapping/</loc>
    </latestloc>
    <authlist>
      
      <author role="Editor">
	<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 role="Editor">
	<name>Alexandre Bertails</name>
	<affiliation>W3C</affiliation>
	<email href="mailto:bertails@w3.org">bertails@w3.org</email>
      </author>
     <author role="Editor">
	<name>Eric Prud'hommeaux</name>
	<affiliation>W3C</affiliation>
	<email href="mailto:eric@w3.org">eric@w3.org</email>
      </author>
      <author role="Editor">
	<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 <em>direct 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 Public Working Draft of the "A Direct Mapping of Relational Data to RDF"
    for review by W3C members and other interested parties.</p>

    <p>This document was developed by the W3C <a
    href="http://www.w3.org/2001/sw/rdb2rdf/">RDB2RDF Working
    Group</a>. The Working Group expects to advance this Working Draft
    to Recommendation Status. A complete <a href="#sec-cvsLog">list of
    changes</a> to this document is available.
    </p>

    <p>Comments on this document should be sent to <a href=
    "mailto:public-rdb2rdf-comments@w3.org">public-rdb2rdf-comments@w3.org</a>,
    a mailing list with a <a href=
    "http://lists.w3.org/Archives/Public/public-rdb2rdf-comments/">public
    archive</a>.</p>

    <p>Publication as a Working Draft does not imply endorsement by the W3C Membership.
    This is a draft document and may be updated, replaced or obsoleted by other documents
    at any time. It is inappropriate to cite this document as other than work in
    progress.</p>

    <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/43889/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: Overview.xml,v 1.37 2011/11/15 17:08:34 eric 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="SQLFN"/> to manipulate and examine the contents predictably and efficiently.
Resource Description Framework (RDF) <bibref ref="RDF-concepts"/> 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>

      <p>
The Direct Mapping is intended to provide a default behavior for <a href="http://www.w3.org/TR/2010/WD-r2rml-20101028/">R2RML: RDB to RDF Mapping Language</a>.
It can also be used to materialize RDF graphs or define virtual graphs, which can be queried by SPARQL or traversed by an RDF graph API.
      </p>
    </div1>

    <div1 id="emp-addr" note="#use">
      <head>Direct Mapping Description (Informative)</head>
      <p>
The direct mapping defines an <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-graph">RDF Graph</a> <bibref ref="RDF-concepts"/> representation of the data in any relational database with a set of common datatypes (see the <a href="#defn-literal_map">definition of literal map</a> below).
The direct mapping takes as input a relational database (data and schema), and generates an RDF graph that is called the <em>direct graph</em>. <!-- uniquely assigned to the database -->
The algorithms in this document compose a graph of relative IRIs which must be resolved against a <em>base</em> IRI <bibref ref="RFC3987"/> to form an RDF graph.
      </p>
      <p>
Foreign keys in relational databases establish a reference from any row in a table to exactly one row in a (potentially different) table.
The direct graph conveys these references, as well as each value in the row.
      </p>
      <div2 id="lead-ex">
      <head>Direct Mapping Example</head>
      <p>
The concepts in direct mapping can be introduced with an example RDF graph produced by a relational database.
	Following is SQL (DDL) to create a simple example with two tables with single-column primary keys and one foreign key reference between them:
      </p>
      <xsd>
CREATE TABLE Addresses (
	ID INT, PRIMARY KEY(ID), 
	city CHAR(10), 
	state CHAR(2)
)

CREATE TABLE People (
	ID INT, PRIMARY KEY(ID), 
	fname CHAR(10), 
	addr INT, 
	FOREIGN KEY(addr) REFERENCES Addresses(ID)
)

INSERT INTO Addresses (ID, city, state) VALUES (18, 'Cambridge', 'MA')
INSERT INTO People (ID, fname, addr) VALUES (7, 'Bob', 18)
INSERT INTO People (ID, fname, addr) VALUES (8, 'Sue', NULL)
      </xsd>
      <p>
HTML tables will be used in this document to convey SQL tables.
The primary key of these tables will be marked with the <code class="pk">PK</code> class to convey an SQL primary key such as <code>ID</code> in <code>CREATE TABLE Addresses (ID INT, ... PRIMARY KEY(ID))</code>.
Foreign keys will be illustrated with a notation like "<code>→ Address(ID)</code>" to convey an SQL foreign key such as <code>CREATE TABLE People (... addr INT, FOREIGN KEY(addr) REFERENCES Addresses(ID))</code>.
      </p>

      <multicol>
	<table class="nonRight hover" cellpadding="2" cellspacing="0" border="1">
	  <caption>People</caption>
	  <tbody>
	    <tr class="SQLconstraints">
	      <th class="pk">PK</th>
	      <th colspan="1"></th>
	      <th>→ Address(ID)</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 hover" cellpadding="2" cellspacing="0" border="1">
	  <caption>Addresses</caption>
	  <tbody>
	    <tr class="SQLconstraints">
	      <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 class="clear">
Given a base IRI <code>http://foo.example/DB/</code>, the direct
mapping of this database produces a direct graph:  
      </p>

      <turtle id="emp-addr-ex1">
@base &lt;http://foo.example/DB/&gt;
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .


<triple onmouseover="hilight('emp-addr_per7')"
	onmouseout ="lolight('emp-addr_per7')">&lt;People/ID<valsep>-</valsep>7&gt; rdf:type &lt;People&gt; .</triple>
<triple onmouseover="hilight('emp-addr_per7')"
	onmouseout ="lolight('emp-addr_per7')"
	id="emp-addr_t_7"        >&lt;People/ID<valsep>-</valsep>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<valsep>-</valsep>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<valsep>-</valsep>7&gt; &lt;People#addr&gt; 18 .</triple>
<triple onmouseover="hilight('emp-addr_addr18')"
	onmouseout ="lolight('emp-addr_addr18')"
	id="emp-addr_t_ref18"    >&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#ref<Pnamesep>-</Pnamesep>addr&gt; &lt;Addresses/ID<valsep>-</valsep>18&gt; .</triple>
<triple onmouseover="hilight('emp-addr_per8')"
	onmouseout ="lolight('emp-addr_per8')">&lt;People/ID<valsep>-</valsep>8&gt; rdf:type &lt;People&gt; .</triple>
<triple onmouseover="hilight('emp-addr_per8')"
	onmouseout ="lolight('emp-addr_per8')"
	id="emp-addr_t_8"        >&lt;People/ID<valsep>-</valsep>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<valsep>-</valsep>8&gt; &lt;People#fname&gt; "Sue" .</triple>

<triple onmouseover="hilight('emp-addr_addr18')"
	onmouseout ="lolight('emp-addr_addr18')">&lt;Addresses/ID<valsep>-</valsep>18&gt; rdf:type &lt;Addresses&gt; .</triple>
<triple onmouseover="hilight('emp-addr_addr18')"
	onmouseout ="lolight('emp-addr_addr18')"
	id="emp-addr_t_18"       >&lt;Addresses/ID<valsep>-</valsep>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<valsep>-</valsep>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<valsep>-</valsep>18&gt; &lt;Addresses#state&gt; "MA" .</triple>
      </turtle>
      <p>
In this expression, each row, e.g. <code>(7, "Bob", 18)</code>, produces a set of triples with a common subject. 
The subject is an IRI formed from the concatenation of the base IRI, table name (<code>People</code>), primary key column name (<code>ID</code>) and primary key value (<code>7</code>). 
The predicate for each column is an IRI formed from the concatenation of the base IRI, table name and the column name. 
The values are RDF literals formed from the lexical form of the column value.
Each foreign keys produces a triple with a predicate composed from the foreign key column names, the referenced table, and the referenced column names.
The object of these triples is the row identifiers (<code>&lt;Addresses/ID<valsep>-</valsep>18&gt;</code>) for the referenced triple. 
Note that these reference row identifiers must coincide with the subject used for the triples generated from the referenced row. Additionally, the 
direct mapping does not generate triples for NULL values; note however that it is not known how to relate the behaviour of the obtained RDF graph with the standard SQL semantics of the NULL values of the source RDB. 
For a detailed discussion of this issue, see a forthcoming working group note.
      </p>


      <!-- div3 id="use">
	<head>Use of the Direct Mapping</head>
	<p>
The Direct Mapping is intended to provide a default behavior for <a href="http://www.w3.org/TR/2010/WD-r2rml-20101028/">R2RML: RDB to RDF Mapping Language</a>.
It can be also used to materialize RDF graphs, such as the one above, or define virtual graphs, which can be queried by SPARQL or traversed by an RDF graph API.
When used to define a virtual graph, SPARQL queries over that virtual graph (below, left) may be executed as SQL queries (below, right), and the results transformed to RDF terms and return as <a href="http://www.w3.org/TR/rdf-sparql-XMLres/">SPARQL results</a>.
	</p>
	  <multicol>
	    <turtle class="nonRight">
PREFIX People: &lt;http://foo.example/DB/People#&gt;
PREFIX Addresses: &lt;http://foo.example/DB/Addresses#&gt;
SELECT ?name ?city WHERE {
    <triple onmouseover="hilight('emp-addr_t_Bob')"
	    onmouseout ="lolight('emp-addr_t_Bob')"
	    id="emp-addr_t_Bob">?who People:fname &lt;?name&gt; .</triple>
    <triple onmouseover="hilight('emp-addr_t_ref18')"
	    onmouseout ="lolight('emp-addr_t_ref18')"
	    id="emp-addr_q_ref18">?who People:addr ?address .</triple>
    <triple onmouseover="hilight('emp-addr_t_Cambridge')"
	    onmouseout ="lolight('emp-addr_t_Cambridge')"
	    id="emp-addr_q_Cambridge">?address People:city ?city .</triple>
 }
	    </turtle>
	    <sql class="nonRight">
&#x2d;&#x2d; SQL capturing the SPARQL query's graph constraints.
SELECT People.fname AS name, Addresses.city
  FROM People
  JOIN Addresses
       ON Addresses.ID=People.addr
 WHERE People.fname IS NOT NULL
   AND Addresses.city IS NOT NULL
	    </sql><div class="right"/>
	  </multicol>
      </div3 -->

      </div2>

      <!-- div2 id="rules">
	<head>Mapping Rules</head>
	<p>
	  Each row in the database produces a set of <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-triple">RDF triples</a> with a <em>subject</em>, <em>predicate</em>, and <em>object</em> composed as follows:
	</p>

	<ulist>
	  <item>
	     <em>Shared Subject:</em> A <a href="#row_iri">Row RDF Node</a>, which may be an Generating <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">IRI</a>, is generated for each row. 
	  </item>
	           <item id="row_type_triple"> 
<em>Table Triples:</em> The row generates a triple with the following:  
               <ulist>
                  <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>Predicate:</em> the <a href="#lit_prop_iri">Column IRI</a> for the
column 
                  </item>
                  <item>
<em>Object:</em> an <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-literal">RDF Literal</a> with an XML Schema datatype corresponding to the SQL datatype of that value. String datatypes <a href="#literal_map">are expressed as</a> an <a href="http://www.w3.org/TR/rdf-concepts/#dfn-plain-literal">RDF plain literal</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>Predicate:</em> the <a href="#lit_prop_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>

         	
        <issue id="primary-is-candidate-key">
          <p>Should the following exception be included in the
definition of the direct mapping?</p>
	<p id="pfkexception"><em>Primary-is-Candidate-Key Exception</em>: If the primary key is also a candidate key K to table R:</p>
	<ulist>
	  <item>
	    The shared subject is the subject of the referenced row in R.
	  </item>
	  <item>
	    The foreign key K generates no reference triple.
	  </item>
	  <item>
	    Even if K is a single-column foreign key, it generates a literal triple.
	  </item>
	</ulist>
        </issue>
      </div2 -->

      <div2 id="fk-candidate">
	<head>Foreign keys referencing candidate keys</head>
	<p>
More complex schemas include composite primary keys<!--
and potentially incomplete foreign keys -->. 
<!-- SQL foreign keys reference primary or candidate keys in the
referenced relations. --> 
In this example, the columns <em>deptName</em> and <em>deptCity</em>
in the <em>People</em> table reference <em>name</em> and <em>city</em>
in the <em>Department</em> table:
	</p>
         <xsd>
CREATE TABLE Addresses (
	ID INT, 
	city CHAR(10), 
	state CHAR(2), 
	PRIMARY KEY(ID)
)

CREATE TABLE Department (
	ID INT, 
	name CHAR(10), 
	city CHAR(10), 
	manager INT, 
	PRIMARY KEY(ID), 
	UNIQUE (name, city)
)

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) 
)

ALTER TABLE Department ADD FOREIGN KEY(manager) REFERENCES People(ID)
         </xsd>	
	 <p>  
Following is an instance of this schema:	   
         </p>
	   <multicol>
	      <table class="nonRight hover" cellpadding="2" cellspacing="0" border="1">
	         <caption>People</caption>
	         <tbody>
	            <tr class="SQLconstraints">
                       <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">8</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 hover" cellpadding="2" cellspacing="0" border="1">
	        <caption>Addresses</caption>
	        <tbody>
	           <tr class="SQLconstraints">
		      <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 hover" cellpadding="2" cellspacing="0" border="1">
	        <caption>Department</caption>
	        <tbody>
	           <tr class="SQLconstraints">
		      <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>
Per the <em>People</em> tables's compound foreign key to Department:
	</p>
	<ulist>
	  <item>
The row in <em>People</em> with <code>deptName="accounting"</code> and <code>deptCity="Cambridge"</code> references a row in <em>Department</em> with a primary key of <code>ID=23</code>.
	  </item>
	  <item>
The predicate for this key is formed from the columns "<code>deptName</code>" and "<code>deptCity</code>", reflecting the order of the column names in the foreign key.
	  </item>
	  <item>
The object of the above predicate is formed from the base IRI, the table name "<code>Department</code>" and the primary key value "<code>ID=23</code>".
	  </item>
	</ulist>
        <p>
In this example, the direct mapping generates the following triples:
        </p>
	<turtle id="multi-key-ex1">
@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<valsep>-</valsep>7&gt; rdf:type &lt;People&gt; .</triple>
<triple onmouseover="hilight('multi-key_per7')"
	onmouseout ="lolight('multi-key_per7')"
	id="multi-key_t_7">&lt;People/ID<valsep>-</valsep>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<valsep>-</valsep>7&gt; &lt;People#fname&gt; "Bob" .</triple>
<triple onmouseover="hilight('multi-key_per18')"
	onmouseout ="lolight('multi-key_per18')"
	id="multi-key_t_ref18">&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#addr&gt; 18 .</triple>
<triple onmouseover="hilight('multi-key_addr18')"
	onmouseout ="lolight('multi-key_addr18')"
	id="multi-key_t_ref18">&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#ref<Pnamesep>-</Pnamesep>addr&gt; &lt;Addresses/ID<valsep>-</valsep>18&gt; .</triple>
<triple onmouseover="hilight('multi-key_peraccounting')"
	onmouseout ="lolight('multi-key_peraccounting')"
	id="multi-key_t_refaccounting" class="new">&lt;People/ID<valsep>-</valsep>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<valsep>-</valsep>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')"
	id="multi-key_t_refaccCa" class="new">&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#ref<Pnamesep>-</Pnamesep>deptName.deptCity&gt; &lt;Department/ID<valsep>-</valsep>23&gt; .</triple>
<triple onmouseover="hilight('multi-key_per8')"
	onmouseout ="lolight('multi-key_per8')">&lt;People/ID<valsep>-</valsep>8&gt; rdf:type &lt;People&gt; .</triple>
<triple onmouseover="hilight('multi-key_per8')"
	onmouseout ="lolight('multi-key_per8')"
	id="multi-key_t_8">&lt;People/ID<valsep>-</valsep>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<valsep>-</valsep>8&gt; &lt;People#fname&gt; "Sue" .</triple>

<triple onmouseover="hilight('multi-key_addr18')"
	onmouseout ="lolight('multi-key_addr18')">&lt;Addresses/ID<valsep>-</valsep>18&gt; rdf:type &lt;Addresses&gt; .</triple>
<triple onmouseover="hilight('multi-key_addr18')"
	onmouseout ="lolight('multi-key_addr18')"
	id="multi-key_t_18">&lt;Addresses/ID<valsep>-</valsep>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<valsep>-</valsep>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<valsep>-</valsep>18&gt; &lt;Addresses#state&gt; "MA" .</triple>

<triple onmouseover="hilight('multi-key_dept23');"
	onmouseout ="lolight('multi-key_dept23');"
	class="new">&lt;Department/ID<valsep>-</valsep>23&gt; rdf:type &lt;Department&gt; .</triple>
<triple onmouseover="hilight('multi-key_dept23');"
	onmouseout ="lolight('multi-key_dept23');"
	id="multi-key_t_23" class="new">&lt;Department/ID<valsep>-</valsep>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<valsep>-</valsep>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<valsep>-</valsep>23&gt; &lt;Department#city&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('multi-key_dept8');"
	onmouseout ="lolight('multi-key_dept8');"
	id="multi-key_t_ref8" class="new">&lt;Department/ID<valsep>-</valsep>23&gt; &lt;Department#manager&gt; 8; .</triple>
<triple onmouseover="hilight('multi-key_per8');"
	onmouseout ="lolight('multi-key_per8');"
	id="multi-key_t_ref8" class="new">&lt;Department/ID<valsep>-</valsep>23&gt; &lt;Department#ref<Pnamesep>-</Pnamesep>manager&gt; &lt;People#ID<valsep>-</valsep>8&gt; .</triple>
	</turtle>
        <p>
The green triples above are generated by considering the new elements
in the augmented database. Note: 
        </p>    
        <ulist>
   <!-- JUAN: because of ISSUE-65 ( I think), the following doesn't hold anymore    
        
           <item>
              <p>
Although <em>deptName</em> is an attribute of table <em>People</em> that is part of a foreign key, the <a href="#literal_triple">Literal
Triple</a> <code>&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#deptName&gt; "accounting" </code> is generated by the direct mapping because
<em>deptName</em> is not the sole column of a foreign key of table <em>People</em>.
              </p>
           </item>
       -->    
           
           
           <item>
              <p>
The <a href="#reference_triple_def">Reference Triple</a> <code>&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#ref-deptName.deptCity&gt; &lt;Department/ID<valsep>-</valsep>23&gt;</code> is generated by considering a foreign key referencing a candidate key (different from the primary key).
              </p>
           </item>
        </ulist>
        </div2>
      <div2 id="multi-key">
	<head>Multi-column primary keys</head>
            <p>
Primary keys may also be composite.
If, in <a href="#fk-candidate">the above example</a>, the primary key for <em>Department</em> were (<em>name</em>, <em>city</em>) instead of <em>ID</em>, the identifier for the only row in this table would be  <code>&lt;Department/name<valsep>-</valsep>accounting<attrsep>.</attrsep>city<valsep>-</valsep>Cambridge&gt;</code>.
The triples involving <code>&lt;Department/ID<valsep>-</valsep>23&gt;</code> would be substituted with the following triples: 
            </p>
            <turtle id="multi-col-ex1">
<triple>&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#ref-deptName.deptCity&gt; &lt;Department/name<valsep>-</valsep>accounting<attrsep>.</attrsep>city<valsep>-</valsep>Cambridge&gt; .</triple> 
<triple>&lt;Department/name<valsep>-</valsep>accounting<attrsep>.</attrsep>city<valsep>-</valsep>Cambridge&gt; rdf:type &lt;Department&gt; .</triple> 
<triple>&lt;Department/name<valsep>-</valsep>accounting<attrsep>.</attrsep>city<valsep>-</valsep>Cambridge&gt; &lt;Department#ID&gt; 23 .</triple> 
<triple>&lt;Department/name<valsep>-</valsep>accounting<attrsep>.</attrsep>city<valsep>-</valsep>Cambridge&gt; &lt;Department#name&gt; "accounting" .</triple>
<triple>&lt;Department/name<valsep>-</valsep>accounting<attrsep>.</attrsep>city<valsep>-</valsep>Cambridge&gt; &lt;Department#city&gt; "Cambridge" .</triple>
            </turtle>

      </div2>

      <div2 id="no-pk">
	<head>Empty (non-existent) primary keys</head>
	<p>
If there is no primary key, rows implies a set of triples with a shared subject, but that subject is a blank node. 
A <em>Tweets</em> table can be added to <a href="#fk-candidate">the above example</a> to keep track of employees' tweets in Twitter:
             </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 hover" cellpadding="2" cellspacing="0" border="1">
	    <caption>Tweets</caption>
	    <tbody>
	      <tr class="SQLconstraints">
		<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="#multi-key_per7">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="#multi-key_per7">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 direct mapping generates the following triples: 
        </p>
	<turtle id="no-pk-ex1">
@base &lt;http://foo.example/DB/&gt;
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

<triple onmouseover="hilight('no-pk_tweeta7')"
	onmouseout ="lolight('no-pk_tweeta7')">_:a rdf:type &lt;Tweets&gt; .</triple>
<triple onmouseover="hilight('no-pk_tweeta7')"
	onmouseout ="lolight('no-pk_tweeta7')"
	id="no-pk_t_a7">_:a &lt;Tweets#ref<Pnamesep>-</Pnamesep>tweeter&gt; &lt;People/ID<valsep>-</valsep>7&gt; .</triple>
<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_tweetb7')"
	onmouseout ="lolight('no-pk_tweetb7')">_:b rdf:type &lt;Tweets&gt; .</triple>
<triple onmouseover="hilight('no-pk_tweetb7')"
	onmouseout ="lolight('no-pk_tweetb7')"
	id="no-pk_t_b7">_:b &lt;Tweets#tweeter&gt; &lt;People/ID<valsep>-</valsep>7&gt; .</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>
        </div2>

	<div2 id="ref-no-pk">
	  <head>Referencing tables with empty primary keys</head>
	  <p>
Rows in tables with no primary key may still be referenced by foreign keys.
(Relational database theory tells us that these rows must be unique as foreign keys reference candidate keys and candidate keys are unique across all the rows in a table.)
References to rows in tables with no primary key are expressed as RDF triples with blank nodes for objects, where that blank node is the same node used for the subject in the referenced row.
	  </p>
	  <p>
This example includes several foreign keys with mutual column names.
For clarity; here is the DDL to clarify these keys:
	  </p>
	  <xsd>
CREATE TABLE Projects (
	lead INT,
        FOREIGN KEY (lead) REFERENCES People(ID),
        name VARCHAR(50), 
        UNIQUE (lead, name), 
        deptName VARCHAR(50), 
        deptCity VARCHAR(50),
        UNIQUE (name, deptName, deptCity),
        FOREIGN KEY (deptName, deptCity) REFERENCES Department(name, city)
)

CREATE TABLE TaskAssignments (
	worker INT,
        FOREIGN KEY (worker) REFERENCES People(ID),
        project VARCHAR(50), 
        PRIMARY KEY (worker, project), 
        deptName VARCHAR(50), 
        deptCity VARCHAR(50),
        FOREIGN KEY (worker) REFERENCES People(ID),
        FOREIGN KEY (project, deptName, deptCity) REFERENCES Projects(name, deptName, deptCity),
        FOREIGN KEY (deptName, deptCity) REFERENCES Department(name, city)
)
	  </xsd>
          <p>
The following is an instance of the preceding schema:
          </p>
	  <multicol>
	    <table class="nonRight hover" cellpadding="2" cellspacing="0" border="1">
	      <caption>Projects</caption>
	      <tbody>
		<tr class="SQLconstraints">
		  <th colspan="2">Unique key</th>
		  <th colspan="2"></th>
		</tr>
		<tr class="SQLconstraints">
		  <th colspan="1"></th>
		  <th colspan="3">Unique key</th>
		</tr>
		<tr class="SQLconstraints">
		  <th colspan="1">→ People(ID)</th>
		  <th colspan="1"></th>
		  <th colspan="2">→ Department(name, city)</th>
		</tr>
		<tr>
		  <th>lead</th>
		  <th>name</th>
		  <th>deptName</th>
		  <th>deptCity</th>
		</tr>
		<tr>
		  <td onmouseover="hilight('ref-no-pk_t_c8');"
		      onmouseout ="lolight('ref-no-pk_t_c8');"
		      id="ref-no-pk_projc8" class="fk"><a href="#multi-key_per8">8</a></td>
		  <td onmouseover="hilight('ref-no-pk_t_cpencil');"
		      onmouseout ="lolight('ref-no-pk_t_cpencil');"
		      id="ref-no-pk_projcpencil">pencil survey</td>
		  <td onmouseover="hilight('ref-no-pk_t_cacc');hilight('ref-no-pk_t_c23')"
		      onmouseout ="lolight('ref-no-pk_t_cacc');lolight('ref-no-pk_t_c23')"
		      id="ref-no-pk_projcacc">accounting</td>
		  <td onmouseover="hilight('ref-no-pk_t_cCam');hilight('ref-no-pk_t_c23')"
		      onmouseout ="lolight('ref-no-pk_t_cCam');lolight('ref-no-pk_t_c23')"
		      id="ref-no-pk_projcCam">Cambridge</td>
		</tr>
		<tr>
		  <td onmouseover="hilight('ref-no-pk_t_d8');"
		      onmouseout ="lolight('ref-no-pk_t_d8');"
		      id="ref-no-pk_projd8" class="fk"><a href="#multi-key_per8">8</a></td>
		  <td onmouseover="hilight('ref-no-pk_t_deraser');"
		      onmouseout ="lolight('ref-no-pk_t_deraser');"
		      id="ref-no-pk_projderaser">eraser survey</td>
		  <td onmouseover="hilight('ref-no-pk_t_dacc');hilight('ref-no-pk_t_d23')"
		      onmouseout ="lolight('ref-no-pk_t_dacc');lolight('ref-no-pk_t_d23')"
		      id="ref-no-pk_projdacc">accounting</td>
		  <td onmouseover="hilight('ref-no-pk_t_dCam');hilight('ref-no-pk_t_d23')"
		      onmouseout ="lolight('ref-no-pk_t_dCam');lolight('ref-no-pk_t_d23')"
		      id="ref-no-pk_projdCam">Cambridge</td>
		</tr>
	      </tbody>
	    </table>
	    <table class="right hover" cellpadding="2" cellspacing="0" border="1">
	      <caption>TaskAssignments</caption>
	      <tbody>
		<tr class="SQLconstraints">
		  <th colspan="2" class="pk">PK</th>
		  <th colspan="2"></th>
		</tr>
		<tr class="SQLconstraints">
		  <th></th>
		  <th colspan="3">→ Projects(name, deptName, deptCity)</th>
		</tr>
		<tr class="SQLconstraints">
		  <th>→ People(ID)</th>
		  <th colspan="1"></th>
		  <th colspan="2">→ Departments(name, city)</th>
		</tr>
		<tr>
		  <th class="pk">worker</th>
		  <th class="pk">project</th>
		  <th>deptName</th>
		  <th>deptCity</th>
		</tr>
		<tr>
		  <td onmouseover="hilight('ref-no-pk_t_pencil7')"
		      onmouseout ="lolight('ref-no-pk_t_pencil7')"
		      id="ref-no-pk_ta7" class="pk"><a href="#multi-key_per7">7</a></td>
		  <td onmouseover="hilight('ref-no-pk_t_pencilpencil');hilight('ref-no-pk_t_pencilc');hilight('ref-no-pk_projcpencil')"
		      onmouseout ="lolight('ref-no-pk_t_pencilpencil');lolight('ref-no-pk_t_pencilc');lolight('ref-no-pk_projcpencil')"
		      id="ref-no-pk_tapencil" class="pk">pencil survey</td>
		  <td onmouseover="hilight('ref-no-pk_t_pencilacc');hilight('ref-no-pk_t_pencilc');hilight('ref-no-pk_t_pencil23');hilight('ref-no-pk_projcacc')"
		      onmouseout ="lolight('ref-no-pk_t_pencilacc');lolight('ref-no-pk_t_pencilc');lolight('ref-no-pk_t_pencil23');lolight('ref-no-pk_projcacc')"
		      id="ref-no-pk_taacc">accounting</td>
		  <td onmouseover="hilight('ref-no-pk_t_pencilCam');hilight('ref-no-pk_t_pencilc');hilight('ref-no-pk_t_pencil23');hilight('ref-no-pk_projcCam')"
		      onmouseout ="lolight('ref-no-pk_t_pencilCam');lolight('ref-no-pk_t_pencilc');lolight('ref-no-pk_t_pencil23');lolight('ref-no-pk_projcCam')"
		      id="ref-no-pk_taCam">Cambridge</td>
		</tr>
	      </tbody>
	    </table>
	  </multicol>
          <p>
In this case, the direct mapping generates the following triples from the preceding tables:
          </p>
	  <turtle id="ref-no-pk-ex1">
@base &lt;http://foo.example/DB/&gt;
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

<triple onmouseover="hilight('ref-no-pk_projc8')"
	onmouseout ="lolight('ref-no-pk_projc8')">_:c rdf:type &lt;Projects&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_projc8')"
	onmouseout ="lolight('ref-no-pk_projc8')"
	id="ref-no-pk_t_c8">_:c &lt;Projects#lead&gt; &lt;People/ID<valsep>-</valsep>8&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_projcpencil')"
	onmouseout ="lolight('ref-no-pk_projcpencil')"
	id="ref-no-pk_t_cpencil">_:c &lt;Projects#name&gt; "pencil survey" .</triple>
<triple onmouseover="hilight('ref-no-pk_projcacc')"
	onmouseout ="lolight('ref-no-pk_projcacc')"
	id="ref-no-pk_t_cacc">_:c &lt;Projects#deptName&gt; "accounting" .</triple>
<triple onmouseover="hilight('ref-no-pk_projcCam')"
	onmouseout ="lolight('ref-no-pk_projcCam')"
	id="ref-no-pk_t_cCam">_:c &lt;Projects#deptCity&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('ref-no-pk_projcacc'); hilight('ref-no-pk_projcCam')"
	onmouseout ="lolight('ref-no-pk_projcacc'); lolight('ref-no-pk_projcCam')"
	id="ref-no-pk_t_c23">_:c &lt;Projects#ref<Pnamesep>-</Pnamesep>deptName<Pnamensep>.</Pnamensep>deptCity&gt; &lt;Department/ID<valsep>-</valsep>23&gt; .</triple>

<triple onmouseover="hilight('ref-no-pk_projd8')"
	onmouseout ="lolight('ref-no-pk_projd8')">_:d rdf:type &lt;Projects&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_projd8')"
	onmouseout ="lolight('ref-no-pk_projd8')"
	id="ref-no-pk_t_d8">_:d &lt;Projects#lead&gt; &lt;People/ID<valsep>-</valsep>8&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_projderaser')"
	onmouseout ="lolight('ref-no-pk_projderaser')"
	id="ref-no-pk_t_deraser">_:d &lt;Projects#name&gt; "eraser survey" .</triple>
<triple onmouseover="hilight('ref-no-pk_projdacc')"
	onmouseout ="lolight('ref-no-pk_projdacc')"
	id="ref-no-pk_t_dacc">_:d &lt;Projects#deptName&gt; "accounting" .</triple>
<triple onmouseover="hilight('ref-no-pk_projdCam')"
	onmouseout ="lolight('ref-no-pk_projdCam')"
	id="ref-no-pk_t_dCam">_:d &lt;Projects#deptCity&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('ref-no-pk_projdacc'); hilight('ref-no-pk_projdCam')"
	onmouseout ="lolight('ref-no-pk_projdacc'); lolight('ref-no-pk_projdCam')"
	id="ref-no-pk_t_d23">_:d &lt;Projects#ref<Pnamesep>-</Pnamesep>deptName<Pnamensep>.</Pnamensep>deptCity&gt; &lt;Department/ID<valsep>-</valsep>23&gt; .</triple>

<triple onmouseover="hilight('ref-no-pk_ta7')"
	onmouseout ="lolight('ref-no-pk_ta7')">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; rdf:type &lt;TaskAssignments&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_ta7')"
	onmouseout ="lolight('ref-no-pk_ta7')"
	id="ref-no-pk_t_pencil7">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#worker&gt; 7 .</triple>
<triple onmouseover=""
	onmouseout =""
	id="ref-no-pk_t_pencil7">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#ref<Pnamesep>-</Pnamesep>worker&gt; &lt;People/ID<valsep>-</valsep>7&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_tapencil')"
	onmouseout ="lolight('ref-no-pk_tapencil')"
	id="ref-no-pk_t_pencilpencil">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#project&gt; "pencil survey" .</triple>
<triple onmouseover="hilight('ref-no-pk_taacc')"
	onmouseout ="lolight('ref-no-pk_taacc')"
	id="ref-no-pk_t_pencilacc">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#deptName&gt; "accounting" .</triple>
<triple onmouseover="hilight('ref-no-pk_taCam')"
	onmouseout ="lolight('ref-no-pk_taCam')"
	id="ref-no-pk_t_pencilCam">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#deptCity&gt; "Cambridge" .</triple>
<triple onmouseover="hilight('ref-no-pk_taacc');hilight('ref-no-pk_taCam')"
	onmouseout ="lolight('ref-no-pk_taacc');lolight('ref-no-pk_taCam')"
	id="ref-no-pk_t_pencil23">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#ref<Pnamesep>-</Pnamesep>deptName<Pnamensep>.</Pnamensep>deptCity&gt; &lt;Department/ID<valsep>-</valsep>23&gt; .</triple>
<triple onmouseover="hilight('ref-no-pk_tapencil');hilight('ref-no-pk_taacc');hilight('ref-no-pk_taCam')"
	onmouseout ="lolight('ref-no-pk_tapencil');lolight('ref-no-pk_taacc');lolight('ref-no-pk_taCam')"
	id="ref-no-pk_t_pencilc" class="new">&lt;TaskAssignment/worker-7.project-pencil+survey&gt; &lt;TaskAssignments#ref<Pnamesep>-</Pnamesep>project.deptName<Pnamensep>.</Pnamensep>deptCity&gt; _:c .</triple>
	  </turtle>
	  <p>
The absence of a primary key forces the generation of blank nodes, but does not change the structure of the direct graph or names of the predicates in that graph.
<!-- This example SPARQL query would find the leads for <em>Person</em> 7's projects regardless of whether the <em>Projects</em> table had a primary key or not.
The following SPARQL query show how the graph constraints might be captured in an RDF query; the SQL query shows how it might be executed as SQL: -->
	  </p>
<!--
	  <multicol>
	    <turtle class="nonRight">
PREFIX asgn: &lt;http://foo.example/DB/TaskAssignments#&gt;
PREFIX proj: &lt;http://foo.example/DB/Projects#&gt;
SELECT ?lead
 <triple onmouseover="hilight('ref-no-pk_t_pencil7');hilight('ref-no-pk_t_pencilc');hilight('ref-no-pk_t_c8');hilight('ref-no-pk_q_pencil7');hilight('ref-no-pk_q_pencilc');hilight('ref-no-pk_q_c8')"
	 onmouseout ="lolight('ref-no-pk_t_pencil7');lolight('ref-no-pk_t_pencilc');lolight('ref-no-pk_t_c8');lolight('ref-no-pk_q_pencil7');lolight('ref-no-pk_q_pencilc');lolight('ref-no-pk_q_c8')"
	 id="ref-no-pk_q_where">WHERE</triple> {
    <triple onmouseover="hilight('ref-no-pk_t_pencil7')"
	    onmouseout ="lolight('ref-no-pk_t_pencil7')"
	    id="ref-no-pk_q_pencil7">?assignment asgn:worker &lt;http://foo.example/DB/People/ID<valsep>-</valsep>7&gt; .</triple>
    <triple onmouseover="hilight('ref-no-pk_t_pencilc')"
	    onmouseout ="lolight('ref-no-pk_t_pencilc')"
	    id="ref-no-pk_q_pencilc">?assignment asgn:project,deptName,deptCity ?project .</triple>
    <triple onmouseover="hilight('ref-no-pk_t_c8')"
	    onmouseout ="lolight('ref-no-pk_t_c8')"
	    id="ref-no-pk_q_c8">?project proj:lead ?lead .</triple>
 }
	    </turtle>
	    <sql class="nonRight">
&#x2d;&#x2d; SQL capturing the SPARQL query's graph constraints.
SELECT lead
FROM TaskAssignments
JOIN Projects ON
      Projects.project=TaskAssignments.name
  AND Projects.deptName=TaskAssignments.deptName
  AND Projects.deptCity=TaskAssignments.deptCity
WHERE Projects.worker=7
	    </sql><div class="right"/>
	  </multicol>
-->
	</div2>
    </div1>
    
    <div1 id="definition">
      <head>Direct Graph Definition</head>
      <p>
	The Direct Graph is a formula for creating an RDF graph from the rows of each table and view in a database schema.
	A base IRI defines a web space for the IRIs in this graph; for the purposes of this specification, all IRIs are generated by appending to a base.
	Terms enclosed in &lt;&gt; are defined in the SQL specification <bibref ref="SQLFN"/>.
      </p>

      <p>
	An SQL table has a set of uniquely-named columns and a set of foreign keys, each mapping a &lt;column name list&gt; to a &lt;unique column list&gt; (a list of columns in some table).
      </p>

      <p>
	SQL table and column identifiers compose RDF IRIs in the direct graph.
	These identifiers are separated by the punctuation characters '#', '<attrsep>.</attrsep>', '/' and '<valsep>-</valsep>'.
	All SQL identifiers are escaped following URL-encoding <a href="http://www.w3.org/TR/html5/association-of-controls-and-forms.html#url-encoded-form-data">HTML form data</a> except that only the above punctuation and the characters not permitted in RDF IRIs are escaped.
      </p>

      <defns>
	<defn name="percent-encode"> (a subset of <a href="http://dev.w3.org/html5/spec/Overview.html#url-encoded-form-data">HTML5 form dataset encoding</a>):
	<ul>
	  <li>                      Replace each PERCENT SIGN character ('%', U+0025) with the string "%25".</li>
	  <li>For table names,      replace each NUMBER SIGN  character ('#', U+0023) with the string "%23".</li>
	  <li>For table names,      replace each SOLIDUS      character ('/', U+002f) with the string "%2f".</li>
	  <li>For attribute names,  replace each HYPHEN-MINUS character ('<valsep>-</valsep>', U+003d) with the string "%3D".</li>
	  <li>For attribute values, replace each FULL STOP    character ('<attrsep>.</attrsep>', U+002e) with the string "%2E".</li>
	  <li>Replace each SPACE        character (U+0020) with the PLUS SIGN character (+, U+002B).</li>
	</ul>
	</defn>
      </defns>

      <issue id="separators">
	There are <a href="http://www.w3.org/mid/20110908203432.GG27040@w3.org">many choices</a> for the custom percent-encoding scheme to use for separating table names, attribute names and values in <a href="#defn-row node">row nodes</a> and <a href="#defn-reference_property_IRI">reference property IRIs</a>, described in <a href="http://www.w3.org/2001/sw/rdb2rdf/track/issues/67">ISSUE-67</a>. This choice of separators is at risk and may change before this document reaches <a href="http://www.w3.org/2005/10/Process-20051014/tr#RecsCR">Candidate Recommendation</a>.
	<resolution>
	  Adopt choice 1 of <a href="http://www.w3.org/mid/20110908203432.GG27040@w3.org">ericP's summary of options</a>.
	</resolution>
      </issue>

      <p id="row_node_def">
	There is either a blank node or IRI assigned to each each row in a table:
      </p>

      <defns>
	<defn name="row node">
	  <ul>
	    <li>If the table has a primary key, the row node is a relative IRI obtained by concatenating:
	    <ul>
	      <li>
		the percent-encoded form of the table name,
	      </li>
	      <li>
		the SOLIDUS character '/',
	      </li>
	      <li>
		for each column in the primary key, in order:
		<ul>
		  <li>
		    the percent-encoded form of the column name,
		  </li>
		  <li>
		    an HYPHEN-MINUS character '<valsep>-</valsep>',
		  </li>
		  <li>
		    the percent-encoded form of the column value,
		  </li>
		  <li>
		    if it is not the last column in the foreign key, a FULL STOP character '<attrsep>.</attrsep>'
		  </li>
		</ul>
	      </li>
	    </ul>
	    </li>
	    <li>If the table has no primary key, the row node is a fresh blank node that is unique to this row.</li>
	  </ul>
	</defn>
      </defns>

      <p id="table_iri">
	A table forms a table IRI:
      </p>

      <defns>
	<defn name="table IRI"> the relative IRI consisting of the percent-encoded form of the table name
	
	</defn>
      </defns>

      <p id="lit_prop_iri">
	A column in a table forms a literal property IRI:
      </p>

      <defns>
	<defn name="literal property IRI">the concatenation of:
	<ul>
	  <li>
	    the percent-encoded form of the table name,
	  </li>
	  <li>
	    the hash character '#',
	  </li>
	  <li>
	    the percent-encoded form of the column name,
	  </li>
	</ul>
	</defn>
      </defns>

      <p id="ref_prop_iri">
	A foreign key in a table forms a reference property IRI:
      </p>

      <defns>
	<defn name="reference property IRI">the concatenation of:
	<ul>
	  <li>
	    the percent-encoded form of the table name,
	  </li>
	  <li>
	    the string '#ref<Pnamesep>-</Pnamesep>',
	  </li>
	  <li>
	    for each column in the foreign key, in order:
	    <ul>
	      <li>
		the percent-encoded form of the column name,
	      </li>
	      <li>
		if it is not the last column in the foreign key, a FULL STOP character '<attrsep>.</attrsep>'
	      </li>
	    </ul>
	  </li>
	</ul>
	</defn>
      </defns>

      <p>
	The values in a row are mapped to RDF literals:
      </p>

      <defns>
	<defn name="literal map">
	  a mapping from an SQL value with a datatype to:
<ul>
  <li>
    for the SQL datatypes <code>CHAR</code> and <code>VARCHAR</code>, a <a href="http://www.w3.org/TR/rdf-concepts/#dfn-plain-literal">Plain literal</a> with the lexical value of the SQL value.
  </li>
  <li>
    for the SQL datatypes <code>BINARY</code>, <code>BINARY VARYING</code> and <code>BINARY LARGE OBJECT</code>, a <a href="http://www.w3.org/TR/xmlschema-2/#base64Binary">xsd:base64Binary</a> with the XML Schema base64 encoding of the SQL value.
  </li>
  <li>
    for the SQL datatype <code>BOOLEAN</code>, a <a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#boolean">xsd:boolean</a> with a lexical value of '<code>true</code>' or '<code>false</code>'.
  </li>
  <li>
    for the SQL datatypes listed in this table, a <a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-typed-literal">Typed literal</a> with the this datatype and lexical form of the canonical XML Schema lexical representation of this domain:
    <table>
<tbody><tr>
      <th>SQL datatype</th>
      <th>RDF datatype</th>
      <!-- th>Lexical form</th -->
    </tr>
    <tr>
      <td><code>NUMERIC</code>, <code>DECIMAL</code></td>
      <td><code><a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#decimal">xsd:decimal</a></code></td>

      <!-- td>SQL result of: <code>CAST(value AS CHARACTER VARYING(18))</code></td -->
    </tr>
    <tr>
      <td><code>SMALLINT</code>, <code>INTEGER</code>, <code>BIGINT</code></td>
      <td><code><a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#integer">xsd:integer</a></code></td>

      <!-- td>SQL result of: <code>CAST(value AS CHARACTER VARYING(18))</code></td -->
    </tr>
    <tr>
      <td><code>FLOAT</code>, <code>REAL</code>, <code>DOUBLE PRECISION</code></td>
      <td><code><a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#double">xsd:double</a></code></td>

      <!-- td>SQL result of: <code>CAST(value AS CHARACTER VARYING(23))</code></td -->
    </tr>
    <tr>
      <td><code>DATE</code></td>
      <td><code><a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#date">xsd:date</a></code></td>
      <!-- td>SQL result of: <code>CAST(value AS CHARACTER VARYING(13))</code></td -->
    </tr>
    <tr>
      <td><code>TIME</code></td>

      <td><code><a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#time">xsd:time</a></code></td>
      <!-- td>SQL result of: <code>CAST(value AS CHARACTER VARYING(23))</code></td -->
    </tr>
    <tr>
      <td><code>TIMESTAMP</code></td>
      <td><code><a href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#dateTime">xsd:dateTime</a></code></td>
      <!-- td>SQL result of: <code>REPLACE(CAST(value AS CHARACTER VARYING(37)), " ", "T")</code></td -->

    </tr>
    </tbody>
    </table>
  </li>
</ul>
	</defn>
      </defns>

      <p>
	Extensions to the Direct Mapping should note the spirit of this mapping, i.e. to use the canonical representation of an XML Schema Datatype corresponding to the SQL datatype.
      </p>

      <p>
	Any input database with a given schema has a <emph>direct graph</emph> defined as:
      </p>

      <defns>
	<defn name="direct graph">
	  the union of the <termref id="table graph">table graph</termref>s for each table in a database schema.
	</defn>
	<defn name="table graph">
	  the union of the <termref id="row graph">row graph</termref>s for each row in a table.
	</defn>
	<defn name="row graph">
	  an RDF graph consisting of the following triples:
	  <ul>
	    <li>
	      the <termref id="row type triple">row type triple</termref>.
	    </li>
	    <li>
	      a <termref id="reference triple">reference triple</termref> for each &lt;column name list&gt; in a table's foreign keys where none of the column values is NULL.
	    </li>
	    <li>
	      a <termref id="literal triple">literal triple</termref> for each column in a table where the column value is non-NULL.
	    </li>
	  </ul>
	</defn>
	
	<defn name="row type triple" id="row_type_triple_def">an RDF triple with:
	  <ul>
	    <li>
	      subject: the <termref id="row node">row node</termref> for the row.
	    </li>
	    <li>
	      predicate: the RDF IRI <code>rdf:type</code>.
	    </li>
	    <li>
	      object: the <termref id="table IRI">table IRI</termref> for the table name.
	    </li>
	  </ul>
	</defn>
	
	<defn name="literal triple" id="literal_triple_def">
	  an RDF triple with:
	  <ul>
	    <li>
	      subject: the <termref id="row node">row node</termref> for the row.
	    </li>
	    <li>
	      predicate: the <termref id="literal property IRI">literal property IRI</termref> for the column.
	    </li>
	    <li>
	      object: the <termref id="literal map">literal map</termref> for the column value.
	    </li>
	  </ul>
	</defn>
	<defn name="reference triple" id="reference_triple_def">
	  an RDF triple with:
	  <ul>
	    <li>
	      subject: the <termref id="row node">row node</termref> for the row.
	    </li>
	    <li>
	      predicate: the <termref id="reference property IRI">reference property IRI</termref> for the columns.
	    </li>
	    <li>
	      object: the <termref id="row node">row node</termref> for the referenced row.
	    </li>
	  </ul>
	</defn>
      </defns>
    </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="SQLFW">SQL. ISO/IEC 9075-1:2008 SQL – Part 1: Framework (SQL/Framework) International Organization for Standardization, 27 January 2009.</bibl>
      <bibl id="SQLFN">ISO/IEC 9075-2:2008 SQL – Part 2: Foundation (SQL/Foundation)
International Organization for Standardization, 27 January 2009.</bibl>
      <bibl id="RDF-concepts" 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="RFC3987" href="http://tools.ietf.org/html/rfc3987">RFC3987 - Internationalized Resource Identifier (IRIs)</bibl>
      <bibl id="SQL2SW" href="http://www.springerlink.com/content/mv58805364k31734/">Translating SQL Applications to the Semantic Web. Syed Hamid Tirmizi, Juan Sequeda and Daniel Miranker. 2008</bibl>
    </blist>
    <div1 id="alg">
      <head>Direct Mapping Algebra (Informative)</head>

    <div2 id="notation">
      <head>Notations</head>

      <p>The RDB and RDF data models make use of the commonly defined <a href="http://en.wikipedia.org/wiki/Abstract_data_type">Abstract Data Types</a> <a href="http://en.wikipedia.org/wiki/Set_(computer_science)">Set</a>, <a href="http://en.wikipedia.org/wiki/List_(computer_science)">List</a> and <a href="http://en.wikipedia.org/wiki/Set_(computer_science)#Multiset">MultiSet</a>, used here as type constructors. For example, <code>Set(A)</code> denotes the type for the sets of elements of type <code>A</code>. We assume that they come with their common operations, such as the function <code>size&nbsp;:&nbsp;Set&nbsp;→&nbsp;Int</code>.</p>

      <p>The definitions follow a type-as-specification approach, thus the models are based on <a href="http://en.wikipedia.org/wiki/Dependent_type">dependent types</a>. For example, <code>{&nbsp;s:Set(A)&nbsp;|&nbsp;size(s)&nbsp;≤&nbsp;1&nbsp;}</code> is a type denoting the sets for elements of type A, such that those sets have at most one element.</p>

      <p>The denotational RDF semantics makes use of the <a href="http://en.wikipedia.org/wiki/Set-builder_notation">set-builder notation</a> for building the RDF sets.</p>

      <div class="syntaxmenu">
	<p>The buttons below can be used to show or hide the available syntaxes.</p>
	<form action="">
	  <p>
	    <input id="use-sets"     onclick="    sets();" value="Set notation (s)" type="button"/>
	    <input id="use-sbuilder" onclick="sbuilder();" style="display: none;" value="Set-builder notation (b)" type="button"/>

	    <input style="" id="hide-rs" onclick="english_toggle();" value="Hide English Syntax (e)" type="button"/>
	    <input id="show-rs" onclick="english_toggle()" style="display: none;" value="Show English Syntax (e)" type="button"/>
	  </p>
	</form>
      </div>

    </div2>

    <div2 id="RDB">
      <head>Relational Data Model</head>

      <div3 id="RDB-ADT">
	<head>RDB Abstract Data Type</head>

        <!-- \M-x replace-regexp num="[0-9]+" num="\#" (replace-regexp "num=\"[0-9]+\"" "num=\"#\"")  num="0" -->
	<scrap lang="ebnf">
	  <prod id="RDB-Database" num="1">
	    <sbuilder>
	      <lhs>Database</lhs>
	      <rhs>Set(<nt def="RDB-Table">Table</nt>)</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>Database</lhs>
	      <rhs>{ <nt def="RDB-Table">Table</nt> }</rhs>
	    </sets>
	    <english>A <dfn>relational database</dfn> is a set of tables.</english>
	  </prod>
	  <prod id="RDB-Table" num="2">
	    <sbuilder>
	      <lhs>Table</lhs>
	      <rhs>(<nt def="RDB-TableName">TableName</nt>, Set((<nt def="RDB-ColumnName">ColumnName</nt>, <nt def="RDB-Datatype">Datatype</nt>)), Set(<nt def="RDB-CandidateKey">CandidateKey</nt>), Set(<nt def="RDB-PrimaryKey">PrimaryKey</nt>) | size() ≤ 1, Set(<nt def="RDB-ForeignKey">ForeignKey</nt>), <nt def="RDB-Body">Body</nt>)</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>Table</lhs>
	      <rhs>( <nt def="RDB-TableName">TableName</nt>, { <nt def="RDB-ColumnName">ColumnName</nt> → <nt def="RDB-Datatype">Datatype</nt> }, { <nt def="RDB-CandidateKey">CandidateKey</nt> }, <nt def="RDB-PrimaryKey">PrimaryKey</nt>?, { <nt def="RDB-ForeignKey">ForeignKey</nt> }, <nt def="RDB-Body">Body</nt> )</rhs>
	    </sets>
	    <english>A <dfn>relation</dfn> has
            <ul>
              <li>a name uniquely defining this table in the database;</li>
              <li>an <a href="http://en.wikipedia.org/wiki/Associative_array">associative array</a> mapping each column to a SQL datatype;</li>
              <li>a potentially empty list of candidate keys, possibly including a primary key;</li>
              <li>a potentially empty set of foreign keys;</li>
              <li>a body containing the rows of data.</li>
            </ul>
            </english>
	  </prod>
	  <prod id="RDB-Body" num="3">
	    <sbuilder>
	      <lhs>Body</lhs>
	      <rhs>MultiSet(<nt def="RDB-Row">Row</nt>)</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>Body</lhs>
	      <rhs>[ <nt def="RDB-Row">Row</nt> ]</rhs>
	    </sets>
	    <english>A <dfn>body</dfn> is a set of potentially duplicate rows.</english>
	  </prod>
	  <prod id="RDB-Row" num="4">
	    <sbuilder>
	      <lhs>Row</lhs>
	      <rhs>Set((<nt def="RDB-ColumnName">ColumnName</nt>, <nt def="RDB-CellValue">CellValue</nt>))</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>Row</lhs>
	      <rhs>{ <nt def="RDB-ColumnName">ColumnName</nt> → <nt def="RDB-CellValue">CellValue</nt> }</rhs>
	    </sets>
	    <english>A <dfn>row</dfn> is a <a href="http://en.wikipedia.org/wiki/Associative_array">associative array</a> mapping each column in a row to a value.</english>
	  </prod>
	  <prod id="RDB-CellValue" num="5">
	    <sbuilder>
	      <lhs>CellValue</lhs>
	      <rhs>Value  |  NULL</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>CellValue</lhs>
	      <rhs>Value | Null</rhs>
	    </sets>
	    <english>A <dfn>cell value</dfn> is either a lexical value or NULL, denoting the absence of value.</english>
	  </prod>
	  <prod id="RDB-ForeignKey" num="6">
	    <sbuilder>
	      <lhs>ForeignKey</lhs>
	      <rhs>(List(<nt def="RDB-ColumnName">ColumnName</nt>), <nt def="RDB-Table">Table</nt>, <nt def="RDB-CandidateKey">CandidateKey</nt>)</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>ForeignKey</lhs>
	      <rhs>{ [<nt def="RDB-ColumnName">ColumnName</nt>] → ( <nt def="RDB-Table">Table</nt>, [<nt def="RDB-ColumnName">ColumnName</nt>] ) }</rhs>
	    </sets>
	    <english>A <dfn>foreign key</dfn> constrains the values of a &lt;column name list&gt; to be equivalent (by the SQL <code>=</code> operator) to the values of a &lt;unique column list&gt; in some row of the referenced table.</english>
	  </prod>
	  <prod id="RDB-PrimaryKey" num="7">
	    <sbuilder>
	      <lhs>PrimaryKey</lhs>
	      <rhs><nt def="RDB-CandidateKey">CandidateKey</nt></rhs>
	    </sbuilder>
	    <sets>
	      <lhs>PrimaryKey</lhs>
	      <rhs><nt def="RDB-CandidateKey">CandidateKey</nt></rhs>
	    </sets>
	    <english>A <dfn>primary key</dfn> is a candidate key with the additional constraint that none of the columns can have a NULL value.</english>
	  </prod>
	  <prod id="RDB-CandidateKey" num="8">
	    <sbuilder>
	      <lhs>CandidateKey</lhs>
	      <rhs>List(<nt def="RDB-ColumnName">ColumnName</nt>)</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>CandidateKey</lhs>
	      <rhs>[ <nt def="RDB-ColumnName">ColumnName</nt> ]</rhs>
	    </sets>
	    <english>A <dfn>candidate key</dfn> is an SQL &lt;unique column list&gt; in some table. This constrains that no two rows in the table have values for the &lt;unique column list&gt; which are <em>all</em> equivalent (by the SQL <code>=</code> operator).</english>
	  </prod>
	  <prod id="RDB-Datatype" num="9">
	    <sbuilder>
	      <lhs>Datatype</lhs>
	      <rhs>Int  |  Float  |  Date  |  …</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>Datatype</lhs>
	      <rhs>{ INT | FLOAT | DATE | TIME | TIMESTAMP | CHAR | VARCHAR | STRING }</rhs>
	    </sets>
	    <english>A <dfn>datatype</dfn> is a common SQL datatype.</english>
	  </prod>
	  <prod id="RDB-TableName" num="10">
	    <sbuilder>
	      <lhs>TableName</lhs>
	      <rhs>String</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>TableName</lhs>
	      <rhs>String</rhs>
	    </sets>
	    <english>A <dfn>table name</dfn> is a string.</english>
	  </prod>
	  <prod id="RDB-ColumnName" num="11">
	    <sbuilder>
	      <lhs>ColumnName</lhs>
	      <rhs>String</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>ColumnName</lhs>
	      <rhs>String</rhs>
	    </sets>
	    <english>A <dfn>column name</dfn> is a string.</english>
	  </prod>
	</scrap>
      </div3>

      <div3 id="RDB-acc">
	<head>RDB accessor functions</head>

        <scrap>
	  <prod id="RDB-tablename" num="12" class="typedef">
	    <sbuilder>
	      <lhs>tablename</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → <nt def="RDB-TableName">TableName</nt></rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>tablename</dfn> returns its name.</english>
	  </prod>
	  <prod id="RDB-header" num="13" class="typedef">
	    <sbuilder>
	      <lhs>header</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → Set((<nt def="RDB-ColumnName">ColumnName</nt>, <nt def="RDB-Datatype">Datatype</nt>))</rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>header</dfn> returns its header.</english>
	  </prod>
	  <prod id="RDB-candidateKeys" num="14" class="typedef">
	    <sbuilder>
	      <lhs>candidateKeys</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → List(<nt def="RDB-CandidateKey">CandidateKey</nt>)</rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>candidateKeys</dfn> returns the list of candidate keys.</english>
	  </prod>
	  <prod id="RDB-primaryKey" num="15" class="typedef">
	    <sbuilder>
	      <lhs>primaryKey</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → { s:Set(<nt def="RDB-CandidateKey">CandidateKey</nt>) | size(s) ≤ 1 }</rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>primaryKey</dfn> returns a set containing the primary key if it exists, otherwise it returns an empty set.</english>
	  </prod>
	  <prod id="RDB-foreignKeys" num="16" class="typedef">
	    <sbuilder>
	      <lhs>foreignKeys</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → Set(<nt def="RDB-ForeignKey">ForeignKey</nt>)</rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>foreignKeys</dfn> returns the set of foreign keys.</english>
	  </prod>
	  <prod id="RDB-unary" num="17" class="typedef">
	    <sbuilder>
	      <lhs>unary</lhs>
	      <rhs><nt def="RDB-ForeignKey">ForeignKey</nt> → Boolean</rhs>
	    </sbuilder>
	    <english>Given a foreign key, <dfn>unary</dfn> tells if this is a unary foreign key, meaning it has exactly one column.</english>
	  </prod>
	  <prod id="RDB-lexicals" num="18" class="typedef">
	    <sbuilder>
	      <lhs>lexicals</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → Set({ c:<nt def="RDB-ColumnName">ColumnName</nt> | ! <nt def="RDB-unary">unary</nt>(c) })</rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>lexicals</dfn> returns the set of columns that do not constitute a unary foreign key.</english>
	  </prod>
	  <prod id="RDB-body" num="19" class="typedef">
	    <sbuilder>
	      <lhs>body</lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → <nt def="RDB-Body">Body</nt></rhs>
	    </sbuilder>
	    <english>Given a table, <dfn>body</dfn> returns its body.</english>
	  </prod>
	  <prod id="RDB-datatype" num="20" class="typedef">
	    <sbuilder>
	      <lhs>datatype</lhs>
	      <rhs>{ h:Set((<nt def="RDB-ColumnName">ColumnName</nt>, <nt def="RDB-Datatype">Datatype</nt>)) } → { c:<nt def="RDB-ColumnName">ColumnName</nt> | ∃ d, (c,d) ∈ h } → { d:<nt def="RDB-Datatype">Datatype</nt> | (c,d) ∈ h }</rhs>
	    </sbuilder>
	    <english>Given a header and a column in this header, <dfn>datatype</dfn> returns the datatype associated with this column.</english>
	  </prod>
	  <prod id="RDB-table" num="21" class="typedef">
	    <sbuilder>
	      <lhs>table</lhs>
	      <rhs>{ r:<nt def="RDB-Row">Row</nt> } → { t:<nt def="RDB-Table">Table</nt> | r ∈ t }</rhs>
	    </sbuilder>
	    <english>Given a row, <dfn>table</dfn> returns the table to which this row belongs.</english>
	  </prod>
	  <prod id="RDB-value" num="22" class="typedef">
	    <sbuilder>
	      <lhs>value</lhs>
	      <rhs>{ r:<nt def="RDB-Row">Row</nt> } → { a:<nt def="RDB-ColumnName">ColumnName</nt> | a ∈ r } → <nt def="RDB-CellValue">CellValue</nt></rhs>
	    </sbuilder>
	    <english>Given a row and a column in this row, <dfn>value</dfn> returns the cell value (can be NULL) for this column.</english>
	  </prod>
	  <prod id="RDB-dereference" num="23" class="typedef">
	    <sbuilder>
	      <lhs>dereference</lhs>
	      <rhs>
{ r:<nt def="RDB-Row">Row</nt> } → { fk:<nt def="RDB-ForeignKey">ForeignKey</nt> | fk ∈ <nt def="RDB-foreignKeys">foreignKeys</nt>(<nt def="RDB-table">table</nt>(r)) }<br/>
→ { targetRow:<nt def="RDB-Row">Row</nt> | <let /> (columnNames, targetTable, ck) = fk <in /><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;targetRow ∈ <nt def="RDB-body">body</nt>(targetTable)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<and />
∀ c<sub>i</sub><sup>fk</sup> ∈ columnNames, ∀ c<sub>j</sub><sup>ck</sup> ∈ ck,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;∀ (c<sub>k</sub><sup>r</sup>, v<sub>k</sub><sup>r</sup>) ∈ r, ∀ (c<sub>l</sub><sup>target</sup>, v<sub>l</sub><sup>target</sup>) ∈ targetRow,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
i = j → c<sub>i</sub><sup>fk</sup> = c<sub>k</sub><sup>r</sup>
      → c<sub>j</sub><sup>ck</sup> = c<sub>l</sub><sup>target</sup>
      → v<sub>k</sub><sup>r</sup>  = v<sub>l</sub><sup>target</sup> }
</rhs>
	    </sbuilder>
	    <english>Given a row and a foreign key from the table containing this row, <dfn>dereference</dfn> returns the row which is referenced by this foreign key, i.e. the row for which the values of the foreign key's &lt;unique column list&gt; are <em>all</em> equivalent (by the SQL <code>=</code> operator) to the values for the  foreign key's &lt;column name list&gt; in the referring table.</english>
	  </prod>
        </scrap>
      </div3>

    </div2>

    <div2 id="RDF">
      <head>RDF Data Model</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">
        <prod id="RDF-Graph" num="24">
          <sbuilder>
            <lhs>Graph</lhs>
            <rhs>Set(<nt def="RDF-Triple">Triple</nt>)</rhs>
          </sbuilder>
	  <sets>
	    <lhs>Graph</lhs>
	    <rhs>{ <nt def="RDF-Triple">Triple</nt> }</rhs>
	  </sets>
          <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>
        </prod>
        <prod id="RDF-Triple" num="25">
          <sbuilder>
            <lhs>Triple</lhs>
            <rhs>(<nt def="RDF-Subject">Subject</nt>, <nt def="RDF-Predicate">Predicate</nt>, <nt def="RDF-Object">Object</nt>)</rhs>
          </sbuilder>
	  <sets>
	    <lhs>Triple</lhs>
	    <rhs>( <nt def="RDF-Subject">Subject</nt>, <nt def="RDF-Predicate">Predicate</nt>, <nt def="RDF-Object">Object</nt> )</rhs>
	  </sets>
          <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-triple">RDF triple</a></dfn> is composed of a subject, predicate and object.</english>
        </prod>
        <prod id="RDF-Subject" num="26">
          <sbuilder>
            <lhs>Subject</lhs>
            <rhs><nt def="RDF-IRI">IRI</nt> | <nt def="RDF-BlankNode">BlankNode</nt></rhs>
          </sbuilder>
	  <sets>
	    <lhs>Subject</lhs>
	    <rhs><nt def="RDF-IRI">IRI</nt> | <nt def="RDF-BlankNode">BlankNode</nt></rhs>
	  </sets>
          <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-subject">subject</a></dfn> is either an IRI or a blank node.</english>
        </prod>
        <prod id="RDF-Predicate" num="27">
          <sbuilder>
            <lhs>Predicate</lhs>
            <rhs><nt def="RDF-IRI">IRI</nt></rhs>
          </sbuilder>
	  <sets>
	    <lhs>Predicate</lhs>
	    <rhs><nt def="RDF-IRI">IRI</nt></rhs>
	  </sets>
          <english>A <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-predicate">predicate</a></dfn> is always an IRI.</english>
        </prod>
        <prod id="RDF-Object" num="28">
          <sbuilder>
            <lhs>Object</lhs>
            <rhs><nt def="RDF-IRI">IRI</nt> | <nt def="RDF-BlankNode">BlankNode</nt> | <nt def="RDF-Literal">Literal</nt></rhs>
          </sbuilder>
	  <sets>
	    <lhs>Object</lhs>
	    <rhs><nt def="RDF-IRI">IRI</nt> | <nt def="RDF-BlankNode">BlankNode</nt> | <nt def="RDF-Literal">Literal</nt></rhs>
	  </sets>
          <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-object">object</a></dfn> is either an IRI, a blank node, or a literal.</english>
        </prod>
        <prod id="RDF-BlankNode" num="29">
          <sbuilder>
            <lhs>BlankNode</lhs>
            <rhs><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">RDF blank node</a></rhs>
          </sbuilder>
	  <sets>
	    <lhs>BlankNode</lhs>
	    <rhs><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">RDF blank node</a></rhs>
	  </sets>
          <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>
        </prod>
        <prod id="RDF-Literal" num="30">
          <sbuilder>
            <lhs>Literal</lhs>
            <rhs><nt def="RDF-PlainLiteral">PlainLiteral</nt> | <nt def="RDF-TypedLiteral">TypedLiteral</nt></rhs>
          </sbuilder>
	  <sets>
	    <lhs>Literal</lhs>
	    <rhs><nt def="RDF-PlainLiteral">PlainLiteral</nt> | <nt def="RDF-TypedLiteral">TypedLiteral</nt></rhs>
	  </sets>
          <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>
        </prod>
        <prod id="RDF-PlainLiteral" num="31">
          <sbuilder>
            <lhs>PlainLiteral</lhs>
            <rhs><nt def="RDF-lexicalForm">lexicalForm</nt> | (<nt def="RDF-lexicalForm">lexicalForm</nt>, <nt def="RDF-langageTag">langageTag</nt>)</rhs>
          </sbuilder>
	  <sets>
	    <lhs>PlainLiteral</lhs>
	    <rhs>(<nt def="RDF-lexicalForm">lexicalForm</nt>) | (<nt def="RDF-lexicalForm">lexicalForm</nt>, <nt def="RDF-langageTag">langageTag</nt>)</rhs>
	  </sets>
          <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>
        </prod>
        <prod id="RDF-TypedLiteral" num="32">
          <sbuilder>
            <lhs>TypedLiteral</lhs>
            <rhs>(<nt def="RDF-lexicalForm">lexicalForm</nt>, <nt def="RDF-IRI">IRI</nt>)</rhs>
          </sbuilder>
	  <sets>
	    <lhs>TypedLiteral</lhs>
	    <rhs>(<nt def="RDF-lexicalForm">lexicalForm</nt>, <nt def="RDF-IRI">IRI</nt>)</rhs>
	  </sets>
          <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-typed-literal">typed literal</a></dfn> is composed of <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>
        </prod>
        <prod id="RDF-IRI" num="33">
          <sbuilder>
            <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>
          </sbuilder>
	  <sets>
	    <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>
	  </sets>
          <english>An <dfn><a href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-URI-reference">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>
        </prod>
        <prod id="RDF-LexicalForm" num="34">
          <sbuilder>
            <lhs>lexicalForm</lhs>
            <rhs>a Unicode String</rhs>
          </sbuilder>
          <sets>
            <lhs>lexicalForm</lhs>
            <rhs>a Unicode String</rhs>
          </sets>
          <english>SQL string representing a value.</english>
        </prod>

	</scrap>
    </div2>

    <div2 id="denotational-semantics">
      <head>Denotational semantics</head>

      <p>In this model, Databases are inhabitants of <a href="#RDB">RDB</a> and they are denoted by mathematical objects living in the <a href="#RDF">RDF domain</a>. This <em>denotational semantics</em> is what we call the <em>Direct Mapping</em>.</p>

      <scrap>
	  <prod id="url-encoding-type" num="35" class="typedef">
	    <sbuilder>
	      <lhs>ue</lhs>
	      <rhs>String → String</rhs>
	    </sbuilder>
	    <english>A <a href="#percent-encode">percent-encoding</a> of the argument.</english>
	  </prod>
      </scrap>

      <p>Most of the functions defining the Direct Mapping are higher-order functions parameterized by a function <sbuilder><nt def="row_node">φ</nt>(r)</sbuilder> <sets><nt def="row_node">row_node</nt>(r)</sets> which maps any <a href="#RDB-Row">row</a> to a unique <a href="#RDF-IRI">IRI</a> or <a href="#RDF-BlankNode">Blank Node</a>:</p>

      <scrap>
	  <prod id="row_node" num="36" class="typedef">
	    <sbuilder>
	      <lhs>φ</lhs>
	      <rhs>∀ db:<nt def="RDB-Database">Database</nt>, ∀ r:<nt def="RDB-Row">Row</nt>, r ∈ db<br/>
		<if /> <nt def="RDB-primaryKey">primaryKey</nt>(<nt def="RDB-table">table</nt>(r)) ≠ ∅ <then /><br/>
		&nbsp;&nbsp;&nbsp;&nbsp;<nt def="url-encoding-type">ue</nt>(<nt def="RDB-tablename">tablename</nt>(<nt def="RDB-table">table</nt>(r))) + '/' + <nt def="url-encoding-type">ue</nt>(c<sub>0</sub>) + '<valsep>-</valsep>' + <nt def="RDB-value">value</nt>(r, c<sub>0</sub>) + '<attrsep>.</attrsep>' + ⋯ + '<attrsep>.</attrsep>' + <nt def="url-encoding-type">ue</nt>(c<sub>n-1</sub>) + '<valsep>-</valsep>' + <nt def="RDB-value">value</nt>(r, c<sub>n-1</sub>)<br/>
		<else /><br/>
		&nbsp;&nbsp;&nbsp;&nbsp;a <nt def="RDF-BlankNode">BlankNode</nt> unique to <code>r</code>
	      </rhs>
	    </sbuilder>
	    <sets>
	      <lhs>row_node</lhs>
	      <rhs>
		<if/> (pk(R) ≠ ∅) <then/><br/>
		&nbsp;&nbsp;&nbsp;&nbsp;<nt def="RDF-IRI">IRI</nt>(UE(R.name) + "/" + (join('<attrsep>.</attrsep>', UE(A.name) + "=" + UE(A.value)) ∣ A ∈ As ))<br/>
		<else/><br/>
		&nbsp;&nbsp;&nbsp;&nbsp;a <nt def="RDF-BlankNode">BlankNode</nt> unique to <code>r</code>
	      </rhs>
	    </sets>
	    <english999>If a row belongs to a table with no primary key then <code>φ</code> maps this row to a unique BlankNode.</english999>
	    <english>
	<defn name="row node">
	  <ul>
	    <li>If the table has a primary key, the row node is a relative IRI obtained by concatenating:
	    <ul>
	      <li>
		the percent-encoded form of the table name,
	      </li>
	      <li>
		the SOLIDUS character '/',
	      </li>
	      <li>
		for each column in the primary key, in order:
		<ul>
		  <li>
		    the percent-encoded form of the column name,
		  </li>
		  <li>
		    an HYPHEN-MINUS character '<valsep>-</valsep>',
		  </li>
		  <li>
		    the percent-encoded form of the column value,
		  </li>
		  <li>
		    if it is not the last column in the foreign key, a FULL STOP character '<attrsep>.</attrsep>'
		  </li>
		</ul>
	      </li>
	    </ul>
	    </li>
	    <li>If the table has no primary key, the row node is a fresh blank node that is unique to this row.</li>
	  </ul>
	</defn>
	    </english>
	  </prod>
	  <prod id="literal_property_IRI-type" num="37" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="litcol">&nbsp;,&nbsp;&nbsp;&nbsp;</semantics></lhs>
	      <rhs>(<nt def="RDB-Row">Row</nt>, <nt def="RDB-Column">Column</nt>) → <nt def="RDB-IRI">IRI</nt></rhs>
	    </sbuilder>
	    <english>A mapping from a list of columns in a row to an IRI.</english>
	  </prod>
	  <prod id="literal_property_IRI" num="37" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="litcol">r, c</semantics></lhs>
	      <rhs><nt def="url-encoding-type">ue</nt>(<nt def="RDB-tablename">tablename</nt>(<nt def="RDB-table">table</nt>(r))) + '#' + <nt def="url-encoding-type">ue</nt>(c))</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>literal_property_IRI(R, A)</lhs>
	      <rhs><nt def="RDF-IRI">IRI</nt>(R.name + "#" + A.name)</rhs>
	    </sets>
	    <english999>A concatenation, with punctuation as separators, of the url-encoded table name and the url-encoded column names.</english999>
	    <english>
	<defn name="literal property IRI">the concatenation of:
	<ul>
	  <li>
	    the percent-encoded form of the table name,
	  </li>
	  <li>
	    the hash character '#',
	  </li>
	  <li>
	    the percent-encoded form of the column name,
	  </li>
	</ul>
	</defn>
	    </english>
	  </prod>
	  <prod id="reference_property_IRI-type" num="37" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="refcol">&nbsp;,&nbsp;&nbsp;&nbsp;</semantics></lhs>
	      <rhs>(<nt def="RDB-Row">Row</nt>, <nt def="RDB-ForeignKey">ForeignKey</nt>) → <nt def="RDB-IRI">IRI</nt></rhs>
	    </sbuilder>
	    <english>A mapping from a list of columns in a row to an IRI.</english>
	  </prod>
	  <prod id="reference_property_IRI" num="37" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="refcol">r, fk</semantics></lhs>
	      <rhs>
		<let />(from*, reftable, to*) = fk <in /><br />
		&nbsp;&nbsp;<nt def="url-encoding-type">ue</nt>(<nt def="RDB-tablename">tablename</nt>(<nt def="RDB-table">table</nt>(r))) + '#'<br/>
		+ <nt def="url-encoding-type">ue</nt>(from<sub>0</sub>) + '<attrsep>.</attrsep>' + ⋯ + '<attrsep>.</attrsep>' + <nt def="url-encoding-type">ue</nt>(from<sub>n-1</sub>) + '<attrsep>.</attrsep>'<br/>
		+ <nt def="url-encoding-type">ue</nt>(reftable) + '<attrsep>.</attrsep>'<br/>
		+ <nt def="url-encoding-type">ue</nt>(to<sub>0</sub>) + '<attrsep>.</attrsep>' + ⋯ + '<attrsep>.</attrsep>' + <nt def="url-encoding-type">ue</nt>(to<sub>n-1</sub>))
	      </rhs>
	    </sbuilder>
	    <sets>
	      <lhs>reference_property_IRI(R, As)</lhs>
	      <rhs><nt def="RDF-IRI">IRI</nt>(R.name + "#" + join('<attrsep>.</attrsep>', UE(A.name)) ∣ A ∈ As )</rhs>
	    </sets>
	    <english999>A concatenation, with punctuation as separators, of the url-encoded table name and the url-encoded column names.</english999>
	    <english>
	<defn name="reference property IRI">the concatenation of:
	<ul>
	  <li>
	    the percent-encoded form of the table name,
	  </li>
	  <li>
	    the hash character '#',
	  </li>
	  <li>
	    for each column in the primary key, in order:
	    <ul>
	      <li>
		the percent-encoded form of the column name,
	      </li>
	      <li>
		if it is not the last column in the foreign key, a FULL STOP character '<attrsep>.</attrsep>'
	      </li>
	    </ul>
	  </li>
	</ul>
	</defn>
	    </english>
	  </prod>
      </scrap>

      <p>
The <sbuilder><code>⟦&nbsp;⟧<sup>φ</sup><sub><nt def="literal_map">datatype</nt></sub></code></sbuilder> <sets><nt def="literal_map">literal_map</nt>(r)</sets> function maps SQL values to XML Schema datatypes.
      </p>

      <scrap>
	  <prod id="literal_map-type" num="38" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="datatype">&nbsp;</semantics></lhs>
	      <rhs><nt def="RDB-Datatype">Datatype</nt> → <nt def="RDB-IRI">IRI</nt></rhs>
	    </sbuilder>
	    <english>A mapping from a SQL datatype to an <a href="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#defDatatypeMap">XML Schema datatype</a> IRI.</english>
	  </prod>
	  <prod id="literal_map" num="38" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="datatype">d</semantics></lhs>
	      <rhs>
<if /> d is Int <then /> XSD:integer<br/>
<else /> <if /> d is Float <then /> XSD:float<br/>
<else /> <if /> d is Date <then /> XSD:date<br/>
⋯</rhs>
	    </sbuilder>
	    <english>The XML Schema datatype for <var>d</var> as defined by IWD 9075 §9.5 <bibref ref="IWD9075"/></english>
	  </prod>
      </scrap>

      <p>
The Direct Mapping is defined by <a href="http://en.wikipedia.org/wiki/Mathematical_induction">induction</a> on the structure of RDB.
Thus it is defined for any relational database.
The entry point for the Direct Mapping is the function <sbuilder><code>⟦&nbsp;⟧<sup>φ</sup><sub><nt def="direct_graph">database</nt></sub></code></sbuilder> <sets><nt def="direct_graph">direct_graph</nt>(r)</sets>.
      </p>

      <scrap>
	  <prod id="direct_graph-type" num="39" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="database" dependsOn="φ">&nbsp;&nbsp;</semantics></lhs>
	      <rhs><nt def="RDB-Database">Database</nt> → <nt def="RDB-Graph">Graph</nt></rhs>
	    </sbuilder>
	    <english>A mapping from a relational database to an RDF graph.</english>
	  </prod>
	  <prod id="direct_graph" num="39" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="database" dependsOn="φ">db</semantics></lhs>
	      <rhs>{ triple | triple ∈ <semantics for="table" def="table_graph" dependsOn="φ">t</semantics> | t ∈ db }</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>direct_graph()</lhs>
	      <rhs>{ <nt def="table_graph">table_graph</nt>(R) ∣ R ∈ DB }</rhs>
	    </sets>
	    <english999>The union of the triples expressing each table in the database.</english999>
	    <english>
	<defn name="direct graph">
	  the union of the <termref id="table graph">table graph</termref>s for each table in a database schema.
	</defn>
	    </english>
	  </prod>
	  <prod id="table_graph-type" num="40" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="table" dependsOn="φ" >&nbsp;</semantics></lhs>
	      <rhs><nt def="RDB-Table">Table</nt> → Set(<nt def="RDB-Triple">Triple</nt>)</rhs>
	    </sbuilder>
	    <english>A mapping from a table to a set of RDF triples.</english>
	  </prod>
	  <prod id="table_graph" num="40" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="table" dependsOn="φ">t</semantics></lhs>
	      <rhs>{ triple | triple ∈ <semantics for="row" def="row_graph" dependsOn="φ">r</semantics> | r ∈ body(t) }</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>table_graph(R)</lhs>
	      <rhs>{ <nt def="row_graph">row_graph</nt>(T, R) ∣ T ∈ R.Body }</rhs>
	    </sets>
	    <english999>The triples expressing each row in the table <var>t</var></english999>
	    <english>
	<defn name="table graph">
	  the union of the <termref id="row graph">row graph</termref>s for each row in a table.
	</defn>
	    </english>
	  </prod>
	  <prod id="noNULLs-type" num="41" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs>noNULLs</lhs>
	      <rhs><nt def="RDB-Row">Row</nt> → <nt def="RDB-ForeignKey">ForeignKey</nt> → <nt def="RDB-Boolean">Boolean</nt></rhs>
	    </sbuilder>
	    <english>A statement between a row and a foreign key, telling if the absence of NULL values</english>
	  </prod>

	  <prod id="noNULLs" num="41" class="funcdef">
	    <sbuilder>
	      <lhs>noNULLs(r, fk)</lhs>
	      <rhs>
<let /> (columnNames, _, _) = fk <in /><br/>
∀ c ∈ columnNames, <nt def="RDB-value">value</nt>(r, c) &ne; NULL
</rhs>
	    </sbuilder>
	    <english999><em>true</em> if there is no NULL value in this row for this foreign key.</english999>
	  </prod>
	  <prod id="row_graph-type" num="42" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="row" dependsOn="φ">&nbsp;</semantics></lhs>
	      <rhs><nt def="RDB-Row">Row</nt> → Set(<nt def="RDB-Triple">Triple</nt>)</rhs>
	    </sbuilder>
	    <english>A mapping from a row to a set of RDF triples.</english>
	  </prod>
	  <prod id="row_graph" num="42" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="row" dependsOn="φ">r</semantics></lhs>
	      <rhs><let /> s = <nt def="row_node">φ</nt>(r) <in /><br/>
               &nbsp;&nbsp;{ <semantics for="type" dependsOn="φ" def="type_triple">r</semantics> }<br/>
               ⋃ { <semantics for="lex" dependsOn="φ" def="literal_triple">r, c</semantics> | <nt def="RDB-value">value</nt>(r, c) ≠ NULL | c ∈ <nt def="RDB-lexicals">lexicals</nt>(r) }<br/>
               ⋃ { <semantics for="ref" dependsOn="φ" def="reference_triple">r, fk</semantics> | <nt def="RDB-noNULLs">noNULLs</nt>(r, fk) | fk ∈ <nt def="RDB-foreignKeys">foreignKeys</nt>(<nt def="RDB-table">table</nt>(r)) }
              </rhs>
	    </sbuilder>
	    <sets>
	      <lhs>row_graph(T, R)</lhs>
	      <rhs>&nbsp;&nbsp;{ <nt def="type_triple">type_triple</nt>(R) }<br/>
	      ∪ { <nt def="literal_triple">literal_triple</nt>(R, A) ∣ A ≠ Null ∧ [A] ∉ R.<nt def="RDB-ForeignKey">ForeignKeys</nt>(T) }<br/>
	      ∪ { <nt def="reference_triple">reference_triple</nt>(As, T) ∣ ∄(T(A) = Null ∣ A ∈ As) ∧ As ≠ R.<nt def="RDB-PrimaryKey">PrimaryKey</nt> ∣ As ∈ R.<nt def="RDB-ForeignKey">ForeignKeys</nt>(T)</rhs>
	    </sets>
	    <english999>The union of the triples coming from
            <ul>
              <li>the NOT NULL foreign keys</li>
              <li>the NOT NULL lexical values (not contributing to a unary foreign key)</li>
              <li>the table name, which denotes an RDF type information</li>
            </ul>
            </english999>
	    <english>
	<defn name="row graph">
	  an RDF graph consisting of the following triples:
	  <ul>
	    <li>
	      the <termref id="row type triple">row type triple</termref>.
	    </li>
	    <li>
	      a <termref id="reference triple">reference triple</termref> for each &lt;column name list&gt; in a table's foreign keys where none of the column values is NULL.
	    </li>
	    <li>
	      a <termref id="literal triple">literal triple</termref> for each column in a table where the column value is non-NULL and where that column is NOT the sole column in any foreign key.
	    </li>
	  </ul>
	</defn>
	    </english>
	  </prod>
	  <prod id="type_triple-type" num="43" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="type">&nbsp;</semantics></lhs>
	      <rhs>(<nt def="RDB-Row">Row</nt>) → <nt def="RDB-Triple">Triple</nt></rhs>
	    </sbuilder>
	    <english>A mapping from a column in a row to an optional pair of RDF predicate and object.</english>
	  </prod>
	  <prod id="type_triple" num="43" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="type">r</semantics></lhs>
	      <rhs>
<let /> s = <nt def="row_node">φ</nt>(r) <in /><br/>
{ (s, <a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">rdf:type</a>, <nt def="url-encoding-type">ue</nt>(<nt def="RDB-tablename">tablename</nt>(<nt def="RDB-table">table</nt>(r)))) }</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>type_triple(R)</lhs>
	      <rhs><nt def="RDF-Triple">triple</nt>(<nt def="row_node">row node</nt>(R), <a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">rdf:type</a>, <nt def="url-encoding-type">ue</nt>(R.name))</rhs>
	    </sets>
	    <english999>If the cell value for this column is NULL: nothing;<br/>
            Otherwise: a predicate based on the column name and a typed type made of the value in the cell plus the corresponding RDF datatype.
            </english999>
	    <english>
	<defn name="row type triple">
	  an RDF triple with:
	  <ul>
	    <li>
	      subject: the <termref id="row node">row node</termref> for the row.
	    </li>
	    <li>
	      predicate: the RDF IRI <code>rdf:type</code>.
	    </li>
	    <li>
	      object: the relative IRI consisting of the percent-encoded form of the table name.
	    </li>
	  </ul>
	</defn>
	    </english>
	  </prod>
	  <prod id="literal_triple-type" num="44" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="lex">&nbsp;,&nbsp;&nbsp;</semantics></lhs>
	      <rhs>(<nt def="RDB-Row">Row</nt>, <nt def="RDB-Column">Column</nt>) → <nt def="RDB-Triple">Triple</nt> //@@ I can't explain why this was: { s:Set((<nt def="RDB-Predicate">Predicate</nt>, <nt def="RDB-Object">Object</nt>)) | size(s) ≤ 1 }</rhs>
	    </sbuilder>
	    <english>A mapping from a column in a row to an optional pair of RDF predicate and object.</english>
	  </prod>
	  <prod id="literal_triple" num="44" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="lex">r, c</semantics></lhs>
	      <rhs>
<let /> s = <nt def="row_node">φ</nt>(r) <in /><br/>
<let /> p = <semantics for="litcol" def="literal_property_IRI"><nt def="RDB-table">table</nt>(r), c</semantics> <in /><br/>
<let /> v = <nt def="RDB-value">value</nt>(r, c) <in /><br/>
<let /> d = <nt def="RDB-datatype">datatype</nt>(<nt def="RDB-header">header</nt>(<nt def="RDB-table">table</nt>(r))(c)) <in /><br/>
<if /> v is NULL <then /> ∅<br/>
<else /> <if /> d is String <then /> {(s, p, v)}<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<else /> <let /> datatype_iri = <semantics for="datatype" def="literal_map">d</semantics> <in /><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{(s, p, (v, datatype_iri))}</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>literal_triple(R, A)</lhs>
	      <rhs><nt def="RDF-Triple">triple</nt>(<nt def="row_node">row node</nt>(R), <nt def="literal_property_IRI">literal_property_IRI</nt>(R, [A]), <nt def="literal_map">literal_map</nt>(A))</rhs>
	    </sets>
	    <english999>If the cell value for this column is NULL: nothing;<br/>
            Otherwise: a predicate based on the column name and a typed literal made of the value in the cell plus the corresponding RDF datatype.
            </english999>
	    <english>
	<defn name="literal triple">
	  an RDF triple with:
	  <ul>
	    <li>
	      subject: the <termref id="row node">row node</termref> for the row.
	    </li>
	    <li>
	      predicate: the <termref id="literal property IRI">literal property IRI</termref> for the column.
	    </li>
	    <li>
	      object: the <termref id="literal map">literal map</termref> for the column value.
	    </li>
	  </ul>
	</defn>
	    </english>
	  </prod>
	  <prod id="reference_triple-type" num="45" auxilliary="1" class="typedef">
	    <sbuilder>
	      <lhs><semantics for="ref">&nbsp;,&nbsp;&nbsp;&nbsp;</semantics></lhs>
	      <rhs>(<nt def="RDB-Row">Row</nt>, <nt def="RDB-ForeignKey">ForeignKey</nt>) → <nt def="RDB-Triple">Triple</nt></rhs>
	    </sbuilder>
	    <english>A mapping from a foreign key in a row to an RDF predicate and an RDF object.</english>
	  </prod>
	  <prod id="reference_triple" num="45" class="funcdef">
	    <sbuilder>
	      <lhs><semantics for="ref">r, fk</semantics></lhs>
	      <rhs><let /> s = <nt def="function-phi">φ</nt>(r) <in /><br/>
                 <let /> targetSpec = <nt def="RDB-dereference">dereference</nt>(r, fk) <in /><br/>
                 <let /> p = <semantics for="refcol" def="reference_property_IRI"><nt def="RDB-table">table</nt>(r), fk</semantics> <in /><br/>
                 <let /> o = <nt def="function-phi">φ</nt>(row(targetSpec)) <in /><br/>
                 (s, p, o)</rhs>
	    </sbuilder>
	    <sets>
	      <lhs>reference_triple(R, As)</lhs>
	      <rhs><nt def="RDF-Triple">triple</nt>(<nt def="row_node">row node</nt>(R), <nt def="reference_property_IRI">reference_property_IRI</nt>(R, As), <nt def="row_node">row_node</nt>(<nt def="RDB-dereference">dereference</nt>(R, As)))</rhs>
	    </sets>
	    <english999>The predicate based on the column name and the object refered by the foreign key <var>fk</var>.</english999>
	    <english>
	<defn name="reference triple">
	  an RDF triple with:
	  <ul>
	    <li>
	      subject: the <termref id="row node">row node</termref> for the row.
	    </li>
	    <li>
	      predicate: the <termref id="reference property IRI">reference property IRI</termref> for the columns.
	    </li>
	    <li>
	      object: the <termref id="row node">row node</termref> for the referenced row.
	    </li>
	  </ul>
	</defn>
	    </english>
	  </prod>

	  <!-- <prod id="" num="52"> -->
	  <!--   <lhs></lhs> -->
	  <!--   <rhs></rhs> -->
	  <!--   <english></english> -->
	  <!-- </prod> -->

      </scrap>

    </div2>

    </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>
@base &lt;http://foo.example/DB/&gt;
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

&lt;http://foo.example/DB/People/ID<valsep>-</valsep>7&gt; a &lt;http://foo.example/DB/#People&gt; .
&lt;http://foo.example/DB/People/ID<valsep>-</valsep>8&gt; a &lt;http://foo.example/DB/#People&gt; .
&lt;http://foo.example/DB/Addresses/ID<valsep>-</valsep>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="53">
	    <lhs>directT(R, T)</lhs>
	    <rhs>{ directL(R, S, A) ∣ A ∈ scalar(T) } ∪ { directN(R, S, A) ∣ A ∈ reference(T) }  ∪ { directP(R, S) } ∣ S = rowIRI(R, T[pk(R)])</rhs>
	    <english></english>
	  </prod>
	  <prod num="54">
	    <lhs>directP(R, S)</lhs>
	    <rhs>triple(S, rdf:type, typeIRI(R))</rhs>
	    <english></english>
	  </prod>
	  <prod num="55">
	    <lhs>typeIRI(R)</lhs>
	    <rhs>IRI(base + "#" + 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>
@base &lt;http://foo.example/DB/&gt;
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#ID&gt; 7 .
&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#fname&gt; "Bob" .
&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#addr&gt; &lt;Addresses/ID<valsep>-</valsep>18&gt; .
&lt;People/ID<valsep>-</valsep>7&gt; &lt;People#addr&gt; &lt;Addresses/ID.19&gt; .
&lt;People/ID<valsep>-</valsep>8&gt; &lt;People#ID&gt; 8 .&lt;People/ID<valsep>-</valsep>8&gt; &lt;People#fname&gt; "Sue" .

&lt;Addresses/ID<valsep>-</valsep>18&gt; &lt;Addresses#ID&gt; 18 .
&lt;Addresses/ID<valsep>-</valsep>18&gt; &lt;Addresses#city&gt; "Cambridge" .
&lt;Addresses/ID<valsep>-</valsep>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="56">
	    <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="57">
	    <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="58">
	    <lhs>repeatpropertyR(R)</lhs>
	    <rhs>{ <nt def="repeatpropertyT">repeatpropertyT</nt>(R, T) ∣ T ∈ R.Body }</rhs>
	    <english></english>
	  </prod>
	  <prod id="many2many-repeatpropertyT" num="59">
	    <lhs>repeatpropertyT(R, T)</lhs>
	    <rhs><nt def="RDF-Triple">triple</nt>(<nt def="base-rowIRI">rowIRI</nt>(RX, PKX), <nt def="base-propertyIRI">propertyIRI</nt>(R, Y), <nt def="base-rowIRI">rowIRI</nt>(RY, PKY))</rhs>
	    <english></english>
	  </prod>
	</scrap>

      </div2>
    </div1 -->

    <div1 id="direct_mapping_rules">
      <head>Direct Mapping as Rules (Informative)</head>
      <p>
      In this section, we formally present the Direct Mapping as
rules in Datalog syntax, inspired by previous approach <bibref ref="SQL2SW"/>. 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 divided into three groups. The first group
contains some built-in predicates for dealing with repeated rows in a
table without a primary key.
      </p>
      <ulist>
         <item id="card">card(r, l, k): Given a table name r without a
primary key and the list l of values [v<sub>1</sub>, ...,
v<sub>n</sub>] for a row of table r, it returns
in k the multiplicity of l in r (that is, k is the number of times row
l appears in r)
         </item>
         <item id="le_built_in">n &le; m: This is the usual order on
positive integer values (given positive integers n and m, it holds if
n is smaller than or equal to m)
         </item>
      </ulist>
      <p>
The second group contains a predicate to deal with null values.
      </p>
      <ulist>
         <item id="nonnull">nonNull(v): Given a value v, it holds if v
is not null 
         </item>
      </ulist>
      <p>
Finally, the third group of built-in predicates is used to generate IRIs for
identifying tables and the columns in a table, and to generate IRIs or
blank nodes for identifying each row in a table.
      </p>
      <ulist>
         <item id="generateTableIRI">generateTableIRI(r, i): Given a
table name r, it generates the <a href="#table_iri">table IRI</a> i of
r
         </item>
         <item id="generateLiteralPropertyIRI">generateLiteralPropertyIRI(r, l, i):
Given a table name r and a non-empty list of columns l, it generates
the <a href="#lit_prop_iri">literal property IRI</a> i for l
         </item>
         <item id="generateReferencePropertyIRI">generateReferencePropertyIRI(r, l, i):
Given a table name r and a non-empty list of columns l, it generates
the <a href="#ref_prop_iri">reference property IRI</a> i for l
         </item>
         <item id="generateRowIRI">generateRowIRI(r, l<sub>1</sub>,
l<sub>2</sub>, i): Given a table name r, a non-empty list
l<sub>1</sub> of columns and a non-empty list l<sub>2</sub> of values
(for the columns in l<sub>1</sub>), it generates the <a
href="#row_node_def">row node</a> (or Row IRI) i for the given row
         </item>
         <item id="generateRowBlankNode">generateRowBlankNode(r, l, n,
i): Given a table name r without a primary key, a list l of values
for a row of table r and a positive integer n, it generates the <a
href="#row_node_def">row node</a> i for the n-th occurrence of row l in
r (which is a <a
href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-blank-node">Blank
Node</a> in this case). It is assumed that n is smaller than or equal
to the multiplicity of l in r (that is, if card(r, l, k) holds, then 1
&le; n &le; k)
          </item>
       </ulist>
       <p>
       Throughout the section, boxes containing Direct Mapping rules and examples will appear. 
       These boxes are color-coded. Gray boxes contain Direct Mapping rules:
       
       <rule>
       This box contains a Direct Mapping rule      
       </rule>
       
       <p>
       Yellow boxes contain examples of applying the previous Direct Mapping rule:
       </p>
       <rule-example>
       This box contains examples of applying a Direct Mapping rule      
       </rule-example>
       
       </p>
       <p>
Consider again the example from Section <a href="#lead-ex">Direct Mapping
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
the 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). In particular, uppercase letters like X, Y, Z, S, P and O are used to denote variables. 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], S) is
used to generate the <a href="#row_node_def">row node</a> (or Row IRI) for the row of table "Addresses" whose value in the primary key "ID" is the value stored in the variable X. The value of this Row IRI is stored in the variable S.
       </p>

       <div2 id="rules_row_type_triples">
	<head>Generating Row Type Triples</head>
	<div3 id="rules_row_type_triples_single_pk">
		<head>Table has a primary key</head>
		<p>
	Assume that r is a table with columns a<sub>1</sub>, ..., a<sub>m</sub> and such that [a<sub>p<sub>1</sub></sub>, ..., a<sub>p<sub>n</sub></sub>] is the primary key of r, where 1 &le; n &le; m and 1 &le; p<sub>1</sub> &lt; ... &lt; p<sub>n</sub> &le; m. Then the following is the direct mapping rule to generate <a href="#row_type_triple_def">row type triples</a> from r:	 
                </p>
		<rule>
Triple(S, "rdf:type", O) ← r(X<sub>1</sub>, ..., X<sub>m</sub>), generateRowIRI("r", ["a<sub>p<sub>1</sub></sub>", ..., "a<sub>p<sub>n</sub></sub>"], [X<sub>p<sub>1</sub></sub>, ..., X<sub>p<sub>n</sub></sub>], S), generateTableIRI("r", O)   
		</rule>
                <p>
For example, table <em>Addresses</em> in the <a href="#lead-ex">Direct Mapping Example</a> has columns <em>ID</em>, <em>city</em> and <em>state</em>, and it has column <em>ID</em> as its primary key. Then the following is the direct mapping rule to generate <a href="#row_type_triple_def">row type triples</a> from <em>Addresses</em>:
                </p>
                <rule-example>
Triple(S, "rdf:type", O) ← Addresses(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), generateRowIRI("Addresses", ["ID"], [X<sub>1</sub>], S), generateTableIRI("Addresses", O)
                </rule-example>
                
                 <p>
As a second example, consider table <em>Department</em> from the example in Section <a href="#fk-candidate">Foreign keys referencing candidate keys</a>, which has columns <em>ID</em>, <em>name</em>, <em>city</em> and <em>manager</em>, and assume that (<em>name</em>, <em>city</em>) is the multi-column primary key of this table (instead of <em>ID</em>). Then the following is the direct mapping rule to generate <a href="#row_type_triple_def">row type triples</a> from <em>Department</em>:
                </p>
		<rule-example>
Triple(S, "rdf:type", O) ← Department(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>, X<sub>4</sub>), generateRowIRI("Department", ["name","city"], [X<sub>2</sub>, X<sub>3</sub>], S), generateTableIRI("Department", O)
		</rule-example>
	</div3>

	
	<div3 id="rules_row_type_triples_no_pk">
		<head>Table does not have a primary key</head>
		<p>
	Assume that r is a table with columns a<sub>1</sub>, ..., a<sub>m</sub> and such that r does not have a primary key. Then the following is the direct mapping rule to generate <a href="#row_type_triple_def">row type triples</a> from r:
                </p>
		<rule>
Triple(S, "rdf:type", O) ← r(X<sub>1</sub>, ..., X<sub>m</sub>), card("r", [X<sub>1</sub>, ..., X<sub>m</sub>], U), V &le; U, generateRowBlankNode("r", [X<sub>1</sub>, ..., X<sub>m</sub>], V, S), 
                            generateTableIRI("r", O)   
		</rule>
                <p>
For example, table <em>Tweets</em> from Section <a href="#no-pk">Empty (non-existent) primary keys</a> has columns <em>tweeter</em>, <em>when</em> and <em>text</em>, and it does not have a primary key. Then the following is the direct mapping rule to generate <a href="#row_type_triple_def">row type triples</a> from <em>Tweets</em>: 
                </p>
		<rule-example>
Triple(S, "rdf:type", O) ← Tweets(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), card("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], U), V &le; U, generateRowBlankNode("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], V, S), 
                            generateTableIRI("Tweets", O)   
		</rule-example>
	</div3>
      </div2>
      
      <div2 id="rules_literal_triples">
	<head>Generating Literal Triples</head>
	<div3 id="rules_literal_triples_single_pk">
		<head>Table has a primary key</head>
		<p>
	Assume that r is a table with columns a<sub>1</sub>, ..., a<sub>m</sub> and such that [a<sub>p<sub>1</sub></sub>, ..., a<sub>p<sub>n</sub></sub>] is the primary key of r, where 1 &le; n &le; m and 1 &le; p<sub>1</sub> &lt; ... &lt; p<sub>n</sub> &le; m. Then for every a<sub>j</sub> (1 ≤ j ≤ m), the direct mapping includes the following rule for r and a<sub>j</sub> to generate <a href="#literal_triple_def">literal triples</a>:
	        </p>
		<rule>
Triple(S, P, X<sub>j</sub>) ← r(X<sub>1</sub>, ..., X<sub>m</sub>), nonNull(X<sub>j</sub>), generateRowIRI("r", ["a<sub>p<sub>1</sub></sub>", ..., "a<sub>p<sub>n</sub></sub>"], [X<sub>p<sub>1</sub></sub>, ..., X<sub>p<sub>n</sub></sub>], S), generateLiteralPropertyIRI("r", ["a<sub>j</sub>"], P)  
		</rule>
                <p>
For example, table <em>Addresses</em> in the <a href="#lead-ex">Direct Mapping Example</a> has columns <em>ID</em>, <em>city</em> and <em>state</em>, and it has column <em>ID</em> as its primary key. Then the following are the direct mapping rules to generate <a href="#literal_triple_def">literal triples</a> from <em>Addresses</em>: 
                </p>
                <rule-example>
Triple(S, P, X<sub>1</sub>) ← Addresses(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), nonNull(X<sub>1</sub>), generateRowIRI("Addresses", ["ID"], [X<sub>1</sub>], S), generateLiteralPropertyIRI("Addresses", ["ID"], P)
Triple(S, P, X<sub>2</sub>) ← Addresses(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), nonNull(X<sub>2</sub>), generateRowIRI("Addresses", ["ID"], [X<sub>1</sub>], S), generateLiteralPropertyIRI("Addresses", ["city"], P)
Triple(S, P, X<sub>3</sub>) ← Addresses(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), nonNull(X<sub>3</sub>), generateRowIRI("Addresses", ["ID"], [X<sub>1</sub>], S), generateLiteralPropertyIRI("Addresses", ["state"], P)
                </rule-example>
 <p>
As a second example, consider again table <em>Department</em> from the example in Section <a href="#fk-candidate">Foreign keys referencing candidate keys</a>, which has columns <em>ID</em>, <em>name</em>, <em>city</em> and <em>manager</em>, and assume that (<em>name</em>, <em>city</em>) is the multi-column primary key of this table (instead of <em>ID</em>). Then the following are the direct mapping rules to generate <a href="#literal_triple_def">literal triples</a> from <em>Department</em>:
                </p>
		<rule-example>
Triple(S, P, X<sub>1</sub>) ← Department(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>, X<sub>4</sub>), nonNull(X<sub>1</sub>), generateRowIRI("Department", ["name", "city"], [X<sub>2</sub>, X<sub>3</sub>], S), 
                   generateLiteralPropertyIRI("Department", ["ID"], P)
Triple(S, P, X<sub>2</sub>) ← Department(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>, X<sub>4</sub>), nonNull(X<sub>2</sub>), generateRowIRI("Department", ["name", "city"], [X<sub>2</sub>, X<sub>3</sub>], S), 
                   generateLiteralPropertyIRI("Department", ["name"], P)
Triple(S, P, X<sub>3</sub>) ← Department(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>, X<sub>4</sub>), nonNull(X<sub>3</sub>), generateRowIRI("Department", ["name", "city"], [X<sub>2</sub>, X<sub>3</sub>], S), 
                   generateLiteralPropertyIRI("Department", ["city"], P)
Triple(S, P, X<sub>4</sub>) ← Department(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>, X<sub>4</sub>), nonNull(X<sub>4</sub>), generateRowIRI("Department", ["name", "city"], [X<sub>2</sub>, X<sub>3</sub>], S), 
                   generateLiteralPropertyIRI("Department", ["manager"], P)
		</rule-example>              
                
	</div3>
	<div3 id="rules_literal_triples_no_pk">
		<head>Table does not have a primary key</head>
		<p>
	Assume that r is a table with columns a<sub>1</sub>, ..., a<sub>m</sub> and such that r does not have a primary key. Then for every a<sub>j</sub> (1 ≤ j ≤ m), the direct mapping includes the following rule for r and a<sub>j</sub> to generate <a href="#literal_triple_def">literal triples</a>:
	</p>
		<rule>
Triple(S, P, X<sub>j</sub>) ← r(X<sub>1</sub>, ..., X<sub>m</sub>), nonNull(X<sub>j</sub>), card("r", [X<sub>1</sub>, ..., X<sub>m</sub>], U), V &le; U, generateRowBlankNode("r", [X<sub>1</sub>, ..., X<sub>m</sub>], V, S), 
                   generateLiteralPropertyIRI("r", ["a<sub>j</sub>"], P)  
		</rule>
                <p>
For example, table <em>Tweets</em> from Section <a href="#no-pk">Empty (non-existent) primary keys</a> has columns <em>tweeter</em>, <em>when</em> and <em>text</em>, and it does not have a primary key. Then the following are the direct mapping rules to generate <a href="#literal_triple_def">literal triples</a> from <em>Tweets</em>:
                </p>
		<rule-example>
Triple(S, P, X<sub>1</sub>) ← Tweets(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), nonNull(X<sub>1</sub>), card("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], U), V &le; U, generateRowBlankNode("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], V, S), 
                   generateLiteralPropertyIRI("Tweets", ["tweeter"], P)
Triple(S, P, X<sub>2</sub>) ← Tweets(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), nonNull(X<sub>2</sub>), card("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], U), V &le; U, generateRowBlankNode("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], V, S), 
                   generateLiteralPropertyIRI("Tweets", ["when"], P)
Triple(S, P, X<sub>3</sub>) ← Tweets(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), nonNull(X<sub>3</sub>), card("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], U), V &le; U, generateRowBlankNode("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], V, S), 
                   generateLiteralPropertyIRI("Tweets", ["text"], P)
		</rule-example>
	</div3>
	
	
	<p>
	
	
	</p>      
	</div2>
	<div2 id="rules_reference_triples">
	<head>Generating Reference Triples</head>
           <p>
           For each foreign key from a table r<sub>1</sub> to a table r<sub>2</sub>, one of the following four cases is applied.	
           </p>
 	<div3 id="rules_reference_triples_r1pk_r2pk">
		<head>Table r<sub>1</sub> has a primary key and table r<sub>2</sub> has a primary key</head>
		<p>Assume that:</p>
		
		 <ulist>
           <item>
              <p>
	r<sub>1</sub> is a table with columns a<sub>1</sub>, ..., a<sub>i</sub> and such that [a<sub>p<sub>1</sub></sub>, ..., a<sub>p<sub>j</sub></sub>] is the primary key of r<sub>1</sub>, where 1 &le; j &le; i and 1 &le; p<sub>1</sub> &lt; ... &lt; p<sub>j</sub> &le; i
              </p>
           </item>
           <item>
              <p>
	r<sub>2</sub> is a table with columns c<sub>1</sub>, ..., c<sub>k</sub> and such that [c<sub>q<sub>1</sub></sub>, ..., c<sub>q<sub>m</sub></sub>] is the primary key of r<sub>2</sub>, where 1 &le; m &le; k and 1 &le; q<sub>1</sub> &lt; ... &lt; q<sub>m</sub> &le; k
              </p>
           </item>
            <item>
              <p>
        the foreign key indicates that the columns a<sub>s<sub>1</sub></sub>, ..., a<sub>s<sub>n</sub></sub> of r<sub>1</sub> reference the columns c<sub>t<sub>1</sub></sub>, ..., c<sub>t<sub>n</sub></sub> of r<sub>2</sub>, where (1) 1 &le; s<sub>1</sub>, ..., s<sub>n</sub> &le; i, (2) 1 &le; t<sub>1</sub>, ..., t<sub>n</sub> &le; k, and (3) n &#8805; 1
              </p>
           </item>
           </ulist>		
                <p>
Then the direct mapping includes the following rule for r<sub>1</sub> and r<sub>2</sub> to generate <a href="#reference_triple_def">Reference Triples:</a>
	        </p>
		<rule>
Triple(S, P, O) ← r<sub>1</sub>(X<sub>1</sub>, ..., X<sub>i</sub>), generateRowIRI("r<sub>1</sub>", ["a<sub>p<sub>1</sub></sub>", ..., "a<sub>p<sub>j</sub></sub>"], [X<sub>p<sub>1</sub></sub>, ..., X<sub>p<sub>j</sub></sub>], S), 
                   r<sub>2</sub>(Y<sub>1</sub>, ..., Y<sub>k</sub>), generateRowIRI("r<sub>2</sub>", ["c<sub>q<sub>1</sub></sub>", ..., "c<sub>q<sub>m</sub></sub>"], [Y<sub>q<sub>1</sub></sub>, ..., Y<sub>q<sub>m</sub></sub>], O), 
                   nonNull(X<sub>s<sub>1</sub></sub>), ..., nonNull(X<sub>s<sub>n</sub></sub>), X<sub>s<sub>1</sub></sub> = Y<sub>t<sub>1</sub></sub>, ...,  X<sub>s<sub>n</sub></sub> = Y<sub>t<sub>n</sub></sub>,  generateReferencePropertyIRI("r<sub>1</sub>", ["a<sub>s<sub>1</sub></sub>", ..., "a<sub>s<sub>n</sub></sub>"], P)
		</rule>
		
                <p>
For example, table <em>Addresses</em> in the <a href="#lead-ex">Direct Mapping Example</a> has columns <em>ID</em>, <em>city</em> and <em>state</em>, where column <em>ID</em> is the primary key. Table <em>People</em> in this example has columns <em>ID</em>, <em>fname</em> and <em>addr</em>, where column <em>ID</em> is the primary key, and it has a foreign key in the column <em>addr</em> that references the column <em>ID</em> in the table <em>Addresses</em>. In this case, the following is the direct mapping rule to generate <a href="#reference_triple_def">Reference Triples</a>:
                </p>
		<rule-example>
Triple(S, P, O) ← People(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), generateRowIRI("People", ["ID"], [X<sub>1</sub>], S), 
                   Addresses(Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>), generateRowIRI("Addresses", ["ID"], [Y<sub>1</sub>], O), 
                   nonNull(X<sub>3</sub>), X<sub>3</sub> = Y<sub>1</sub>,  generateReferencePropertyIRI("People", ["addr"], P)
                </rule-example>
                        
                
	</div3>

	<div3 id="rules_reference_triples_r1pk_r2nopk">
		<head>Table r<sub>1</sub> has a primary key and table r<sub>2</sub> does not have a primary key</head>
		<p>Assume that:</p>
		
		 <ulist>
           <item>
              <p>
	r<sub>1</sub> is a table with columns a<sub>1</sub>, ..., a<sub>i</sub> and such that [a<sub>p<sub>1</sub></sub>, ..., a<sub>p<sub>j</sub></sub>] is the primary key of r<sub>1</sub>, where 1 &le; j &le; i and and 1 &le; p<sub>1</sub> &lt; ... &lt; p<sub>j</sub> &le; i
              </p>
           </item>
           <item>
              <p>
	r<sub>2</sub> is a table with columns c<sub>1</sub>, ..., c<sub>k</sub>, and it does not have a primary key
              </p>
           </item>
            <item>
              <p>
        the foreign key indicates that the columns a<sub>s<sub>1</sub></sub>, ..., a<sub>s<sub>n</sub></sub> of r<sub>1</sub> reference the columns c<sub>t<sub>1</sub></sub>, ..., c<sub>t<sub>n</sub></sub> of r<sub>2</sub>, where (1) 1 &le; s<sub>1</sub>, ..., s<sub>n</sub> &le; i, (2) 1 &le; t<sub>1</sub>, ..., t<sub>n</sub> &le; k, and (3) n &#8805; 1
              </p>
           </item>
           </ulist>

                <p>
Then the direct mapping includes the following rule for r<sub>1</sub> and r<sub>2</sub> to generate <a href="#reference_triple_def">Reference Triples:</a>
	        </p>
		<rule>
Triple(S, P, O) ← r<sub>1</sub>(X<sub>1</sub>, ..., X<sub>i</sub>), generateRowIRI("r<sub>1</sub>", ["a<sub>p<sub>1</sub></sub>", ..., "a<sub>p<sub>j</sub></sub>"], [X<sub>p<sub>1</sub></sub>, ..., X<sub>p<sub>j</sub></sub>], S),
                   r<sub>2</sub>(Y<sub>1</sub>, ..., Y<sub>k</sub>), card("r<sub>2</sub>", [Y<sub>1</sub>, ..., Y<sub>k</sub>], U), V ≤ U, generateRowBlankNode("r<sub>2</sub>", [Y<sub>1</sub>, ..., Y<sub>k</sub>], V, O), 
                   nonNull(X<sub>s<sub>1</sub></sub>), ..., nonNull(X<sub>s<sub>n</sub></sub>), X<sub>s<sub>1</sub></sub> = Y<sub>t<sub>1</sub></sub>, ...,  X<sub>s<sub>n</sub></sub> = Y<sub>t<sub>n</sub></sub>,  generateReferencePropertyIRI("r<sub>1</sub>", ["a<sub>s<sub>1</sub></sub>", ..., "a<sub>s<sub>n</sub></sub>"], P)
		</rule>
		
                <p>
For example, assume that table <em>Addresses</em> in the <a href="#lead-ex">Direct Mapping Example</a> has columns <em>ID</em>, <em>city</em> and <em>state</em>, and that column <em>ID</em> is a candidate key (instead of a primary key), so that table <em>Addresses</em> does not have a primary key. Moreover, assume that table <em>People</em> in this example has columns <em>ID</em>, <em>fname</em> and <em>addr</em>, it has column <em>ID</em> as its primary key, and it has a foreign key in the column <em>addr</em> to the candidate key <em>ID</em> in the table <em>Addresses</em>. In this case, the following is the direct mapping rule to generate <a href="#reference_triple_def">Reference Triples</a>:
                </p>
		<rule-example>
Triple(S, P, O) ← People(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), generateRowIRI("People", ["ID"], [X<sub>1</sub>], S), 
                   Addresses(Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>), card("Addresses", [Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>], U), V ≤ U, generateRowBlankNode("Addresses", [Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>], V, O), 
                   nonNull(X<sub>3</sub>), X<sub>3</sub> = Y<sub>1</sub>,  generateReferencePropertyIRI("People", ["addr"], P)
                </rule-example>
                
	</div3>
	
		<div3 id="rules_reference_triples_r1nopk_r2pk">
		<head>Table r<sub>1</sub> does not have primary key and table r<sub>2</sub> has a primary key</head>
		<p>Assume that:</p>
		
		 <ulist>
           <item>
              <p>
	r<sub>1</sub> is a table with columns a<sub>1</sub>, ..., a<sub>i</sub>, and it does not have a primary key
              </p>
           </item>
           <item>
              <p>
	r<sub>2</sub> is a table with columns c<sub>1</sub>, ..., c<sub>k</sub> and such that [c<sub>q<sub>1</sub></sub>, ..., c<sub>q<sub>m</sub></sub>] is the primary key of r<sub>2</sub>, where 1 &le; m &le; k and 1 &le; q<sub>1</sub> &lt; ... &lt; q<sub>m</sub> &le; k
              </p>
           </item>
            <item>
              <p>
        the foreign key indicates that the columns a<sub>s<sub>1</sub></sub>, ..., a<sub>s<sub>n</sub></sub> of r<sub>1</sub> reference the columns c<sub>t<sub>1</sub></sub>, ..., c<sub>t<sub>n</sub></sub> of r<sub>2</sub>, where (1) 1 &le; s<sub>1</sub>, ..., s<sub>n</sub> &le; i, (2) 1 &le; t<sub>1</sub>, ..., t<sub>n</sub> &le; k, and (3) n &#8805; 1
              </p>
           </item>
           </ulist>
                <p>
Then the direct mapping includes the following rule for r<sub>1</sub> and r<sub>2</sub> to generate <a href="#reference_triple_def">Reference Triples:</a>
	        </p>
		<rule>
Triple(S, P, O) ← r<sub>1</sub>(X<sub>1</sub>, ..., X<sub>i</sub>), card("r<sub>1</sub>", [X<sub>1</sub>, ..., X<sub>i</sub>], U), V ≤ U, generateRowBlankNode("r<sub>1</sub>", [X<sub>1</sub>, ..., X<sub>i</sub>], V, S), 
                   r<sub>2</sub>(Y<sub>1</sub>, ..., Y<sub>k</sub>), generateRowIRI("r<sub>2</sub>", ["c<sub>q<sub>1</sub></sub>", ..., "c<sub>q<sub>m</sub></sub>"], [Y<sub>q<sub>1</sub></sub>, ..., Y<sub>q<sub>m</sub></sub>], O), 
                   nonNull(X<sub>s<sub>1</sub></sub>), ..., nonNull(X<sub>s<sub>n</sub></sub>), X<sub>s<sub>1</sub></sub> = Y<sub>t<sub>1</sub></sub>, ...,  X<sub>s<sub>n</sub></sub> = Y<sub>t<sub>n</sub></sub>,  generateReferencePropertyIRI("r<sub>1</sub>", ["a<sub>s<sub>1</sub></sub>", ..., "a<sub>s<sub>n</sub></sub>"], P)
		</rule>
		<p>
For example, table <em>People</em> in the <a href="#lead-ex">Direct Mapping Example</a> has columns <em>ID</em>, <em>fname</em> and <em>addr</em>, and it has column <em>ID</em> as its primary key, while table <em>Tweets</em> from Section <a href="#no-pk">Empty (non-existent) primary keys</a> has columns <em>tweeter</em>, <em>when</em> and <em>text</em>, it does not have a primary key, and it has a foreign key in column <em>tweeter</em> that references column <em>ID</em> in table <em>People</em>. In this case, the following is the direct mapping rule to generate <a href="#reference_triple_def">Reference Triples</a>:
		</p>
		<rule-example>
Triple(S, P, O) ← Tweets(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), card("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], U), V ≤ U, generateRowBlankNode("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], V, S), 
                   People(Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>), generateRowIRI("People", ["ID"], [Y<sub>1</sub>], O), 
                   nonNull(X<sub>1</sub>), X<sub>1</sub> = Y<sub>1</sub>, generateReferencePropertyIRI("Tweets", ["tweeter"], P)
		</rule-example>

                        
                
	</div3>
	
		<div3 id="rules_reference_triples_r1nopk_r2nopk">
		<head>Table r<sub>1</sub> does not have primary key and table r<sub>2</sub> does not have a primary key</head>
		<p>Assume that:</p>
		
		 <ulist>
           <item>
              <p>
	r<sub>1</sub> is a table with columns a<sub>1</sub>, ..., a<sub>i</sub>, and it does not have a primary key
              </p>
           </item>
           <item>
              <p>
	r<sub>2</sub> is a table with columns c<sub>1</sub>, ..., c<sub>k</sub>, and it does not have a primary key
              </p>
           </item>
            <item>
              <p>
        the foreign key indicates that the columns a<sub>s<sub>1</sub></sub>, ..., a<sub>s<sub>n</sub></sub> of r<sub>1</sub> reference the columns c<sub>t<sub>1</sub></sub>, ..., c<sub>t<sub>n</sub></sub> of r<sub>2</sub>, where (1) 1 &le; s<sub>1</sub>, ..., s<sub>n</sub> &le; i, (2) 1 &le; t<sub>1</sub>, ..., t<sub>n</sub> &le; k, and (3) n &#8805; 1
              </p>
           </item>
           </ulist>
                <p>
Then the direct mapping includes the following rule for r<sub>1</sub> and r<sub>2</sub> to generate <a href="#reference_triple_def">Reference Triples:</a>
	        </p>
		<rule>
Triple(S, P, O) ← r<sub>1</sub>(X<sub>1</sub>, ..., X<sub>i</sub>), card("r<sub>1</sub>", [X<sub>1</sub>, ..., X<sub>i</sub>], U<sub>1</sub>), V<sub>1</sub> ≤ U<sub>1</sub>, generateRowBlankNode("r<sub>1</sub>", [X<sub>1</sub>, ..., X<sub>i</sub>], V<sub>1</sub>, S), 
                   r<sub>2</sub>(Y<sub>1</sub>, ..., Y<sub>k</sub>), card("r<sub>2</sub>", [Y<sub>1</sub>, ..., Y<sub>k</sub>], U<sub>2</sub>), V<sub>2</sub> ≤ U<sub>2</sub>, generateRowBlankNode("r<sub>2</sub>", [Y<sub>1</sub>, ..., Y<sub>k</sub>], V<sub>2</sub>, O), 
                   nonNull(X<sub>s<sub>1</sub></sub>), ..., nonNull(X<sub>s<sub>n</sub></sub>), X<sub>s<sub>1</sub></sub> = Y<sub>t<sub>1</sub></sub>, ...,  X<sub>s<sub>n</sub></sub> = Y<sub>t<sub>n</sub></sub>,  generateReferencePropertyIRI("r<sub>1</sub>", ["a<sub>s<sub>1</sub></sub>", ..., "a<sub>s<sub>n</sub></sub>"], P)
		</rule>
		
		<p>
For example, assume that table <em>People</em> in the <a href="#lead-ex">Direct Mapping Example</a> has columns <em>ID</em>, <em>fname</em> and <em>addr</em>, and that column <em>ID</em> is a candidate key (instead of a primary key), so that <em>People</em> does not have a primary key. Moreover, assume that table <em>Tweets</em> from Section <a href="#no-pk">Empty (non-existent) primary keys</a> has columns <em>tweeter</em>, <em>when</em> and <em>text</em>, it does not have a primary key, and it has a foreign in column <em>tweeter</em> that references candidate key <em>ID</em> in table <em>People</em>. In this case, the following is the direct mapping rule to generate <a href="#reference_triple_def">Reference Triples</a>:
		</p>
		<rule-example>
Triple(S, P, O) ← Tweets(X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>), card("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], U<sub>1</sub>), V<sub>1</sub> ≤ U<sub>1</sub>, generateRowBlankNode("Tweets", [X<sub>1</sub>, X<sub>2</sub>, X<sub>3</sub>], V<sub>1</sub>, S), 
                   People(Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>), card("People", [Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>], U<sub>2</sub>), V<sub>2</sub> ≤ U<sub>2</sub>, generateRowBlankNode("People", [Y<sub>1</sub>, Y<sub>2</sub>, Y<sub>3</sub>], V<sub>2</sub>, O), 
                   nonNull(X<sub>1</sub>), X<sub>1</sub> = Y<sub>1</sub>, generateReferencePropertyIRI("Tweets", ["tweeter"], P)
		</rule-example>
                        
                
	</div3>
	
	
	</div2>
    </div1>

    <div1 id="sec-cvsLog">
      <head>CVS History</head>
      <pre>
$Log: Overview.xml,v $
Revision 1.37  2011/11/15 17:08:34  eric
~ reflect http://www.w3.org/mid/20111030231138.GA31372@w3.org

Revision 1.36  2011/11/15 05:59:24  jsequeda
Addressed the following last minute comments:

http://www.w3.org/2001/sw/rdb2rdf/wiki/Last_Call#5_DM_and_R2RML:_comments_on_working_drafts

http://www.w3.org/2001/sw/rdb2rdf/wiki/Last_Call#9_DM:_.28Editorial.29_Last_Call_Comments_on_the_Direct_Mapping_document

http://www.w3.org/2001/sw/rdb2rdf/wiki/Last_Call#11_DM:_Small_typographical_mistake

Revision 1.35  2011/09/20 13:33:04  marenas
fix some typos

Revision 1.34  2011/09/20 03:02:19  eric
~ finished with literal map

Revision 1.33  2011/09/19 20:59:07  eric
...

Revision 1.32  2011/09/19 20:57:37  eric
...

Revision 1.31  2011/09/19 20:34:38  eric
- issue 64
+ captured http://www.w3.org/2001/sw/rdb2rdf/r2rml/#datatype-conversions

Revision 1.30  2011/09/16 04:46:57  eric
~ cleaned up directory

Revision 1.16  2011/09/14 18:42:17  jsequeda
Updated Rules section to reflect the resolutions of the past issues.

Revision 1.15  2011/09/13 17:17:02  eric
...

Revision 1.14  2011/09/13 17:10:13  eric
...

Revision 1.13  2011/09/13 17:03:48  eric
...

Revision 1.12  2011/09/13 15:57:14  eric
+ separators issue

Revision 1.11  2011/09/09 03:50:04  eric
~ migrate to ① attr¹-val¹.attrⁿ-valⁿ   ref-attr¹.attrⁿ

Revision 1.10  2011/09/06 17:16:32  eric
~ update to '.'s and '-'s

Revision 1.9  2011/08/30 16:55:04  eric
+ custom-url-encode

Revision 1.8  2011/08/30 16:05:23  eric
+ anchors for examples

Revision 1.7  2011/08/30 16:02:41  eric
~ use '.' instead of '-'

Revision 1.6  2011/08/13 13:53:35  eric
~ refined explicitFK semantics
+ document keypress switches

Revision 1.5  2011/08/13 08:01:31  eric
~ re-ordered
+ alg delta for explicitFK

Revision 1.4  2011/08/10 19:02:46  eric
~ validation

Revision 1.3  2011/08/10 18:58:29  eric
~ editorial changes addressed in a <a href="http://www.w3.org/mid/20110810185218.GD26038@w3.org">response to David McNeil &lt;dmcneil@revelytix.com&gt; comments of 2011-08-10 10:12-0500</a>

Revision 1.2  2011/08/10 12:16:14  eric
+ unary scalar triples
~ changed reference keys to include referenced table and columns
- property IRI
+ reference propety IRI
+ literal propety IRI
~ updated informative text to document construction of reference property IRIs

Revision 1.1  2011/08/10 11:09:44  eric
CREATED

Revision 1.10  2011/08/09 17:24:33  eric
...

Revision 1.9  2011/08/09 17:22:33  eric
...

Revision 1.8  2011/08/09 17:16:31  eric
...

Revision 1.7  2011/08/09 16:20:19  eric
- issues

Revision 1.6  2011/08/09 15:53:48  eric
~ merging in formal notation from ../directGraph/

Revision 1.5  2011/08/05 18:07:37  eric
~ fixing markup in the irc log

Revision 1.4  2011/08/05 14:26:41  eric
~ addressing <a href="http://www.w3.org/mid/38DFCC08-D903-498F-A952-9065EACBA7DA@cyganiak.de">cygri's comments</a>

Revision 1.3  2011/08/05 03:13:48  eric
~ roll in marenas's 1.29 Overview.xml updates

Revision 1.2  2011/08/03 19:27:23  eric
~ s/attribute/column/

Revision 1.1  2011/08/03 17:26:31  eric
+ EGP.html

Revision 1.24  2011/07/06 17:13:56  bertails
~ emphasize keywords: let in if then else

Revision 1.23  2011/07/06 15:03:55  bertails
+ noNulls statement from K-CAP paper

Revision 1.22  2011/07/06 13:45:27  bertails
~ WD is pubrules compliant + new editor

Revision 1.21  2011/03/23 20:53:12  bertails
~ cleaning before moving to TR space

Revision 1.20  2011/03/17 23:16:34  eric
- fragments on node IRIs

Revision 1.19  2011/03/08 04:14:06  bertails
~ fix some typos

Revision 1.18  2011/03/07 00:48:06  bertails
+ phi function mapping rows to RDF nodes

Revision 1.17  2011/03/07 00:13:06  bertails
+ RDB accessor functions

Revision 1.16  2011/03/06 21:56:29  bertails
~ migrating to cleaner denotational semantics

Revision 1.15  2011/03/02 17:26:34  marenas
Datalog rules in Section 4 were simplified

Revision 1.14  2011/03/01 02:35:49  marenas
Section 4 now includes all the Datalog rules that define the direct mapping

Revision 1.13  2011/02/01 16:15:17  marenas
Section 4 now includes an example for each type of Datalog rule used to define the direct mapping

Revision 1.12  2011/01/27 01:16:42  marenas
New version of Datalog rules to deal with repeated tuples in a table without a primary key

Revision 1.11  2010/11/17 21:36:44  eric
~ validated HTML, CSS, links for publication

Revision 1.10  2010/11/16 17:45:35  eric
~ xml well-formed

Revision 1.9  2010/11/16 17:43:47  eric
~ 2010-11-16T17:34:38Z &lt;ericP&gt; mhausenblas: s/very simple direct mapping/direct mapping/
~ re-title notation
~ addressed nunolopes's issue with rule 23
~ text from #rdb2rdf 2010-11-16T17:40:18Z &lt;juansequeda&gt;...

Revision 1.8  2010/11/16 17:30:18  eric
~ fixed Notation title

Revision 1.7  2010/11/16 17:25:52  eric
~ re-oranized algebra section

Revision 1.6  2010/11/16 17:22:39  eric
~ re-ordered authors

Revision 1.5  2010/11/11 18:39:27  marenas
rephrasing the definition of table tuples

Revision 1.4  2010/11/11 17:58:25  marenas
New Section 2.2: "Preliminaries: Generating IRIs"
Examples are now grouped in Section 2.4: "Additional Examples and Corner Cases"

Revision 1.3  2010/11/10 14:54:48  marenas
Removing "(Editor)" from the list of authors

Revision 1.2  2010/11/10 12:56:22  eric
+ <a href="#formalism-model">formalism-model issue</a>

Revision 1.1  2010/11/10 02:51:03  eric
moved from ../directMapping

Revision 1.56  2010/11/10 02:47:08  eric
~ well-formedness error

Revision 1.55  2010/11/10 02:45:37  eric
~ finished adopting the all-relative-IRI model in order to sync with the merged text from alt/
~ adopted "direct" mapping per the resolution of the 2010-11-09 telecon
~ made Juan and Marcello editors instead of authors
~ fixed a couple typos
: I believe this specification follows the intent of:
  RESOLUTION: http://www.w3.org/2001/sw/rdb2rdf/directMapping/ with Juan,
  Marcelo and Eric as editors based on Richard's proposal as of
  http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2010Nov/0052.html and
  try to work in J&amp;M's IRI and Triple generations part; move hierarchical
  table and the M-M mappings into Ed note; datalog as a separate section; Eric
  perform merge with review/approval/consensus of Juan, Marcelo, &amp; Eric

Revision 1.54  2010/11/09 22:46:56  eric
+ <a href="#hier-table-at-risk">hier-table-at-risk issue</a>

Revision 1.53  2010/11/09 22:41:02  eric
~ date

Revision 1.52  2010/11/09 22:39:12  eric
~ s/stem/base/g
+ inclusion of collapsible sections from alt/

Revision 1.51  2010/11/09 15:39:46  eric
~ removed collapsible sections per request mid:AANLkTikvnrgXuu5fDAw+c2nUv5ENkmngPAJJ05c2gASk@mail.gmail.com

Revision 1.50  2010/11/09 15:06:34  eric
+ exp sections

Revision 1.49  2010/11/09 14:12:08  eric
~ addressed <a href="http://www.w3.org/mid/03EDA176-4DFB-4251-B5F0-3CD73A7D1D52@cyganiak.de">cygri's comments of 2010-11-09T06:46:12Z</a>

Revision 1.48  2010/11/09 04:11:35  eric
~ addressed <a href="http://www.w3.org/mid/3AB73FFE-1FF7-429C-9AB6-1E38E4281273@cyganiak.de">cygri's comments of 2010-11-07T04:13Z</a>
+ inclusion of some explanatory details from <a href="/2001/sw/rdb2rdf/directGraph/alt">alt</a>

Revision 1.47  2010/11/04 12:42:21  eric
~ working on style for editorial choices

Revision 1.46  2010/11/04 06:10:08  eric
~ hilit triples in query in Use of Direct Mapping

Revision 1.45  2010/11/04 05:42:55  eric
~ incorporated <a href="http://www.w3.org/mid/88769680-C75B-4DF5-B613-78F4D56A6965@cyganiak.de">Richard Cyganiak's comments</a> targeted at <a href="/2001/sw/rdb2rdf/directGraph/alt">alt</a>

Revision 1.44  2010/11/02 08:18:07  eric
~ updates per DanC's feedback

Revision 1.43  2010/10/29 03:10:12  eric
~ s/relational terminology/SQL terminology/

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
+ Extending the Direct Mapping 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>
    </div1>
  </back>
</spec>
       
