SlideShare a Scribd company logo
+

Automatic RDB2RDF

Mariano Rodriguez-Muro,
Free University of Bozen-Bolzano
+

Disclaimer


License


This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 License
(http://creativecommons.org/licenses/by-sa/3.0/)
+

Reading material/sources


Direct Mapping specifications
W3C
http://www.w3.org/TR/rdb-direct-mapping/



Direct Mapping test cases
W3C
http://www.w3.org/2001/sw/rdb2rdf/test-cases/
+
Combining Information
+

Combining Information


Most common information
storage
 Relational DBs
 XML
 Comma/Tab delimited
files/spreadsheets
 Proprietary file formats



Common Data Model: RDF and
SWT can provide can make it
easier to integrate across all
formats (not replace)



Knowledge Model: RDFS, OWL
and SWRL can make it easier to
integrate under a common
knowledge model
+

Combining Information
Tools and techniques for different data sources. In particular:


Relational DBMS


R2RML and Direct Mapping



ontop, D2RQ Server



Java Objects as RDF



XML and XML feeds (web services) as RDF
+

Standards and Tools
Mapping languages


Standards by RDB2RDF working group (W3C)





Direct Mapping
R2RML

Proprietary

Tools
Free: D2R, Virtuoso, Morph, r2rml4net, db2triples, ultrawrap,
Quest


Commercial: Virtuoso, ultrawrap, Oracle SW
+
Direct Mapping
Automatic standard mappings
+

RDF2RF: Direct Mapping

“The direct mapping defines a simple transformation, providing a basis
for defining and comparing more intricate transformations. It can also
be used to materialize RDF graphs or define
virtual graphs, which can be queried by SPARQL or traversed by an
RDF graph API.”
+

Usage


Approach 1: ETL



Transform the data into RDF using the engine





Connect the database to a Direct Mapping engine
Load the RDF data into a triple store

Approach 2: Virtual RDF Graphs


Connect the database to a Direct Mapping engine with support for
Virtual RDF graphs



Start the engine’s SPARQL end-point



Query the (virtual) RDF Graph using the vocabulary defined by the
Direct Mapping transformation
+

Example

People

PK

Addresses
PK

ID

fname

addr

ID

City

State

7

Bob

18

18

Cambridge

Ma

8

Sue

NULL

Given a base IRI http://foo.example/DB/
@base <http://foo.example/DB/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<People/ID=7> rdf:type <People> .
<People/ID=7> <People#ID> 7 .
<People/ID=7> <People#fname> "Bob" .
<People/ID=7> <People#addr> 18 .
<People/ID=7> <People#ref-addr> <Addresses/ID=18> .
<People/ID=8> rdf:type <People> .
<People/ID=8> <People#ID> 8 .
<People/ID=8> <People#fname> "Sue" .
<Addresses/ID=18> rdf:type <Addresses> .
<Addresses/ID=18> <Addresses#ID> 18 .
<Addresses/ID=18> <Addresses#city> "Cambridge" .
<Addresses/ID=18> <Addresses#state> "MA" .
+

Tables with Primary Keys


In this expression, each row, e.g. (7, "Bob", 18), produces a set of triples with a
common subject. The subject is an IRI formed from the concatenation of the
base IRI, table name (People), primary key column name (ID) and primary key
value (7). The predicate for each column is an IRI formed from the
concatenation of the base IRI, table name and the column name.



The values are RDF literals formed from the lexical form of the column value.
Each foreign key produces a triple with a predicate composed from the foreign
key column names, the referenced table, and the referenced column names.



The object of these triples is the row identifier (<Addresses/ID=18>) for the
referenced triple. Note that these reference row identifiers must coincide with
the subject used for the triples generated from the referenced row.



The direct mapping does not generate triples for NULL values. Note that it is
not known how to relate the behavior of the obtained RDF graph with the
standard SQL semantics of the NULL values of the source RDB.
+

Example

People

PK

Addresses
PK

ID

fname

addr

ID

City

State

7

Bob

18

18

Cambridge

Ma

8

Sue

NULL

Given a base IRI http://foo.example/DB/
@base <http://foo.example/DB/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<People/ID=7> rdf:type <People> .
<People/ID=7> <People#ID> 7 .
<People/ID=7> <People#fname> "Bob" .
<People/ID=7> <People#addr> 18 .
<People/ID=7> <People#ref-addr> <Addresses/ID=18> .
<People/ID=8> rdf:type <People> .
<People/ID=8> <People#ID> 8 .
<People/ID=8> <People#fname> "Sue" .
<Addresses/ID=18> rdf:type <Addresses> .
<Addresses/ID=18> <Addresses#ID> 18 .
<Addresses/ID=18> <Addresses#city> "Cambridge" .
<Addresses/ID=18> <Addresses#state> "MA" .
+

Foreign keys / candidate keys
People
PK

Addresses(ID)

ID

fname

addr

deptName

deptCity

7

Bob

18

accounting

Cambridge

8

Sue

NULL

NULL

NULL

Department

Addresses

PK

PK

ID

name

city

manager

23

accounting

Cambridge

8

ID

City

State

18

Cambridge

Ma
+

RDF
@base <http://foo.example/DB/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<People/ID=7> rdf:type <People> .
<People/ID=7> <People#ID> 7 .
<People/ID=7> <People#fname> "Bob" .
<People/ID=7> <People#addr> 18 .
<People/ID=7> <People#ref-addr> <Addresses/ID=18> .
<People/ID=7> <People#deptName> "accounting" .
<People/ID=7> <People#deptCity> "Cambridge" .
<People/ID=7> <People#ref-deptName;deptCity> <Department/ID=23> .
<People/ID=8> rdf:type <People> .
<People/ID=8> <People#ID> 8 .
<People/ID=8> <People#fname> "Sue" .
<Addresses/ID=18> rdf:type <Addresses> .
<Addresses/ID=18> <Addresses#ID> 18 .
<Addresses/ID=18> <Addresses#city> "Cambridge" .
<Addresses/ID=18> <Addresses#state> "MA" .
<Department/ID=23> rdf:type <Department> .
<Department/ID=23> <Department#ID> 23 .
<Department/ID=23> <Department#name> "accounting" .
<Department/ID=23> <Department#city> "Cambridge" .
<Department/ID=23> <Department#manager> 8 .
<Department/ID=23> <Department#ref-manager> <People#ID=8> .
+

Multi-column primary keys
Primary keys may also be composite. If, in the above example, the
primary key for Department were (name, city) instead of ID, the
identifier for the only row in this table would be
<Department/name=accounting;city=Cambridge>. The triples involving
<Department/ID=23> would be replaced with the following triples:

<People/ID=7> <People#ref-deptName;deptCity> <Department/name=accounting;city=Cambridge> .
<Department/name=accounting;city=Cambridge> rdf:type <Department> .
<Department/name=accounting;city=Cambridge> <Department#ID> 23 .
<Department/name=accounting;city=Cambridge> <Department#name> "accounting" .
<Department/name=accounting;city=Cambridge> <Department#city> "Cambridge" .
+

Empty (non-existing) primary keys
If there is no primary key, each row implies a set of triples with a
shared subject, but that subject is a blank node. A Tweets table can
be added to the above example to keep track of employees' tweets in
Twitter:

@base <http://foo.example/DB/>
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>

Tweets
People(ID)
tweeter

when

text

7

2010-08-30T01:33

I really like lolcats.

7

2010-08-30T09:01

I take it back.

_:a rdf:type <Tweets> .
_:a <Tweets#tweeter> "7" .
_:a <Tweets#ref-tweeter> <People/ID=7> .
_:a <Tweets#when> "2010-0830T01:33"^^xsd:dateTime .
_:a <Tweets#text> "I really like lolcats." .

_:b rdf:type <Tweets> .
_:b <Tweets#tweeter> "7" .
_:b <Tweets#ref-tweeter> <People/ID=7> .
_:b <Tweets#when> "2010-0830T09:01"^^xsd:dateTime .
_:b <Tweets#text> "I take it back." .
+

Row nodes
Definition row node:


If the table has a primary key, the row node is a relative IRI obtained by
concatenating:






the percent-encoded form of the table name,
the SOLIDUS character '/',
for each column in the primary key, in order:
 the percent-encoded form of the column name,
 a EQUALS SIGN character '=',
 the percent-encoded lexical form of the canonical RDF literal representation of
the column value as defined in R2RML section 10.2 Natural Mapping of SQL
Values [R2RML],
 if it is not the last column in the primary key, a SEMICOLON character ';'

If the table has no primary key, the row node is a fresh blank node that is
unique to this row.
+

Referencing tables with empty
primary keys


Rows in tables with no primary key may still be referenced by
foreign keys. (Relational database theory tells us that these
rows must be unique as foreign keys reference candidate keys
and candidate keys are unique across all the rows in a table.)
References to rows in tables with no primary key are expressed
as RDF triples with blank nodes for objects, where that blank
node is the same node used for the subject in the referenced
row.
+

Referencing tables with empty
primary keys
Projects

Unique Key
Unique Key
People(ID)

Department(name,city)

lead

name

deptName

deptCity

8

pencil survey

accounting

Cambridge

8

eraser survey

accounting

Cambridge

TaskAssignments
PK
Projects(name, deptName, deptCity)
People(ID)

Department(name,city)

worker

project

deptName

deptCity

7

pencil survey

accounting

Cambridge
@base <http://foo.example/DB/>
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
_:c rdf:type <Projects> .
_:c <Projects#lead> <People/ID=8> .
_:c <Projects#name> "pencil survey" .
_:c <Projects#deptName> "accounting" .
_:c <Projects#deptCity> "Cambridge" .
_:c <Projects#ref-deptName;deptCity> <Department/ID=23> .
_:d rdf:type <Projects> .
_:d <Projects#lead> <People/ID=8> .
_:d <Projects#name> "eraser survey" .
_:d <Projects#deptName> "accounting" .
_:d <Projects#deptCity> "Cambridge" .
_:d <Projects#ref-deptName;deptCity> <Department/ID=23> .
<TaskAssignments/worker=7.project=pencil%20survey> rdf:type <TaskAssignments> .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#worker> 7 .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#ref-worker> <People/ID=7> .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#project> "pencil survey" .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#deptName> "accounting" .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#deptCity> "Cambridge" .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#ref-deptName;deptCity>
<Department/ID=23> .
<TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#ref-project;deptName;deptCity> _:c .
+

Percent Encoding
Definition percent-encode:


Replace the string with the IRI-safe form per section 7.3 of
[R2RML].

String
42
Hello World!
2011-08-23T22:17:00Z
~A_17.1-2
葉篤正

IRI-safe version
42
Hello%20World%21
2011-08-23T22%3A17%3A00Z
~A_17.1-2
葉篤正
+
Test
+

Case 1
+

Case 1: Solution
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .
_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> .
_:a <Target#litattr1> 1010 .
_:a <Target#key1attr1> "K1A1" .
_:a <Target#key1attr2> "K1A2" .
_:a <Target#key2attr1> "K2A1" .
_:a <Target#key2attr2> "K2A2" .
<Source/ID=1100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> .
<Source/ID=1100> <Source#ID> 1100 .
<Source/ID=1100> <Source#attrA> "K2A2" .
<Source/ID=1100> <Source#attrB> "K2A1" .
<Source/ID=1100> <Source#ref-attrA;attrB> _:a .
+

Case 2
+

Case 2: solution

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .
<Target/PK=1010> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> .
<Target/PK=1010> <Target#PK> 1010 .
<Target/PK=1010> <Target#key1attr1> "K1A1" .
<Target/PK=1010> <Target#key1attr2> "K1A2" .
<Target/PK=1010> <Target#key2attr1> "K2A1" .
<Target/PK=1010> <Target#key2attr2> "K2A2" .
<Source/ID=1100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> .
<Source/ID=1100> <Source#ID> 1100 .
<Source/ID=1100> <Source#attrA> "K2A2" .
<Source/ID=1100> <Source#attrB> "K2A1" .
<Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> .
+

Case 3
+

Case 3: solution

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .

<Target/PK=1010> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> .
<Target/PK=1010> <Target#PK> 1010 .
<Target/PK=1010> <Target#key1attr1> "K1A11" .
<Target/PK=1010> <Target#key1attr2> "K1A21" .
<Target/PK=1010> <Target#key2attr1> "K2A11" .
<Target/PK=1010> <Target#key2attr2> "K2A21" .
<Target/PK=1011> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> .
<Target/PK=1011> <Target#PK> 1011 .
<Target/PK=1011> <Target#key1attr1> "K1A12" .
<Target/PK=1011> <Target#key1attr2> "K1A22" .
<Target/PK=1011> <Target#key2attr2> "K2A22" .
+

Case 3: solution (cont.)

<Target/PK=1011> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> .
<Target/PK=1011> <Target#PK> 1011 .
<Target/PK=1011> <Target#key1attr1> "K1A12" .
<Target/PK=1011> <Target#key1attr2> "K1A22" .
<Target/PK=1011> <Target#key2attr2> "K2A22" .
<Source/ID=1100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> .
<Source/ID=1100> <Source#ID> 1100 .
<Source/ID=1100> <Source#attrA> "K2A21" .
<Source/ID=1100> <Source#attrB> "K2A11" .
<Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> .
<Source/ID=1101> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> .
<Source/ID=1101> <Source#ID> 1101 .
<Source/ID=1101> <Source#attrA> "K2A22" .
+
Usage
+

Using a Mapping (revisited)


ETL: Generate RDF triples for a triple-store (D2R, morph,
Quest, etc.).
Advantages: Easy integration with inference, compatible with
an RDF tool.




Disadvantages: Updates on the sources do not propagate,
Duplicated Data

Virtual RDF Graphs: Do on-the-fly SPARQL to SQL translation
(D2R, Virtuoso, Quest, etc.)


Advantages: Always in-synch, no data duplication, simple setup



Disadvantages: Only few tools offer good performance, only few
tools support inference
+

D2RQ


The D2RQ Platform is a system for accessing relational
databases as virtual, read-only RDF graphs. It offers RDFbased access to the content of relational databases without
having to replicate it into an RDF store. Using D2RQ you can:


query a non-RDF database using SPARQL



access the content of the database as Linked Data over the Web



create custom dumps of the database in RDF formats for loading
into an RDF store (ETL style)



access information in a non-RDF database using the Apache Jena
API

More Related Content

What's hot

ShEx by Example
ShEx by ExampleShEx by Example
ShEx by Example
Jose Emilio Labra Gayo
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
Marin Dimitrov
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
Frank van Harmelen
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectives
Jose Emilio Labra Gayo
 
Mapping Hierarchical Sources into RDF using the RML Mapping Language
Mapping Hierarchical Sources into RDF using the RML Mapping LanguageMapping Hierarchical Sources into RDF using the RML Mapping Language
Mapping Hierarchical Sources into RDF using the RML Mapping Language
andimou
 
An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of Data
Olaf Hartig
 
Data shapes-test-suite
Data shapes-test-suiteData shapes-test-suite
Data shapes-test-suite
Jose Emilio Labra Gayo
 
RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031
kwangsub kim
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
Jose Emilio Labra Gayo
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
Jose Emilio Labra Gayo
 
Towards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression DerivativesTowards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression Derivatives
Jose Emilio Labra Gayo
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
andyseaborne
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
Nilesh Wagmare
 
Ks2008 Semanticweb In Action
Ks2008 Semanticweb In ActionKs2008 Semanticweb In Action
Ks2008 Semanticweb In ActionRinke Hoekstra
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
AdonisDamian
 
Another RDF Encoding Form
Another RDF Encoding FormAnother RDF Encoding Form
Another RDF Encoding Form
Jakob .
 
RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applications
Jose Emilio Labra Gayo
 
ShEx vs SHACL
ShEx vs SHACLShEx vs SHACL
ShEx vs SHACL
Jose Emilio Labra Gayo
 

What's hot (19)

ShEx by Example
ShEx by ExampleShEx by Example
ShEx by Example
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectives
 
Mapping Hierarchical Sources into RDF using the RML Mapping Language
Mapping Hierarchical Sources into RDF using the RML Mapping LanguageMapping Hierarchical Sources into RDF using the RML Mapping Language
Mapping Hierarchical Sources into RDF using the RML Mapping Language
 
An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of Data
 
Data shapes-test-suite
Data shapes-test-suiteData shapes-test-suite
Data shapes-test-suite
 
RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
5 rdfs
5 rdfs5 rdfs
5 rdfs
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
 
Towards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression DerivativesTowards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression Derivatives
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
 
Ks2008 Semanticweb In Action
Ks2008 Semanticweb In ActionKs2008 Semanticweb In Action
Ks2008 Semanticweb In Action
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
Another RDF Encoding Form
Another RDF Encoding FormAnother RDF Encoding Form
Another RDF Encoding Form
 
RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applications
 
ShEx vs SHACL
ShEx vs SHACLShEx vs SHACL
ShEx vs SHACL
 

Viewers also liked (9)

SWT Lab 1
SWT Lab 1SWT Lab 1
SWT Lab 1
 
SWT Lab 2
SWT Lab 2SWT Lab 2
SWT Lab 2
 
SWT Lab 5
SWT Lab 5SWT Lab 5
SWT Lab 5
 
SWT Lab 3
SWT Lab 3SWT Lab 3
SWT Lab 3
 
SWT Lecture Session 8 - Rules
SWT Lecture Session 8 - RulesSWT Lecture Session 8 - Rules
SWT Lecture Session 8 - Rules
 
SWT Lecture Session 6 - RDFS semantics, inference techniques, sesame rdfs
SWT Lecture Session 6 - RDFS semantics, inference techniques, sesame rdfsSWT Lecture Session 6 - RDFS semantics, inference techniques, sesame rdfs
SWT Lecture Session 6 - RDFS semantics, inference techniques, sesame rdfs
 
2011.118 1233
2011.118 12332011.118 1233
2011.118 1233
 
SWT Lecture Session 8 - Inference in jena
SWT Lecture Session 8 - Inference in jenaSWT Lecture Session 8 - Inference in jena
SWT Lecture Session 8 - Inference in jena
 
7 advanced uses of rdfs
7 advanced uses of rdfs7 advanced uses of rdfs
7 advanced uses of rdfs
 

Similar to SWT Lecture Session 9 - RDB2RDF direct mapping

Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLioDo it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
Open Knowledge Belgium
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
Fabien Gandon
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQLLino Valdivia
 
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTSThe Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems,Bhilai,Durg,Chhattisgarh.
 
Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...
Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...
Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...
andimou
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic  Web and Linked DataAn introduction to Semantic  Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013Fabien Gandon
 
Sql
SqlSql
Aall denver 2010
Aall denver 2010Aall denver 2010
Aall denver 2010
Diane Hillmann
 
Validating and Describing Linked Data Portals using RDF Shape Expressions
Validating and Describing Linked Data Portals using RDF Shape ExpressionsValidating and Describing Linked Data Portals using RDF Shape Expressions
Validating and Describing Linked Data Portals using RDF Shape Expressions
Jose Emilio Labra Gayo
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
Abhinayacheekati
 
CRL: A Rule Language for Table Analysis and Interpretation
CRL: A Rule Language for Table Analysis and InterpretationCRL: A Rule Language for Table Analysis and Interpretation
CRL: A Rule Language for Table Analysis and Interpretation
Alexey Shigarov
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
Dan Brickley
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB
 
On_Mapping_Relational_Databases_to_RDF_and_SHACL.pdf
On_Mapping_Relational_Databases_to_RDF_and_SHACL.pdfOn_Mapping_Relational_Databases_to_RDF_and_SHACL.pdf
On_Mapping_Relational_Databases_to_RDF_and_SHACL.pdf
Department of Informatics, University of Oslo
 
Mapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQLMapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQL
Gábor Szárnyas
 
What’s in a structured value?
What’s in a structured value?What’s in a structured value?
What’s in a structured value?
Andy Powell
 

Similar to SWT Lecture Session 9 - RDB2RDF direct mapping (20)

Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLioDo it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
 
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTSThe Smartpath Information Systems | BASIC RDBMS CONCEPTS
The Smartpath Information Systems | BASIC RDBMS CONCEPTS
 
Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...
Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...
Machine-Interpretable Dataset and Service Descriptions for Heterogeneous Data...
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic  Web and Linked DataAn introduction to Semantic  Web and Linked Data
An introduction to Semantic Web and Linked Data
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
 
XSPARQL CrEDIBLE workshop
XSPARQL CrEDIBLE workshopXSPARQL CrEDIBLE workshop
XSPARQL CrEDIBLE workshop
 
Sql
SqlSql
Sql
 
Aall denver 2010
Aall denver 2010Aall denver 2010
Aall denver 2010
 
Validating and Describing Linked Data Portals using RDF Shape Expressions
Validating and Describing Linked Data Portals using RDF Shape ExpressionsValidating and Describing Linked Data Portals using RDF Shape Expressions
Validating and Describing Linked Data Portals using RDF Shape Expressions
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
 
CRL: A Rule Language for Table Analysis and Interpretation
CRL: A Rule Language for Table Analysis and InterpretationCRL: A Rule Language for Table Analysis and Interpretation
CRL: A Rule Language for Table Analysis and Interpretation
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDB
 
On_Mapping_Relational_Databases_to_RDF_and_SHACL.pdf
On_Mapping_Relational_Databases_to_RDF_and_SHACL.pdfOn_Mapping_Relational_Databases_to_RDF_and_SHACL.pdf
On_Mapping_Relational_Databases_to_RDF_and_SHACL.pdf
 
Mapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQLMapping Graph Queries to PostgreSQL
Mapping Graph Queries to PostgreSQL
 
What’s in a structured value?
What’s in a structured value?What’s in a structured value?
What’s in a structured value?
 

More from Mariano Rodriguez-Muro

SWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFSSWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFSMariano Rodriguez-Muro
 
SWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLSWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLMariano Rodriguez-Muro
 
SWT Lecture Session 1 - Introduction
SWT Lecture Session 1 - IntroductionSWT Lecture Session 1 - Introduction
SWT Lecture Session 1 - Introduction
Mariano Rodriguez-Muro
 
ontop: A tutorial
ontop: A tutorialontop: A tutorial
ontop: A tutorial
Mariano Rodriguez-Muro
 
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Mariano Rodriguez-Muro
 
Introduction to query rewriting optimisation with dependencies
Introduction to query rewriting optimisation with dependenciesIntroduction to query rewriting optimisation with dependencies
Introduction to query rewriting optimisation with dependencies
Mariano Rodriguez-Muro
 
OXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriringOXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriring
Mariano Rodriguez-Muro
 
OWLED'12 Quest
OWLED'12 QuestOWLED'12 Quest
OWLED'12 Quest
Mariano Rodriguez-Muro
 
ODBASE'08 dl-lite explanations
ODBASE'08 dl-lite explanationsODBASE'08 dl-lite explanations
ODBASE'08 dl-lite explanations
Mariano Rodriguez-Muro
 
IMAS'08 obda plugin
IMAS'08 obda pluginIMAS'08 obda plugin
IMAS'08 obda plugin
Mariano Rodriguez-Muro
 
DL'12 dl-lite explanations
DL'12 dl-lite explanationsDL'12 dl-lite explanations
DL'12 dl-lite explanations
Mariano Rodriguez-Muro
 
DL'12 mastro at work
DL'12 mastro at workDL'12 mastro at work
DL'12 mastro at work
Mariano Rodriguez-Muro
 
AMW'11 dependencies-sem index-t-mappings
AMW'11 dependencies-sem index-t-mappingsAMW'11 dependencies-sem index-t-mappings
AMW'11 dependencies-sem index-t-mappings
Mariano Rodriguez-Muro
 

More from Mariano Rodriguez-Muro (16)

SWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFSSWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFS
 
SWT Lecture Session 5 - RDFS
SWT Lecture Session 5 - RDFSSWT Lecture Session 5 - RDFS
SWT Lecture Session 5 - RDFS
 
SWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLSWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQL
 
SWT Lecture Session 4 - Sesame
SWT Lecture Session 4 - SesameSWT Lecture Session 4 - Sesame
SWT Lecture Session 4 - Sesame
 
4 sesame
4 sesame4 sesame
4 sesame
 
SWT Lecture Session 1 - Introduction
SWT Lecture Session 1 - IntroductionSWT Lecture Session 1 - Introduction
SWT Lecture Session 1 - Introduction
 
ontop: A tutorial
ontop: A tutorialontop: A tutorial
ontop: A tutorial
 
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
 
Introduction to query rewriting optimisation with dependencies
Introduction to query rewriting optimisation with dependenciesIntroduction to query rewriting optimisation with dependencies
Introduction to query rewriting optimisation with dependencies
 
OXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriringOXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriring
 
OWLED'12 Quest
OWLED'12 QuestOWLED'12 Quest
OWLED'12 Quest
 
ODBASE'08 dl-lite explanations
ODBASE'08 dl-lite explanationsODBASE'08 dl-lite explanations
ODBASE'08 dl-lite explanations
 
IMAS'08 obda plugin
IMAS'08 obda pluginIMAS'08 obda plugin
IMAS'08 obda plugin
 
DL'12 dl-lite explanations
DL'12 dl-lite explanationsDL'12 dl-lite explanations
DL'12 dl-lite explanations
 
DL'12 mastro at work
DL'12 mastro at workDL'12 mastro at work
DL'12 mastro at work
 
AMW'11 dependencies-sem index-t-mappings
AMW'11 dependencies-sem index-t-mappingsAMW'11 dependencies-sem index-t-mappings
AMW'11 dependencies-sem index-t-mappings
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 

SWT Lecture Session 9 - RDB2RDF direct mapping

  • 2. + Disclaimer  License  This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/)
  • 3. + Reading material/sources  Direct Mapping specifications W3C http://www.w3.org/TR/rdb-direct-mapping/  Direct Mapping test cases W3C http://www.w3.org/2001/sw/rdb2rdf/test-cases/
  • 5. + Combining Information  Most common information storage  Relational DBs  XML  Comma/Tab delimited files/spreadsheets  Proprietary file formats  Common Data Model: RDF and SWT can provide can make it easier to integrate across all formats (not replace)  Knowledge Model: RDFS, OWL and SWRL can make it easier to integrate under a common knowledge model
  • 6. + Combining Information Tools and techniques for different data sources. In particular:  Relational DBMS  R2RML and Direct Mapping  ontop, D2RQ Server  Java Objects as RDF  XML and XML feeds (web services) as RDF
  • 7. + Standards and Tools Mapping languages  Standards by RDB2RDF working group (W3C)    Direct Mapping R2RML Proprietary Tools Free: D2R, Virtuoso, Morph, r2rml4net, db2triples, ultrawrap, Quest  Commercial: Virtuoso, ultrawrap, Oracle SW
  • 9. + RDF2RF: Direct Mapping “The direct mapping defines a simple transformation, providing a basis for defining and comparing more intricate transformations. It can also be used to materialize RDF graphs or define virtual graphs, which can be queried by SPARQL or traversed by an RDF graph API.”
  • 10. + Usage  Approach 1: ETL   Transform the data into RDF using the engine   Connect the database to a Direct Mapping engine Load the RDF data into a triple store Approach 2: Virtual RDF Graphs  Connect the database to a Direct Mapping engine with support for Virtual RDF graphs  Start the engine’s SPARQL end-point  Query the (virtual) RDF Graph using the vocabulary defined by the Direct Mapping transformation
  • 11. + Example People PK Addresses PK ID fname addr ID City State 7 Bob 18 18 Cambridge Ma 8 Sue NULL Given a base IRI http://foo.example/DB/ @base <http://foo.example/DB/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <People/ID=7> rdf:type <People> . <People/ID=7> <People#ID> 7 . <People/ID=7> <People#fname> "Bob" . <People/ID=7> <People#addr> 18 . <People/ID=7> <People#ref-addr> <Addresses/ID=18> . <People/ID=8> rdf:type <People> . <People/ID=8> <People#ID> 8 . <People/ID=8> <People#fname> "Sue" . <Addresses/ID=18> rdf:type <Addresses> . <Addresses/ID=18> <Addresses#ID> 18 . <Addresses/ID=18> <Addresses#city> "Cambridge" . <Addresses/ID=18> <Addresses#state> "MA" .
  • 12. + Tables with Primary Keys  In this expression, each row, e.g. (7, "Bob", 18), produces a set of triples with a common subject. The subject is an IRI formed from the concatenation of the base IRI, table name (People), primary key column name (ID) and primary key value (7). The predicate for each column is an IRI formed from the concatenation of the base IRI, table name and the column name.  The values are RDF literals formed from the lexical form of the column value. Each foreign key produces a triple with a predicate composed from the foreign key column names, the referenced table, and the referenced column names.  The object of these triples is the row identifier (<Addresses/ID=18>) for the referenced triple. Note that these reference row identifiers must coincide with the subject used for the triples generated from the referenced row.  The direct mapping does not generate triples for NULL values. Note that it is not known how to relate the behavior of the obtained RDF graph with the standard SQL semantics of the NULL values of the source RDB.
  • 13. + Example People PK Addresses PK ID fname addr ID City State 7 Bob 18 18 Cambridge Ma 8 Sue NULL Given a base IRI http://foo.example/DB/ @base <http://foo.example/DB/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <People/ID=7> rdf:type <People> . <People/ID=7> <People#ID> 7 . <People/ID=7> <People#fname> "Bob" . <People/ID=7> <People#addr> 18 . <People/ID=7> <People#ref-addr> <Addresses/ID=18> . <People/ID=8> rdf:type <People> . <People/ID=8> <People#ID> 8 . <People/ID=8> <People#fname> "Sue" . <Addresses/ID=18> rdf:type <Addresses> . <Addresses/ID=18> <Addresses#ID> 18 . <Addresses/ID=18> <Addresses#city> "Cambridge" . <Addresses/ID=18> <Addresses#state> "MA" .
  • 14. + Foreign keys / candidate keys People PK Addresses(ID) ID fname addr deptName deptCity 7 Bob 18 accounting Cambridge 8 Sue NULL NULL NULL Department Addresses PK PK ID name city manager 23 accounting Cambridge 8 ID City State 18 Cambridge Ma
  • 15. + RDF @base <http://foo.example/DB/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <People/ID=7> rdf:type <People> . <People/ID=7> <People#ID> 7 . <People/ID=7> <People#fname> "Bob" . <People/ID=7> <People#addr> 18 . <People/ID=7> <People#ref-addr> <Addresses/ID=18> . <People/ID=7> <People#deptName> "accounting" . <People/ID=7> <People#deptCity> "Cambridge" . <People/ID=7> <People#ref-deptName;deptCity> <Department/ID=23> . <People/ID=8> rdf:type <People> . <People/ID=8> <People#ID> 8 . <People/ID=8> <People#fname> "Sue" . <Addresses/ID=18> rdf:type <Addresses> . <Addresses/ID=18> <Addresses#ID> 18 . <Addresses/ID=18> <Addresses#city> "Cambridge" . <Addresses/ID=18> <Addresses#state> "MA" . <Department/ID=23> rdf:type <Department> . <Department/ID=23> <Department#ID> 23 . <Department/ID=23> <Department#name> "accounting" . <Department/ID=23> <Department#city> "Cambridge" . <Department/ID=23> <Department#manager> 8 . <Department/ID=23> <Department#ref-manager> <People#ID=8> .
  • 16. + Multi-column primary keys Primary keys may also be composite. If, in the above example, the primary key for Department were (name, city) instead of ID, the identifier for the only row in this table would be <Department/name=accounting;city=Cambridge>. The triples involving <Department/ID=23> would be replaced with the following triples: <People/ID=7> <People#ref-deptName;deptCity> <Department/name=accounting;city=Cambridge> . <Department/name=accounting;city=Cambridge> rdf:type <Department> . <Department/name=accounting;city=Cambridge> <Department#ID> 23 . <Department/name=accounting;city=Cambridge> <Department#name> "accounting" . <Department/name=accounting;city=Cambridge> <Department#city> "Cambridge" .
  • 17. + Empty (non-existing) primary keys If there is no primary key, each row implies a set of triples with a shared subject, but that subject is a blank node. A Tweets table can be added to the above example to keep track of employees' tweets in Twitter: @base <http://foo.example/DB/> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> Tweets People(ID) tweeter when text 7 2010-08-30T01:33 I really like lolcats. 7 2010-08-30T09:01 I take it back. _:a rdf:type <Tweets> . _:a <Tweets#tweeter> "7" . _:a <Tweets#ref-tweeter> <People/ID=7> . _:a <Tweets#when> "2010-0830T01:33"^^xsd:dateTime . _:a <Tweets#text> "I really like lolcats." . _:b rdf:type <Tweets> . _:b <Tweets#tweeter> "7" . _:b <Tweets#ref-tweeter> <People/ID=7> . _:b <Tweets#when> "2010-0830T09:01"^^xsd:dateTime . _:b <Tweets#text> "I take it back." .
  • 18. + Row nodes Definition row node:  If the table has a primary key, the row node is a relative IRI obtained by concatenating:     the percent-encoded form of the table name, the SOLIDUS character '/', for each column in the primary key, in order:  the percent-encoded form of the column name,  a EQUALS SIGN character '=',  the percent-encoded lexical form of the canonical RDF literal representation of the column value as defined in R2RML section 10.2 Natural Mapping of SQL Values [R2RML],  if it is not the last column in the primary key, a SEMICOLON character ';' If the table has no primary key, the row node is a fresh blank node that is unique to this row.
  • 19. + Referencing tables with empty primary keys  Rows in tables with no primary key may still be referenced by foreign keys. (Relational database theory tells us that these rows must be unique as foreign keys reference candidate keys and candidate keys are unique across all the rows in a table.) References to rows in tables with no primary key are expressed as RDF triples with blank nodes for objects, where that blank node is the same node used for the subject in the referenced row.
  • 20. + Referencing tables with empty primary keys Projects Unique Key Unique Key People(ID) Department(name,city) lead name deptName deptCity 8 pencil survey accounting Cambridge 8 eraser survey accounting Cambridge TaskAssignments PK Projects(name, deptName, deptCity) People(ID) Department(name,city) worker project deptName deptCity 7 pencil survey accounting Cambridge
  • 21. @base <http://foo.example/DB/> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . _:c rdf:type <Projects> . _:c <Projects#lead> <People/ID=8> . _:c <Projects#name> "pencil survey" . _:c <Projects#deptName> "accounting" . _:c <Projects#deptCity> "Cambridge" . _:c <Projects#ref-deptName;deptCity> <Department/ID=23> . _:d rdf:type <Projects> . _:d <Projects#lead> <People/ID=8> . _:d <Projects#name> "eraser survey" . _:d <Projects#deptName> "accounting" . _:d <Projects#deptCity> "Cambridge" . _:d <Projects#ref-deptName;deptCity> <Department/ID=23> . <TaskAssignments/worker=7.project=pencil%20survey> rdf:type <TaskAssignments> . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#worker> 7 . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#ref-worker> <People/ID=7> . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#project> "pencil survey" . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#deptName> "accounting" . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#deptCity> "Cambridge" . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#ref-deptName;deptCity> <Department/ID=23> . <TaskAssignments/worker=7.project=pencil%20survey> <TaskAssignments#ref-project;deptName;deptCity> _:c .
  • 22. + Percent Encoding Definition percent-encode:  Replace the string with the IRI-safe form per section 7.3 of [R2RML]. String 42 Hello World! 2011-08-23T22:17:00Z ~A_17.1-2 葉篤正 IRI-safe version 42 Hello%20World%21 2011-08-23T22%3A17%3A00Z ~A_17.1-2 葉篤正
  • 25. + Case 1: Solution @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . _:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . _:a <Target#litattr1> 1010 . _:a <Target#key1attr1> "K1A1" . _:a <Target#key1attr2> "K1A2" . _:a <Target#key2attr1> "K2A1" . _:a <Target#key2attr2> "K2A2" . <Source/ID=1100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A2" . <Source/ID=1100> <Source#attrB> "K2A1" . <Source/ID=1100> <Source#ref-attrA;attrB> _:a .
  • 27. + Case 2: solution @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . <Target/PK=1010> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1010> <Target#PK> 1010 . <Target/PK=1010> <Target#key1attr1> "K1A1" . <Target/PK=1010> <Target#key1attr2> "K1A2" . <Target/PK=1010> <Target#key2attr1> "K2A1" . <Target/PK=1010> <Target#key2attr2> "K2A2" . <Source/ID=1100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A2" . <Source/ID=1100> <Source#attrB> "K2A1" . <Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> .
  • 29. + Case 3: solution @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . <Target/PK=1010> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1010> <Target#PK> 1010 . <Target/PK=1010> <Target#key1attr1> "K1A11" . <Target/PK=1010> <Target#key1attr2> "K1A21" . <Target/PK=1010> <Target#key2attr1> "K2A11" . <Target/PK=1010> <Target#key2attr2> "K2A21" . <Target/PK=1011> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1011> <Target#PK> 1011 . <Target/PK=1011> <Target#key1attr1> "K1A12" . <Target/PK=1011> <Target#key1attr2> "K1A22" . <Target/PK=1011> <Target#key2attr2> "K2A22" .
  • 30. + Case 3: solution (cont.) <Target/PK=1011> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Target> . <Target/PK=1011> <Target#PK> 1011 . <Target/PK=1011> <Target#key1attr1> "K1A12" . <Target/PK=1011> <Target#key1attr2> "K1A22" . <Target/PK=1011> <Target#key2attr2> "K2A22" . <Source/ID=1100> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1100> <Source#ID> 1100 . <Source/ID=1100> <Source#attrA> "K2A21" . <Source/ID=1100> <Source#attrB> "K2A11" . <Source/ID=1100> <Source#ref-attrA;attrB> <Target/PK=1010> . <Source/ID=1101> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <Source> . <Source/ID=1101> <Source#ID> 1101 . <Source/ID=1101> <Source#attrA> "K2A22" .
  • 32. + Using a Mapping (revisited)  ETL: Generate RDF triples for a triple-store (D2R, morph, Quest, etc.). Advantages: Easy integration with inference, compatible with an RDF tool.   Disadvantages: Updates on the sources do not propagate, Duplicated Data Virtual RDF Graphs: Do on-the-fly SPARQL to SQL translation (D2R, Virtuoso, Quest, etc.)  Advantages: Always in-synch, no data duplication, simple setup  Disadvantages: Only few tools offer good performance, only few tools support inference
  • 33. + D2RQ  The D2RQ Platform is a system for accessing relational databases as virtual, read-only RDF graphs. It offers RDFbased access to the content of relational databases without having to replicate it into an RDF store. Using D2RQ you can:  query a non-RDF database using SPARQL  access the content of the database as Linked Data over the Web  create custom dumps of the database in RDF formats for loading into an RDF store (ETL style)  access information in a non-RDF database using the Apache Jena API