You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4991 lines
275 KiB
4991 lines
275 KiB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml"
|
|
xmlns:xsd ="http://www.w3.org/2001/XMLSchema#"
|
|
xmlns:dcterms="http://purl.org/dc/terms/"
|
|
xmlns:foaf="http://xmlns.com/foaf/0.1/"
|
|
xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
|
|
xmlns:ov="http://open.vocab.org/terms/"
|
|
xmlns:owl="http://www.w3.org/2002/07/owl#"
|
|
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
|
|
xmlns:test="http://www.w3.org/2006/03/test-description#"
|
|
xmlns:doap="http://usefulinc.com/ns/doap#">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>
|
|
R2RML and Direct Mapping Test Cases
|
|
</title>
|
|
<link rel="stylesheet" type="text/css" href="tc.css"/>
|
|
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" />
|
|
</head>
|
|
<body>
|
|
<div class="head">
|
|
<p>
|
|
<a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72" /></a>
|
|
</p>
|
|
<h1>
|
|
<a id="title"></a>R2RML and Direct Mapping Test Cases
|
|
</h1>
|
|
<h2>
|
|
<a id="w3c-doctype"></a>W3C Editor's Draft 1 November 2011
|
|
</h2>
|
|
<dl>
|
|
<dt>
|
|
This version:
|
|
</dt>
|
|
<dd>
|
|
<a href="http://www.w3.org/2001/sw/rdb2rdf/test-cases/">http://www.w3.org/2001/sw/rdb2rdf/test-cases/</a>
|
|
</dd>
|
|
<dt>
|
|
Latest version:
|
|
</dt>
|
|
<dd>
|
|
<a href="http://www.w3.org/2001/sw/rdb2rdf/test-cases/">http://www.w3.org/2001/sw/rdb2rdf/test-cases/</a>
|
|
</dd>
|
|
<dt>
|
|
Editors:
|
|
</dt>
|
|
<dd>
|
|
Boris Villazón-Terrazas, Universidad Politécnica de Madrid <!-- <a href="mailto:"><bvillazon@fi.upm.es></a> -->
|
|
</dd>
|
|
<dd>
|
|
Michael Hausenblas, DERI, NUI Galway <!-- <a href="mailto:michael.hausenblas@deri.org"><michael.hausenblas@deri.org></a> -->
|
|
</dd>
|
|
</dl>
|
|
<p class="copyright">
|
|
<a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2010 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
|
|
</p>
|
|
</div>
|
|
<hr />
|
|
<div>
|
|
<h2>
|
|
<a id="abstract"></a>Abstract
|
|
</h2>
|
|
<p>
|
|
This document defines the R2RML and Direct Mapping Test Cases deliverable for the <a href="http://www.w3.org/2001/sw/rdb2rdf/">RDB2RDF Working Group</a> as defined in the Working Group's <a href="http://www.w3.org/2009/08/rdb2rdf-charter.html">Charter</a>.
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<h2>
|
|
<a id="status"></a>Status of this Document
|
|
</h2>
|
|
<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 an Editor's Draft for review by W3C members and other interested parties.
|
|
</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 Editor's 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>
|
|
The W3C <a href="http://www.w3.org/2001/sw/rdb2rdf/">RDB2RDF Working Group</a> is the W3C working group responsible for this document.
|
|
</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>
|
|
<p><em>Last Modified: $Date: 2011/11/01 02:06:06 $</em></p>
|
|
</div>
|
|
<div class="toc">
|
|
<h2>
|
|
<a id="contents"></a>Table of Contents
|
|
</h2>
|
|
<p class="toc">
|
|
1 <a href="#intro">Introduction</a><br />
|
|
2 <a href="#organization">Organization</a><br />
|
|
3 <a href="#terminology">Terminology</a><br />
|
|
4 <a href="#how-to-run-the-tests">How to run the tests</a><br />
|
|
5 <a href="#tc">Test Cases</a><br />
|
|
<ul>
|
|
<li><a href="#D000-1table0rows">D000-1table0rows</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0000">Direct Graph TC0000</a><br /> </li>
|
|
<li><a href="#R2RMLTC0000">R2RMLTC0000</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D001-1table1row">D001-1table1row</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0001">Direct Graph TC0001</a><br /> </li>
|
|
<li><a href="#R2RMLTC0001a">R2RMLTC0001a</a><br /></li>
|
|
<li><a href="#R2RMLTC0001b">R2RMLTC0001b</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D002-1table2columns1row">D002-1table2columns1row</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0002">Direct Graph TC0002</a><br /> </li>
|
|
<li><a href="#R2RMLTC0002a">R2RMLTC0002a</a><br /></li>
|
|
<li><a href="#R2RMLTC0002b">R2RMLTC0002b</a><br /></li>
|
|
<li><a href="#R2RMLTC0002c">R2RMLTC0002c</a><br /></li>
|
|
<li><a href="#R2RMLTC0002d">R2RMLTC0002d</a><br /></li>
|
|
<li><a href="#R2RMLTC0002e">R2RMLTC0002e</a><br /></li>
|
|
<li><a href="#R2RMLTC0002f">R2RMLTC0002f</a><br /></li>
|
|
<li><a href="#R2RMLTC0002g">R2RMLTC0002g</a><br /></li>
|
|
<li><a href="#R2RMLTC0002h">R2RMLTC0002h</a><br /></li>
|
|
<li><a href="#R2RMLTC0002i">R2RMLTC0002i</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D003-1table3columns1row">D003-1table3columns1row</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0003">Direct Graph TC0003</a><br /> </li>
|
|
<li><a href="#R2RMLTC0003a">R2RMLTC0003a</a><br /></li>
|
|
<li><a href="#R2RMLTC0003b">R2RMLTC0003b</a><br /></li>
|
|
<li><a href="#R2RMLTC0003c">R2RMLTC0003c</a><br /></li>
|
|
<li><a href="#R2RMLTC0003d">R2RMLTC0003d</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D004-1table2columnsprojection">D004-1table2columnsprojection</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0004">Direct Graph TC0004</a><br /> </li>
|
|
<li><a href="#R2RMLTC0004a">R2RMLTC0004a</a><br /></li>
|
|
<li><a href="#R2RMLTC0004b">R2RMLTC0004b</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D005-2duplicates0nulls">D005-2duplicates0nulls</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0005">Direct Graph TC0005</a><br /> </li>
|
|
<li><a href="#R2RMLTC0005a">R2RMLTC0005a</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D006-1table1primarykey1column1row">D006-1table1primarykey1column1row</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0006">Direct Graph TC0006</a><br /> </li>
|
|
<li><a href="#R2RMLTC0006a">R2RMLTC0006a</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D007-1table1primarykey2columns1row">D007-1table1primarykey2columns1row</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0007">Direct Graph TC0007</a><br /> </li>
|
|
<li><a href="#R2RMLTC0007a">R2RMLTC0007a</a><br /></li>
|
|
<li><a href="#R2RMLTC0007b">R2RMLTC0007b</a><br /></li>
|
|
<li><a href="#R2RMLTC0007c">R2RMLTC0007c</a><br /></li>
|
|
<li><a href="#R2RMLTC0007d">R2RMLTC0007d</a><br /></li>
|
|
<li><a href="#R2RMLTC0007e">R2RMLTC0007e</a><br /></li>
|
|
<li><a href="#R2RMLTC0007f">R2RMLTC0007f</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D008-1table1compositeprimarykey3columns1row">D008-1table1compositeprimarykey3columns1row</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0008">Direct Graph TC0008</a><br /> </li>
|
|
<li><a href="#R2RMLTC0008a">R2RMLTC0008a</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D009-2tables1primarykey1foreingkey">D009-2tables1primarykey1foreingkey</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0009">Direct Graph TC0009</a><br /> </li>
|
|
<li><a href="#R2RMLTC0009a">R2RMLTC0009a</a><br /></li>
|
|
<li><a href="#R2RMLTC0009b">R2RMLTC0009b</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D010-SpecialChars">D010-SpecialChars</a><br /></li>
|
|
<ul>
|
|
<li><a href="#R2RMLTC0010a">R2RMLTC0010a</a><br /></li>
|
|
<li><a href="#R2RMLTC0010b">R2RMLTC0010b</a><br /></li>
|
|
<li><a href="#R2RMLTC0010c">R2RMLTC0010c</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D011-M2MRelations">D011-M2MRelations</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0011">Direct Graph TC0011</a><br /> </li>
|
|
<li><a href="#R2RMLTC0011a">R2RMLTC0011a</a><br /></li>
|
|
<li><a href="#R2RMLTC0011b">R2RMLTC0011b</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D012-2tables2duplicates0nulls">D012-2tables2duplicates0nulls</a><br /></li>
|
|
<ul>
|
|
<li><a href="#R2RMLTC0012a">R2RMLTC0012a</a><br /></li>
|
|
<li><a href="#R2RMLTC0012b">R2RMLTC0012b</a><br /></li>
|
|
<li><a href="#R2RMLTC0012c">R2RMLTC0012c</a><br /></li>
|
|
<li><a href="#R2RMLTC0012d">R2RMLTC0012d</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D013-1table3columns2rows1nullvalue">D013-1table3columns2rows1nullvalue</a><br /></li>
|
|
<ul>
|
|
<li><a href="#Direct Graph TC0013">Direct Graph TC0013</a><br /> </li>
|
|
<li><a href="#R2RMLTC0013a">R2RMLTC0013a</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D014-3tablesExample">D014-3tablesExample</a><br /></li>
|
|
<ul>
|
|
<li><a href="#R2RMLTC0014a">R2RMLTC0014a</a><br /></li>
|
|
<li><a href="#R2RMLTC0014b">R2RMLTC0014b</a><br /></li>
|
|
<li><a href="#R2RMLTC0014c">R2RMLTC0014c</a><br /></li>
|
|
<li><a href="#R2RMLTC0014d">R2RMLTC0014d</a><br /></li>
|
|
<li><a href="#R2RMLTC0014e">R2RMLTC0014e</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D015-1tableSeveralLanguages">D015-1tableSeveralLanguages</a><br /></li>
|
|
<ul>
|
|
<li><a href="#R2RMLTC0015a">R2RMLTC0015a</a><br /></li>
|
|
<li><a href="#R2RMLTC0015b">R2RMLTC0015b</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><a href="#D016-1tableSQLdatatypes">D016-1tableSQLdatatypes</a><br /></li>
|
|
<ul>
|
|
<li><a href="#R2RMLTC0016a">R2RMLTC0016a</a><br /></li>
|
|
<li><a href="#R2RMLTC0016b">R2RMLTC0016b</a><br /></li>
|
|
<li><a href="#R2RMLTC0016c">R2RMLTC0016c</a><br /></li>
|
|
<li><a href="#R2RMLTC0016d">R2RMLTC0016d</a><br /></li>
|
|
<li><a href="#R2RMLTC0016e">R2RMLTC0016e</a><br /></li>
|
|
</ul>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
<hr />
|
|
<div class="body">
|
|
<div class="div1">
|
|
<h2>
|
|
<a id="intro"></a>1 Introduction
|
|
</h2>
|
|
<p>
|
|
This document defines the R2RML and Direct mapping test cases, consisting of a collection of test case documents (input and expected output) and the test case manifest document (describing each test case).
|
|
</p>
|
|
<p>
|
|
The purpose of the Test Cases is to verify and validate the specification of the <a href="http://www.w3.org/TR/2011/WD-r2rml-20110920/" target="_blank">R2RML language</a> and <a href="http://www.w3.org/TR/2011/WD-rdb-direct-mapping-20110920/" target="_blank">Direct mapping</a>. Moreover, these test cases can be useful to create a test harness or automated test framework for testing the interoperable implementors, i.e. R2RML engines.
|
|
</p>
|
|
<p>
|
|
The R2RML Test Case coverage matrix is available <a href="http://www.w3.org/2001/sw/rdb2rdf/wiki/R2RML_TC">here</a> .
|
|
</p>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a id="organization"></a>2 Organization
|
|
</h2>
|
|
<p>
|
|
Test cases are organized by database. We use a descriptive naming convention for the databases. For each database we have:
|
|
</p>
|
|
<ul>
|
|
<li> Graphical representation of the tables involved.
|
|
<li> The SQL script associated to the database (sql file).
|
|
<li> Direct mappping associated to the database and it includes:
|
|
<ul>
|
|
<li> Title
|
|
<li> Purpose
|
|
<li> Specification Reference
|
|
<li> Review Status
|
|
<li> Associated file (nt)
|
|
</ul>
|
|
<li> One or more R2RML Test Cases associated to the database. A R2RML test case includes:
|
|
<ul>
|
|
<li> Title
|
|
<li> Purpose
|
|
<li> Specification Reference
|
|
<li> Review Status
|
|
<li> Associated file (nq)
|
|
</ul>
|
|
</ul>
|
|
<p>
|
|
The associated files (sql, nt, and nq) are available at the <a href="https://dvcs.w3.org/hg/rdb2rdf-tests/" target="_blank">W3C repository</a>.
|
|
</p>
|
|
<p>
|
|
The following picture illustrates the organization.
|
|
</p>
|
|
<img src="img/tcsmall.png" border="0">
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a id="terminology"></a>3 Terminology
|
|
</h2>
|
|
<dl>
|
|
<dt>
|
|
R2RML engine
|
|
</dt>
|
|
<dd>
|
|
A software that takes a relational database (RDB) and a R2RML mapping document as input and produces an RDF graph according to the mapping document.
|
|
</dd>
|
|
<dt>
|
|
Test case manifest document
|
|
</dt>
|
|
<dd>
|
|
An RDF document that describe the test cases, relating input with expected output as well as containing additional metadata (such as description) about each test case. Typically used in a harness to automatically test an implementation regarding its conformance.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a id="how-to-run-the-tests"></a> 4 How to run the tests
|
|
</h2>
|
|
<p>
|
|
@@@ This section shall contain some hints on how to actually run the test suite, upload the results for generating implementation reports for implementers.
|
|
</p>
|
|
<img src="img/process.png" border="0">
|
|
<p>
|
|
Moreover, the section describes the inputs/outputs of the testing ...
|
|
</p>
|
|
</div>
|
|
|
|
<div class="div1">
|
|
<h2>
|
|
<a id="tc"></a>5 Test Cases
|
|
</h2>
|
|
<p>
|
|
Each test case is described using the <a href="http://www.w3.org/2006/03/test-description" target="_blank">Test Metadata</a> vocabulary in RDFa.
|
|
The table owner for the all the databases is boricles.
|
|
</p>
|
|
|
|
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D000-1table0rows" typeof="rdb2rdftest:DataBase">
|
|
<a id="D000-1table0rows"></a><h3>D000-1table0rows</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Empty table</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>Name<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"Name" varchar(50)
|
|
);
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D000-1table0rows/create.sql" target="_blank">D000-1table0rows</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0000" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0000"></a><h3 property="dcterms:identifier">Direct Graph TC0000</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Empty table</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests if an empty table produces an empty RDF graph</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D000-1table0rows/create.sql">D000-1table0rows</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D000-1table0rows/directGraph.nt">Direct Graph TC0000</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0000" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0000"></a><h3 property="dcterms:identifier">R2RMLTC0000</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Empty table</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests if an empty table produces an empty RDF graph</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#physical-tables">#physical-tables</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D000-1table0rows/create.sql">D000-1table0rows</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D000-1table0rows/mapped.nq">mapped.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D000-1table0rows/r2rml.ttl">R2RMLTC0000</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student"; ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Name}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D001-1table1row" typeof="rdb2rdftest:DataBase">
|
|
<a id="D001-1table1row"></a><h3>D001-1table1row</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, one row</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>STUDENT</b></caption> <tbody><tr><th>NAME<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>Venus</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE Student (
|
|
Name varchar(50)
|
|
);
|
|
INSERT INTO Student (Name) VALUES ('Venus');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/create.sql" target="_blank">D001-1table1row</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0001" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0001"></a><h3 property="dcterms:identifier">Direct Graph TC0001</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, one row</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) one column mapping, no primary key; (2) generation of a "BlankNode" subject; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/create.sql">D001-1table1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/directGraph.nt">Direct Graph TC0001</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code>_:a</code></td><td><code><Student#Name></code></td><td><code>"Venus"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0001a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0001a"></a><h3 property="dcterms:identifier">R2RMLTC0001a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) one column mapping, no primary key; (2) subject URI generation by using one single column; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-template-valued-term-map">#dfn-template-valued-term-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/create.sql">D001-1table1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Venus></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/r2rmla.ttl">R2RMLTC0001a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Name}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0001b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0001b"></a><h3 property="dcterms:identifier">R2RMLTC0001b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) one column mapping, no primary key; (2) generation of a "BlankNode" subject; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#termtype">#termtype</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/create.sql">D001-1table1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fff</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D001-1table1row/r2rmlb.ttl">R2RMLTC0001b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:column "Name"; rr:termType rr:BlankNode ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D002-1table2columns1row" typeof="rdb2rdftest:DataBase">
|
|
<a id="D002-1table2columns1row"></a><h3>D002-1table2columns1row</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, two columns, one row</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>Name<br><small>VARCHAR(50)</small></th>
|
|
<th>ID<br><small>INTEGER</small></th>
|
|
</tr>
|
|
<tr><td><code>Venus</code></td><td><code>10</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"ID" integer,
|
|
"Name" varchar(50)
|
|
);
|
|
INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql" target="_blank">D002-1table2columns1row</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0002" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0002"></a><h3 property="dcterms:identifier">Direct Graph TC0002</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two columns mapping, no primary key; (2) generation of a "BlankNode" subject; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/directGraph.nt">Direct Graph TC0002</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code>_:a</code></td><td><code><Student#id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td></tr><tr><td><code>_:a</code></td><td><code><Student#name></code></td><td><code>"Venus"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002a"></a><h3 property="dcterms:identifier">R2RMLTC0002a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key; (2) subject URI generated by concatenation of two column values; (3) one column to one property; (4) presence of unqualified name for a rr:tableName</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#from-template">#from-template</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmla.ttl">R2RMLTC0002a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{ID}{Name}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002b"></a><h3 property="dcterms:identifier">R2RMLTC0002b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key; (2) generation of a "BlankNode" subject; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-r2rml-view">#dfn-r2rml-view</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ffd</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ffd</code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ffd</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmlb.ttl">R2RMLTC0002b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
Select ('Student' || "ID" ) AS StudentId
|
|
, "ID"
|
|
, "Name"
|
|
from Student
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002c"></a><h3 property="dcterms:identifier">R2RMLTC0002c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of an invalid SQL identifier</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-sql-identifier">#dfn-sql-identifier</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmlc.ttl">R2RMLTC0002c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{ID}{Name}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "IDs"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002d" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002d"></a><h3 property="dcterms:identifier">R2RMLTC0002d</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence delimited identifiers</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-sql-identifier">#dfn-sql-identifier</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/mappedd.nq">mappedd.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:Student10</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code>_:Student10</code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code>_:Student10</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmld.ttl">R2RMLTC0002d</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
Select ('Student' || "ID" ) AS StudentId
|
|
, "ID"
|
|
, "Name"
|
|
from "SA.Student"
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002e" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002e"></a><h3 property="dcterms:identifier">R2RMLTC0002e</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of an invalid rr:tableName</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-sql-identifier">#dfn-sql-identifier</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmle.ttl">R2RMLTC0002e</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Students" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{ID}{Name}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002f" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002f"></a><h3 property="dcterms:identifier">R2RMLTC0002f</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of schema-qualified name for a rr:tableName</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#from-template">#from-template</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/mappedf.nq">mappedf.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmlf.ttl">R2RMLTC0002f</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "SA.Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{ID}{Name}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002g" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002g"></a><h3 property="dcterms:identifier">R2RMLTC0002g</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of an invalid SQL query</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-sql-identifier">#dfn-sql-identifier</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmlg.ttl">R2RMLTC0002g</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
Select ('Student' || "ID" ) AS StudentId
|
|
, "ID"
|
|
, "Name"
|
|
"SA.Student"
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002h" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002h"></a><h3 property="dcterms:identifier">R2RMLTC0002h</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of duplicate column names in the SELECT list of the SQL query</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-sql-identifier">#dfn-sql-identifier</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmlh.ttl">R2RMLTC0002h</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
Select ('Student' || ID ) AS StudentId
|
|
, "ID"
|
|
, "Name"
|
|
, "ID"
|
|
from "SA.Student"
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0002i" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0002i"></a><h3 property="dcterms:identifier">R2RMLTC0002i</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of a SQL Version identifier </span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#r2rml-views">#r2rml-views</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/create.sql">D002-1table2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/mappedi.nq">mappedi.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ffd</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ffd</code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ffd</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D002-1table2columns1row/r2rmli.ttl">R2RMLTC0002i</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
Select ('Student' || ID ) AS StudentId
|
|
, ID
|
|
, Name
|
|
from SA.Student
|
|
""";
|
|
|
|
rr:sqlVersion rr:SQL2008
|
|
|
|
];
|
|
|
|
|
|
|
|
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D003-1table3columns1row" typeof="rdb2rdftest:DataBase">
|
|
<a id="D003-1table3columns1row"></a><h3>D003-1table3columns1row</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, two columns, one row</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>ID<br><small>INTEGER</small></th>
|
|
<th>FirstName<br><small>VARCHAR(50)</small></th>
|
|
<th>LastName<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>10</code></td><td><code>Venus</code></td><td><code>Williams</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"ID" integer,
|
|
"FirstName" varchar(50),
|
|
"LastName" varchar(50)
|
|
);
|
|
INSERT INTO "Student" ("ID", "FirstName", "LastName") VALUES (10,'Venus', 'Williams');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/create.sql" target="_blank">D003-1table3columns1row</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0003" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0003"></a><h3 property="dcterms:identifier">Direct Graph TC0003</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two columns mapping, no primary key; (2) generation of a "BlankNode" subject; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/create.sql">D003-1table3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/directGraph.nt">Direct Graph TC0003</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code>_:a</code></td><td><code><Student#ID></code></td><td><code>"10"</code></td></tr><tr><td><code>_:a</code></td><td><code><Student#FirstName></code></td><td><code>"Venus"</code></td></tr><tr><td><code>_:a</code></td><td><code><Student#LastName></code></td><td><code>"Williams"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0003a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0003a"></a><h3 property="dcterms:identifier">R2RMLTC0003a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key; (2) subject URI generated by concatenation of two column values; (3) one column to one property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#from-column">#from-column</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/create.sql">D003-1table3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Williams"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/r2rmla.ttl">R2RMLTC0003a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "SA.Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{FirstName}{LastName}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName ];
|
|
rr:objectMap [ rr:column "FirstName" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:lastName ];
|
|
rr:objectMap [ rr:column "LastName" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0003b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0003b"></a><h3 property="dcterms:identifier">R2RMLTC0003b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key; (2) one column to one property and (3) from template feature</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#from-template">#from-template</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/create.sql">D003-1table3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus Williams"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/r2rmlb.ttl">R2RMLTC0003b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
SELECT "ID",
|
|
("FirstName" || ' ' || "LastName") AS Name,
|
|
"FirstName",
|
|
"LastName"
|
|
FROM "Student"
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{FirstName}{LastName}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0003c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0003c"></a><h3 property="dcterms:identifier">R2RMLTC0003c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests rr:termType rr:BlankNode and rr:Literal</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#termtype">#termtype</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/create.sql">D003-1table3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/mappedc.nq">mappedc.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:Student10VenusWilliams</code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Williams"</code></td><td><code> </code></td></tr><tr><td><code>_:Student10VenusWilliams</code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code>_:Student10VenusWilliams</code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/r2rmlc.ttl">R2RMLTC0003c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
SELECT ('Student' || "ID" || "FirstName" || "LastName") as StudentID,
|
|
"ID",
|
|
"FirstName",
|
|
"LastName"
|
|
FROM "Student"
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:column "StudentID"; rr:termType rr:BlankNode; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName ];
|
|
rr:objectMap [ rr:column "FirstName";
|
|
rr:termType rr:Literal ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:lastName ];
|
|
rr:objectMap [ rr:column "LastName";
|
|
rr:termType rr:Literal ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0003d" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0003d"></a><h3 property="dcterms:identifier">R2RMLTC0003d</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two columns mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests rr:termType rr:IRI</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#from-template">#from-template</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/create.sql">D003-1table3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/mappedd.nq">mappedd.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code><http://example.com/data/Venus></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://example.com//lastName></code></td><td><code><http://example.com/data/Williams></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10VenusWilliams></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D003-1table3columns1row/r2rmld.ttl">R2RMLTC0003d</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [
|
|
rr:sqlQuery """
|
|
SELECT ('Student' || "ID" || "FirstName" || "LastName") as StudentID,
|
|
"ID",
|
|
"FirstName",
|
|
"LastName"
|
|
FROM "Student"
|
|
"""
|
|
];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{StudentID}"; rr:termType rr:IRI; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:firstName ];
|
|
rr:objectMap [ rr:template "http://example.com/data/{FirstName}";
|
|
rr:termType rr:IRI ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:lastName ];
|
|
rr:objectMap [ rr:template "http://example.com/data/{LastName}";
|
|
rr:termType rr:IRI ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D004-1table2columnsprojection" typeof="rdb2rdftest:DataBase">
|
|
<a id="D004-1table2columnsprojection"></a><h3>D004-1table2columnsprojection</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, two columns, projection</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student_Sport</b></caption> <tbody><tr><th>Student<br><small>VARCHAR(50)</small></th>
|
|
<th>Sport<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>Venus</code></td><td><code>Tennis</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student_Sport"(
|
|
"Student" varchar(50),
|
|
"Sport" varchar(50)
|
|
);
|
|
INSERT INTO "Student_Sport" ("Student","Sport") VALUES ('Venus', 'Tennis');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/create.sql" target="_blank">D004-1table2columnsprojection</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0004" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0004"></a><h3 property="dcterms:identifier">Direct Graph TC0004</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Three column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key, (2) generation of a "BlankNode" subject; (3) one row table to two different resources</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/create.sql">D004-1table2columnsprojection</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/directGraph.nt">Direct Graph TC0004</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code>_:a</code></td><td><code><Student_Sport#Student></code></td><td><code>"Venus"</code></td></tr><tr><td><code>_:a</code></td><td><code><Student_Sport#Sport></code></td><td><code>"Tennis"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0004a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0004a"></a><h3 property="dcterms:identifier">R2RMLTC0004a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Projection</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key, (2) subject URI generated by a column value; (3) one row table to two different resources</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#typing">#typing</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/create.sql">D004-1table2columnsprojection</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Venus></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Tennis></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Tennis"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Tennis></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Sport></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/r2rmla.ttl">R2RMLTC0004a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student_Sport" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Student}";
|
|
rr:class ex:Student ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Student" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student_Sport" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Sport}";
|
|
rr:class ex:Sport ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Sport" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0004b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0004b"></a><h3 property="dcterms:identifier">R2RMLTC0004b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Projection</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests: (1) two column mapping, no primary key, (2) generation of a "BlankNode" subject; (3) one row table to two different resources</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#r2rml-views">#r2rml-views</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/create.sql">D004-1table2columnsprojection</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff6</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Tennis"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff6</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Sport></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff7</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff7</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D004-1table2columnsprojection/r2rmlb.ttl">R2RMLTC0004b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('Student' || Student) AS StudentId,
|
|
Student
|
|
from Student_Sport
|
|
""";
|
|
] ;
|
|
|
|
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode;
|
|
rr:class ex:Student ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Student" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('Sport' || Sport) AS SportId,
|
|
Sport
|
|
from Student_Sport
|
|
""";
|
|
];
|
|
|
|
rr:subjectMap [ rr:column "SportId"; rr:termType rr:BlankNode;
|
|
rr:class ex:Sport ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Sport" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D005-2duplicates0nulls" typeof="rdb2rdftest:DataBase">
|
|
<a id="D005-2duplicates0nulls"></a><h3>D005-2duplicates0nulls</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Duplicate tuples, no primary key</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>IOUs</b></caption> <tbody><tr><th>amount<br><small>DOUBLE</small></th>
|
|
<th>lname<br><small>CHARACTER(20)</small></th>
|
|
<th>fname<br><small>CHARACTER(20)</small></th>
|
|
</tr>
|
|
<tr><td><code>30.0E0</code></td><td><code>Smith </code></td><td><code>Bob </code></td></tr>
|
|
<tr><td><code>20.0E0</code></td><td><code>Jones </code></td><td><code>Sue </code></td></tr>
|
|
<tr><td><code>30.0E0</code></td><td><code>Smith </code></td><td><code>Bob </code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "IOUs" (
|
|
"fname" CHAR(20),
|
|
"lname" CHAR(20),
|
|
"amount" FLOAT);
|
|
INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30);
|
|
INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Sue', 'Jones', 20);
|
|
INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30);
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D005-2duplicates0nulls/create.sql" target="_blank">D005-2duplicates0nulls</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0005" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0005"></a><h3 property="dcterms:identifier">Direct Graph TC0005</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Duplicate tuples, no primary key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the generation of Blank Nodes for duplicate tuples</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D005-2duplicates0nulls/create.sql">D005-2duplicates0nulls</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D005-2duplicates0nulls/directGraph.nt">Direct Graph TC0005</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code>_:a</code></td><td><code><IOUs#fname></code></td><td><code>"Bob"</code></td></tr><tr><td><code>_:a</code></td><td><code><IOUs#lname></code></td><td><code>"Smith"</code></td></tr><tr><td><code>_:a</code></td><td><code><IOUs#amount></code></td><td><code>"30.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td></tr><tr><td><code>_:b</code></td><td><code><IOUs#fname></code></td><td><code>"Sue"</code></td></tr><tr><td><code>_:b</code></td><td><code><IOUs#lname></code></td><td><code>"Jones"</code></td></tr><tr><td><code>_:b</code></td><td><code><IOUs#amount></code></td><td><code>"20.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td></tr><tr><td><code>_:c</code></td><td><code><IOUs#fname></code></td><td><code>"Bob"</code></td></tr><tr><td><code>_:c</code></td><td><code><IOUs#lname></code></td><td><code>"Smith"</code></td></tr><tr><td><code>_:c</code></td><td><code><IOUs#amount></code></td><td><code>"30.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0005a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0005a"></a><h3 property="dcterms:identifier">R2RMLTC0005a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Duplicate tuples, no primary key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the generation of duplicate triples and the typing of resources</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#typing">#typing</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D005-2duplicates0nulls/create.sql">D005-2duplicates0nulls</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D005-2duplicates0nulls/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Bob-Smith></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Bob-Smith></code></td><td><code><http://example.com/owes></code></td><td><code>"30.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Sue-Jones></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Sue-Jones></code></td><td><code><http://example.com/owes></code></td><td><code>"20.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Bob-Smith></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Bob-Smith></code></td><td><code><http://example.com/owes></code></td><td><code>"30.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D005-2duplicates0nulls/r2rmla.ttl">R2RMLTC0005a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "IOUs" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{fname}-{lname}";
|
|
rr:class foaf:Person ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:owes ];
|
|
rr:objectMap [ rr:column "amount"; rr:datatype xsd:float ]
|
|
];
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D006-1table1primarykey1column1row" typeof="rdb2rdftest:DataBase">
|
|
<a id="D006-1table1primarykey1column1row"></a><h3>D006-1table1primarykey1column1row</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, one column, one primary key</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>Name (PK)<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>Venus</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"Name" varchar(50) PRIMARY KEY
|
|
);
|
|
INSERT INTO "Student" ("Name") VALUES ('Venus');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D006-1table1primarykey1column1row/create.sql" target="_blank">D006-1table1primarykey1column1row</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0006" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0006"></a><h3 property="dcterms:identifier">Direct Graph TC0006</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, one column, one primary key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a table with a column that is a primary key</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D006-1table1primarykey1column1row/create.sql">D006-1table1primarykey1column1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D006-1table1primarykey1column1row/directGraph.nt">Direct Graph TC0006</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code><Student/Name.Venus#_></code></td><td><code><Student#Name></code></td><td><code>"Venus"</code></td></tr><tr><td><code><Student/Name.Venus#_></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><Student></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0006a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0006a"></a><h3 property="dcterms:identifier">R2RMLTC0006a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping, one primary key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests one column mapping with one primary key and rr:template</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-template-valued-term-map">#dfn-template-valued-term-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D006-1table1primarykey1column1row/create.sql">D006-1table1primarykey1column1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D006-1table1primarykey1column1row/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Venus></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D006-1table1primarykey1column1row/r2rmla.ttl">R2RMLTC0006a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Name}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D007-1table1primarykey2columns1row" typeof="rdb2rdftest:DataBase">
|
|
<a id="D007-1table1primarykey2columns1row"></a><h3>D007-1table1primarykey2columns1row</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One table, one column, one primary key</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>Name<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>10</code></td><td><code>Venus</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"ID" integer,
|
|
"Name" varchar(50),
|
|
PRIMARY KEY ("ID")
|
|
);
|
|
INSERT INTO "Student" ("ID", "Name") VALUES(10,'Venus');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql" target="_blank">D007-1table1primarykey2columns1row</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0007" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0007"></a><h3 property="dcterms:identifier">Direct Graph TC0007</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">A table with a primary key and 2 columns</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a table with a primary key and 2 columns</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/directGraph.nt">Direct Graph TC0007</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#ID></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#Name></code></td><td><code>"Venus"</code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><Student></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0007a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0007a"></a><h3 property="dcterms:identifier">R2RMLTC0007a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests constant-value term map by using rr:constant property</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#constant">#constant</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code><http://example.com/PersonGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/r2rmla.ttl">R2RMLTC0007a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{Name}";
|
|
rr:graphMap [ rr:constant ex:PersonGraph; ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type; ];
|
|
rr:objectMap [ rr:constant foaf:Person; ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0007b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0007b"></a><h3 property="dcterms:identifier">R2RMLTC0007b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests constant-value term map by using constant shortcut properties rr:predicate, rr:object and rr:graph. Also directly using rr:tableName</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#constant">#constant</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code><http://example.com/PersonGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/r2rmlb.ttl">R2RMLTC0007b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:tableName "Student";
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{Name}";
|
|
rr:graph ex:PersonGraph;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:id;
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate foaf:firstName;
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0007c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0007c"></a><h3 property="dcterms:identifier">R2RMLTC0007c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests subjectmap with more than one class IRIs, rr:class</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#typing">#typing</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/mappedc.nq">mappedc.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/r2rmlc.ttl">R2RMLTC0007c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "http://example.com/Student{ID}{Name}";
|
|
rr:class foaf:Person,ex:Student;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0007d" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0007d"></a><h3 property="dcterms:identifier">R2RMLTC0007d</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose"> Tests subjectmap with an alternative of having rr:class, i.e., by specifying an rr:predicateObjectMap with predicate rdf:type</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#typing">#typing</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/mappedd.nq">mappedd.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/r2rmld.ttl">R2RMLTC0007d</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "http://example.com/Student{ID}{Name}";
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object ex:Student;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0007e" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0007e"></a><h3 property="dcterms:identifier">R2RMLTC0007e</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests subjectmap with rr:graphMap and rr:class</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#named-graphs">#named-graphs</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/mappede.nq">mappede.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<ttp://www.w3.org/2001/XMLSchema#integer <http://example.com/PersonGraph></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code><http://example.com/PersonGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/r2rmle.ttl">R2RMLTC0007e</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{Name}";
|
|
rr:graphMap [ rr:constant ex:PersonGraph];
|
|
rr:class foaf:Person
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0007f" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0007f"></a><h3 property="dcterms:identifier">R2RMLTC0007f</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">One column mapping</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests subjectmap with rr:graphMap and specifying an rr:predicateObjectMap with predicate rdf:type</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#named-graphs">#named-graphs</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/create.sql">D007-1table1primarykey2columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/mappedf.nq">mappedf.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code><http://example.com/PersonGraph></code></td></tr><tr><td><code><http://example.com/Student10Venus></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<ttp://www.w3.org/2001/XMLSchema#integer <http://example.com/PersonGraph></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D007-1table1primarykey2columns1row/r2rmlf.ttl">R2RMLTC0007f</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{Name}";
|
|
rr:graphMap [ rr:constant ex:PersonGraph];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type; ];
|
|
rr:objectMap [ rr:constant foaf:Person; ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D008-1table1compositeprimarykey3columns1row" typeof="rdb2rdftest:DataBase">
|
|
<a id="D008-1table1compositeprimarykey3columns1row"></a><h3>D008-1table1compositeprimarykey3columns1row</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Composite primary key</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>Name (PK)<br><small>VARCHAR(50)</small></th>
|
|
<th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>Sport<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>Venus Williams</code></td><td><code>10</code></td><td><code>Tennis</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"ID" integer,
|
|
"Name" varchar(50),
|
|
"Sport" varchar (50),
|
|
PRIMARY KEY ("ID","Name")
|
|
);
|
|
INSERT INTO "Student" ("ID", "Name","Sport") VALUES(10,'Venus Williams','Tennis');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D008-1table1compositeprimarykey3columns1row/create.sql" target="_blank">D008-1table1compositeprimarykey3columns1row</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0008" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0008"></a><h3 property="dcterms:identifier">Direct Graph TC0008</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Composite primary key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a table with a composite primary key</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D008-1table1compositeprimarykey3columns1row/create.sql">D008-1table1compositeprimarykey3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D008-1table1compositeprimarykey3columns1row/directGraph.nt">Direct Graph TC0008</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code><Student/ID.10_Name.Venus+Williams#_></code></td><td><code><Student#ID></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td></tr><tr><td><code><Student/ID.10_Name.Venus+Williams#_></code></td><td><code><Student#Name></code></td><td><code>"Venus Williams"</code></td></tr><tr><td><code><Student/ID.10_Name.Venus+Williams#_></code></td><td><code><Student#Sport></code></td><td><code>"Tennis"</code></td></tr><tr><td><code><Student/ID.10_Name.Venus+Williams#_></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><Student></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0008a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0008a"></a><h3 property="dcterms:identifier">R2RMLTC0008a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Test that results of the mapping can be directed to a target graph.</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#named-graphs">#named-graphs</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D008-1table1compositeprimarykey3columns1row/create.sql">D008-1table1compositeprimarykey3columns1row</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D008-1table1compositeprimarykey3columns1row/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Student10Venus%20Williams></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code><http://example.com/graph/Student10Venus%20Williams></code></td></tr><tr><td><code><http://example.com/Student10Venus%20Williams></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus Williams"</code></td><td><code><http://example.com/graph/Student10Venus%20Williams></code></td></tr><tr><td><code><http://example.com/Student10Venus%20Williams></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code><http://example.com/graph/Student10Venus%20Williams></code></td></tr><tr><td><code><http://example.com/Student10Venus%20Williams></code></td><td><code><http://example.com/Sport></code></td><td><code>"Tennis"</code></td><td><code><http://example.com/graph/Student10Venus%20Williams></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D008-1table1compositeprimarykey3columns1row/r2rmla.ttl">R2RMLTC0008a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Student{ID}{Name}";
|
|
rr:graphMap [ rr:template "http://example.com/graph/Student{ID}{Name}"; ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type; ];
|
|
rr:objectMap [ rr:constant foaf:Person; ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:Sport; ];
|
|
rr:objectMap [ rr:column "Sport" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D009-2tables1primarykey1foreingkey" typeof="rdb2rdftest:DataBase">
|
|
<a id="D009-2tables1primarykey1foreingkey"></a><h3>D009-2tables1primarykey1foreingkey</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two tables 1 primary key 1 foreing key</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>Sport (FK)<br><small>INTEGER</small></th>
|
|
<th>Name<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>10</code></td><td><code>100</code></td><td><code>Venus Williams</code></td></tr>
|
|
<tr><td><code>20</code></td><td><code>NULL</code></td><td><code>Demi Moore</code></td></tr>
|
|
</tbody></table><table class="ex-data"> <caption><b>Sport</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>Name<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>100</code></td><td><code>Tennis</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Sport" (
|
|
"ID" integer,
|
|
"Name" varchar (50),
|
|
PRIMARY KEY ("ID")
|
|
);
|
|
|
|
CREATE TABLE "Student" (
|
|
"ID" integer,
|
|
"Name" varchar(50),
|
|
"Sport" integer,
|
|
PRIMARY KEY ("ID"),
|
|
FOREIGN KEY("Sport") REFERENCES "Sport"("ID")
|
|
);
|
|
|
|
INSERT INTO "Sport" ("ID", "Name") VALUES (100,'Tennis');
|
|
INSERT INTO "Student" ("ID", "Name", "Sport") VALUES (10,'Venus Williams', 100);
|
|
INSERT INTO "Student" ("ID", "Name", "Sport") VALUES (20,'Demi Moore', NULL);
|
|
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/create.sql" target="_blank">D009-2tables1primarykey1foreingkey</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0009" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0009"></a><h3 property="dcterms:identifier">Direct Graph TC0009</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two tables 1 primary key 1 foreing key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests two tables with a primary key and a foreing key</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/create.sql">D009-2tables1primarykey1foreingkey</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/directGraph.nt">Direct Graph TC0009</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code><Student/ID.20#_></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><Student></code></td></tr><tr><td><code><Student/ID.20#_></code></td><td><code><Student#ID></code></td><td><code>"20"^^<http://www.w3.org/2001/XMLSchema#integer></code></td></tr><tr><td><code><Student/ID.20#_></code></td><td><code><Student#Name></code></td><td><code>"Demi Moore"</code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><Student></code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#ID></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#Name></code></td><td><code>"Venus Williams"</code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#Sport></code></td><td><code><Sport/ID.100#_></code></td></tr><tr><td><code><Sport/ID.100#_></code></td><td><code><Sport#ID></code></td><td><code>"100"^^<http://www.w3.org/2001/XMLSchema#integer></code></td></tr><tr><td><code><Sport/ID.100#_></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><Sport></code></td></tr><tr><td><code><Sport/ID.100#_></code></td><td><code><Sport#Name></code></td><td><code>"Tennis"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0009a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0009a"></a><h3 property="dcterms:identifier">R2RMLTC0009a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two tables to 1 primary key 1 foreing key</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Test foreign key relationships among logical tables</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#foreign-key">#foreign-key</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/create.sql">D009-2tables1primarykey1foreingkey</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/resource/student_10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ontology/Student></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/resource/student_10></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus Williams"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/resource/student_20></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ontology/Student></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/resource/student_20></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Demi Moore"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/resource/sport_100></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ontology/Sport></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/resource/sport_100></code></td><td><code><http://www.w3.org/2000/01/rdf-schema#label></code></td><td><code>"Tennis"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/resource/student_10></code></td><td><code><http://example.com/ontology/practises></code></td><td><code><http://example.com/resource/sport_100></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/r2rmla.ttl">R2RMLTC0009a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap
|
|
[
|
|
rr:template "http://example.com/resource/student_{ID}";
|
|
rr:termType rr:IRI;
|
|
rr:class <http://example.com/ontology/Student>;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [
|
|
rr:column "Name";
|
|
rr:termType rr:Literal;
|
|
];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant <http://example.com/ontology/practises> ];
|
|
rr:refObjectMap [
|
|
rr:parentTriplesMap <TriplesMap2>;
|
|
rr:joinCondition [
|
|
rr:child "Sport" ;
|
|
rr:parent "ID" ;
|
|
]
|
|
];
|
|
];
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Sport" ];
|
|
|
|
rr:subjectMap
|
|
[
|
|
rr:template "http://example.com/resource/sport_{ID}";
|
|
rr:termType rr:IRI;
|
|
rr:class <http://example.com/ontology/Sport>;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdfs:label ];
|
|
rr:objectMap [
|
|
rr:column "Name";
|
|
rr:termType rr:Literal;
|
|
];
|
|
];
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0009b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0009b"></a><h3 property="dcterms:identifier">R2RMLTC0009b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two tables to multiple graphs</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Test that results from distinct parts of the mapping can be directed to different target graphs.</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#named-graphs">#named-graphs</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/create.sql">D009-2tables1primarykey1foreingkey</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/resource/student_10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ontology/Student></code></td><td><code><http://example.org/graph/students></code></td></tr><tr><td><code><http://example.com/resource/student_10></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Venus Williams"</code></td><td><code><http://example.org/graph/students></code></td></tr><tr><td><code><http://example.com/resource/student_20></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ontology/Student></code></td><td><code><http://example.org/graph/students></code></td></tr><tr><td><code><http://example.com/resource/student_20></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Demi Moore"</code></td><td><code><http://example.org/graph/students></code></td></tr><tr><td><code><http://example.com/resource/sport_100></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ontology/Sport></code></td><td><code><http://example.org/graph/sports></code></td></tr><tr><td><code><http://example.com/resource/sport_100></code></td><td><code><http://www.w3.org/2000/01/rdf-schema#label></code></td><td><code>"Tennis"</code></td><td><code><http://example.org/graph/sports></code></td></tr><tr><td><code><http://example.com/resource/student_10></code></td><td><code><http://example.com/ontology/practises></code></td><td><code><http://example.com/resource/sport_100></code></td><td><code><http://example.org/graph/practise></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D009-2tables1primarykey1foreingkey/r2rmlb.ttl">R2RMLTC0009b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Student" ];
|
|
|
|
rr:subjectMap
|
|
[
|
|
rr:template "http://example.com/resource/student_{ID}";
|
|
rr:termType rr:IRI;
|
|
rr:class <http://example.com/ontology/Student>;
|
|
rr:graphMap [ rr:graph <http://example.com/graph/students> ] ;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [
|
|
rr:column "Name";
|
|
rr:termType rr:Literal;
|
|
];
|
|
rr:graphMap [ rr:graph <http://example.com/graph/students> ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant <http://example.com/ontology/practises> ];
|
|
rr:refObjectMap [
|
|
rr:parentTriplesMap <TriplesMap2>;
|
|
rr:joinCondition [
|
|
rr:child "Sport" ;
|
|
rr:parent "ID" ;
|
|
]
|
|
];
|
|
rr:graphMap [ rr:graph <http://example.com/graph/practise> ];
|
|
];
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMapClass;
|
|
|
|
|
|
rr:logicalTable [ rr:tableName "Sport" ];
|
|
|
|
rr:subjectMap
|
|
[
|
|
rr:template "http://example.com/resource/sport_{ID}";
|
|
rr:termType rr:IRI;
|
|
rr:class <http://example.com/ontology/Sport>;
|
|
rr:graphMap [ rr:graph <http://example.com/graph/sports> ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdfs:label ];
|
|
rr:objectMap [
|
|
rr:column "Name";
|
|
rr:termType rr:Literal;
|
|
];
|
|
rr:graphMap [ rr:graph <http://example.com/graph/sports> ];
|
|
];
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D010-SpecialChars" typeof="rdb2rdftest:DataBase">
|
|
<a id="D010-SpecialChars"></a><h3>D010-SpecialChars</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with Special Chars</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Country Info</b></caption> <tbody><tr><th>Country Code (PK)<br><small>INTEGER</small></th>
|
|
<th>Name<br><small>CHARACTER(100)</small></th>
|
|
<th>ISO 3166<br><small>CHARACTER(10)</small></th>
|
|
</tr>
|
|
<tr><td><code>1</code></td><td><code>Bolivia, Plurinational State of </code></td><td><code>BO </code></td></tr>
|
|
<tr><td><code>2</code></td><td><code>Ireland </code></td><td><code>IE </code></td></tr>
|
|
<tr><td><code>3</code></td><td><code>Saint Martin (French part) </code></td><td><code>MF </code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Country Info" (
|
|
"Country Code" INTEGER PRIMARY KEY,
|
|
"Name" CHAR(100),
|
|
"ISO 3166" CHAR(10)
|
|
);
|
|
INSERT INTO "Country Info" ("Country Code", "Name", "ISO 3166") VALUES (1, 'Bolivia, Plurinational State of', 'BO');
|
|
INSERT INTO "Country Info" ("Country Code", "Name", "ISO 3166") VALUES (2, 'Ireland', 'IE');
|
|
INSERT INTO "Country Info" ("Country Code", "Name", "ISO 3166") VALUES (3, 'Saint Martin (French part)', 'MF');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/create.sql" target="_blank">D010-SpecialChars</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0010a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0010a"></a><h3 property="dcterms:identifier">R2RMLTC0010a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with Special Chars</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a template with blank space in column</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-template-valued-term-map">#dfn-template-valued-term-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/create.sql">D010-SpecialChars</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/1></code></td><td><code><http://example.com/name></code></td><td><code>"Bolivia, Plurinational State of"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/2></code></td><td><code><http://example.com/name></code></td><td><code>"Ireland"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/3></code></td><td><code><http://example.com/name></code></td><td><code>"Saint Martin (French part)"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/r2rmla.ttl">R2RMLTC0010a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Country Info"; ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Country Code}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0010b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0010b"></a><h3 property="dcterms:identifier">R2RMLTC0010b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with Special Chars</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a template with special chars in column value</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-template-valued-term-map">#dfn-template-valued-term-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/create.sql">D010-SpecialChars</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/1Bolivia%2C%20Plurinational%20State%20of></code></td><td><code><http://example.com/name></code></td><td><code>"Bolivia, Plurinational State of"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/2Ireland></code></td><td><code><http://example.com/name></code></td><td><code>"Ireland"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/3Saint%20Martin%20(French%20part)></code></td><td><code><http://example.com/name></code></td><td><code>"Saint Martin (French part)"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/r2rmlb.ttl">R2RMLTC0010b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Country Info"; ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Country Code}{Name}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:name ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0010c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0010c"></a><h3 property="dcterms:identifier">R2RMLTC0010c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with Special Chars</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a template with special chars in column value and backslash escapes in string templates</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-template-valued-term-map">#dfn-template-valued-term-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/create.sql">D010-SpecialChars</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/mappedc.nq">mappedc.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/1Bolivia%2C%20Plurinational%20State%20of></code></td><td><code><http://example.com/code></code></td><td><code>"{{{ BO }}}"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/2Ireland></code></td><td><code><http://example.com/code></code></td><td><code>"{{{ IE }}}"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/3Saint%20Martin%20(French%20part)></code></td><td><code><http://example.com/code></code></td><td><code>"{{{ MF }}}"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D010-SpecialChars/r2rmlc.ttl">R2RMLTC0010c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Country Info"; ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Country Code}{Name}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:code ];
|
|
rr:objectMap [ rr:template "\\{\\{\\{ {ISO 3166} \\}\\}\\}" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D011-M2MRelations" typeof="rdb2rdftest:DataBase">
|
|
<a id="D011-M2MRelations"></a><h3>D011-M2MRelations</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Many to Many relations</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Student</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>FirstName<br><small>VARCHAR(50)</small></th>
|
|
<th>LastName<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>10</code></td><td><code>Venus</code></td><td><code>Williams</code></td></tr>
|
|
<tr><td><code>11</code></td><td><code>Fernando</code></td><td><code>Alonso</code></td></tr>
|
|
<tr><td><code>12</code></td><td><code>David</code></td><td><code>Villa</code></td></tr>
|
|
</tbody></table><table class="ex-data"> <caption><b>Student_Sport</b></caption> <tbody><tr><th>ID_Sport (PFK)<br><small>INTEGER</small></th>
|
|
<th>ID_Student (PFK)<br><small>INTEGER</small></th>
|
|
</tr>
|
|
<tr><td><code>110</code></td><td><code>10</code></td></tr>
|
|
<tr><td><code>111</code></td><td><code>11</code></td></tr>
|
|
<tr><td><code>112</code></td><td><code>11</code></td></tr>
|
|
<tr><td><code>111</code></td><td><code>12</code></td></tr>
|
|
</tbody></table><table class="ex-data"> <caption><b>Sport</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>Description<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>110</code></td><td><code>Tennis</code></td></tr>
|
|
<tr><td><code>111</code></td><td><code>Football</code></td></tr>
|
|
<tr><td><code>112</code></td><td><code>Formula1</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Student" (
|
|
"ID" integer PRIMARY KEY,
|
|
"FirstName" varchar(50),
|
|
"LastName" varchar(50)
|
|
);
|
|
CREATE TABLE "Sport" (
|
|
"ID" integer PRIMARY KEY,
|
|
"Description" varchar(50)
|
|
);
|
|
CREATE TABLE "Student_Sport" (
|
|
"ID_Student" integer,
|
|
"ID_Sport" integer,
|
|
PRIMARY KEY ("ID_Student","ID_Sport"),
|
|
FOREIGN KEY ("ID_Student") REFERENCES "Student"("ID"),
|
|
FOREIGN KEY ("ID_Sport") REFERENCES "Sport"("ID")
|
|
);
|
|
|
|
INSERT INTO "Student" ("ID","FirstName","LastName") VALUES (10,'Venus', 'Williams');
|
|
INSERT INTO "Student" ("ID","FirstName","LastName") VALUES (11,'Fernando', 'Alonso');
|
|
INSERT INTO "Student" ("ID","FirstName","LastName") VALUES (12,'David', 'Villa');
|
|
|
|
INSERT INTO "Sport" ("ID", "Description") VALUES (110,'Tennis');
|
|
INSERT INTO "Sport" ("ID", "Description") VALUES (111,'Football');
|
|
INSERT INTO "Sport" ("ID", "Description") VALUES (112,'Formula1');
|
|
|
|
INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (10,110);
|
|
INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (11,111);
|
|
INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (11,112);
|
|
INSERT INTO "Student_Sport" ("ID_Student", "ID_Sport") VALUES (12,111);
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/create.sql" target="_blank">D011-M2MRelations</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0011" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0011"></a><h3 property="dcterms:identifier">Direct Graph TC0011</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Many to Many relations</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests M to M relations</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/create.sql">D011-M2MRelations</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/directGraph.nt">Direct Graph TC0011</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code><Student/ID.12#_></code></td><td><code><rdf:type></code></td><td><code><Student></code></td></tr><tr><td><code><Student/ID.12#_></code></td><td><code><Student#FirstName></code></td><td><code>"David"</code></td></tr><tr><td><code><Student/ID.12#_></code></td><td><code><Student#LastName></code></td><td><code>"Villa"</code></td></tr><tr><td><code><Student_Sport/ID_Student.10,ID_Sport.110#_></code></td><td><code><rdf:type></code></td><td><code><Student_Sport></code></td></tr><tr><td><code><Student_Sport/ID_Student.10,ID_Sport.110#_></code></td><td><code><Student_Sport#ID_Sport></code></td><td><code><Sport/ID.110#_></code></td></tr><tr><td><code><Student_Sport/ID_Student.10,ID_Sport.110#_></code></td><td><code><Student_Sport#ID_Student></code></td><td><code><Student/ID.10#_></code></td></tr><tr><td><code><Student/ID.11#_></code></td><td><code><rdf:type></code></td><td><code><Student></code></td></tr><tr><td><code><Student/ID.11#_></code></td><td><code><Student#FirstName></code></td><td><code>"Fernando"</code></td></tr><tr><td><code><Student/ID.11#_></code></td><td><code><Student#LastName></code></td><td><code>"Alonso"</code></td></tr><tr><td><code><Sport/ID.111#_></code></td><td><code><Sport#Description></code></td><td><code>"Football"</code></td></tr><tr><td><code><Sport/ID.110#_></code></td><td><code><rdf:type></code></td><td><code><Sport></code></td></tr><tr><td><code><Sport/ID.110#_></code></td><td><code><Sport#Description></code></td><td><code>"Tennis"</code></td></tr><tr><td><code><Student_Sport/ID_Student.12,ID_Sport.111#_></code></td><td><code><rdf:type></code></td><td><code><Student_Sport></code></td></tr><tr><td><code><Student_Sport/ID_Student.12,ID_Sport.111#_></code></td><td><code><Student_Sport#ID_Sport></code></td><td><code><Sport/ID.111#_></code></td></tr><tr><td><code><Student_Sport/ID_Student.12,ID_Sport.111#_></code></td><td><code><Student_Sport#ID_Student></code></td><td><code><Student/ID.12#_></code></td></tr><tr><td><code><Student_Sport/ID_Student.11,ID_Sport.111#_></code></td><td><code><rdf:type></code></td><td><code><Student_Sport></code></td></tr><tr><td><code><Student_Sport/ID_Student.11,ID_Sport.111#_></code></td><td><code><Student_Sport#ID_Sport></code></td><td><code><Sport/ID.111#_></code></td></tr><tr><td><code><Student_Sport/ID_Student.11,ID_Sport.111#_></code></td><td><code><Student_Sport#ID_Student></code></td><td><code><Student/ID.11#_></code></td></tr><tr><td><code><Student_Sport/ID_Student.11,ID_Sport.112#_></code></td><td><code><rdf:type></code></td><td><code><Student_Sport></code></td></tr><tr><td><code><Student_Sport/ID_Student.11,ID_Sport.112#_></code></td><td><code><Student_Sport#ID_Sport></code></td><td><code><Sport/ID.112#_></code></td></tr><tr><td><code><Student_Sport/ID_Student.11,ID_Sport.112#_></code></td><td><code><Student_Sport#ID_Student></code></td><td><code><Student/ID.11#_></code></td></tr><tr><td><code><Sport/ID.112#_></code></td><td><code><rdf:type></code></td><td><code><Sport></code></td></tr><tr><td><code><Sport/ID.112#_></code></td><td><code><Sport#Description></code></td><td><code>"Formula1"</code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><rdf:type></code></td><td><code><Student></code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#FirstName></code></td><td><code>"Venus"</code></td></tr><tr><td><code><Student/ID.10#_></code></td><td><code><Student#LastName></code></td><td><code>"Williams"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0011a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0011a"></a><h3 property="dcterms:identifier">R2RMLTC0011a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">M to N relation, by using a SQL query</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests, M to N relations, by using a SQL query</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#r2rml-views">#r2rml-views</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/create.sql">D011-M2MRelations</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/110Tennis></code></td><td><code><http://example.com/description></code></td><td><code>"Tennis"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/110Tennis></code></td><td><code><http://example.com/id></code></td><td><code>"110"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10VenusWilliams></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/110Tennis></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10VenusWilliams></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Williams"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10VenusWilliams></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/10VenusWilliams></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/111Football></code></td><td><code><http://example.com/description></code></td><td><code>"Football"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/111Football></code></td><td><code><http://example.com/id></code></td><td><code>"111"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/12DavidVilla></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/111Football></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/12DavidVilla></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Villa"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/12DavidVilla></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"David"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/12DavidVilla></code></td><td><code><http://example.com/id></code></td><td><code>"12"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/112Formula1></code></td><td><code><http://example.com/description></code></td><td><code>"Formula1"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/112Formula1></code></td><td><code><http://example.com/id></code></td><td><code>"112"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/11FernandoAlonso></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/112Formula1></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/11FernandoAlonso></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/111Football></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/11FernandoAlonso></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Alonso"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/11FernandoAlonso></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Fernando"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/11FernandoAlonso></code></td><td><code><http://example.com/id></code></td><td><code>"11"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/r2rmla.ttl">R2RMLTC0011a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
SELECT Student.ID as ID,
|
|
Student.FirstName as FirstName,
|
|
Student.LastName as LastName,
|
|
Sport.Description as Description,
|
|
Sport.ID as Sport_ID
|
|
FROM Student,Sport,Student_Sport
|
|
WHERE Student.ID = Student_Sport.ID_Student
|
|
AND Sport.ID = Student_Sport.ID_Sport;
|
|
"""; ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{ID}{FirstName}{LastName}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName ];
|
|
rr:objectMap [ rr:column "FirstName" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:lastName ];
|
|
rr:objectMap [ rr:column "LastName" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:plays ];
|
|
rr:objectMap [ rr:template "http://example.com/{Sport_ID}{Description}" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Sport" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "http://example.com/{ID}{Description}";
|
|
rr:class ex:Sport;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:description ];
|
|
rr:objectMap [ rr:column "Description" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0011b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0011b"></a><h3 property="dcterms:identifier">R2RMLTC0011b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">M to N relation, by using an additional Triples Map</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests, M to N relations, by using an additional Triples Map</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#termtype">#termtype</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/create.sql">D011-M2MRelations</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/student/10></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Williams"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/10></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Venus"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/12></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Villa"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/12></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"David"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/12></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/11></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Alonso"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/11></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Fernando"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/11></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Student></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/110></code></td><td><code><http://example.com/description></code></td><td><code>"Tennis"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/110></code></td><td><code><http://example.com/id></code></td><td><code>"110"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/110></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Sport></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/111></code></td><td><code><http://example.com/description></code></td><td><code>"Football"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/111></code></td><td><code><http://example.com/id></code></td><td><code>"111"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/111></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Sport></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/112></code></td><td><code><http://example.com/description></code></td><td><code>"Formula1"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/112></code></td><td><code><http://example.com/id></code></td><td><code>"112"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/sport/112></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/Sport></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/10></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/sport/110></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/12></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/sport/111></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/11></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/sport/112></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/student/11></code></td><td><code><http://example.com/plays></code></td><td><code><http://example.com/sport/111></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D011-M2MRelations/r2rmlb.ttl">R2RMLTC0011b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
rr:logicalTable [ rr:tableName "Student"; ] ;
|
|
rr:subjectMap [
|
|
rr:template "http://example.com/student/{ID}";
|
|
rr:class ex:Student;
|
|
];
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:firstName ];
|
|
rr:objectMap [ rr:column "FirstName" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:lastName ];
|
|
rr:objectMap [ rr:column "LastName" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
rr:logicalTable [ rr:tableName "Sport"; ] ;
|
|
rr:subjectMap [
|
|
rr:template "http://example.com/sport/{ID}";
|
|
rr:class ex:Sport;
|
|
];
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:description ];
|
|
rr:objectMap [ rr:column "Description" ]
|
|
]
|
|
.
|
|
|
|
<LinkMap_1_2>
|
|
|
|
rr:logicalTable [ rr:tableName "Student_Sport" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/student/{ID_Student}" ];
|
|
|
|
rr:predicateObjectMap [
|
|
rr:predicateMap [ rr:constant ex:plays ];
|
|
rr:objectMap [ rr:template "http://example.com/sport/{ID_Sport}" ];
|
|
].
|
|
|
|
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D012-2tables2duplicates0nulls" typeof="rdb2rdftest:DataBase">
|
|
<a id="D012-2tables2duplicates0nulls"></a><h3>D012-2tables2duplicates0nulls</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Two tables two duplicates zero nulls</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>IOUs</b></caption> <tbody><tr><th>amount<br><small>DOUBLE</small></th>
|
|
<th>lname<br><small>CHARACTER(20)</small></th>
|
|
<th>fname<br><small>CHARACTER(20)</small></th>
|
|
</tr>
|
|
<tr><td><code>30.0E0</code></td><td><code>Smith </code></td><td><code>Bob </code></td></tr>
|
|
<tr><td><code>20.0E0</code></td><td><code>Jones </code></td><td><code>Sue </code></td></tr>
|
|
<tr><td><code>30.0E0</code></td><td><code>Smith </code></td><td><code>Bob </code></td></tr>
|
|
</tbody></table><table class="ex-data"> <caption><b>Lives</b></caption> <tbody><tr><th>lname<br><small>CHARACTER(20)</small></th>
|
|
<th>fname<br><small>CHARACTER(20)</small></th>
|
|
<th>city<br><small>CHARACTER(20)</small></th>
|
|
</tr>
|
|
<tr><td><code>Smith </code></td><td><code>Bob </code></td><td><code>London </code></td></tr>
|
|
<tr><td><code>Jones </code></td><td><code>Sue </code></td><td><code>Madrid </code></td></tr>
|
|
<tr><td><code>Smith </code></td><td><code>Bob </code></td><td><code>London </code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "IOUs" (
|
|
"fname" CHAR(20),
|
|
"lname" CHAR(20),
|
|
"amount" FLOAT);
|
|
INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30);
|
|
INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Sue', 'Jones', 20);
|
|
INSERT INTO "IOUs" ("fname", "lname", "amount") VALUES ('Bob', 'Smith', 30);
|
|
CREATE TABLE "Lives" (
|
|
"fname" CHAR(20),
|
|
"lname" CHAR(20),
|
|
"city" CHAR(20));
|
|
INSERT INTO "Lives" ("fname", "lname", "city") VALUES ('Bob', 'Smith', 'London');
|
|
INSERT INTO "Lives" ("fname", "lname", "city") VALUES ('Sue', 'Jones', 'Madrid');
|
|
INSERT INTO "Lives" ("fname", "lname", "city") VALUES ('Bob', 'Smith', 'London');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/create.sql" target="_blank">D012-2tables2duplicates0nulls</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0012a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0012a"></a><h3 property="dcterms:identifier">R2RMLTC0012a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Duplicate tuples generate same blank node</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#termtype">#termtype</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/create.sql">D012-2tables2duplicates0nulls</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff3</code></td><td><code><http://example.com/amount></code></td><td><code>"30.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff3</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Bob Smith"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff3</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/IOU></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff2</code></td><td><code><http://example.com/amount></code></td><td><code>"20.0"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff2</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Sue Jones"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7ff2</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/IOU></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/r2rmla.ttl">R2RMLTC0012a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "IOUs" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "{fname}_{lname}_{amount}";
|
|
rr:termType rr:BlankNode;
|
|
rr:class ex:IOU;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [
|
|
rr:template "{fname} {lname}";
|
|
rr:termType rr:Literal ;
|
|
]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:amount ];
|
|
rr:objectMap [
|
|
rr:column "amount";
|
|
rr:termType rr:Literal ;
|
|
rr:datatype xsd:float ;
|
|
]
|
|
];
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0012b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0012b"></a><h3 property="dcterms:identifier">R2RMLTC0012b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Duplicate tuples generate same blank node</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests that blank nodes with same identifier and in the same graph but generated by different logical rows are considered equivalent.</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#termtype">#termtype</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/create.sql">D012-2tables2duplicates0nulls</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fef</code></td><td><code><http://example.com/city></code></td><td><code>"London"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fef</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Bob Smith"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fef</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/IOU></code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fee</code></td><td><code><http://example.com/amount></code></td><td><code>"Madrid"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fee</code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Sue Jones"</code></td><td><code> </code></td></tr><tr><td><code>_:AX2dX38ec05dcX3aX131488bea58X3aXX2dX7fee</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/IOU></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/r2rmlb.ttl">R2RMLTC0012b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "IOUs" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "{fname}_{lname}";
|
|
rr:termType rr:BlankNode ;
|
|
rr:class ex:IOU;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [
|
|
rr:template "{fname} {lname}";
|
|
rr:termType rr:Literal ;
|
|
]
|
|
];
|
|
.
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Lives" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "{fname}_{lname}";
|
|
rr:termType rr:BlankNode;
|
|
rr:class ex:IOU;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:city ];
|
|
rr:objectMap [
|
|
rr:column "city";
|
|
rr:termType rr:Literal ;
|
|
]
|
|
];
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0012c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0012c"></a><h3 property="dcterms:identifier">R2RMLTC0012c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">TriplesMap without subjectMap</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a R2RML with missing information, TriplesMap without subjectMap.</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#data-errors">#data-errors</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/create.sql">D012-2tables2duplicates0nulls</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/r2rmlc.ttl">R2RMLTC0012c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "IOUs" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [
|
|
rr:template "{fname} {lname}";
|
|
rr:termType rr:Literal ;
|
|
]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:amount ];
|
|
rr:objectMap [
|
|
rr:column "amount";
|
|
rr:termType rr:Literal ;
|
|
rr:datatype xsd:float ;
|
|
]
|
|
];
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0012d" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0012d"></a><h3 property="dcterms:identifier">R2RMLTC0012d</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">TriplesMap with two subjectMap</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a R2RML with wrong information, TriplesMap with two subjectMap.</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#data-errors">#data-errors</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/create.sql">D012-2tables2duplicates0nulls</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D012-2tables2duplicates0nulls/r2rmld.ttl">R2RMLTC0012d</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "IOUs" ];
|
|
|
|
rr:subjectMap [
|
|
rr:template "{fname}_{lname}_{amount}";
|
|
rr:termType rr:BlankNode;
|
|
rr:class ex:IOU;
|
|
];
|
|
|
|
rr:subjectMap [
|
|
rr:template "{amount}_{fname}_{lname}";
|
|
rr:termType rr:BlankNode;
|
|
rr:class ex:IOU;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name ];
|
|
rr:objectMap [
|
|
rr:template "{fname} {lname}";
|
|
rr:termType rr:Literal ;
|
|
]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:amount ];
|
|
rr:objectMap [
|
|
rr:column "amount";
|
|
rr:termType rr:Literal ;
|
|
rr:datatype xsd:float ;
|
|
]
|
|
];
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D013-1table3columns2rows1nullvalue" typeof="rdb2rdftest:DataBase">
|
|
<a id="D013-1table3columns2rows1nullvalue"></a><h3>D013-1table3columns2rows1nullvalue</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with null value</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Person</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>Name<br><small>VARCHAR(50)</small></th>
|
|
<th>DateOfBirth<br><small>VARCHAR(50)</small></th>
|
|
</tr>
|
|
<tr><td><code>1</code></td><td><code>Alice</code></td><td><code>NULL</code></td></tr>
|
|
<tr><td><code>2</code></td><td><code>Bob</code></td><td><code>September, 2010</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Person" (
|
|
"ID" integer,
|
|
"Name" varchar(50),
|
|
"DateOfBirth" varchar(50),
|
|
PRIMARY KEY ("ID")
|
|
);
|
|
INSERT INTO "Person" ("ID", "Name", "DateOfBirth") VALUES (1,'Alice', NULL);
|
|
INSERT INTO "Person" ("ID", "Name", "DateOfBirth") VALUES (2,'Bob', 'September, 2010');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D013-1table3columns2rows1nullvalue/create.sql" target="_blank">D013-1table3columns2rows1nullvalue</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#Direct Graph TC0013" typeof="rdb2rdftest:DirectMapping">
|
|
<a id="Direct Graph TC0013"></a><h3 property="dcterms:identifier">Direct Graph TC0013</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Direct Graph of table with NULL values</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests Direct Graph of table with NULL values</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<span property="test:specificationReference">#rules_table_triples</span>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D013-1table3columns2rows1nullvalue/create.sql">D013-1table3columns2rows1nullvalue</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D013-1table3columns2rows1nullvalue/directGraph.nt">Direct Graph TC0013</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th></tr><tr><td><code><Person/ID=1></code></td><td><code><Person#Name></code></td><td><code>"Alice"</code></td></tr><tr><td><code><Person/ID=2></code></td><td><code><Person#Name></code></td><td><code>"Bob"</code></td></tr><tr><td><code><Person/ID=2></code></td><td><code><Person#DateOfBirth></code></td><td><code>"September, 2010"</code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0013a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0013a"></a><h3 property="dcterms:identifier">R2RMLTC0013a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Duplicate tuples generate same blank node</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the presence of null values in a template valued term map</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-template-valued-term-map">#dfn-template-valued-term-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D013-1table3columns2rows1nullvalue/create.sql">D013-1table3columns2rows1nullvalue</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D013-1table3columns2rows1nullvalue/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Person1Alice></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Person1Alice></code></td><td><code><http://example.com/id></code></td><td><code>"1"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Person1Alice></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Alice"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Person2BobSeptember%2C%202010></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Person2BobSeptember%2C%202010></code></td><td><code><http://example.com/id></code></td><td><code>"2"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Person2BobSeptember%2C%202010></code></td><td><code><http://xmlns.com/foaf/0.1/name></code></td><td><code>"Bob"</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Person2BobSeptember%2C%202010></code></td><td><code><http://example.com/BirthDay></code></td><td><code>"September, 2010"</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D013-1table3columns2rows1nullvalue/r2rmla.ttl">R2RMLTC0013a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Person" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Person{ID}{Name}{DateOfBirth}"; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type; ];
|
|
rr:objectMap [ rr:constant foaf:Person; ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant foaf:name; ];
|
|
rr:objectMap [ rr:column "Name" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:BirthDay; ];
|
|
rr:objectMap [ rr:column "DateOfBirth" ]
|
|
]
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D014-3tablesExample" typeof="rdb2rdftest:DataBase">
|
|
<a id="D014-3tablesExample"></a><h3>D014-3tablesExample</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">3 tables extended example</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>EMP</b></caption> <tbody><tr><th>empno (PK)<br><small>INTEGER</small></th>
|
|
<th>deptno (FK)<br><small>INTEGER</small></th>
|
|
<th>ename<br><small>VARCHAR(100)</small></th>
|
|
<th>job<br><small>VARCHAR(30)</small></th>
|
|
<th>etype<br><small>VARCHAR(30)</small></th>
|
|
</tr>
|
|
<tr><td><code>7369</code></td><td><code>10</code></td><td><code>SMITH</code></td><td><code>CLERK</code></td><td><code>PART_TIME</code></td></tr>
|
|
</tbody></table><table class="ex-data"> <caption><b>LIKES</b></caption> <tbody><tr><th>id<br><small>INTEGER</small></th>
|
|
<th>likedObj<br><small>VARCHAR(100)</small></th>
|
|
<th>likeType<br><small>VARCHAR(30)</small></th>
|
|
</tr>
|
|
<tr><td><code>7369</code></td><td><code>Soccer</code></td><td><code>Playing</code></td></tr>
|
|
<tr><td><code>7369</code></td><td><code>Basketball</code></td><td><code>Watching</code></td></tr>
|
|
</tbody></table><table class="ex-data"> <caption><b>DEPT</b></caption> <tbody><tr><th>dname<br><small>VARCHAR(30)</small></th>
|
|
<th>loc<br><small>VARCHAR(100)</small></th>
|
|
<th>deptno<br><small>INTEGER</small></th>
|
|
</tr>
|
|
<tr><td><code>APPSERVER</code></td><td><code>NEW YORK</code></td><td><code>10</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "DEPT" (
|
|
"deptno" INTEGER UNIQUE,
|
|
"dname" VARCHAR(30),
|
|
"loc" VARCHAR(100));
|
|
INSERT INTO "DEPT" ("deptno", "dname", "loc") VALUES (10, 'APPSERVER', 'NEW YORK');
|
|
|
|
CREATE TABLE "EMP" (
|
|
"empno" INTEGER PRIMARY KEY,
|
|
"ename" VARCHAR(100),
|
|
"job" VARCHAR(30),
|
|
"deptno" INTEGER REFERENCES "DEPT" ("deptno"),
|
|
"etype" VARCHAR(30));
|
|
INSERT INTO "EMP" ("empno", "ename", "job", "deptno", "etype" ) VALUES (7369, 'SMITH', 'CLERK', 10, 'PART_TIME');
|
|
|
|
CREATE TABLE "LIKES" (
|
|
"id" INTEGER,
|
|
"likeType" VARCHAR(30),
|
|
"likedObj" VARCHAR(100));
|
|
INSERT INTO "LIKES" ("id", "likeType", "likedObj") VALUES (7369, 'Playing', 'Soccer');
|
|
INSERT INTO "LIKES" ("id", "likeType", "likedObj") VALUES (7369, 'Watching', 'Basketball');
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/create.sql" target="_blank">D014-3tablesExample</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0014a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0014a"></a><h3 property="dcterms:identifier">R2RMLTC0014a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">3 tables extended example</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a logicaltable with sqlQuery</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-graph-map">#dfn-graph-map</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/create.sql">D014-3tablesExample</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code>_:Department10</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ns#dept></code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr><tr><td><code>_:Department10</code></td><td><code><http://example.com/dept#deptno></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#positiveInteger></code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr><tr><td><code>_:Department10</code></td><td><code><http://example.com/dept#name></code></td><td><code>"APPSERVER"</code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr><tr><td><code>_:Department10</code></td><td><code><http://example.com/dept#location></code></td><td><code>"NEW YORK"</code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr><tr><td><code>_:Department10</code></td><td><code><http://example.com/dept#COMPANY></code></td><td><code>"EXAMPLE Corporation"</code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/r2rmla.ttl">R2RMLTC0014a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix ex: <http://example.com/ns#> .
|
|
@prefix emp: <http://example.com/emp#> .
|
|
@prefix dept: <http://example.com/dept#> .
|
|
@prefix likes: <http://example.com/likes#> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('Department' || "deptno") AS "deptId"
|
|
, "deptno"
|
|
, "dname"
|
|
, "loc"
|
|
from SA.DEPT
|
|
""" ];
|
|
|
|
rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
|
|
rr:class ex:dept;
|
|
rr:graphMap [ rr:graph ex:DeptGraph; ];
|
|
rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:deptno ];
|
|
rr:objectMap [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:name ];
|
|
rr:objectMap [ rr:column "dname" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:location ];
|
|
rr:objectMap [ rr:column "loc" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:COMPANY ];
|
|
rr:objectMap [ rr:object "EXAMPLE Corporation" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0014b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0014b"></a><h3 property="dcterms:identifier">R2RMLTC0014b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">3 tables extended example</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Mapping specification using SQL-based logical table definition</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#inverse">#inverse</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/create.sql">D014-3tablesExample</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ns#emp></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#jobtype></code></td><td><code><http://example.com/emp/job/CLERK></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/emp/job/CLERK></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#emptype></code></td><td><code><http://example.com/emp/etype/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/emp/etype/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#empno></code></td><td><code>"7369"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/CLERK/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#name></code></td><td><code>"SMITH"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#job></code></td><td><code>"CLERK"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#deptNum></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#etype></code></td><td><code>"PART TIME"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#c_ref_deptno></code></td><td><code>_:Department10</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#name></code></td><td><code>"SMITH"</code></td><td><code><http://example.com/emp#empNameGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/r2rmlb.ttl">R2RMLTC0014b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/ns#> .
|
|
@prefix emp: <http://example.com/emp#> .
|
|
@prefix dept: <http://example.com/dept#> .
|
|
@prefix likes: <http://example.com/likes#> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('Department' || deptno) AS deptId
|
|
, deptno
|
|
, dname
|
|
, loc
|
|
from SA.DEPT
|
|
""" ];
|
|
|
|
rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
|
|
rr:class ex:dept;
|
|
rr:graphMap [ rr:graph ex:DeptGraph; ];
|
|
rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:deptno ];
|
|
rr:objectMap [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:name ];
|
|
rr:objectMap [ rr:column "dname" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:location ];
|
|
rr:objectMap [ rr:column "loc" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:COMPANY ];
|
|
rr:objectMap [ rr:object "EXAMPLE Corporation" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('http://example.com/emp/' || empno) AS empURI
|
|
, empno
|
|
, ename
|
|
, ('http://example.com/emp/job/'|| job) AS jobTypeURI
|
|
, job
|
|
, deptno
|
|
, ('http://example.com/emp/etype/'|| etype) AS empTypeURI
|
|
, etype
|
|
, ('http://example.com/graph/'|| job || '/' || etype) AS graphURI
|
|
from SA.EMP
|
|
""" ];
|
|
|
|
rr:subjectMap [ rr:column "empURI";
|
|
rr:class ex:emp;
|
|
rr:graphMap [ rr:column "graphURI" ]; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:jobtype ];
|
|
rr:objectMap [ rr:column "jobTypeURI" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type ];
|
|
rr:objectMap [ rr:column "jobTypeURI" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:emptype ];
|
|
rr:objectMap [ rr:column "empTypeURI" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type ];
|
|
rr:objectMap [ rr:column "empTypeURI" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:empno ];
|
|
rr:objectMap [ rr:column "empno" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:name ];
|
|
rr:objectMap [ rr:column "ename" ];
|
|
rr:graphMap [ rr:graph emp:empNameGraph ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:job ];
|
|
rr:objectMap [ rr:column "job" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:deptNum ];
|
|
rr:objectMap [ rr:column "deptno" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:etype ];
|
|
rr:objectMap [ rr:column "etype" ]
|
|
];
|
|
|
|
rr:predicateObjectMap [
|
|
rr:predicateMap [ rr:constant emp:c_ref_deptno ];
|
|
rr:refObjectMap [
|
|
rr:parentTriplesMap <TriplesMap1>;
|
|
rr:joinCondition [
|
|
rr:child "deptno";
|
|
rr:parent "deptno";
|
|
];
|
|
];
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0014c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0014c"></a><h3 property="dcterms:identifier">R2RMLTC0014c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">3 tables extended example</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Mapping specification using table name based logical table definition</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#foreign-key">#foreign-key</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/create.sql">D014-3tablesExample</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/mappedc.nq">mappedc.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ns#emp></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#jobtype></code></td><td><code><http://example.com/emp/job/CLERK></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/emp/job/CLERK></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#emptype></code></td><td><code><http://example.com/emp/etype/PART_TIME> <http://example.com/graph/CLERK/PART_TIME></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/emp/etype/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#empno></code></td><td><code>"7369"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/CLERK/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#name></code></td><td><code>"SMITH"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#job></code></td><td><code>"CLERK"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#deptNum></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#etype></code></td><td><code>"PART TIME"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#c_ref_deptno></code></td><td><code>_:Department10</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#name></code></td><td><code>"SMITH"</code></td><td><code><http://example.com/emp#empNameGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/r2rmlc.ttl">R2RMLTC0014c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/ns#> .
|
|
@prefix emp: <http://example.com/emp#> .
|
|
@prefix dept: <http://example.com/dept#> .
|
|
@prefix likes: <http://example.com/likes#> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('Department' || deptno) AS deptId
|
|
, deptno
|
|
, dname
|
|
, loc
|
|
from SA.DEPT
|
|
""" ];
|
|
|
|
rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
|
|
rr:class ex:dept;
|
|
rr:graphMap [ rr:graph ex:DeptGraph; ];
|
|
rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:deptno ];
|
|
rr:objectMap [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:name ];
|
|
rr:objectMap [ rr:column "dname" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:location ];
|
|
rr:objectMap [ rr:column "loc" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:COMPANY ];
|
|
rr:objectMap [ rr:object "EXAMPLE Corporation" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "SA.EMP" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/emp/{empno}";
|
|
rr:class ex:emp;
|
|
rr:graphMap [ rr:template "http://example.com/graph/{job}/{etype}"; ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:jobtype ];
|
|
rr:objectMap [ rr:template "http://example.com/emp/job/{job}" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type ];
|
|
rr:objectMap [ rr:template "http://example.com/emp/job/{job}" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:emptype ];
|
|
rr:objectMap [ rr:template "http://example.com/emp/etype/{etype}" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type ];
|
|
rr:objectMap [ rr:template "http://example.com/emp/etype/{etype}" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:empno ];
|
|
rr:objectMap [ rr:column "empno" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:name ];
|
|
rr:objectMap [ rr:column "ename" ];
|
|
rr:graphMap [ rr:graph emp:empNameGraph ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:job ];
|
|
rr:objectMap [ rr:column "job" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:deptNum ];
|
|
rr:objectMap [ rr:column "deptno" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:etype ];
|
|
rr:objectMap [ rr:column "etype" ]
|
|
];
|
|
|
|
rr:predicateObjectMap [
|
|
rr:predicateMap [ rr:constant emp:c_ref_deptno ];
|
|
rr:refObjectMap [
|
|
rr:parentTriplesMap <TriplesMap1>;
|
|
rr:joinCondition [
|
|
rr:child "deptno";
|
|
rr:parent "deptno";
|
|
];
|
|
];
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0014d" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0014d"></a><h3 property="dcterms:identifier">R2RMLTC0014d</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">3 tables extended example</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Mapping specification showing reuse of ObjectMap elements</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#foreign-key">#foreign-key</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/create.sql">D014-3tablesExample</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/mappedd.nq">mappedd.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ns#emp></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#jobtype></code></td><td><code><http://example.com/emp/job/CLERK></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/emp/job/CLERK></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#emptype></code></td><td><code><http://example.com/emp/etype/PART_TIME> <http://example.com/graph/CLERK/PART_TIME></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/emp/etype/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#empno></code></td><td><code>"7369"^^<http://www.w3.org/2001/XMLSchema#integer> <http://example.com/graph/CLERK/PART_TIME></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#name></code></td><td><code>"SMITH"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#job></code></td><td><code>"CLERK"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#deptNum></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#etype></code></td><td><code>"PART TIME"</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#c_ref_deptno></code></td><td><code>_:Department10</code></td><td><code><http://example.com/graph/CLERK/PART_TIME></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp#name></code></td><td><code>"SMITH"</code></td><td><code><http://example.com/emp#empNameGraph></code></td></tr><tr><td><code>_:Department10</code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://example.com/ns#dept></code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr><tr><td><code>_:Department10</code></td><td><code><http://example.com/dept#deptno></code></td><td><code>"10"^^<sd:positiveInteger <http://example.com/ns#dept></code></td><td><code><http://example.com/ns#DeptGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/r2rmld.ttl">R2RMLTC0014d</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/ns#> .
|
|
@prefix emp: <http://example.com/emp#> .
|
|
@prefix dept: <http://example.com/dept#> .
|
|
@prefix likes: <http://example.com/likes#> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('Department' || deptno) AS deptId
|
|
, deptno
|
|
, dname
|
|
, loc
|
|
from SA.DEPT
|
|
""" ];
|
|
|
|
rr:subjectMap [ rr:column "deptId"; rr:termType rr:BlankNode;
|
|
rr:class ex:dept;
|
|
rr:graphMap [ rr:graph ex:DeptGraph; ];
|
|
rr:inverseExpression "{deptno} = substr({deptId},length('Department')+1)"];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:deptno ];
|
|
rr:objectMap [ rr:column "deptno"; rr:datatype xsd:positiveInteger ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:name ];
|
|
rr:objectMap [ rr:column "dname" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:location ];
|
|
rr:objectMap [ rr:column "loc" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant dept:COMPANY ];
|
|
rr:objectMap [ rr:object "EXAMPLE Corporation" ]
|
|
]
|
|
.
|
|
|
|
|
|
<jobtypeObjectMap>
|
|
a rr:ObjectMap;
|
|
rr:template "http://example.com/emp/job/{job}"
|
|
.
|
|
|
|
<emptypeObjectMap>
|
|
a rr:ObjectMap;
|
|
rr:template "http://example.com/emp/etype/{etype}"
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "SA.EMP" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/emp/{empno}";
|
|
rr:class ex:emp;
|
|
rr:graphMap [ rr:template "http://example.com/graph/{job}/{etype}"; ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:jobtype ];
|
|
rr:objectMap <jobtypeObjectMap>
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type ];
|
|
rr:objectMap <jobtypeObjectMap>
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:emptype ];
|
|
rr:objectMap <emptypeObjectMap>
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant rdf:type ];
|
|
rr:objectMap <emptypeObjectMap>
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:empno ];
|
|
rr:objectMap [ rr:column "empno" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:name ];
|
|
rr:objectMap [ rr:column "ename" ];
|
|
rr:graphMap [ rr:graph emp:empNameGraph ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:job ];
|
|
rr:objectMap [ rr:column "job" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:deptNum ];
|
|
rr:objectMap [ rr:column "deptno" ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant emp:etype ];
|
|
rr:objectMap [ rr:column "etype" ]
|
|
];
|
|
|
|
rr:predicateObjectMap [
|
|
rr:predicateMap [ rr:constant emp:c_ref_deptno ];
|
|
rr:refObjectMap [
|
|
rr:parentTriplesMap <TriplesMap1>;
|
|
rr:joinCondition [
|
|
rr:child "deptno";
|
|
rr:parent "deptno";
|
|
];
|
|
];
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0014e" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0014e"></a><h3 property="dcterms:identifier">R2RMLTC0014e</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">3 tables extended example</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Mapping Specification for the LIKES Table</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#dfn-output-dataset">#dfn-output-dataset</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/create.sql">D014-3tablesExample</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/mappede.nq">mappede.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp/likes/Playing></code></td><td><code>"Soccer"</code></td><td><code><http://example.com/ns#LikesGraph></code></td></tr><tr><td><code><http://example.com/emp/7369></code></td><td><code><http://example.com/emp/likes/Watching></code></td><td><code>"Basketball"</code></td><td><code><http://example.com/ns#LikesGraph></code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D014-3tablesExample/r2rmle.ttl">R2RMLTC0014e</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/ns#> .
|
|
@prefix emp: <http://example.com/emp#> .
|
|
@prefix dept: <http://example.com/dept#> .
|
|
@prefix likes: <http://example.com/likes#> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
<TriplesMap3>
|
|
a rr:TriplesMap;
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
Select ('http://example.com/emp/' || id) AS empId
|
|
, ('http://example.com/emp/likes/' || likeType) AS empLikes
|
|
, likedObj
|
|
from SA.LIKES
|
|
""" ];
|
|
|
|
rr:subjectMap [
|
|
rr:column "empId";
|
|
rr:graphMap [ rr:graph ex:LikesGraph ];
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:column "empLikes" ];
|
|
rr:objectMap [ rr:column "likedObj" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D015-1tableSeveralLanguages" typeof="rdb2rdftest:DataBase">
|
|
<a id="D015-1tableSeveralLanguages"></a><h3>D015-1tableSeveralLanguages</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with language information</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Country</b></caption> <tbody><tr><th>Code (PK)<br><small>CHARACTER(2)</small></th>
|
|
<th>Lan (PK)<br><small>CHARACTER(10)</small></th>
|
|
<th>Name<br><small>CHARACTER(100)</small></th>
|
|
</tr>
|
|
<tr><td><code>BO</code></td><td><code>EN </code></td><td><code>Bolivia, Plurinational State of </code></td></tr>
|
|
<tr><td><code>BO</code></td><td><code>ES </code></td><td><code>Estado Plurinacional de Bolivia </code></td></tr>
|
|
<tr><td><code>IE</code></td><td><code>EN </code></td><td><code>Ireland </code></td></tr>
|
|
<tr><td><code>IE</code></td><td><code>ES </code></td><td><code>Irlanda </code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Country" (
|
|
"Code" CHAR(2),
|
|
"Name" CHAR(100),
|
|
"Lan" CHAR(10),
|
|
PRIMARY KEY ("Code","Lan")
|
|
);
|
|
INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('BO', 'Bolivia, Plurinational State of', 'EN');
|
|
INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('BO', 'Estado Plurinacional de Bolivia', 'ES');
|
|
INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('IE', 'Ireland', 'EN');
|
|
INSERT INTO "Country" ("Code", "Name", "Lan") VALUES ('IE', 'Irlanda', 'ES');
|
|
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D015-1tableSeveralLanguages/create.sql" target="_blank">D015-1tableSeveralLanguages</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0015a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0015a"></a><h3 property="dcterms:identifier">R2RMLTC0015a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with language information</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the language tag</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#language-tags">#language-tags</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D015-1tableSeveralLanguages/create.sql">D015-1tableSeveralLanguages</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D015-1tableSeveralLanguages/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/BO></code></td><td><code><http://www.w3.org/2000/01/rdf-schema#label></code></td><td><code>"Bolivia, Plurinational State of"@en</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/BO></code></td><td><code><http://www.w3.org/2000/01/rdf-schema#label></code></td><td><code>"Estado Plurinacional de Bolivia"@es</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/IE></code></td><td><code><http://www.w3.org/2000/01/rdf-schema#label></code></td><td><code>"Ireland"@en</code></td><td><code> </code></td></tr><tr><td><code><http://example.com/IE></code></td><td><code><http://www.w3.org/2000/01/rdf-schema#label></code></td><td><code>"Irlanda"@es</code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D015-1tableSeveralLanguages/r2rmla.ttl">R2RMLTC0015a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
SELECT "Code", "Name", "Lan"
|
|
FROM "Country"
|
|
WHERE "Lan" = 'EN';
|
|
""" ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Code}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdfs:label;
|
|
rr:objectMap [ rr:column "Name"; rr:language "en" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
SELECT "Code", "Name", "Lan"
|
|
FROM "Country"
|
|
WHERE "Lan" = 'ES';
|
|
""" ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Code}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdfs:label;
|
|
rr:objectMap [ rr:column "Name"; rr:language "es" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0015b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0015b"></a><h3 property="dcterms:identifier">R2RMLTC0015b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with language information</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests a term map with rr:language where the value isn't a valid language, which is an error</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#language-tags">#language-tags</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D015-1tableSeveralLanguages/create.sql">D015-1tableSeveralLanguages</a>
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D015-1tableSeveralLanguages/r2rmlb.ttl">R2RMLTC0015b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
SELECT "Code", "Name", "Lan"
|
|
FROM "Country"
|
|
WHERE "Lan" = 'EN';
|
|
""" ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Code}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdfs:label;
|
|
rr:objectMap [ rr:column "Name"; rr:language "english" ]
|
|
]
|
|
.
|
|
|
|
<TriplesMap2>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:sqlQuery """
|
|
SELECT "Code", "Name", "Lan"
|
|
FROM "Country"
|
|
WHERE "Lan" = 'ES';
|
|
""" ] ;
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/{Code}" ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdfs:label;
|
|
rr:objectMap [ rr:column "Name"; rr:language "spanish" ]
|
|
]
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
|
|
<!-- dbi -->
|
|
<div class="div2" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D016-1tableSQLdatatypes" typeof="rdb2rdftest:DataBase">
|
|
<a id="D016-1tableSQLdatatypes"></a><h3>D016-1tableSQLdatatypes</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Graphical representation:</b>
|
|
</p>
|
|
<table class="ex-data"> <caption><b>Patient</b></caption> <tbody><tr><th>ID (PK)<br><small>INTEGER</small></th>
|
|
<th>EntranceDate<br><small>TIMESTAMP</small></th>
|
|
<th>Weight<br><small>DOUBLE</small></th>
|
|
<th>PaidInAdvance<br><small>BOOLEAN</small></th>
|
|
<th>Height<br><small>DOUBLE</small></th>
|
|
<th>FirstName<br><small>VARCHAR(50)</small></th>
|
|
<th>LastName<br><small>VARCHAR(50)</small></th>
|
|
<th>Photo<br><small>BINARY</small></th>
|
|
<th>BirthDate<br><small>DATE</small></th>
|
|
<th>Sex<br><small>VARCHAR(6)</small></th>
|
|
</tr>
|
|
<tr><td><code>10</code></td><td><code>2009-10-10 12:12:22.000000</code></td><td><code>80.25E0</code></td><td><code>FALSE</code></td><td><code>1.65E0</code></td><td><code>Monica</code></td><td><code>Geller</code></td><td><code>x‚Ê </code></td><td><code>1981-10-10</code></td><td><code>female</code></td></tr>
|
|
<tr><td><code>11</code></td><td><code>2008-11-12 09:45:44.000000</code></td><td><code>70.22E0</code></td><td><code>TRUE</code></td><td><code>1.7E0</code></td><td><code>Rachel</code></td><td><code>Green</code></td><td><code>ºÑõ </code></td><td><code>1982-11-12</code></td><td><code>female</code></td></tr>
|
|
<tr><td><code>12</code></td><td><code>2007-03-12 02:13:14.000000</code></td><td><code>90.31E0</code></td><td><code>TRUE</code></td><td><code>1.76E0</code></td><td><code>Chandler</code></td><td><code>Bing</code></td><td><code>Ñ·åû </code></td><td><code>1978-04-06</code></td><td><code>male</code></td></tr>
|
|
</tbody></table>
|
|
<p><b>SQL:</b>
|
|
<pre class="sql">
|
|
CREATE TABLE "Patient" (
|
|
"ID" INTEGER,
|
|
"FirstName" VARCHAR(50),
|
|
"LastName" VARCHAR(50),
|
|
"Sex" VARCHAR(6),
|
|
"Weight" REAL,
|
|
"Height" FLOAT,
|
|
"BirthDate" DATE,
|
|
"EntranceDate" TIMESTAMP,
|
|
"PaidInAdvance" BOOLEAN,
|
|
"Photo" BINARY(20),
|
|
PRIMARY KEY ("ID")
|
|
);
|
|
|
|
INSERT INTO "Patient" ("ID", "FirstName","LastName","Sex","Weight","Height","BirthDate","EntranceDate","PaidInAdvance","Photo")
|
|
VALUES (10,'Monica','Geller','female',80.25,1.65,'1981-10-10','2009-10-10 12:12:22','FALSE',CAST('monica' as BINARY(20)) );
|
|
INSERT INTO "Patient" ("ID", "FirstName","LastName","Sex","Weight","Height","BirthDate","EntranceDate","PaidInAdvance","Photo")
|
|
VALUES (11,'Rachel','Green','female',70.22,1.70,'1982-11-12','2008-11-12 09:45:44','TRUE',CAST('rachel' as BINARY(20)));
|
|
INSERT INTO "Patient" ("ID", "FirstName","LastName","Sex","Weight","Height","BirthDate","EntranceDate","PaidInAdvance","Photo")
|
|
VALUES (12,'Chandler','Bing','male',90.31,1.76,'1978-04-06','2007-03-12 02:13:14','TRUE',CAST('chandler' as BINARY(20)));
|
|
|
|
</pre>
|
|
</p>
|
|
|
|
<p><b>File:</b><a href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/create.sql" target="_blank">D016-1tableSQLdatatypes</a></p>
|
|
|
|
</div>
|
|
|
|
<!-- Direct Graph i -->
|
|
|
|
<!-- R2RML i -->
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0016a" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0016a"></a><h3 property="dcterms:identifier">R2RMLTC0016a</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the rr:termtype and datatype conversions: string and integer</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#datatype-conversions">#datatype-conversions</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/create.sql">D016-1tableSQLdatatypes</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/mappeda.nq">mappeda.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/id></code></td><td><code>"10"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Monica"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Geller"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://xmlns.com/foaf/0.1/gender></code></td><td><code>"female"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/id></code></td><td><code>"11"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Rachel"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Green"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://xmlns.com/foaf/0.1/gender></code></td><td><code>"female"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/id></code></td><td><code>"12"^^<http://www.w3.org/2001/XMLSchema#integer></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://xmlns.com/foaf/0.1/firstName></code></td><td><code>"Chandler"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://xmlns.com/foaf/0.1/lastName></code></td><td><code>"Bing"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://xmlns.com/foaf/0.1/gender></code></td><td><code>"male"^^<http://www.w3.org/2001/XMLSchema#string></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/r2rmla.ttl">R2RMLTC0016a</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Patient" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Patient{ID}"; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicateMap [ rr:constant ex:id; ];
|
|
rr:objectMap [ rr:column "ID"; rr:datatype xsd:integer ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate foaf:firstName;
|
|
rr:objectMap [ rr:column "FirstName"; rr:datatype xsd:string ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate foaf:lastName;
|
|
rr:objectMap [ rr:column "LastName"; rr:datatype xsd:string ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate foaf:gender;
|
|
rr:objectMap [ rr:column "Sex"; rr:datatype xsd:string ]
|
|
];
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0016b" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0016b"></a><h3 property="dcterms:identifier">R2RMLTC0016b</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the rr:termtype and datatype conversions: real and float</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#datatype-conversions">#datatype-conversions</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/create.sql">D016-1tableSQLdatatypes</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/mappedb.nq">mappedb.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/weight></code></td><td><code>"80.25"^^<http://www.w3.org/2001/XMLSchema#real></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/height></code></td><td><code>"1.65"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/weight></code></td><td><code>"70.22"^^<http://www.w3.org/2001/XMLSchema#real></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/height></code></td><td><code>"1.7"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/weight></code></td><td><code>"90.31"^^<http://www.w3.org/2001/XMLSchema#real></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/height></code></td><td><code>"1.76"^^<http://www.w3.org/2001/XMLSchema#float></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/r2rmlb.ttl">R2RMLTC0016b</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Patient" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Patient{ID}"; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:weight;
|
|
rr:objectMap [ rr:column "Weight"; rr:datatype xsd:real ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:height;
|
|
rr:objectMap [ rr:column "Height"; rr:datatype xsd:float ]
|
|
];
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0016c" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0016c"></a><h3 property="dcterms:identifier">R2RMLTC0016c</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the rr:termtype and datatype conversions: date and timestamp</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#datatype-conversions">#datatype-conversions</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/create.sql">D016-1tableSQLdatatypes</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/mappedc.nq">mappedc.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/birthdate></code></td><td><code>"1981-10-10"^^<http://www.w3.org/2001/XMLSchema#date></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/entrancedate></code></td><td><code>"2009-10-10 12:12:22"^^<http://www.w3.org/2001/XMLSchema#dateTime></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/birthdate></code></td><td><code>"1982-11-12"^^<http://www.w3.org/2001/XMLSchema#date></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/entrancedate></code></td><td><code>"2008-11-12 09:45:44"^^<http://www.w3.org/2001/XMLSchema#dateTime></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/birthdate></code></td><td><code>"1978-04-06"^^<http://www.w3.org/2001/XMLSchema#date></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/entrancedate></code></td><td><code>"2007-03-12 02:13:14"^^<http://www.w3.org/2001/XMLSchema#dateTime></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/r2rmlc.ttl">R2RMLTC0016c</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Patient" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Patient{ID}"; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:birthdate;
|
|
rr:objectMap [ rr:column "BirthDate"; rr:datatype xsd:date ]
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:entrancedate;
|
|
rr:objectMap [ rr:column "EntranceDate"; rr:datatype xsd:dateTime ]
|
|
];
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0016d" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0016d"></a><h3 property="dcterms:identifier">R2RMLTC0016d</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the rr:termtype and datatype conversions: boolean</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#datatype-conversions">#datatype-conversions</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/create.sql">D016-1tableSQLdatatypes</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/mappedd.nq">mappedd.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/paid></code></td><td><code>"false"^^<http://www.w3.org/2001/XMLSchema#boolean></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/paid></code></td><td><code>"true"^^<http://www.w3.org/2001/XMLSchema#boolean></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/paid></code></td><td><code>"true"^^<http://www.w3.org/2001/XMLSchema#boolean></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/r2rmld.ttl">R2RMLTC0016d</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Patient" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Patient{ID}"; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:paid;
|
|
rr:objectMap [ rr:column "PaidInAdvance"; rr:datatype xsd:boolean ]
|
|
];
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<div class="div3" about="http://www.w3.org/2001/sw/rdb2rdf/test-cases/#R2RMLTC0016e" typeof="rdb2rdftest:R2RML">
|
|
<a id="R2RMLTC0016e"></a><h3 property="dcterms:identifier">R2RMLTC0016e</h3>
|
|
<p><b>Title:</b><span property="dcterms:title">Table with datatypes</span></p>
|
|
<p><b>Purpose:</b>
|
|
<span property="test:purpose">Tests the rr:termtype and datatype conversions: binary</span>
|
|
</p>
|
|
<p><b>Specification reference:</b>
|
|
<a target="_blank" rel="test:specificationReference" href="http://www.w3.org/TR/2011/WD-r2rml-20110920/#datatype-conversions">#datatype-conversions</a>
|
|
</p>
|
|
<p><b>Review status:</b>
|
|
<span property="test:reviewStatus">http://www.w3.org/2006/03/test-description#unreviewed</span>
|
|
</p>
|
|
<p><b>Input:</b>
|
|
<a target="_blank" rel="rdb2rdftest:database" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/create.sql">D016-1tableSQLdatatypes</a>
|
|
</p>
|
|
<p><b>Expected result:</b>
|
|
<a target="_blank" rel="rdb2rdftest:output" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/mappede.nq">mappede.nq</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<!-- <pre class="rdf"> -->
|
|
<table class="ex-output" style="border-collapse: collapse; border-color: #000000" border="1" cellpadding="5" ><tr><th>Subject</th><th>Predicate</th><th>Object</th><th>Graph</th></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient10></code></td><td><code><http://example.com/id></code></td><td><code>"eILK"^^<http://www.w3.org/2001/XMLSchema#base64Binary></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient11></code></td><td><code><http://example.com/id></code></td><td><code>"utH1"^^<http://www.w3.org/2001/XMLSchema#base64Binary></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://www.w3.org/1999/02/22-rdf-syntax-ns#type></code></td><td><code><http://xmlns.com/foaf/0.1/Person></code></td><td><code> </code></td></tr><tr><td><code><http://example.com/Patient12></code></td><td><code><http://example.com/id></code></td><td><code>"0bfl+w=="^^<http://www.w3.org/2001/XMLSchema#base64Binary></code></td><td><code> </code></td></tr></table>
|
|
<!-- </pre> -->
|
|
</p>
|
|
<p><b>R2RML mapping:</b>
|
|
<a target="_blank" rel="rdb2rdftest:mappingDocument" href="https://dvcs.w3.org/hg/rdb2rdf-tests/file/b65581772625/D016-1tableSQLdatatypes/r2rmle.ttl">R2RMLTC0016e</a>
|
|
</p>
|
|
<p><b>RDF:</b>
|
|
<pre class="mapping">
|
|
@prefix rr: <http://www.w3.org/ns/r2rml#> .
|
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix ex: <http://example.com/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@base <http://mappingpedia.org/rdb2rdf/r2rml/tc/> .
|
|
|
|
|
|
<TriplesMap1>
|
|
a rr:TriplesMap;
|
|
|
|
rr:logicalTable [ rr:tableName "Patient" ];
|
|
|
|
rr:subjectMap [ rr:template "http://example.com/Patient{ID}"; ];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate rdf:type;
|
|
rr:object foaf:Person;
|
|
];
|
|
|
|
rr:predicateObjectMap
|
|
[
|
|
rr:predicate ex:photo;
|
|
rr:objectMap [ rr:column "Photo"; rr:datatype xsd:base64Binary ]
|
|
];
|
|
|
|
.
|
|
|
|
</pre>
|
|
</p>
|
|
</div>
|
|
<!-- dbi-->
|
|
</body>
|
|
</html>
|