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.
1970 lines
81 KiB
1970 lines
81 KiB
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="EN" xml:lang="EN">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>
|
|
Use Cases and Requirements for Mapping Relational Databases to RDF
|
|
</title>
|
|
<style type="text/css">
|
|
/*<![CDATA[*/
|
|
@import url("local.css");
|
|
code { font-family: monospace; }
|
|
|
|
div.constraint,
|
|
div.issue,
|
|
div.note,
|
|
div.notice { margin-left: 2em; }
|
|
|
|
ol.enumar { list-style-type: decimal; }
|
|
ol.enumla { list-style-type: lower-alpha; }
|
|
ol.enumlr { list-style-type: lower-roman; }
|
|
ol.enumua { list-style-type: upper-alpha; }
|
|
ol.enumur { list-style-type: upper-roman; }
|
|
|
|
|
|
div.exampleInner pre { margin-left: 1em;
|
|
margin-top: 0em; margin-bottom: 0em}
|
|
div.exampleOuter {border: 4px double gray;
|
|
margin: 0em; padding: 0em}
|
|
div.exampleInner { background-color: #d5dee3;
|
|
border-top-width: 4px;
|
|
border-top-style: double;
|
|
border-top-color: #d3d3d3;
|
|
border-bottom-width: 4px;
|
|
border-bottom-style: double;
|
|
border-bottom-color: #d3d3d3;
|
|
padding: 4px; margin: 0em }
|
|
div.exampleWrapper { margin: 4px }
|
|
div.exampleHeader { font-weight: bold;
|
|
margin: 4px}
|
|
em.rfc2119 { text-transform: lowercase;
|
|
font-variant: small-caps;
|
|
font-style: normal; }
|
|
/*]]>*/
|
|
</style>
|
|
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-WD.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 name="title" id="title"></a>Use Cases and Requirements for Mapping Relational Databases to RDF
|
|
</h1>
|
|
<h2>
|
|
<a name="w3c-doctype" id="w3c-doctype"></a>W3C Working Draft 8 June 2010
|
|
</h2>
|
|
<dl>
|
|
<dt>
|
|
This version:
|
|
</dt>
|
|
<dd>
|
|
<a href="http://www.w3.org/TR/2010/WD-rdb2rdf-ucr-20100608/">http://www.w3.org/TR/2010/WD-rdb2rdf-ucr-20100608/</a>
|
|
</dd>
|
|
<dt>
|
|
Latest version:
|
|
</dt>
|
|
<dd>
|
|
<a href="http://www.w3.org/TR/rdb2rdf-ucr/">http://www.w3.org/TR/rdb2rdf-ucr/</a>
|
|
</dd>
|
|
<dt>
|
|
Editors:
|
|
</dt>
|
|
<dd>
|
|
Eric Prud'hommeaux, W3C <a href="mailto:eric@w3.org"><eric@w3.org></a>
|
|
</dd>
|
|
<dd>
|
|
Michael Hausenblas, DERI, NUI Galway <a href="mailto:michael.hausenblas@deri.org"><michael.hausenblas@deri.org></a>
|
|
</dd>
|
|
<dt>
|
|
Authors:
|
|
</dt>
|
|
<dd>
|
|
Sören Auer, Universität Leipzig <a href="mailto:auer@informatik.uni-leipzig.de"><auer@informatik.uni-leipzig.de></a>
|
|
</dd>
|
|
<dd>
|
|
Lee Feigenbaum, Cambridge Semantics <a href="mailto:lee@thefigtrees.net"><lee@thefigtrees.net></a>
|
|
</dd>
|
|
<dd>
|
|
Daniel Miranker, University of Texas at Austin <a href="mailto:miranker@cs.utexas.edu"><miranker@cs.utexas.edu></a>
|
|
</dd>
|
|
<dd>
|
|
Angela Fogarolli, University of Trento <a href="mailto:afogarol@disi.unitn.it"><afogarol@disi.unitn.it></a>
|
|
</dd>
|
|
<dd>
|
|
Juan Sequeda, University of Texas at Austin <a href="mailto:jsequeda@cs.utexas.edu"><jsequeda@cs.utexas.edu></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 name="abstract" id="abstract"></a>Abstract
|
|
</h2>
|
|
<p>
|
|
The need to share data with collaborators motivates custodians and users of relational databases (RDB) to expose relational data on the Web of Data. This document examines a set of use cases from science and industry, taking relational data and exposing it in patterns conforming to shared RDF schemata. These use cases expose a set of functional requirements for exposing relational data as RDF in the RDB2RDF Mapping Language (R2RML).
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<h2>
|
|
<a name="status" 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 the First Public Working Draft of the "Use Cases and Requirements for Mapping Relational Databases to RDF" 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 Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
|
|
</p>
|
|
<p>
|
|
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>
|
|
</div>
|
|
<div>
|
|
<h2>
|
|
<a name="scope" id="scope"></a>Scope
|
|
</h2>
|
|
<p>
|
|
Per the <a href="http://www.w3.org/2009/08/rdb2rdf-charter">RDB2RDF charter</a>, the scope of the RDB2RDF Mapping Language (R2RML) is limited to read-only access to the relational database. This means that data can be extracted from the relational database, but not updated.
|
|
</p>
|
|
</div>
|
|
<div class="toc">
|
|
<h2>
|
|
<a name="contents" id="contents"></a>Table of Contents
|
|
</h2>
|
|
<p class="toc">
|
|
1 <a href="#intro">Introduction</a><br />
|
|
1.1 <a href="#intro-whyrdb2rdf">Why Mapping RDBs to RDF?</a><br />
|
|
1.2 <a href="#intro-whystandard">Why a standard RDB2RDF method?</a><br />
|
|
2 <a href="#uc">Use Cases</a><br />
|
|
2.1 <a href="#HCLS">UC1 - Patient Recruitment</a><br />
|
|
2.1.1 <a href="#HCLS-query">Queries Over the RDF Graph</a><br />
|
|
2.1.2 <a href="#HCLS-req">Derived Requirements</a><br />
|
|
2.2 <a href="#WP">UC2 - Web applications (Wordpress)</a><br />
|
|
2.2.1 <a href="#WP-query">Queries Over the RDF Graph</a><br />
|
|
2.2.2 <a href="#WP-req">Derived Requirements</a><br />
|
|
2.3 <a href="#tax">UC3 - Integrating Enterprise Relational databases for tax control</a><br />
|
|
2.3.1 <a href="#tax-query">Querying</a><br />
|
|
2.3.2 <a href="#tax-req">Derived Requirements</a><br />
|
|
2.4 <a href="#rCAD">UC4 - rCAD: RNA Comparative Analysis Database</a><br />
|
|
2.4.1 <a href="#d1e859">Expose Relational Data as RDF when there is no existing Domain Ontology to map the relational schema to</a><br />
|
|
2.4.2 <a href="#d1e876">Expose Mapping a Relational Database to an OWL DL ontology</a><br />
|
|
2.4.3 <a href="#rCAD-req">Derived Requirements</a><br />
|
|
3 <a href="#reqs">Requirements</a><br />
|
|
3.1 <a href="#reqs-core">Core Requirements</a><br />
|
|
3.1.1 <a href="#DIRECT">DIRECT - Direct Mapping</a><br />
|
|
3.1.2 <a href="#TRANSFORM">TRANSFORM - Transformative Mapping</a><br />
|
|
3.1.3 <a href="#GUIDGEN">GUIDGEN - Generation of Globally Unique Identifiers</a><br />
|
|
3.1.4 <a href="#SQLGEN">SQLGEN - Query Translation</a><br />
|
|
3.1.5 <a href="#ETL">ETL - Extract-Transform-Load</a><br />
|
|
3.1.6 <a href="#DATATYPES">DATATYPES - Datatypes</a><br />
|
|
3.1.7 <a href="#VSDATATYPES">VSDATATYPES - Database Vendor Specific Datatypes</a><br />
|
|
3.1.8 <a href="#RENAMECOL">RENAMECOL - Ability to Rename SQL Column Names</a><br />
|
|
3.1.9 <a href="#APPLYFUNCTIONBEFOREMAP">APPLYFUNCTION - Apply a Function before Mapping</a><br />
|
|
3.1.10 <a href="#Exposing_many-to-many_join_tables_as_simple_triples">MANYTOMANY - Exposing many-to-many join tables as simple triples</a><br />
|
|
3.1.11 <a href="#CLASSESFROMATTRIBVALUES">CLASSESFROMATTRIBVALUES - Creating Classes based on Attribute Values</a><br />
|
|
3.2 <a href="#reqs-optional">Optional Requirements</a><br />
|
|
3.2.1 <a href="#NAMEDGRAPH">NAMEDGRAPH - Named Graphs</a><br />
|
|
3.2.2 <a href="#NSDECL">NSDECL - Namespace declaration</a><br />
|
|
3.2.3 <a href="#METADATA">METADATA - Static Metadata</a><br />
|
|
3.2.4 <a href="#PROVENANCE">PROVENANCE - Provenance</a><br />
|
|
3.2.5 <a href="#UPDATES">UPDATES - Update Logs</a><br />
|
|
4 <a href="#ack">Acknowledgments</a><br />
|
|
5 <a href="#refs">References</a><br />
|
|
</p>
|
|
<h3>
|
|
<a name="appendices" id="appendices"></a>Appendices
|
|
</h3>
|
|
<p class="toc">
|
|
A <a href="#glossary">Glossary</a> (Non-Normative)<br />
|
|
B <a href="#approaches">RDB2RDF Mapping Approaches</a> (Non-Normative)<br />
|
|
B.1 <a href="#justDirect">Direct Mapping</a><br />
|
|
B.2 <a href="#databaseToOntology">Direct Mapping Plus Ontology Mapping</a><br />
|
|
B.3 <a href="#directPlusOnt">Database to Ontology Mapping</a><br />
|
|
</p>
|
|
</div>
|
|
<hr />
|
|
<div class="body">
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="intro" id="intro"></a>1 Introduction
|
|
</h2>
|
|
<p>
|
|
The majority of dynamic Web content is backed by relational databases (RDB), and so are many enterprise systems <a href="#DynaWebSites">[DynaWebSites]</a>. On the other hand, in order to expose structured data on the Web, Resource Description Framework (RDF) <a href="#RDF">[RDF]</a> is used. This document reviews use cases and requirements for a <em>relational database to RDF mapping</em> (RDB2RDF) with the following structure:
|
|
</p>
|
|
<ol class="enumar">
|
|
<li>The remainder of this section motivates why mapping RDBs to RDF is necessary and needed and highlights the importance of a standard.
|
|
</li>
|
|
<li>In the next section RDB2RDF <a href="#uc">use cases</a> are reviewed.
|
|
</li>
|
|
<li>The last section discusses <a href="#reqs">requirements</a> regarding a RDB2RDF mapping language, driven by an analysis of the aforementioned use cases.
|
|
</li>
|
|
</ol>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="intro-whyrdb2rdf" id="intro-whyrdb2rdf"></a>1.1 Why Mapping RDBs to RDF?
|
|
</h3>
|
|
<p>
|
|
The Web of Data is constantly growing due to its compelling potential of facilitating data integration and retrieval. At the same time however, RDB systems host a vast amount of structured data in relational tables augmented with integrity constraints. In order to make this huge amount of relational data available for the Web of Data, a connection must be established between RDBs and a format suitable for the Web of Data.
|
|
</p>
|
|
<p>
|
|
The advantages of creating an <em>RDF view</em> of relational data are inherited from the Web of Data and can be summarized based on the tasks they facilitate:
|
|
</p>
|
|
<ul>
|
|
<li>
|
|
<em>Integration</em>: data in different RDBs can be integrated using RDF semantics and mechanisms; in this sense, the Web of Data can be imagined as one big database. Moreover, information in the database can be integrated with information that comes from other data sources.
|
|
</li>
|
|
<li>
|
|
<em>Retrieval</em>: once data are published in the Web of Data (as opposed to relational databases), queries can span different data sources and more powerful retrieval methods can be built.
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
RDF data in the Web should be defined and linked in a way that makes it accessible for humans and machines <a href="#LinkedData">[LinkedData]</a>. The Web of data is a scalable environment with explicit semantics where not only humans can navigate information, but also machines are able to find connections and use them to navigate through the information space. In order to realise this global information space, we need to:
|
|
</p>
|
|
<ul>
|
|
<li>follow a common model to describe, connect and access resources;
|
|
</li>
|
|
<li>name resources in an unambiguous way
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
The most common way to publish resources in the Web of Data follows the RDF model <a href="#RDF">[RDF]</a> and uses Uniform Resource Identifiers (<a href="#URI">[URI]</a>) for resource identification, thereby facilitating the creation of a comprehensive and flexible resource description.
|
|
</p>
|
|
<p>
|
|
In the following, we will use <em>RDB2RDF</em> to denote any technique that takes as an input a RDB (schema and data) and produces one or more RDF graphs, as depicted in the following figure:
|
|
</p>
|
|
<div>
|
|
<img src="rdb2rdf_principle.png" alt="RDB2RDF principle" />
|
|
</div>
|
|
<p>
|
|
The consumer of the RDF Graph (virtual or materialized) essentially can access the RDF data in different ways:
|
|
</p>
|
|
<ol class="enumar">
|
|
<li>
|
|
<em>Query</em> access, which means the agent issues a SPARQL query against an endpoint exposed by the system and processes the results (typically the result is a SPARQL result set in XML or JSON);
|
|
</li>
|
|
<li>
|
|
<em>Entity-level</em> access, which means the agent performs an HTTP <code>GET</code> on a URI exposed by the system and processes the result (typically the result is an RDF graph);
|
|
</li>
|
|
<li>
|
|
<em>Dump</em> access, which means the agent performs an HTTP <code>GET</code> on dump of the entire RDF graph, for example in Extract, Transform, and Load (ETL) processes.
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="intro-whystandard" id="intro-whystandard"></a>1.2 Why a standard RDB2RDF method?
|
|
</h3>
|
|
<p>
|
|
With the advent of the Web of Data, researcher and practitioners have compared the RDB model and the RDF model <a href="#RDB-RDF">[RDB-RDF]</a> and surveyed different approaches to map them <a href="#RDBMSMapping">[RDBMSMapping]</a>. As noted in the survey on existing RDB2RDF mapping approaches <a href="#RDB2RDFSurvey">[RDB2RDFSurvey]</a>, a couple of proposals on how to tackle the RDB2RDF mapping issues are known.
|
|
</p>
|
|
<p>
|
|
Use of a standard for mapping language for RDB to RDF may allow use of a single mapping specification in the context of mirroring of schema and (possibly some or all of the) data in various databases, possibly from different vendors (e.g., Oracle database, MySQL, etc.) and located at various sites. Similarly structured data (that is, data stored using same schema) is useful in many different organizations often located in different parts of the world. These organizations may employ databases from different vendors due to one or more of many possible factors (such as, licensing cost, resource constraints, availability of useful tools and applications and of appropriate database administrators, etc.). Presence of a standard RDB2RDF mapping language allows creation and use of a single mapping specification against each of the hosting databases to present a single (virtual or materialized) RDF view of the relational data hosted in those databases and this RDF view can then be queried by applications using SPARQL query or protocol.
|
|
</p>
|
|
<p>
|
|
Another reason for a standard is to allow easy migration between different systems. Just as a single web-page in HTML can be viewed by two different Web browsers from different vendors, a single RDB2RDF mapping standard should allow a user from one database to expose their data as RDF, and then, when they export their data to another database, allow the newly imported data to be queried as RDF without changing the mapping file. For example, imagine that a database administrator is exposing weather data as Linked Data to be consumed by other applications. At first, this weather data is stored in a light-weight database (such as MySQL). However, as more and more weather data is collected, and more and more users access the Web data, the light-weight database may have difficulty scaling. Therefore, the database administrator migrates their database to a more heavy-weight database (such as Oracle Database 11g). Of course, the database administrator does not want to re-create the ability to view the data as RDF using a vendor-specific mapping file, but instead wants to seamlessly migrate the view of their data as RDF.
|
|
</p>
|
|
<p>
|
|
A standardized mapping between relational data and RDF allows the database administrator to migrate the view of their data as RDF across databases, allowing the vendors to compete on functionality and features rather than forcing database administrators to rewrite their entire relational data to RDF mapping when they want to migrate their data from one database to another.
|
|
</p>
|
|
<p>
|
|
Another motivation for a standard is that for certain classes of systems (such as CMS) a 'default' mapping could be defined which can be deployed no matter what underlying RDB is used. As these systems, such as Drupal or Wordpress, can be run on top of different underlying relational databases. A standardized way of mapping between relational data and RDF hence allows the underlying database to be changed without disturbing the content management system.
|
|
</p>
|
|
<p>
|
|
Further, having a standard mapping would simplify programming applications that access multiple database sources.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="uc" id="uc"></a>2 Use Cases
|
|
</h2>
|
|
<p>
|
|
With integration of relational data from one RDB with various kinds of data (such as relational, spreadsheets, CSV, unstructured text, etc.), the use cases presented in the following fall into one or more of the following categories:
|
|
</p>
|
|
<ol class="enumar">
|
|
<li>I want to integrate my RDB with another structured source (RDB, XLS, CSV, etc.), so I'll convert my RDB to RDF and assume my other structured source can also be in RDF. See <a href="#HCLS">UC1</a>, <a href="#tax">UC3</a>.
|
|
</li>
|
|
<li>I want to integrate my RDB with existing RDF on the web (Linked Data), so I'll convert my RDB to RDF and then I'm able to link and integrate. See <a href="#WP">UC2</a>, <a href="#rCAD">UC4</a>.
|
|
</li>
|
|
<li>I want to integrate my RDB with unstructured data (HTML, PDF, etc.), so I'll convert my RDB to RDF and assume my other unstructured source can also be in RDF.
|
|
</li>
|
|
<li>I want my RDB data to be available for SPARQL or other RDF-based querying, and/or for others to integrate with other data sources (structured, RDF, unstructured). See <a href="#WP">UC2</a>, <a href="#rCAD">UC4</a>.
|
|
</li>
|
|
</ol>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="HCLS" id="HCLS"></a>2.1 UC1 - Patient Recruitment
|
|
</h3>
|
|
<p>
|
|
The <a href="http://esw.w3.org/HCLSIG">Semantic Web for Health Care and Life Sciences Interest Group</a> has created several demonstrators using SPARQL to query clinical and biological relational databases. Included is the database structure, sample data, and a SPARQL query. Following are six tables of sample diabetic patient data extracted from the University of Texas Health Science Center. Some columns have been omitted from this use case for brevity.
|
|
</p>
|
|
<p>
|
|
Accompanying each table are two RDF views (represented in Turtle) corresponding to <em style="background-color: rgb(238, 238, 255);">HL7/RIM</em> and <em style="background-color: rgb(238, 255, 238);">CDISK SDTM</em> ontology in RDFS. While there are many motivations for providing a common interface to administer distinct databases (access to patient history, shared rules for clinical decision support, etc.), in this case, SPARQL queries (following the table description) were used to find candidates for clinical studies. For these RDF graphs, the following namespaces apply:
|
|
</p>
|
|
<pre>
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix hl7: <http://www.hl7.org/v3ballot/xml/infrastructure/vocabulary/vocabulary#> .
|
|
@prefix stdm: <http://www.sdtm.org/vocabulary#> .
|
|
|
|
</pre><em>Person</em>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
ID
|
|
</th>
|
|
<th>
|
|
SexDE
|
|
</th>
|
|
<th>
|
|
DateOfBirth
|
|
</th>
|
|
<th>
|
|
LastEditedDTTM
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1234561
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
1983-01-02 00:00:00
|
|
</td>
|
|
<td>
|
|
2007-11-13 15:49:20
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1234562
|
|
</td>
|
|
<td>
|
|
3
|
|
</td>
|
|
<td>
|
|
1963-12-27 00:00:00
|
|
</td>
|
|
<td>
|
|
2008-01-30 17:08:42
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1234563
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
1983-02-25 00:00:00
|
|
</td>
|
|
<td>
|
|
2007-03-10 06:01:55
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<pre style="background-color: rgb(238, 238, 255);">
|
|
<http://hospital.example/DB/Person/ID.1234561#record> a hl7:Person ;
|
|
hl7:administrativeGenderCodePrintName Sex_DE:M ;
|
|
hl7:livingSubjectBirthTime "1983-01-02T00:00:00Z"^^xsd:dateTime .
|
|
|
|
<http://hospital.example/DB/Person/ID.1234562#record> a hl7:Person ;
|
|
hl7:administrativeGenderCodePrintName Sex_DE:F ;
|
|
hl7:livingSubjectBirthTime "1963-12-27T00:00:00Z"^^xsd:dateTime .
|
|
<http://hospital.example/DB/Person/ID.1234563#record> a hl7:Person ;
|
|
hl7:administrativeGenderCodePrintName Sex_DE:M ;
|
|
hl7:livingSubjectBirthTime "1983-02-25T00:00:00Z"^^xsd:dateTime .
|
|
</pre>
|
|
<pre style="background-color: rgb(238, 255, 238);">
|
|
<http://hospital.example/DB/Person/ID.1234561#record> a sdtm:Patient ;
|
|
stdm:dateTimeOfBirth "1983-01-02T00:00:00Z"^^xsd:dateTime .
|
|
<http://hospital.example/DB/Person/ID.1234562#record> a sdtm:Patient ;
|
|
sdtm:dateTimeOfBirth "1963-12-27T00:00:00Z"^^xsd:dateTime ;
|
|
sdtm:sex <http://hospital.example/DB/Sex_DE#F> .
|
|
<http://hospital.example/DB/Person/ID.1234563#record> a sdtm:Patient ;
|
|
sdtm:dateTimeOfBirth "1983-02-25T00:00:00Z"^^xsd:dateTime ;
|
|
sdtm:sex <http://hospital.example/DB/Sex_DE#F> .
|
|
|
|
</pre><em>Sex_DE</em>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
ID
|
|
</th>
|
|
<th>
|
|
EntryCode
|
|
</th>
|
|
<th>
|
|
EntryName
|
|
</th>
|
|
<th>
|
|
EntryMnemonic
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
1
|
|
</td>
|
|
<td>
|
|
Male
|
|
</td>
|
|
<td>
|
|
M
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
3
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
Female
|
|
</td>
|
|
<td>
|
|
F
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<pre style="background-color: rgb(238, 238, 255);">
|
|
<http://hospital.example/DB/Zex_DE/ID.2#record>
|
|
|
|
hl7:administrativeGenderCodePrintName "Male"@en-us ;
|
|
Sex_DE:EntryMnemonic "M"@en-us .
|
|
<http://hospital.example/DB/Zex_DE/ID.3#record>
|
|
hl7:administrativeGenderCodePrintName "Female"@en-us ;
|
|
Sex_DE:EntryMnemonic "F"@en-us .
|
|
</pre>
|
|
<pre style="background-color: rgb(238, 255, 238);">
|
|
<http://hospital.example/DB/Person/ID.1234561#record>
|
|
stdm:sex <http://hospital.example/DB/Sex_DE#M> .
|
|
<http://hospital.example/DB/Person/ID.1234562#record>
|
|
stdm:sex <http://hospital.example/DB/Sex_DE#F> .
|
|
|
|
<http://hospital.example/DB/Person/ID.1234563#record>
|
|
stdm:sex <http://hospital.example/DB/Sex_DE#M> .
|
|
|
|
</pre><em>Item_Medication</em>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
ID
|
|
</th>
|
|
<th>
|
|
PatientID
|
|
</th>
|
|
<th>
|
|
ItemType
|
|
</th>
|
|
<th>
|
|
PerformedDTTM
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
99999999002
|
|
</td>
|
|
<td>
|
|
1234561
|
|
</td>
|
|
<td>
|
|
ME
|
|
</td>
|
|
<td>
|
|
2007-09-28 00:00:00
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
99999999003
|
|
</td>
|
|
<td>
|
|
1234562
|
|
</td>
|
|
<td>
|
|
ME
|
|
</td>
|
|
<td>
|
|
2007-09-28 00:00:00
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
99999999004
|
|
</td>
|
|
<td>
|
|
1234562
|
|
</td>
|
|
<td>
|
|
ME
|
|
</td>
|
|
<td>
|
|
2008-07-28 00:00:00
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<pre style="background-color: rgb(238, 238, 255);">
|
|
<http://hospital.example/DB/Person/ID.1234561#record>
|
|
|
|
hl7:substanceAdministration <http://hospital.example/DB/Item_Medication/ID.99999999002#record> .
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999002#record>
|
|
a hl7:SubstanceAdministration ;
|
|
hl7:effectiveTime _:t1 .
|
|
_:t1 hl7:start "2007-09-28T00:00:00"^^xsd:dateTime .
|
|
<http://hospital.example/DB/Person/ID.1234562#record>
|
|
|
|
hl7:substanceAdministration <http://hospital.example/DB/Item_Medication/ID.99999999003#record> ;
|
|
hl7:substanceAdministration <http://hospital.example/DB/Item_Medication/ID.99999999004#record> .
|
|
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999003#record>
|
|
a hl7:SubstanceAdministration ;
|
|
hl7:effectiveTime _:t2 .
|
|
_:t2 hl7:start "2007-09-28T00:00:00"^^xsd:dateTime .
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999004#record>
|
|
a hl7:SubstanceAdministration ;
|
|
hl7:effectiveTime _:t3 .
|
|
_:t3 hl7:start "2008-07-28T00:00:00"^^xsd:dateTime .
|
|
|
|
</pre><em>Medication</em>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
ID
|
|
</th>
|
|
<th>
|
|
ItemID
|
|
</th>
|
|
<th>
|
|
Dose
|
|
</th>
|
|
<th>
|
|
Refill
|
|
</th>
|
|
<th>
|
|
QuantityToDispense
|
|
</th>
|
|
<th>
|
|
DaysToTake
|
|
</th>
|
|
<th>
|
|
PrescribedByID
|
|
</th>
|
|
<th>
|
|
MedDictDE
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
88888888002
|
|
</td>
|
|
<td>
|
|
99999999002
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
6
|
|
</td>
|
|
<td>
|
|
180
|
|
</td>
|
|
<td>
|
|
45
|
|
</td>
|
|
<td>
|
|
1004682
|
|
</td>
|
|
<td>
|
|
132139
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
88888888003
|
|
</td>
|
|
<td>
|
|
99999999002
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
0
|
|
</td>
|
|
<td>
|
|
180
|
|
</td>
|
|
<td>
|
|
45
|
|
</td>
|
|
<td>
|
|
1004683
|
|
</td>
|
|
<td>
|
|
132139
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
88888888004
|
|
</td>
|
|
<td>
|
|
99999999003
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
6
|
|
</td>
|
|
<td>
|
|
180
|
|
</td>
|
|
<td>
|
|
45
|
|
</td>
|
|
<td>
|
|
1004682
|
|
</td>
|
|
<td>
|
|
132139
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
88888888005
|
|
</td>
|
|
<td>
|
|
99999999004
|
|
</td>
|
|
<td>
|
|
4
|
|
</td>
|
|
<td>
|
|
6
|
|
</td>
|
|
<td>
|
|
180
|
|
</td>
|
|
<td>
|
|
45
|
|
</td>
|
|
<td>
|
|
1004682
|
|
</td>
|
|
<td>
|
|
132139
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<pre style="background-color: rgb(238, 238, 255);">
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999002#record>
|
|
|
|
hl7:consumable <http://hospital.example/DB/Medication_DE/ID.132139#record> .
|
|
_:t1 hl7:durationInDays 45 .
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999003#record>
|
|
|
|
hl7:consumable <http://hospital.example/DB/Medication_DE/ID.132139#record> .
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999004#record>
|
|
hl7:consumable <http://hospital.example/DB/Medication_DE/ID.132139#record> .
|
|
_:t2 hl7:durationInDays 45 .
|
|
|
|
<http://hospital.example/DB/Item_Medication/ID.99999999005#record>
|
|
hl7:consumable <http://hospital.example/DB/Medication_DE/ID.132139#record> .
|
|
_:t3 hl7:durationInDays 45 .
|
|
|
|
</pre><em>Medication_DE</em>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
ID
|
|
</th>
|
|
<th>
|
|
Entry
|
|
</th>
|
|
<th>
|
|
EntryCode
|
|
</th>
|
|
<th>
|
|
EntryName
|
|
</th>
|
|
<th>
|
|
NDC
|
|
</th>
|
|
<th>
|
|
Strength
|
|
</th>
|
|
<th>
|
|
Form
|
|
</th>
|
|
<th>
|
|
UnitOfMeasure
|
|
</th>
|
|
<th>
|
|
DrugName
|
|
</th>
|
|
<th>
|
|
DisplayName
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
132139
|
|
</td>
|
|
<td>
|
|
131933
|
|
</td>
|
|
<td>
|
|
98630
|
|
</td>
|
|
<td>
|
|
GlipiZIDE-Metformin HCl 2.5-250 MG Tablet
|
|
</td>
|
|
<td>
|
|
54868079500
|
|
</td>
|
|
<td>
|
|
2.5-250
|
|
</td>
|
|
<td>
|
|
TABS
|
|
</td>
|
|
<td>
|
|
MG
|
|
</td>
|
|
<td>
|
|
GlipiZIDE-Metformin HCl
|
|
</td>
|
|
<td>
|
|
GlipiZIDE-Metformin HCl 2.5-250 MG Tablet
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<pre style="background-color: rgb(238, 238, 255);">
|
|
<http://hospital.example/DB/Medication_DE/ID.132139#record>
|
|
|
|
hl7:displayName "GlipiZIDE-Metformin HCl 2.5-250 MG Tablet" .
|
|
</pre><em>NDCcodes</em>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
ingredient
|
|
</th>
|
|
<th>
|
|
RxCUI
|
|
</th>
|
|
<th>
|
|
labelType
|
|
</th>
|
|
<th>
|
|
name
|
|
</th>
|
|
<th>
|
|
NDC
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
6809
|
|
</td>
|
|
<td>
|
|
351273
|
|
</td>
|
|
<td>
|
|
Clinical
|
|
</td>
|
|
<td>
|
|
Glipizide 2.5 MG / Metformin 500 MG Oral Tablet
|
|
</td>
|
|
<td>
|
|
54868079500
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<pre style="background-color: rgb(238, 238, 255);">
|
|
<http://hospital.example/DB/Medication_DE/ID.132139#record>
|
|
spl:activeIngredient _:i1 .
|
|
_:i1 spl:classCode 54868079500 .
|
|
|
|
</pre>
|
|
<pre style="background-color: rgb(238, 255, 238);">
|
|
[ a sdtm:ConcomitantMedication ;
|
|
sdtm:subject <http://hospital.example/DB/Person/ID.1234561#record> ;
|
|
sdtm:standardizedMedicationName "GlipiZIDE-Metformin HCl 2.5-250 MG Tablet" ;
|
|
hl7:activeIngredient [hl7:classCode 54868079500 ] ;
|
|
sdtm:startDateTimeOfMedication "2007-09-28 00:00:00"^^xsd:dateTime ] .
|
|
|
|
[ a sdtm:ConcomitantMedication ;
|
|
sdtm:subject <http://hospital.example/DB/Person/ID.1234562#record> ;
|
|
sdtm:standardizedMedicationName "GlipiZIDE-Metformin HCl 2.5-250 MG Tablet" ;
|
|
hl7:activeIngredient [ hl7:classCode 54868079500 ] ;
|
|
sdtm:startDateTimeOfMedication "2007-09-28 00:00:00"^^xsd:dateTime ] .
|
|
|
|
[ a sdtm:ConcomitantMedication ;
|
|
sdtm:subject <http://hospital.example/DB/Person/ID.1234562#record> ;
|
|
sdtm:standardizedMedicationName "GlipiZIDE-Metformin HCl 2.5-250 MG Tablet" ;
|
|
hl7:activeIngredient [ hl7:classCode 54868079500 ] ;
|
|
sdtm:startDateTimeOfMedication "2008-07-28 00:00:00"^^xsd:dateTime ] .
|
|
|
|
</pre>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="HCLS-query" id="HCLS-query"></a>2.1.1 Queries Over the RDF Graph
|
|
</h4>
|
|
<p>
|
|
The use case can be realised as a SPARQL query over the RDF graphs. The following is a SPARQL query, which extracts patients taking a particular class of medication, an anticoagulant, and not another (weight loss, here).
|
|
</p>
|
|
<pre>
|
|
PREFIX sdtm: <http://www.sdtm.org/vocabulary#>
|
|
PREFIX spl: <http://www.hl7.org/v3ballot/xml/infrastructure/vocabulary/vocabulary#>
|
|
|
|
SELECT ?patient ?dob ?sex # ?takes ?indicDate ?indicEnd ?contra
|
|
WHERE {
|
|
?patient a sdtm:Patient ;
|
|
sdtm:middleName ?middleName ;
|
|
sdtm:dateTimeOfBirth ?dob ;
|
|
sdtm:sex ?sex .
|
|
|
|
[ sdtm:subject ?patient ;
|
|
sdtm:standardizedMedicationName ?takes ;
|
|
|
|
spl:activeIngredient [ spl:classCode 6809 ] ;
|
|
sdtm:startDateTimeOfMedication ?indicDate
|
|
] .
|
|
OPTIONAL {
|
|
[ sdtm:subject ?patient ;
|
|
sdtm:standardizedMedicationName ?disqual ;
|
|
spl:activeIngredient [ spl:classCode 11289 ]
|
|
sdtm:startDateTimeOfMedication ?indicDate
|
|
] }
|
|
} LIMIT 30
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="HCLS-req" id="HCLS-req"></a>2.1.2 Derived Requirements
|
|
</h4>
|
|
<p>
|
|
This use case leads to the following requirements:
|
|
</p>
|
|
<ul>
|
|
<li>Map relational data to an RDF schema derived from the relational schema.
|
|
</li>
|
|
<li>Create a virtual RDF view that is used to translate SPARQL queries over the RDF views to SQL queries over the relational data.
|
|
</li>
|
|
<li>Mapping of relational data types to RDF/XML datatypes, for example, SQL date/time formats to XML Schema date/time formats.
|
|
</li>
|
|
<li>Mapping column names to RDF property names, for example, the column <code>DaysToTake</code> from the <code>Medication</code> table is mapped to <code>hl7:durationInDays</code>.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="WP" id="WP"></a>2.2 UC2 - Web applications (Wordpress)
|
|
</h3>
|
|
<p>
|
|
In order to make the Web of Data useful to ordinary Web users, RDF and OWL have to be deployed on the Web on a much larger scale. Web applications such as Content Management Systems, online shops or community applications (e.g. Wikis, blogs, forums) already store their data in relational databases. Providing a standardized way to map the relational data and schema behind these Web applications into RDF, RDF-Schema and OWL will facilitate novel semantic browsing and search applications.
|
|
</p>
|
|
<p>
|
|
By supporting the long tail of Web applications and thus counteracting the centralization of the Web 2.0 applications, the planned RDB2RDF standardization will help to give control over data back to end-users and thus promote a democratization of the Web.
|
|
</p>
|
|
<p>
|
|
To support this use case, the mapping language should be easily implementable for lightweight Web applications and have a shallow learning curve to foster early adoption by Web developers.
|
|
</p>
|
|
<p>
|
|
We illustrate this use case with the example of Wordpress. <a href="http://wordpress.org/" class="external text" title="http://wordpress.org/">Wordpress</a> is a popular blogging Web application and installed on tens of thousands of Web servers. Wordpress used a relational database (MySQL) with a relatively simple schema:
|
|
</p><img src="wp_schema.png" alt="Wordpress SQL Schema" />
|
|
<p>
|
|
Wordpress SQL Schema:
|
|
</p>
|
|
<ul>
|
|
<li>
|
|
<a href="http://www.w3.org/2001/sw/rdb2rdf/wiki/images/1/11/Wordpress_blog.sql.txt" class="external text" title="http://www.w3.org/2001/sw/rdb2rdf/wiki/images/1/11/Wordpress_blog.sql.txt">SQL Schema</a>
|
|
</li>
|
|
<li>
|
|
<a href="http://www.w3.org/2001/sw/rdb2rdf/wiki/images/5/53/Aksw_blog.sql.txt" class="external text" title="http://www.w3.org/2001/sw/rdb2rdf/wiki/images/5/53/Aksw_blog.sql.txt">SQL Schema and complete data of blog.aksw.org</a>
|
|
</li>
|
|
<li>
|
|
<a href="http://www.w3.org/2001/sw/rdb2rdf/wiki/images/5/57/Aksw-blog.nt.txt" class="external text" title="http://www.w3.org/2001/sw/rdb2rdf/wiki/images/5/57/Aksw-blog.nt.txt">NTriples export of the above database</a> created using <a href="http://Triplify.org" class="external text" title="http://Triplify.org">Triplify</a>
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
A mapping should be able to reuse existing vocabularies.
|
|
</p>
|
|
<p>
|
|
Mapped to RDF the resulting ontology should contain the classes post, attachment, tag, category, user and comment. An example instance of the post class, for example, should look like:
|
|
</p>
|
|
<pre>
|
|
@prefix sioc: <http://rdfs.org/sioc/ns#> .
|
|
@prefix dc: <http://purl.org/dc/terms/> .
|
|
@prefix dc11: <http://purl.org/dc/elements/1.1/> .
|
|
|
|
<<a href="http://blog.aksw.org/triplify/post/8" class="external free" title="http://blog.aksw.org/triplify/post/8">http://blog.aksw.org/triplify/post/8</a>> <a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" class="external free" title="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">a</a> <a href="http://rdfs.org/sioc/ns#Post" class="external free" title="http://rdfs.org/sioc/ns#Post">sioc:Post</a> .
|
|
|
|
<<a href="http://blog.aksw.org/triplify/post/8" class="external free" title="http://blog.aksw.org/triplify/post/8">http://blog.aksw.org/triplify/post/8</a>> <a href="http://rdfs.org/sioc/ns#has_creator" class="external free" title="http://rdfs.org/sioc/ns#has_creator">sioc:has_creator</a> <<a href="http://blog.aksw.org/triplify/user/5" class="external free" title="http://blog.aksw.org/triplify/user/5">http://blog.aksw.org/triplify/user/5</a>> .
|
|
<<a href="http://blog.aksw.org/triplify/post/8" class="external free" title="http://blog.aksw.org/triplify/post/8">http://blog.aksw.org/triplify/post/8</a>> <a href="http://purl.org/dc/terms/created" class="external free" title="http://purl.org/dc/terms/created">dc:created</a> "2007-02-27T17:23:36"^^<<a href="http://www.w3.org/2001/XMLSchema#dateTime" class="external free" title="http://www.w3.org/2001/XMLSchema#dateTime">http://www.w3.org/2001/XMLSchema#dateTime</a>> .
|
|
|
|
<<a href="http://blog.aksw.org/triplify/post/8" class="external free" title="http://blog.aksw.org/triplify/post/8">http://blog.aksw.org/triplify/post/8</a>> <a href="http://purl.org/dc/elements/1.1/title" class="external free" title="http://purl.org/dc/elements/1.1/title">dc11:title</a> "Submissions open: 3rd Workshop on Scripting for the Semantic Web" .
|
|
|
|
<<a href="http://blog.aksw.org/triplify/post/8" class="external free" title="http://blog.aksw.org/triplify/post/8">http://blog.aksw.org/triplify/post/8</a>> <a href="http://rdfs.org/sioc/ns#content" class="external free" title="http://rdfs.org/sioc/ns#content">sioc:content</a> "The submissions web-site is now open for the 3rd Workshop on Scripting for the Semantic Web..." .
|
|
<<a href="http://blog.aksw.org/triplify/post/8" class="external free" title="http://blog.aksw.org/triplify/post/8">http://blog.aksw.org/triplify/post/8</a>> <a href="http://purl.org/dc/terms/modified" class="external free" title="http://purl.org/dc/terms/modified">dc:modified</a> "2008-02-22T21:41:00"^^<<a href="http://www.w3.org/2001/XMLSchema#dateTime" class="external free" title="http://www.w3.org/2001/XMLSchema#dateTime">http://www.w3.org/2001/XMLSchema#dateTime</a>> .
|
|
|
|
</pre>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="WP-query" id="WP-query"></a>2.2.1 Queries Over the RDF Graph
|
|
</h4>
|
|
<p>
|
|
An example SPARQL query on the resulting ontology could be:
|
|
</p>
|
|
<pre>
|
|
SELECT ?name, ?title
|
|
WHERE {
|
|
?post rdf:type sioc:Post .
|
|
?post dc:title ?title .
|
|
?post dc:has_creator ?author
|
|
?author foaf:name ?name
|
|
}
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="WP-req" id="WP-req"></a>2.2.2 Derived Requirements
|
|
</h4>
|
|
<p>
|
|
This use case leads to the following requirements:
|
|
</p>
|
|
<ul>
|
|
<li>Support Extract-Transform-Load (ETL) for the created RDF by the mapping.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="tax" id="tax"></a>2.3 UC3 - Integrating Enterprise Relational databases for tax control
|
|
</h3>
|
|
<p>
|
|
Integrating relational databases and exposing them on the Web or Intranet requires the re-use of unique identifiers in order to integrate and interlink data about entities on different databases.
|
|
</p>
|
|
<p>
|
|
The re-use of unique identifiers allows:
|
|
</p>
|
|
<ul>
|
|
<li>Joins between entities described in different databases.
|
|
</li>
|
|
<li>Join structured data (SQL) to structured data, from incompatible schema, or where data is dirty, poorly normalized, lacking proper keys/indices.
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
This use case is a pilot project for the Trentino region tax agency. Trentino is an autonomous region in the north of Italy. The region has a population of 1 million people and more than 200 municipalities with their own information systems. The goal of is to integrate and link tax related data about people, organizations, buildings, etc. This data come from different databases especially from the region's many municipalities, each with their own individual data structures.
|
|
</p>
|
|
<p>
|
|
The re-use of unique identifiers will provide a lightweight method for aggregating the data. In this way we are providing a tax agent an intelligent tool for navigating through the data present in the many different databases. Using unique identifiers, a tool can aggregate data and create a profile for each tax payer. Each user profile shows different type of information, with links to other entities such as the buildings owned, payments made, location of residence etc.
|
|
</p>
|
|
<p>
|
|
The RDF generated from the two databases is materialized and joined using the generated unique identifiers.
|
|
</p>
|
|
<p>
|
|
<em>Example</em>
|
|
</p>
|
|
<p>
|
|
Supposed that we have two tables (<code>Anagrafe</code> and <code>Urban_Cadastre</code>) from different databases, we select some typical attributes for the two tables to explain our conversion method. Table <code>Angrafe</code> includes the information about two type of entities, persons and locations (a person's residence place), and some other information:
|
|
</p>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
Firstname
|
|
</th>
|
|
<th>
|
|
Lastname
|
|
</th>
|
|
<th>
|
|
City_Residence_Place
|
|
</th>
|
|
<th>
|
|
Country_Residence_Place
|
|
</th>
|
|
<th>
|
|
Other_Info
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Paolo
|
|
</td>
|
|
<td>
|
|
Bouquet
|
|
</td>
|
|
<td>
|
|
Trento
|
|
</td>
|
|
<td>
|
|
Italy
|
|
</td>
|
|
<td>
|
|
xyz...
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
Table <code>Urban_Cadastre</code> contains the information about buildings and their owners:
|
|
</p>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
Owner_Name
|
|
</th>
|
|
<th>
|
|
Building_LocalID
|
|
</th>
|
|
<th>
|
|
Building_Address
|
|
</th>
|
|
<th>
|
|
Building_Type
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Paolo Bouquet
|
|
</td>
|
|
<td>
|
|
123456
|
|
</td>
|
|
<td>
|
|
VIA G.LEOPARDI
|
|
</td>
|
|
<td>
|
|
3
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
<em>DDL</em>:
|
|
</p>
|
|
<pre>
|
|
CREATE TABLE Anagrafe (
|
|
Firstname varchar
|
|
Lastname varchar
|
|
City_Residence_Place varchar
|
|
Country_Residence_Place varchar
|
|
Other_Info varchar
|
|
PRIMARY KEY (Firstname, Lastname)
|
|
)
|
|
|
|
CREATE TABLE (
|
|
Owner_Name varchar
|
|
Building_LocalID integer
|
|
Building_Address varchar
|
|
Building_Type varchar
|
|
PRIMARY KEY (Owner_Name)
|
|
)
|
|
|
|
</pre>
|
|
<p>
|
|
Using traditional RDB2RDF translation methods the RDF representation for the two example tables coming from two different databases is shown below:
|
|
</p>
|
|
<pre>
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix database_anagrafe: <http://www.database1.org/anagrafe/> .
|
|
|
|
database_anagrafe:entry_row1 database_anagrafe:Other_Info "xyz" ;
|
|
database_anagrafe:Country_Residence_Place "Italy" ;
|
|
database_anagrafe:City_Residence_Place "Trento" ;
|
|
database_anagrafe:Last_Name "Bouquet" ;
|
|
database_anagrafe:First_Name "Paolo" .
|
|
</pre>
|
|
<pre>
|
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix database_urbano: <http://www.database1.org/Urban_Cadastre/> .
|
|
|
|
database_urbano:entry_row1 database_urbano:Building_Type "3" ;
|
|
database_urbano:Building_Address "VIA G.LEOPARDI" ;
|
|
database_urbano:Building_LocalID "123456" ;
|
|
database_urbano:Owner_Name "Paolo Bouquet" .
|
|
|
|
</pre>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="tax-query" id="tax-query"></a>2.3.1 Querying
|
|
</h4>
|
|
<p>
|
|
If we wanted to query these two tables, we would have to create a unique identifier, such as <code>http://www.example.org/Paolo_Bouquet</code> for Paolo Bouquet, to refer to entities in order to join descriptions about the same entity coming from different data sources.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="tax-req" id="tax-req"></a>2.3.2 Derived Requirements
|
|
</h4>
|
|
<p>
|
|
This use case leads to the following requirements:
|
|
</p>
|
|
<ul>
|
|
<li>Create unique identifiers for the entities described by the data.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="rCAD" id="rCAD"></a>2.4 UC4 - rCAD: RNA Comparative Analysis Database
|
|
</h3>
|
|
<p>
|
|
rCAD - RNA Comparative Analysis using SQLServer: the tremendous increase in available biological information creates opportunities to decipher the structure, function and evolution of cellular components while presenting new computational challenges for performance and scalability. To fully utilize this large increase in knowledge, it must be organized for efficient retrieval and integrated for multi-dimensional analysis. Given this, biologists are able to invent new comparative sequence analysis protocols that will yield new and different structural and functional information. Based on Microsoft SQL-server, we have designed and <a href="http://research.microsoft.com/apps/video/default.aspx?id=103865" class="external text" title="http://research.microsoft.com/apps/video/default.aspx?id=103865">implemented the RNA Comparative Analysis Database - rCAD</a> which supports comparative analysis of RNA sequence and structure, and unites, for the first time in a single environment, multiple dimensions of information necessary for alignment viewing, sequence metadata, structural annotations, structure prediction studies, structural statistics of different motifs, and phylogenetic analysis. This system provides a queryable environment that hosts efficient updates and rich analytics.
|
|
</p>
|
|
<p>
|
|
For this use-case, we will be presenting only the Sequence Alignment schema. The SQL-DDL for Microsoft SQL Server can be found here: <a href="http://userweb.cs.utexas.edu/%7Ejsequeda/rCAD_Alignment.sql" class="external text" title="http://userweb.cs.utexas.edu/~jsequeda/rCAD_Alignment.sql">rCAD Sequence Alignment SQL DDL</a>
|
|
</p>
|
|
<p>
|
|
This use-case presents the issue of a schema that does not have an existing domain ontology in which it can be mapped to. The closest domain ontology is the <a href="http://bioportal.bioontology.org/ontologies/3083" class="external text" title="http://bioportal.bioontology.org/ontologies/3083">Multiple Alignment Ontology (MAO)</a> which can only be mapped to the Sequence Alignment part of the entire rCAD database. However, MAO is in the OBO language. Nevertheless, <a href="http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-559/Paper6.pdf" class="external text" title="http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-559/Paper6.pdf">OBO ontologies can be translated to OWL (and back)</a>.
|
|
</p>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="d1e859" id="d1e859"></a>2.4.1 Expose Relational Data as RDF when there is no existing Domain Ontology to map the relational schema to
|
|
</h4>
|
|
<p>
|
|
Rob from the RNA lab would like to expose the Sequence Alignment data from the rCAD database as RDF. However, there is no existing domain ontology in which the relational schema can be mapped to. Therefore, an ontology should be derived automatically from the relational schema. The RDF data will become instance of this automatically generated ontology.
|
|
</p>
|
|
<p>
|
|
The Alignment table from the rCAD database is the following:
|
|
</p>
|
|
<pre>
|
|
CREATE TABLE [AlignmentClassic].[Alignment] (
|
|
[AlnID] int NOT NULL,
|
|
[SeqTypeID] tinyint NOT NULL,
|
|
[AlignmentName] varchar(max) NULL,
|
|
[ParentAlnID] int NULL,
|
|
[NextColumnNumber] int NOT NULL,
|
|
CONSTRAINT [PK_Alignment] PRIMARY KEY([AlnID])
|
|
)
|
|
ON [PRIMARY]
|
|
GO
|
|
ALTER TABLE [AlignmentClassic].[Alignment]
|
|
ADD CONSTRAINT [FK_Alignment_SequenceType]
|
|
FOREIGN KEY([SeqTypeID])
|
|
REFERENCES [dbo].[SequenceType]([SeqTypeID])
|
|
ON DELETE NO ACTION
|
|
ON UPDATE NO ACTION
|
|
GO
|
|
ALTER TABLE [AlignmentClassic].[Alignment]
|
|
ADD CONSTRAINT [FK_Alignment_Alignment]
|
|
FOREIGN KEY([ParentAlnID])
|
|
REFERENCES [AlignmentClassic].[Alignment]([AlnID])
|
|
ON DELETE NO ACTION
|
|
ON UPDATE NO ACTION
|
|
GO
|
|
</pre>
|
|
<p>
|
|
and the desired ontology that is generated automatically from the relational schema is the following:
|
|
</p>
|
|
<pre>
|
|
PREFIX rcad: <http://rcad.org/vocabulary/rcad.owl#>
|
|
rcad:Alignment rdf:type owl:Class .
|
|
rcad:AlignmentName rdf:type owl:DatatypeProperty.
|
|
rcad:AlignmentName rdfs:domain rcad:Alignment.
|
|
rcad:AlignmentName rdfs:range xsd:string.
|
|
rcad:NextColumnNumber rdf:type owl:DatatypeProperty.
|
|
rcad:NextColumnNumber rdfs:domain rcad:Alignment.
|
|
rcad:NextColumnNumber rdfs:range xsd:integer.
|
|
rcad:ParentAlnID rdf:type owl:ObjectProperty
|
|
rcad:ParentAlnID rdfs:domain rcad:Alignment
|
|
rcad:ParentAlnID rdfs:range rcad:Alignment
|
|
|
|
</pre>
|
|
<p>
|
|
and the desired RDF triples, which are instances of the automatically generated ontology are the following:
|
|
</p>
|
|
<pre>
|
|
PREFIX rcad: <http://rcad.org/vocabulary/rcad.owl#>
|
|
|
|
PREFIX rcad-data: <http://rcad.org/vocabulary/rcad-data.rdf#>
|
|
|
|
rcad-data:alignment1000 a rcad:Alignment;
|
|
rcad:AlignmentName "My Alignment 1000"^^xsd:string;
|
|
rcad:NextColumnNumber "123"^^xsd:int;
|
|
rcad:ParentAlnID rcad-data:alignment2000
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="d1e876" id="d1e876"></a>2.4.2 Expose Mapping a Relational Database to an OWL DL ontology
|
|
</h4>
|
|
<p>
|
|
Rob, from the RNA lab would like to expose the Sequence Alignment data from the rCAD database as RDF. Just recently the Multiple Alignment Ontology (MAO) as been released, which is an "<a href="http://bioportal.bioontology.org/ontologies/3083" class="external text" title="http://bioportal.bioontology.org/ontologies/3083">ontology for data retrieval and exchange in the fields of multiple DNA/RNA alignment, protein sequence and protein structure alignment.</a>" However, this ontology has been developed in OBO. Nevertheless, OBO ontologies can be translated to OWL ontologies, specifically OWL DL. Therefore, Rob will like to map his rCAD database to the MAO ontology
|
|
</p>
|
|
<p>
|
|
The Alignment and Alignment Column tables from the rCAD database is the following:
|
|
</p>
|
|
<pre>
|
|
CREATE TABLE [AlignmentClassic].[Alignment] (
|
|
[AlnID] int NOT NULL,
|
|
[SeqTypeID] tinyint NOT NULL,
|
|
[AlignmentName] varchar(max) NULL,
|
|
[ParentAlnID] int NULL,
|
|
[NextColumnNumber] int NOT NULL,
|
|
CONSTRAINT [PK_Alignment] PRIMARY KEY([AlnID])
|
|
)
|
|
GO
|
|
ALTER TABLE [AlignmentClassic].[Alignment]
|
|
ADD CONSTRAINT [FK_Alignment_SequenceType]
|
|
FOREIGN KEY([SeqTypeID])
|
|
REFERENCES [dbo].[SequenceType]([SeqTypeID])
|
|
ON DELETE NO ACTION
|
|
ON UPDATE NO ACTION
|
|
GO
|
|
ALTER TABLE [AlignmentClassic].[Alignment]
|
|
ADD CONSTRAINT [FK_Alignment_Alignment]
|
|
FOREIGN KEY([ParentAlnID])
|
|
REFERENCES [AlignmentClassic].[Alignment]([AlnID])
|
|
ON DELETE NO ACTION
|
|
ON UPDATE NO ACTION
|
|
GO
|
|
|
|
---
|
|
|
|
CREATE TABLE [AlignmentClassic].[AlignmentColumn] (
|
|
[AlnID] int NOT NULL,
|
|
[ColumnNumber] int NOT NULL,
|
|
[ColumnOrdinal] int NOT NULL,
|
|
CONSTRAINT [PK_AlignmentColumn] PRIMARY KEY([AlnID],[ColumnNumber])
|
|
)
|
|
GO
|
|
ALTER TABLE [AlignmentClassic].[AlignmentColumn]
|
|
ADD CONSTRAINT [FK_AlignmentColumn_Alignment]
|
|
FOREIGN KEY([AlnID])
|
|
REFERENCES [AlignmentClassic].[Alignment]([AlnID])
|
|
ON DELETE NO ACTION
|
|
ON UPDATE NO ACTION
|
|
GO
|
|
</pre>
|
|
<p>
|
|
This is just part of the <a href="http://www.berkeleybop.org/ontologies/obo-all/mao/mao.owl">Multiple Alignment Ontology</a> in OWL DL.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="rCAD-req" id="rCAD-req"></a>2.4.3 Derived Requirements
|
|
</h4>
|
|
<p>
|
|
This use case leads to the following requirements:
|
|
</p>
|
|
<ul>
|
|
<li>Map relational data to an RDF schema derived from the relational schema.
|
|
</li>
|
|
<li>Map from the local ontology to a domain ontology.
|
|
</li>
|
|
<li>Allow transformation of SPARQL queries over the RDF view into efficient SQL queries.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="reqs" id="reqs"></a>3 Requirements
|
|
</h2>
|
|
<div class="div2">
|
|
<p>
|
|
Following is a set of proposed requirements for R2RML.
|
|
</p>
|
|
<h3>
|
|
<a name="reqs-core" id="reqs-core"></a>3.1 Core Requirements
|
|
</h3>
|
|
<p>
|
|
The analysis of the above use cases yields a set of core requirements for the R2RML.
|
|
</p>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="DIRECT" id="DIRECT"></a>3.1.1 DIRECT - Direct Mapping
|
|
</h4>
|
|
<p>
|
|
Relational schema and data are a potentially cyclic graph where nodes are tables or tuples and edges are either foreign/primary key relationships or table attributes. This relational graph can be directly mapped to a RDF graph where the nodes of the relational graph correspond to the subject or object and the edges of the relational graph correspond to the predicate. This directly mapped RDF graph represents exactly the information in the relational database.
|
|
</p>
|
|
<p>
|
|
The relational schema can be directly mapped to a RDFS/OWL ontology while the relational data is directly mapped to a RDF graph, which is an instance of the RDFS/OWL ontology - this ontology is considered the <em>local ontology</em>. This local ontology can be used when it is desired to let the database schema determine the effective ontology of the RDF view. An example of direct mapping is shown in <a href="#justDirect">Section 3.1</a>.
|
|
</p>
|
|
<p>
|
|
A minimal configuration <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> provide a (virtual) RDF graph representing the attributes and relationships between tuples in the relational database.
|
|
</p>
|
|
<p>
|
|
This requirement comes from <a href="#HCLS">UC1</a> and <a href="#WP">UC2</a> as well as the first part of <a href="#rCAD">UC4</a>.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="TRANSFORM" id="TRANSFORM"></a>3.1.2 TRANSFORM - Transformative Mapping
|
|
</h4>
|
|
<p>
|
|
It is good Web of Data practice to re-use existing domain ontologies. Mapping between the relational graph or the local ontology with a domain ontology usually requires graph transformations <a href="#GraphTransform">[GraphTransform]</a>. An example of this mapping is shown in <a href="#databaseToOntology">Section 3.2</a>. The local ontology considers the teacher classification (Math, Physics, etc) as literal values while in the domain ontology the teacher classifications are RDFS/OWL classes.
|
|
</p>
|
|
<p>
|
|
The R2RML language <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> express transformations of the relational graph to produce the (virtual) RDF graph.
|
|
</p>
|
|
<p>
|
|
This requirement comes from the second part of <a href="#rCAD">UC4</a>.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="GUIDGEN" id="GUIDGEN"></a>3.1.3 GUIDGEN - Generation of Globally Unique Identifiers
|
|
</h4>
|
|
<p>
|
|
RDF identifiers for objects in the <a href="http://en.wikipedia.org/wiki/Conceptual_model">conceptual model</a> can, in some cases, be generated from a transformation of the schema and data in a tuple representing that conceptual model. For example, it may be sufficient to identify a patient in a clinical database with primary key <code>patientID</code> and value <code>1234561</code> as <code>http://myclinic.example/patient/patientID.12334561#x</code>, while but if the patient IDs are shared with another database, it will be necessary to transform one or both of these identifiers into a common form, e.g. <code>http://allclinics.example/sharedRecords/patient.12334561#y</code>. These use cases are labeled <code>custom-identifier</code>.
|
|
</p>
|
|
<p>
|
|
Given a row in a protein database with a primary key attribute "ID" and another unique attribute "uniProt":
|
|
</p>
|
|
<table cellpadding="2" cellspacing="0" border="1" summary="example of data">
|
|
<tbody>
|
|
<tr>
|
|
<th id="ID">
|
|
ID
|
|
</th>
|
|
<th id="uniProt">
|
|
uniProt
|
|
</th>
|
|
<th id="name">
|
|
name
|
|
</th>
|
|
<th id="seqLength">
|
|
seqLength
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
18
|
|
</th>
|
|
<th>
|
|
68250
|
|
</th>
|
|
<th>
|
|
YYHAB
|
|
</th>
|
|
<th>
|
|
246 AA
|
|
</th>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="note">
|
|
<p class="prefix">
|
|
<em>Note:</em>
|
|
</p>The RDB2RDF would like to ask the world which of the following subject mappings are likely to meet the most use cases:
|
|
<pre>
|
|
<http://mydb.example/prots/ID=18> db:name "YYHAB" . # consistent function of the primary key
|
|
<http://mydb.example/prots18/more/path> db:name "YYHAB" . # user-defined function of the primary key
|
|
<http://www.uniprot.org/uniprot/P68250> db:name "YYHAB" . # user-defined function of arbitrary attributes
|
|
|
|
</pre>
|
|
<p>
|
|
The former uses a potentially hard-coded formula, the middle uses a user-supplied function of the primary key and the latter uses a function of a different attribute to produce a common proteomic node label.
|
|
</p>
|
|
</div>
|
|
<p>
|
|
The R2RML language <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> allow for a mechanism to generate globally unique identifiers for database entities. The generation of identifiers should be designed to support the implementation of the Linked Data principles <a href="#LinkedData">[LinkedData]</a>. Where possible, R2RML <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> encourage the reuse of public identifiers for long-lived entities such as persons, corporations and geo-locations.
|
|
</p>
|
|
<p>
|
|
This requirement comes from <a href="#tax">UC3</a>, but also found necessary in other use cases.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="SQLGEN" id="SQLGEN"></a>3.1.4 SQLGEN - Query Translation
|
|
</h4>
|
|
<p>
|
|
One use of R2RML is to materialize RDF views of data. Another is to define virtual RDF views, enabled by translating SPARQL queries over the RDF view into SQL queries over the original database.
|
|
</p>
|
|
<p>
|
|
The R2RML language <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> allow mapping specification to have sufficient information to enable transformation of SPARQL queries over the RDF view into efficient SQL queries over the relational database.
|
|
</p>
|
|
<p>
|
|
This requirement comes from the second part of <a href="#rCAD">UC4</a>.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="ETL" id="ETL"></a>3.1.5 ETL - Extract-Transform-Load
|
|
</h4>
|
|
<p>
|
|
In certain cases query access or entity-level access (see also explanation in <a href="#intro-whyrdb2rdf">Section 1.1 Why Mapping RDBs to RDF?</a> ) to the exposed RDF graph is not sufficient.
|
|
</p>
|
|
<p>
|
|
The R2RML language <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> allow the mapping to have sufficient information to provide a dump of the entire RDF graph (materialzed RDF graph).
|
|
</p>
|
|
<p>
|
|
This requirement comes from <a href="#WP">UC2</a>, but in fact all use cases require this.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="DATATYPES" id="DATATYPES"></a>3.1.6 DATATYPES - Datatypes
|
|
</h4>
|
|
<p>
|
|
Relational data types <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> be treated consistently with RDF datatypes per SQL-XSD mapping <code>ISO IWD 9075-14:2011(E) Subclause 9.5, "Mapping SQL data types to XML Schema data types"</code>, possibly including XML datatypes defined at <a href="http://standards.iso.org/iso/9075/2003/sqlxml">http://standards.iso.org/iso/9075/2003/sqlxml</a>.
|
|
</p>
|
|
<p>
|
|
This requirement comes from <a href="#HCLS">UC1</a>, but in fact all use cases require this.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="VSDATATYPES" id="VSDATATYPES"></a>3.1.7 VSDATATYPES - Database Vendor Specific Datatypes
|
|
</h4>
|
|
<p>
|
|
The R2RML language <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> provide an extensibility mechanism to allow for mapping database vendor-specific data types.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="RENAMECOL" id="RENAMECOL"></a>3.1.8 RENAMECOL - Ability to Rename SQL Column Names
|
|
</h4>
|
|
<p>
|
|
When mapping from a relational schema to an RDF Schema or OWL ontology and column names are mapped to property names, it <em class="rfc2119" title="Keyword in RFC 2119 context">MUST</em> be possible to rename the property names.
|
|
</p>
|
|
<p>
|
|
This requirement comes from <a href="#HCLS">UC1</a>.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="APPLYFUNCTIONBEFOREMAP" id="APPLYFUNCTIONBEFOREMAP"></a>3.1.9 APPLYFUNCTION - Apply a Function before Mapping
|
|
</h4>
|
|
<p>
|
|
In some cases, what you want to map is not the original value in the database but the result of applying a function to the value. For example, the value may be temperature in Centigrade and you may want to convert to Fahrenheit. Or from Euros to Dollars. It is easy to think of other examples. Position may be stored as a tuple <code>(latitude, longitude</code> and you may want to map to two separate properties. Or the address may be stored in a number of columns and you may want to map as a single string. A more complex example: a database row might contain Wiki text, which should be transformed into HTML. This can be achieved, for example, by using standard or user defined SQL functions or using <a href="http://www.w3.org/TR/xquery-operators/">XQuery/XPath Functions and Operators</a>.
|
|
</p>
|
|
<p>
|
|
The mapping language <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> allow for applying a function before mapping.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="Exposing_many-to-many_join_tables_as_simple_triples" id="Exposing_many-to-many_join_tables_as_simple_triples"></a>3.1.10 MANYTOMANY - Exposing many-to-many join tables as simple triples
|
|
</h4>
|
|
<p>
|
|
Relational databases typically use three tables to represent Many-to-Many relationships. This requirements is to allow such relationships to be mapped using direct links between the entities.
|
|
</p>
|
|
<table style="float:right; padding: 1em;" cellpadding="2" cellspacing="0" border="1" summary="example of data">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
TeacherID
|
|
</th>
|
|
<th>
|
|
TeacherName
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1
|
|
</td>
|
|
<td>
|
|
Adams
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
Baker
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
3
|
|
</td>
|
|
<td>
|
|
Clark
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
...
|
|
</td>
|
|
<td>
|
|
...
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table style="float:right; padding: 1em;" cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
StudentId
|
|
</th>
|
|
<th>
|
|
TeacherID
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1
|
|
</td>
|
|
<td>
|
|
1
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
3
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
3
|
|
</td>
|
|
<td>
|
|
2
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
...
|
|
</td>
|
|
<td>
|
|
...
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table style="float:right; padding: 1em;" cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
StudentId
|
|
</th>
|
|
<th>
|
|
StudentName
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1
|
|
</td>
|
|
<td>
|
|
Davis
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
Evans
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
3
|
|
</td>
|
|
<td>
|
|
Frank
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
...
|
|
</td>
|
|
<td>
|
|
...
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
The community's school district maintains an RDB with basic student and personnel information, including a <code>STUDENTS</code> and a <code>TEACHERS</code> table. The relationship between the two is given in a <code>STUDENT_TEACHER</code> table:
|
|
</p>
|
|
<p>
|
|
The SQL DDL for these tables are the following:
|
|
</p>
|
|
<pre>
|
|
CREATE TABLE student (
|
|
studentID int PRIMARY KEY,
|
|
studentName varchar
|
|
)
|
|
|
|
CREATE TABLE teacher (
|
|
teacherID int PRIMARY KEY,
|
|
teacherName varchar
|
|
)
|
|
|
|
CREATE TABLE student_teacher (
|
|
studentID int,
|
|
teacherID int,
|
|
PRIMARY KEY(studentID, teacherID),
|
|
FOREIGN KEY(studentID) REFERENCES student(studentID),
|
|
FOREIGN KEY(teacherID) REFERENCES teacher(teacherID)
|
|
)
|
|
</pre>
|
|
<p>
|
|
SemantEducaTrix, the most recent Semantic Web company to burst into the educational software market, is mapping the school system's relational database to RDF/SPARQL. They'd like to access the relationships modelled with this join table as simple links between students and teachers:
|
|
</p>
|
|
<pre>
|
|
ex:student1 ex:studentName "Davis".
|
|
ex:student2 ex:studentName "Evans".
|
|
ex:student2 ex:studentName "Frank".
|
|
|
|
</pre>
|
|
<pre>
|
|
ex:teacher1 ex:teacherName "Adams".
|
|
ex:teacher2 ex:teacherName "Baker".
|
|
ex:teacher3 ex:teacherName "Clark".
|
|
|
|
</pre>
|
|
<pre>
|
|
ex:student1 ex:has_teacher ex:teacher1, ex:teacher 2 ;
|
|
ex:student2 ex:has_teacher ex:teacher3 ;
|
|
ex:student3 ex:has_teacher ex:teacher2 ;
|
|
...
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="CLASSESFROMATTRIBVALUES" id="CLASSESFROMATTRIBVALUES"></a>3.1.11 CLASSESFROMATTRIBVALUES - Creating Classes based on Attribute Values
|
|
</h4>
|
|
<p>
|
|
The requirement is for creating multiple classes from a single column based on the values of a related attribute.
|
|
</p>
|
|
<p>
|
|
The <code>TEACHERS</code> table, see above, has a <code>Classification</code> column:
|
|
</p>
|
|
<table cellpadding="2" cellspacing="0" border="1">
|
|
<tbody>
|
|
<tr>
|
|
<th>
|
|
TeacherId
|
|
</th>
|
|
<th>
|
|
Classification
|
|
</th>
|
|
<th>
|
|
...
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
1
|
|
</td>
|
|
<td>
|
|
History
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
2
|
|
</td>
|
|
<td>
|
|
Physics
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
3
|
|
</td>
|
|
<td>
|
|
Music
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
SemantEducaTrix wants to instantiate these teachers as different {{{rdf:type}}}s depending on the value in the <code>Classification</code> column:
|
|
</p>
|
|
<pre>
|
|
ex:teacher1 a ex:HistoryTeacher .
|
|
ex:teacher2 a ex:PhysicsTeacher .
|
|
ex:teacher3 a ex:MusicTeacher .
|
|
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="reqs-optional" id="reqs-optional"></a>3.2 Optional Requirements
|
|
</h3>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="NAMEDGRAPH" id="NAMEDGRAPH"></a>3.2.1 NAMEDGRAPH - Named Graphs
|
|
</h4>
|
|
<p>
|
|
The mapping language <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> enable the creation of multiple Named Graphs within one mapping definition.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="NSDECL" id="NSDECL"></a>3.2.2 NSDECL - Namespace declaration
|
|
</h4>
|
|
<p>
|
|
The mapping language <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> enable the declaration and use of namespace prefixes.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="METADATA" id="METADATA"></a>3.2.3 METADATA - Static Metadata
|
|
</h4>
|
|
<p>
|
|
The mapping language <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> enable the attachment of static metadata (such as licensing information) to all RDF entities or instances of a certain class. This is in particular important, when RDF is published as Linked Data on the Web, for example when one wants to state that the dataset at hand is available under a certain license, such as the <a href="http://www.opendatacommons.org/licenses/pddl/">Public Domain Dedication and License</a>.
|
|
</p>
|
|
<table border="1" summary="Editorial note">
|
|
<tr>
|
|
<td align="left" valign="top">
|
|
<em>Editorial note</em>
|
|
</td>
|
|
<td align="right" valign="top"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" align="left" valign="top">
|
|
See also next requirement which could be considered a special case of static metadata.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="PROVENANCE" id="PROVENANCE"></a>3.2.4 PROVENANCE - Provenance
|
|
</h4>
|
|
<p>
|
|
The mapping language <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> support the preservation of provenance by generating additional RDF triples according to a provenance vocabulary, such as <a href="http://purl.org/net/provenance/">http://purl.org/net/provenance/</a>.
|
|
</p>
|
|
</div>
|
|
<div class="div3">
|
|
<h4>
|
|
<a name="UPDATES" id="UPDATES"></a>3.2.5 UPDATES - Update Logs
|
|
</h4>
|
|
<p>
|
|
The mapping language <em class="rfc2119" title="Keyword in RFC 2119 context">SHOULD</em> provide extension points to support the creation of update logs of relational data.
|
|
</p>
|
|
<table border="1" summary="Editorial note">
|
|
<tr>
|
|
<td align="left" valign="top">
|
|
<em>Editorial note</em>
|
|
</td>
|
|
<td align="right" valign="top"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" align="left" valign="top">
|
|
Not really in the scope of R2RML, hence a nice-to-have feature.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="ack" id="ack"></a>4 Acknowledgments
|
|
</h2>
|
|
<p>
|
|
The editors gratefully acknowledge contributions from the members of the W3C RDB2RDF Working Group: Marcelo Arenas, Sören Auer, Samir Batla, Richard Cyganiak, Daniel Daniel Miranker, Souripriya Das, Alexander de Leon, Alexander de Leon, Orri Erling, Ahmed Ezzat, Lee Feigenbaum, Angela Fogarolli, Enrico Franconi, Howard Greenblatt, Wolfgang Halb, Harry Halpin, Nuno Lopes, Li Ma, Ashok Malhotra, Ivan Mikhailov, Juan Sequeda, Seema Sundara, Ben Szekely, Edward Thomas, and Boris Villazón-Terrazas.
|
|
</p>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="refs" id="refs"></a>5 References
|
|
</h2>
|
|
<dl>
|
|
<dt class="label">
|
|
<a name="DynaWebSites" id="DynaWebSites"></a>DynaWebSites
|
|
</dt>
|
|
<dd>
|
|
A survey on dynamic Web content generation and delivery techniques, Jayashree Ravi, Zhifeng Yu, Weisong Shi, 2009. (See http://www.cs.wayne.edu/~weisong/papers/ravi09-dynamic-content.pdf.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="LinkedData" id="LinkedData"></a>LinkedData
|
|
</dt>
|
|
<dd>
|
|
Linked Data, Tim Berners-Lee, Design Issue Note, 2006. (See http://www.w3.org/DesignIssues/LinkedData.html.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="SPARQL" id="SPARQL"></a>SPARQL
|
|
</dt>
|
|
<dd>
|
|
SPARQL Query Language for RDF, Eric Prud'hommeaux and Andy Seaborne 2008. (See http://www.w3.org/TR/rdf-sparql-query/.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="SQL" id="SQL"></a>SQL
|
|
</dt>
|
|
<dd>
|
|
ISO (International Organization for Standardization). ISO/IEC 9075-2:1999, Information technology --- Database languages --- SQL --- Part 2: Foundation (SQL/Foundation). [Geneva]: International Organization for Standardization, 1999. (See http://www.iso.ch/cate/d26197.html.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="RDF-RDB" id="RDF-RDB"></a>RDF-RDB
|
|
</dt>
|
|
<dd>
|
|
RDF Access to Relational Databases (See http://www.w3.org/2003/01/21-RDF-RDB-access/.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="RDB-RDF" id="RDB-RDF"></a>RDB-RDF
|
|
</dt>
|
|
<dd>
|
|
Relational Databases on the Semantic Web, Tim Berners-Lee, Design Issue Note, 1998. (See http://www.w3.org/DesignIssues/RDB-RDF.html.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="RDBMSMapping" id="RDBMSMapping"></a>RDBMSMapping
|
|
</dt>
|
|
<dd>
|
|
SWAD-Europe Deliverable 10.2: Mapping Semantic Web Data with RDBMSes, Dave Beckett and Jan Grant, 2003. (See http://www.w3.org/2001/sw/Europe/reports/scalable_rdbms_mapping_report/#sec-mapping.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="RDB2RDFSurvey" id="RDB2RDFSurvey"></a>RDB2RDFSurvey
|
|
</dt>
|
|
<dd>
|
|
A Survey of Current Approaches for Mapping of Relational Databases to RDF, Satya S. Sahoo, Wolfgang Halb, Sebastian Hellmann, Kingsley Idehen, Ted Thibodeau Jr, Sören Auer, Juan Sequeda, Ahmed Ezzat, 2009. (See http://www.w3.org/2005/Incubator/rdb2rdf/RDB2RDF_SurveyReport.pdf.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="GraphTransform" id="GraphTransform"></a>GraphTransform
|
|
</dt>
|
|
<dd>
|
|
Wikipedia Article on Graph rewriting (See http://en.wikipedia.org/wiki/Graph_rewriting.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="RDF" id="RDF"></a>RDF
|
|
</dt>
|
|
<dd>
|
|
Resource Description Framework (RDF): Concepts and Abstract Syntax, G. Klyne, J. J. Carroll, Editors, W3C Recommendation, 10 February 2004 (See http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="ReuseableIDs" id="ReuseableIDs"></a>ReuseableIDs
|
|
</dt>
|
|
<dd>
|
|
Reusable Identifiers in the RDB2RDF mapping language, Michael Hausenblas and Themis Palpanas, 2009. (See http://esw.w3.org/topic/Rdb2RdfXG/ReusableIdentifier.)
|
|
</dd>
|
|
<dt class="label">
|
|
<a name="URI" id="URI"></a>URI
|
|
</dt>
|
|
<dd>
|
|
RFC3986 - Uniform Resource Identifier (URI): Generic Syntax (See http://tools.ietf.org/html/rfc3986.)
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
<div class="back">
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="glossary" id="glossary"></a>A Glossary (Non-Normative)
|
|
</h2>
|
|
<p>
|
|
<em>domain ontology</em> [<a name="glossary-do" id="glossary-do" title="">Definition</a>: an ontology that has been developed by experts in the domain and accepted by a community (for example, FOAF, SIOC, Gene Ontology, etc.)]
|
|
</p>
|
|
<p>
|
|
<em>graph</em> [<a name="glossary-gr" id="glossary-gr" title="">Definition</a>: TBD]
|
|
</p>
|
|
<p>
|
|
<em>entity</em> [<a name="glossary-en" id="glossary-en" title="">Definition</a>: TBD]
|
|
</p>
|
|
<p>
|
|
<em>federation</em> [<a name="glossary-fe" id="glossary-fe" title="">Definition</a>: TBD]
|
|
</p>
|
|
<p>
|
|
<em>identifier</em> [<a name="glossary-id" id="glossary-id" title="">Definition</a>: TBD]
|
|
</p>
|
|
<p>
|
|
<em>label</em> [<a name="glossary-la" id="glossary-la" title="">Definition</a>: TBD]
|
|
</p>
|
|
<p>
|
|
<em>local ontology</em> [<a name="glossary-lo" id="glossary-lo" title="">Definition</a>: an ontology that has been derived from the relational schema]
|
|
</p>
|
|
<p>
|
|
<em>named graph</em> [<a name="glossary-ng" id="glossary-ng" title="">Definition</a>: a graph that is given a URI, see <a href="#SPARQL">[SPARQL]</a> for details.]
|
|
</p>
|
|
<p>
|
|
<em>mapping</em> [<a name="glossary-ma" id="glossary-ma" title="">Definition</a>: TBD]
|
|
</p>
|
|
<p>
|
|
<em>vocabulary</em> [<a name="glossary-vo" id="glossary-vo" title="">Definition</a>: see ontology]
|
|
</p>
|
|
</div>
|
|
<div class="div1">
|
|
<h2>
|
|
<a name="approaches" id="approaches"></a>B RDB2RDF Mapping Approaches (Non-Normative)
|
|
</h2>
|
|
<p>
|
|
The RDB2RDF Working Group would like to call out, without specifically endorsing, three emergent approaches to mapping relational data to RDF.
|
|
</p>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="justDirect" id="justDirect"></a>B.1 Direct Mapping
|
|
</h3>
|
|
<p>
|
|
Supplying a relational database (schema and data) plus a stem URI defines an RDF graph, which emulates the relational schema. <img src="RDB2RDF_Option_1.jpg" alt="" />
|
|
</p>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="databaseToOntology" id="databaseToOntology"></a>B.2 Direct Mapping Plus Ontology Mapping
|
|
</h3>
|
|
<p>
|
|
The RDB2RDF may define a mapping semantics as a mapping to a direct graph, followed by the application of RDF graph transformations into an RDF graph in a final ontology. <img src="RDB2RDF_Option_2.jpg" alt="" />
|
|
</p>
|
|
</div>
|
|
<div class="div2">
|
|
<h3>
|
|
<a name="directPlusOnt" id="directPlusOnt"></a>B.3 Database to Ontology Mapping
|
|
</h3>
|
|
<p>
|
|
The RDB2RDF may define a mapping semantics as a single step process from database to an RDF graph in a final ontology. <img src="RDB2RDF_Option_3.jpg" alt="" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|