SlideShare a Scribd company logo
+

Custom Mappings R2RML

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

Disclaimer

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

Reading material/sources


R2RML specification
W3C
http://www.w3.org/TR/r2rml/



R2RML specification
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
+
R2RML
Custom Mapping
+

R2RML Overview


An R2RML mapping refers to logical tables to retrieve data from
the input database. A logical table can be one of the following:






A base table,
a view, or
a valid SQL query (called an “R2RML view” because it emulates a SQL
view without modifying the database).

Each logical table is mapped to RDF using a triples map. The
triples map is a rule that maps each row in the logical table to a
number of RDF triples. The rule has two main parts:




A subject map that generates the subject of all RDF triples that will be
generated from a logical table row. The subjects often are IRIs that are
generated from the primary key column(s) of the table.
Multiple predicate-object maps that in turn consist of predicate maps
and object maps (or referencing object maps).
+

R2RML Overview


Triples are produced by combining the subject map with a
predicate map and object map, and applying these three to
each logical table row. For example, the complete rule for
generating a set of triples might be:




Subjects: A template http://data.example.com/employee/{empno} is
used to generate subject IRIs from the empno column.
Predicates: The constant vocabulary IRI ex:name is used.
Objects: The value of the ename column is used to produce an RDF
literal.

By default, all RDF triples are in the default graph of the output
dataset. A triples map can contain graph maps that place some or all
of the triples into named graphs instead.
+

Example

<http://data.example.com/employee/7369> rdf:type ex:Employee.
<http://data.example.com/employee/7369> ex:name "SMITH".
<http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>.
<http://data.example.com/department/10> rdf:type ex:Department.
<http://data.example.com/department/10> ex:name "APPSERVER".
<http://data.example.com/department/10> ex:location "NEW YORK".
<http://data.example.com/department/10> ex:staff 1.
+

Example

<http://data.example.com/employee/7369> rdf:type ex:Employee.
<http://data.example.com/employee/7369> ex:name "SMITH".
<http://data.example.com/employee/7369> ex:department
<http://data.example.com/department/10>.
<http://data.example.com/department/10> rdf:type ex:Department.
<http://data.example.com/department/10> ex:name "APPSERVER".
<http://data.example.com/department/10> ex:location "NEW YORK".
<http://data.example.com/department/10> ex:staff 1.

Note in particular:
• Construction of custom IRI identifiers for departments and employees;
• use of a custom target vocabulary (ex:Employee, ex:location etc.);
• the ex:staff property has the total number of staff of a department; this
value is not stored directly in the database but has to be computed.
• the ex:department property relates an employee to their department,
using the identifiers of both entities;
+

Simple tables
Result
<http://data.example.com/employee/7369> rdf:type ex:Employee.
<http://data.example.com/employee/7369> ex:name "SMITH".
<http://data.example.com/employee/7369> ex:department
<http://data.example.com/department/10>.
<http://data.example.com/department/10> rdf:type ex:Department.
<http://data.example.com/department/10> ex:name "APPSERVER".
<http://data.example.com/department/10> ex:location "NEW YORK".
<http://data.example.com/department/10> ex:staff 1.

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix ex: <http://example.com/ns#>.
<#TriplesMap1>
rr:logicalTable [ rr:tableName "EMP" ];
rr:subjectMap [
rr:template "http://data.example.com/employee/{EMPNO}";
rr:class ex:Employee;
];
rr:predicateObjectMap [
rr:predicate ex:name;
rr:objectMap [ rr:column "ENAME" ];
].
+

Views
<http://data.example.com/employee/7369> rdf:type ex:Employee.
<http://data.example.com/employee/7369> ex:name "SMITH".
<http://data.example.com/employee/7369> ex:department
<http://data.example.com/department/10>.
<http://data.example.com/department/10> rdf:type ex:Department.
<http://data.example.com/department/10> ex:name "APPSERVER".
<http://data.example.com/department/10> ex:location "NEW YORK".
<http://data.example.com/department/10> ex:staff 1.

<#DeptTableView> rr:sqlQuery """
SELECT DEPTNO,
DNAME,
LOC,
(SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS
STAFF
FROM DEPT;
""".

View definition
+

Views
Result
<http://data.example.com/employee/7369> rdf:type ex:Employee.
<http://data.example.com/employee/7369> ex:name "SMITH".
<http://data.example.com/employee/7369> ex:department
<http://data.example.com/department/10>.
<http://data.example.com/department/10> rdf:type ex:Department.

<#TriplesMap2>
<http://data.example.com/department/10> ex:name "APPSERVER".
<http://data.example.com/department/10> ex:location "NEW YORK".
rr:logicalTable <#DeptTableView>;
<http://data.example.com/department/10> ex:staff 1.
rr:subjectMap [
rr:template "http://data.example.com/department/{DEPTNO}";
rr:class ex:Department;
];
rr:predicateObjectMap [
rr:predicate ex:name;
Mapping to a View
rr:objectMap [ rr:column "DNAME" ];
];
Definition
rr:predicateObjectMap [
rr:predicate ex:location;
rr:objectMap [ rr:column "LOC" ];
];
rr:predicateObjectMap [
rr:predicate ex:staff;
rr:objectMap [ rr:column "STAFF" ];
].
+

Linking Two Tables (or views)
Result
<http://data.example.com/employee/7369> rdf:type ex:Employee.
<http://data.example.com/employee/7369> ex:name "SMITH".
<http://data.example.com/employee/7369> ex:department
<http://data.example.com/department/10>.
<http://data.example.com/department/10> rdf:type ex:Department.
<http://data.example.com/department/10> ex:name "APPSERVER".
<http://data.example.com/department/10> ex:location "NEW YORK".
<http://data.example.com/department/10> ex:staff 1.

<#TriplesMap1>
rr:predicateObjectMap [
rr:predicate ex:department;
rr:objectMap [
rr:parentTriplesMap <#TriplesMap2>;
rr:joinCondition [
rr:child "DEPTNO";
rr:parent "DEPTNO";
];
];
].
+

Many to Many relations

Expected output
<http://data.example.com/employee=7369/department=10>
ex:employee <http://data.example.com/employee/7369> ;
ex:department <http://data.example.com/department/10> .
<http://data.example.com/employee=7369/department=20>
ex:employee <http://data.example.com/employee/7369> ;
ex:department <http://data.example.com/department/20> .
<http://data.example.com/employee=7400/department=10>
ex:employee <http://data.example.com/employee/7400> ;
ex:department <http://data.example.com/department/10> .
+

Many to Many relations
<http://data.example.com/employee=7369/department=10>
ex:employee <http://data.example.com/employee/7369> ;
ex:department <http://data.example.com/department/10> .

<#TriplesMap3>
rr:logicalTable [ rr:tableName "EMP2DEPT" ];
rr:subjectMap [ rr:template "http://data.example.com/employee={EMPNO}/department={DEPTNO}" ];
rr:predicateObjectMap [
rr:predicate ex:employee;
rr:objectMap [ rr:template "http://data.example.com/employee/{EMPNO}" ];
];
rr:predicateObjectMap [
rr:predicate ex:department;
rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ];
].

The mapping
+

Many to Many relations
<http://data.example.com/employee=7369/department=10>
ex:employee <http://data.example.com/employee/7369> ;
ex:department <http://data.example.com/department/10> .

<#TriplesMap3>
Note that this models the case where
rr:logicalTable [ rr:tableName "EMP2DEPT" ];
the subject identifies each row
rr:subjectMap [ rr:template "http://data.example.com/employee={EMPNO}/department={DEPTNO}" ];
(composite)
rr:predicateObjectMap [
rr:predicate ex:employee;
rr:objectMap [ rr:template "http://data.example.com/employee/{EMPNO}" ];
];
rr:predicateObjectMap [
rr:predicate ex:department;
rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ];
].

The mapping
+

Many to Many relations (alt)

Expected output

<http://data.example.com/employee/7369>
ex:department <http://data.example.com/department/10> ;
ex:department <http://data.example.com/department/20> .
<http://data.example.com/employee/7400>
ex:department <http://data.example.com/department/10>.
+

Many to Many relations (alt)
<http://data.example.com/employee/7369>
ex:department <http://data.example.com/department/10> ;
ex:department <http://data.example.com/department/20> .
<http://data.example.com/employee/7400>
ex:department <http://data.example.com/department/10>.

<#TriplesMap3>
rr:logicalTable [ rr:tableName "EMP2DEPT" ];
rr:subjectMap [
rr:template "http://data.example.com/employee/{EMPNO}";
];
rr:predicateObjectMap [
rr:predicate ex:department;
rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ];
].

The mapping
+

Many to Many relations (alt)
<http://data.example.com/employee/7369>
ex:department <http://data.example.com/department/10> ;
ex:department <http://data.example.com/department/20> .
<http://data.example.com/employee/7400>
ex:department <http://data.example.com/department/10>.

<#TriplesMap3>
rr:logicalTable [ rr:tableName "EMP2DEPT" ];
rr:subjectMap [
rr:template "http://data.example.com/employee/{EMPNO}";
];
rr:predicateObjectMap [
rr:predicate ex:department;
rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ];
].

The mapping
+

Translating DB codes to IRIs

Assume the following correspondance:
CLERK
http://data.example.com/roles/general-office
NIGHTGUARD
http://data.example.com/roles/security
ENGINEER
http://data.example.com/roles/engineering

<http://data.example.com/employee/7369> ex:role
<http://data.example.com/roles/general-office>.
+

Translating DB codes to IRIs

<#TriplesMap1>
rr:logicalTable [ rr:sqlQuery """
SELECT EMP.*, (CASE JOB
WHEN 'CLERK' THEN 'general-office'
WHEN 'NIGHTGUARD' THEN 'security'
WHEN 'ENGINEER' THEN 'engineering'
END) ROLE FROM EMP
""" ];
rr:subjectMap [
rr:template "http://data.example.com/employee/{EMPNO}";
];
rr:predicateObjectMap [
rr:predicate ex:role;
rr:objectMap [ rr:template "http://data.example.com/roles/{ROLE}" ];
].
+
In detail specification
Definitions/considerations
+

Data errors


A data error is a condition of the data in the input database
that would lead to the generation of an invalid RDF term.
The following conditions give rise to data errors:


A term map with term type rr:IRI results in the generation of an
invalid IRI.



A term map whose natural RDF datatype is overridden with a
specified datatype produces an ill-typed literal (see datatypeoverride RDF literal).
+

Data errors


A data error is a condition of the data in the input database
that would lead to the generation of an invalid RDF term.
The following conditions give rise to data errors:


A term map with term type rr:IRI results in the generation of an
invalid IRI.



A term map whose natural RDF datatype is overridden with athe
Data errors cannot generally be detected by analyzing
specified datatype produces an ill-typed literal (see datatype- data
table schema of the database, but only by scanning the
override RDF tables. For large and rapidly changing databases, this
in the literal).
can be impractical. Therefore, R2RML processors are
allowed to answer queries that do not “touch” a data error,
and the behavior of such operations is well-defined. For the
same reason, the conformance of R2RML mappings is
defined without regard for the presence of data errors.
+

Default Mappings


An R2RML processor may include an R2RML default
mapping generator.



The default mapping should be such that its output is the Direct
Graph corresponding to the input database (Direct Mapping).



Duplicate row preservation: For tables without a primary key,
the Direct Graph requires that a fresh blank node is created for
each row. This ensures that duplicate rows in such tables are
preserved. This requirement is relaxed for R2RML default
mappings: They may reuse the same blank node for multiple
duplicate rows. This behaviour does not preserve duplicate
rows.
+

Logical Tables

A logical table is a tabular SQL query result that is to be mapped to
RDF triples. A logical table is either
• a SQL base table or view, or
• an R2RML view.
Every logical table has an effective SQL query that, if executed
over the SQL connection, produces as its result the contents of the
logical table.
+

Base Tables and SQL Views
(rr:tableName)


A SQL base table or view is a logical table containing SQL data
from a base table or view in the input database. A SQL base
table or view is represented by a resource that has exactly one
rr:tableName property.
The value of rr:tableName specifies the table or view name of
the base table or view. Its value must be a valid schemaqualified name that names an existing base table or view in the
input database.



The effective SQL query of a SQL base table or view is:
SELECT * FROM {table}
+

Example of mapping to a base table

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix ex: <http://example.com/ns#>.
<#TriplesMap1>
rr:logicalTable [ rr:tableName "EMP" ];
rr:subjectMap [
rr:template "http://data.example.com/employee/{EMPNO}";
rr:class ex:Employee;
];
rr:predicateObjectMap [
rr:predicate ex:name;
rr:objectMap [ rr:column "ENAME" ];
].
+

R2RML Views (rr:sqlQuery, rr:sqlVersion)
An R2RML view is a logical table whose contents are the result
of executing a SQL query against the input database. It is
represented by a resource that has exactly one rr:sqlQuery
property, whose value is a literal with a lexical form that is a
valid SQL query.
Data transformation
R2RML mappings sometimes require data transformation,
computation, or filtering before generating triples from the
database. This can be achieved by defining a SQL view in the
input database and referring to it with rr:tableName. However,
this approach may sometimes not be practical for lack of
database privileges or other reasons. R2RML views achieve the
same effect without requiring changes to the input database.
+

R2RML Views (rr:sqlQuery)


Duplicated columns are not allowed:
SELECT EMP.DEPTNO, 1 AS DEPTNO FROM EMP;



Unnamed columns are not recommended
SELECT DEPTNO, COUNT(EMPNO) FROM EMP GROUP BY
DEPTNO;
+

Example of mappings to views

<#DeptTableView> rr:sqlQuery """
SELECT DEPTNO,
DNAME,
LOC,
(SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS
STAFF
FROM DEPT;
<#TriplesMap2>
""".
rr:logicalTable <#DeptTableView>;
rr:subjectMap [
rr:template "http://data.example.com/department/{DEPTNO}";
rr:class ex:Department;
];
rr:predicateObjectMap [
rr:predicate ex:name;
rr:objectMap [ rr:column "DNAME" ];
];
rr:predicateObjectMap [
rr:predicate ex:staff;
rr:objectMap [ rr:column "STAFF" ];
].
+

R2RML Views (rr:sqlVersion)


An R2RML view may have one or more SQL version identifiers.
They must be valid IRIs and are represented as values of the
rr:sqlVersion property. The following SQL version identifier
indicates that the SQL query conforms to Core SQL 2008:
http://www.w3.org/ns/r2rml#SQL2008



The absence of a SQL version identifier indicates that no claim
to Core SQL 2008 conformance is made.



Additional identifiers, not normative, an be found at:
http://www.w3.org/2001/sw/wiki/RDB2RDF/SQL_Version_IRIs
+

Example
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://example.com/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .
<TriplesMap1>
a rr:TriplesMap;
rr:logicalTable [
rr:sqlQuery """
SELECT "ID”, "Name” FROM "Student” """;
rr:sqlVersion rr:SQL2008
];
rr:subjectMap [ rr:template "http://example.com/{"ID"}/{"Name"}"; ];
rr:predicateObjectMap
[
rr:predicate
foaf:name ;
rr:objectMap
[ rr:column ""Name"" ]
]
.
+

Mapping Logical Tables to RDF with
Triples Maps

A triples map specifies a rule for translating each row of a logical
table to zero or more RDF triples.
+

Mapping Logical Tables to RDF with
Triples Maps
The RDF triples generated from one row in the logical table all share the
same subject.
A triples map is represented by a resource that references the following
other resources:
• It must have exactly one rr:logicalTable property. Its value is a logical
table that specifies a SQL query result to be mapped to triples.
• It must have exactly one subject map that specifies how to generate a
subject for each row of the logical table. It may be specified in two ways:
• using the rr:subjectMap property, whose value must be the subject
map, or
• using the constant shortcut property rr:subject.
• It may have zero or more rr:predicateObjectMap properties, whose
values must be predicate-object maps. They specify pairs of predicate
maps and object maps that, together with the subjects generated by
the subject map, may form one or more RDF triples for each row.
+

Mapping Logical Tables to RDF with
Triples Maps

[]
rr:logicalTable [ rr:tableName "DEPT" ];
rr:subjectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ];
rr:predicateObjectMap [
rr:predicate ex:name;
rr:objectMap [ rr:column "DNAME" ];
];
rr:predicateObjectMap [
rr:predicate ex:location;
rr:objectMap [ rr:column "LOC" ];
].
+

Mapping Logical Tables to RDF with
Triples Maps
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix ex: <http://example.com/ns#>.
<#TriplesMap1>
rr:logicalTable [ rr:tableName "EMP" ];
rr:subjectMap [
rr:template "http://data.example.com/employee/{EMPNO}";
rr:class ex:Employee;
];
rr:predicateObjectMap [
rr:predicate ex:name;
rr:objectMap [ rr:column "ENAME" ];
].
+

Creating Resources with Subject
Maps


A subject map is a term map. It specifies a rule for generating
the subjects of the RDF triples generated by a triples map.



Term maps are used to generate the subjects, predicates and
objects of the RDF triples that are generated by a triples map.
Consequently, there are several kinds of term maps, depending
on where in the mapping they occur: subject maps, predicate
maps, object maps and graph maps.



A term map must be exactly one of the following:





a constant-valued term map,
a column-valued term map,
a template-valued term map.
+

Example with template
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://example.com/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .
<TriplesMap1>
a rr:TriplesMap;
rr:logicalTable [ rr:tableName ""IOUs"" ];

rr:subjectMap [ rr:template "http://example.com/{"fname"};{"lname"}";
rr:class foaf:Person ];
rr:predicateObjectMap
[
rr:predicate
rr:objectMap
];
.

ex:owes ;
[ rr:column ""amount""; ]
+

Example with constants

@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://example.com/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .
<TriplesMap1>
a rr:TriplesMap;
rr:logicalTable [ rr:tableName ""Student"" ];
rr:subjectMap [ rr:constant ex:BadStudent ] ;
rr:predicateObjectMap
[
rr:predicateMap [ rr:constant ex:description ];
rr:objectMap [ rr:constant "Bad Student"; ]
]
.
+

Creating Resources with Subject
Maps

<TriplesMap1>
a rr:TriplesMap;
rr:logicalTable [
rr:sqlQuery "”” Select ('Student' || "ID" ) AS StudentId , "ID”, "Name”
from "Student” ""” ];
rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; ];
rr:predicateObjectMap
[
rr:predicate
foaf:name ;
rr:objectMap
[ rr:column ""Name"" ]
]
.
+

Creating Properties and Values with
Predicate-Object Maps


A predicate-object map is a function that creates one or more
predicate-object pairs for each logical table row of a logical
table. It is used in conjunction with a subject map to generate
RDF triples in a triples map.
+

Creating Properties and Values with
Predicate-Object Maps


A predicate-object map is represented by a resource that references the
following other resources:




One or more predicate maps. Each of them may be specified in one of two
ways:
 using the rr:predicateMap property, whose value must be a predicate map, or
 using the constant shortcut property rr:predicate.
One or more object maps or referencing object maps. Each of them may be
specified in one of two ways:



using the rr:objectMap property, whose value must be either an object map,
or a referencing object map.
using the constant shortcut property rr:object.



A predicate map is a term map.



An object map is a term map.
+

Example with shortcuts

<TriplesMap1>
a rr:TriplesMap;
rr:logicalTable [ rr:tableName ""Student""; ];
rr:subjectMap [ rr:template "http://example.com/Student/{"ID"}/{"Name"}";
rr:graph ex:PersonGraph;
];
rr:predicateObjectMap
[
rr:predicaterdf:type;
rr:object
];
rr:predicateObjectMap
[
rr:predicate
rr:objectMap
]

foaf:Person;

foaf:name;
[ rr:column ""Name"" ]
+

Example with constants

@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://example.com/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@base <http://example.com/base/> .
<TriplesMap1>
a rr:TriplesMap;
rr:logicalTable [ rr:tableName ""Student"" ];
rr:subjectMap [ rr:constant ex:BadStudent ] ;
rr:predicateObjectMap
[
rr:predicateMap [ rr:constant ex:description ];
rr:objectMap [ rr:constant "Bad Student"; ]
]
.
+

Creating Properties and Values with
Predicate-Object Maps
A referencing object map allows using the subjects of another triples map as the objects generated
by a predicate-object map. Since both triples maps may be based on different logical tables, this
may require a join between the logical tables. This is not restricted to 1:1 joins.
A referencing object map is represented by a resource that:


has exactly one rr:parentTriplesMap property, whose value must be a triples map, known as the
referencing object map's parent triples map.



may have one or more rr:joinCondition properties, whose values must be join conditions.

A join condition is represented by a resource that has exactly one value for each of the following
two properties:


rr:child, whose value is known as the join condition's child column and must be a column name
that exists in the logical table of the triples map that contains the referencing object map



rr:parent, whose value is known as the join condition's parent column and must be a column
name that exists in the logical table of the referencing object map's parent triples map.
<TriplesMap1> a rr:TriplesMap;
rr:logicalTable [ rr:tableName ""Student"" ];
rr:subjectMap [ rr:template "http://example.com/resource/student_{"ID"}"; ];
rr:predicateObjectMap
[
rr:predicate
foaf:name ; rr:objectMap [ rr:column ""Name""; ];
];
rr:predicateObjectMap
[
rr:predicate <http://example.com/ontology/practises> ;
rr:objectMap
[
a rr:RefObjectMap ; rr:parentTriplesMap <TriplesMap2>;
rr:joinCondition [ rr:child ""Sport"" ;
rr:parent ""ID"" ; ]
];
];
.

<TriplesMap2> a rr:TriplesMap;
rr:logicalTable [ rr:tableName ""Sport"" ];
rr:subjectMap [ rr:template "http://example.com/resource/sport_{"ID"}"; ];
rr:predicateObjectMap
[
rr:predicate rdfs:label ; rr:objectMap [ rr:column ""Name""; ];
];
.
SWT Lecture Session 10 R2RML Part 1

More Related Content

What's hot

RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
Marin Dimitrov
 
ShEx by Example
ShEx by ExampleShEx by Example
ShEx by Example
Jose Emilio Labra Gayo
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
Frank van Harmelen
 
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
 
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
 
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
 
Data shapes-test-suite
Data shapes-test-suiteData shapes-test-suite
Data shapes-test-suite
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
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
AdonisDamian
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
Jose Emilio Labra Gayo
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
Nilesh Wagmare
 
Another RDF Encoding Form
Another RDF Encoding FormAnother RDF Encoding Form
Another RDF Encoding Form
Jakob .
 
Hack U Barcelona 2011
Hack U Barcelona 2011Hack U Barcelona 2011
Hack U Barcelona 2011
Peter Mika
 
Ks2008 Semanticweb In Action
Ks2008 Semanticweb In ActionKs2008 Semanticweb In Action
Ks2008 Semanticweb In ActionRinke Hoekstra
 

What's hot (19)

RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
 
ShEx by Example
ShEx by ExampleShEx by Example
ShEx by Example
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
 
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
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectives
 
RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031
 
5 rdfs
5 rdfs5 rdfs
5 rdfs
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Data shapes-test-suite
Data shapes-test-suiteData shapes-test-suite
Data shapes-test-suite
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
Sem webmaubeuge
Sem webmaubeugeSem webmaubeuge
Sem webmaubeuge
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
 
Another RDF Encoding Form
Another RDF Encoding FormAnother RDF Encoding Form
Another RDF Encoding Form
 
Hack U Barcelona 2011
Hack U Barcelona 2011Hack U Barcelona 2011
Hack U Barcelona 2011
 
SWT Lecture Session 8 - Rules
SWT Lecture Session 8 - RulesSWT Lecture Session 8 - Rules
SWT Lecture Session 8 - Rules
 
Ks2008 Semanticweb In Action
Ks2008 Semanticweb In ActionKs2008 Semanticweb In Action
Ks2008 Semanticweb In Action
 

Viewers also liked (8)

SWT Lab 1
SWT Lab 1SWT Lab 1
SWT Lab 1
 
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
 
SWT Lab 3
SWT Lab 3SWT Lab 3
SWT Lab 3
 
SWT Lab 2
SWT Lab 2SWT Lab 2
SWT Lab 2
 
SWT Lab 5
SWT Lab 5SWT Lab 5
SWT Lab 5
 
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 10 R2RML Part 1

Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQLLino Valdivia
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
Dimitris Kontokostas
 
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIsJosef Petrák
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
Paolo Pareti
 
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
 
Semantic Web introduction
Semantic Web introductionSemantic Web introduction
Semantic Web introduction
Graphity
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
Dr. Neil Brittliff
 
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemasDC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
Mikael Nilsson
 
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
 
Introduction to RDFa
Introduction to RDFaIntroduction to RDFa
Introduction to RDFa
Ivan Herman
 
RDFa Tutorial
RDFa TutorialRDFa Tutorial
RDFa Tutorial
Ivan Herman
 
Triplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the WebTriplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the Web
Daniele Dell'Aglio
 
HyperGraphQL
HyperGraphQLHyperGraphQL
HyperGraphQL
Szymon Klarman
 
Parallel RDF generation of heterogeneous Big Data sources
Parallel RDF generation of heterogeneous Big Data sourcesParallel RDF generation of heterogeneous Big Data sources
Parallel RDF generation of heterogeneous Big Data sources
ssuserf3a67c
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
Myungjin Lee
 
Chapter 3 semantic web
Chapter 3 semantic webChapter 3 semantic web
Chapter 3 semantic webR A Akerkar
 
20100614 ISWSA Keynote
20100614 ISWSA Keynote20100614 ISWSA Keynote
20100614 ISWSA Keynote
Axel Polleres
 
Translation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RMLTranslation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RML
Franck Michel
 

Similar to SWT Lecture Session 10 R2RML Part 1 (20)

Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
Data in RDF
Data in RDFData in RDF
Data in RDF
 
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...
 
Semantic Web introduction
Semantic Web introductionSemantic Web introduction
Semantic Web introduction
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
 
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemasDC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
 
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
 
Introduction to RDFa
Introduction to RDFaIntroduction to RDFa
Introduction to RDFa
 
RDFa Tutorial
RDFa TutorialRDFa Tutorial
RDFa Tutorial
 
Triplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the WebTriplewave: a step towards RDF Stream Processing on the Web
Triplewave: a step towards RDF Stream Processing on the Web
 
HyperGraphQL
HyperGraphQLHyperGraphQL
HyperGraphQL
 
Parallel RDF generation of heterogeneous Big Data sources
Parallel RDF generation of heterogeneous Big Data sourcesParallel RDF generation of heterogeneous Big Data sources
Parallel RDF generation of heterogeneous Big Data sources
 
Drupal web services
Drupal web servicesDrupal web services
Drupal web services
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
Chapter 3 semantic web
Chapter 3 semantic webChapter 3 semantic web
Chapter 3 semantic web
 
20100614 ISWSA Keynote
20100614 ISWSA Keynote20100614 ISWSA Keynote
20100614 ISWSA Keynote
 
Translation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RMLTranslation of Relational and Non-Relational Databases into RDF with xR2RML
Translation of Relational and Non-Relational Databases into RDF with xR2RML
 

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

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
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
 
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
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
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
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
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
 
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
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
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
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
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
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
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
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
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
 

Recently uploaded (20)

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
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
 
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
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
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
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
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...
 
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
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
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
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
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 ...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
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
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
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.
 

SWT Lecture Session 10 R2RML Part 1

  • 1. + Custom Mappings R2RML Mariano Rodriguez-Muro, Free University of Bozen-Bolzano
  • 2. + Disclaimer License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License http://creativecommons.org/licenses/by-sa/3.0/
  • 3. + Reading material/sources  R2RML specification W3C http://www.w3.org/TR/r2rml/  R2RML specification 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. + R2RML Overview  An R2RML mapping refers to logical tables to retrieve data from the input database. A logical table can be one of the following:     A base table, a view, or a valid SQL query (called an “R2RML view” because it emulates a SQL view without modifying the database). Each logical table is mapped to RDF using a triples map. The triples map is a rule that maps each row in the logical table to a number of RDF triples. The rule has two main parts:   A subject map that generates the subject of all RDF triples that will be generated from a logical table row. The subjects often are IRIs that are generated from the primary key column(s) of the table. Multiple predicate-object maps that in turn consist of predicate maps and object maps (or referencing object maps).
  • 10. + R2RML Overview  Triples are produced by combining the subject map with a predicate map and object map, and applying these three to each logical table row. For example, the complete rule for generating a set of triples might be:    Subjects: A template http://data.example.com/employee/{empno} is used to generate subject IRIs from the empno column. Predicates: The constant vocabulary IRI ex:name is used. Objects: The value of the ename column is used to produce an RDF literal. By default, all RDF triples are in the default graph of the output dataset. A triples map can contain graph maps that place some or all of the triples into named graphs instead.
  • 11. + Example <http://data.example.com/employee/7369> rdf:type ex:Employee. <http://data.example.com/employee/7369> ex:name "SMITH". <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>. <http://data.example.com/department/10> rdf:type ex:Department. <http://data.example.com/department/10> ex:name "APPSERVER". <http://data.example.com/department/10> ex:location "NEW YORK". <http://data.example.com/department/10> ex:staff 1.
  • 12. + Example <http://data.example.com/employee/7369> rdf:type ex:Employee. <http://data.example.com/employee/7369> ex:name "SMITH". <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>. <http://data.example.com/department/10> rdf:type ex:Department. <http://data.example.com/department/10> ex:name "APPSERVER". <http://data.example.com/department/10> ex:location "NEW YORK". <http://data.example.com/department/10> ex:staff 1. Note in particular: • Construction of custom IRI identifiers for departments and employees; • use of a custom target vocabulary (ex:Employee, ex:location etc.); • the ex:staff property has the total number of staff of a department; this value is not stored directly in the database but has to be computed. • the ex:department property relates an employee to their department, using the identifiers of both entities;
  • 13. + Simple tables Result <http://data.example.com/employee/7369> rdf:type ex:Employee. <http://data.example.com/employee/7369> ex:name "SMITH". <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>. <http://data.example.com/department/10> rdf:type ex:Department. <http://data.example.com/department/10> ex:name "APPSERVER". <http://data.example.com/department/10> ex:location "NEW YORK". <http://data.example.com/department/10> ex:staff 1. @prefix rr: <http://www.w3.org/ns/r2rml#>. @prefix ex: <http://example.com/ns#>. <#TriplesMap1> rr:logicalTable [ rr:tableName "EMP" ]; rr:subjectMap [ rr:template "http://data.example.com/employee/{EMPNO}"; rr:class ex:Employee; ]; rr:predicateObjectMap [ rr:predicate ex:name; rr:objectMap [ rr:column "ENAME" ]; ].
  • 14. + Views <http://data.example.com/employee/7369> rdf:type ex:Employee. <http://data.example.com/employee/7369> ex:name "SMITH". <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>. <http://data.example.com/department/10> rdf:type ex:Department. <http://data.example.com/department/10> ex:name "APPSERVER". <http://data.example.com/department/10> ex:location "NEW YORK". <http://data.example.com/department/10> ex:staff 1. <#DeptTableView> rr:sqlQuery """ SELECT DEPTNO, DNAME, LOC, (SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS STAFF FROM DEPT; """. View definition
  • 15. + Views Result <http://data.example.com/employee/7369> rdf:type ex:Employee. <http://data.example.com/employee/7369> ex:name "SMITH". <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>. <http://data.example.com/department/10> rdf:type ex:Department. <#TriplesMap2> <http://data.example.com/department/10> ex:name "APPSERVER". <http://data.example.com/department/10> ex:location "NEW YORK". rr:logicalTable <#DeptTableView>; <http://data.example.com/department/10> ex:staff 1. rr:subjectMap [ rr:template "http://data.example.com/department/{DEPTNO}"; rr:class ex:Department; ]; rr:predicateObjectMap [ rr:predicate ex:name; Mapping to a View rr:objectMap [ rr:column "DNAME" ]; ]; Definition rr:predicateObjectMap [ rr:predicate ex:location; rr:objectMap [ rr:column "LOC" ]; ]; rr:predicateObjectMap [ rr:predicate ex:staff; rr:objectMap [ rr:column "STAFF" ]; ].
  • 16. + Linking Two Tables (or views) Result <http://data.example.com/employee/7369> rdf:type ex:Employee. <http://data.example.com/employee/7369> ex:name "SMITH". <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10>. <http://data.example.com/department/10> rdf:type ex:Department. <http://data.example.com/department/10> ex:name "APPSERVER". <http://data.example.com/department/10> ex:location "NEW YORK". <http://data.example.com/department/10> ex:staff 1. <#TriplesMap1> rr:predicateObjectMap [ rr:predicate ex:department; rr:objectMap [ rr:parentTriplesMap <#TriplesMap2>; rr:joinCondition [ rr:child "DEPTNO"; rr:parent "DEPTNO"; ]; ]; ].
  • 17. + Many to Many relations Expected output <http://data.example.com/employee=7369/department=10> ex:employee <http://data.example.com/employee/7369> ; ex:department <http://data.example.com/department/10> . <http://data.example.com/employee=7369/department=20> ex:employee <http://data.example.com/employee/7369> ; ex:department <http://data.example.com/department/20> . <http://data.example.com/employee=7400/department=10> ex:employee <http://data.example.com/employee/7400> ; ex:department <http://data.example.com/department/10> .
  • 18. + Many to Many relations <http://data.example.com/employee=7369/department=10> ex:employee <http://data.example.com/employee/7369> ; ex:department <http://data.example.com/department/10> . <#TriplesMap3> rr:logicalTable [ rr:tableName "EMP2DEPT" ]; rr:subjectMap [ rr:template "http://data.example.com/employee={EMPNO}/department={DEPTNO}" ]; rr:predicateObjectMap [ rr:predicate ex:employee; rr:objectMap [ rr:template "http://data.example.com/employee/{EMPNO}" ]; ]; rr:predicateObjectMap [ rr:predicate ex:department; rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ]; ]. The mapping
  • 19. + Many to Many relations <http://data.example.com/employee=7369/department=10> ex:employee <http://data.example.com/employee/7369> ; ex:department <http://data.example.com/department/10> . <#TriplesMap3> Note that this models the case where rr:logicalTable [ rr:tableName "EMP2DEPT" ]; the subject identifies each row rr:subjectMap [ rr:template "http://data.example.com/employee={EMPNO}/department={DEPTNO}" ]; (composite) rr:predicateObjectMap [ rr:predicate ex:employee; rr:objectMap [ rr:template "http://data.example.com/employee/{EMPNO}" ]; ]; rr:predicateObjectMap [ rr:predicate ex:department; rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ]; ]. The mapping
  • 20. + Many to Many relations (alt) Expected output <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10> ; ex:department <http://data.example.com/department/20> . <http://data.example.com/employee/7400> ex:department <http://data.example.com/department/10>.
  • 21. + Many to Many relations (alt) <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10> ; ex:department <http://data.example.com/department/20> . <http://data.example.com/employee/7400> ex:department <http://data.example.com/department/10>. <#TriplesMap3> rr:logicalTable [ rr:tableName "EMP2DEPT" ]; rr:subjectMap [ rr:template "http://data.example.com/employee/{EMPNO}"; ]; rr:predicateObjectMap [ rr:predicate ex:department; rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ]; ]. The mapping
  • 22. + Many to Many relations (alt) <http://data.example.com/employee/7369> ex:department <http://data.example.com/department/10> ; ex:department <http://data.example.com/department/20> . <http://data.example.com/employee/7400> ex:department <http://data.example.com/department/10>. <#TriplesMap3> rr:logicalTable [ rr:tableName "EMP2DEPT" ]; rr:subjectMap [ rr:template "http://data.example.com/employee/{EMPNO}"; ]; rr:predicateObjectMap [ rr:predicate ex:department; rr:objectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ]; ]. The mapping
  • 23. + Translating DB codes to IRIs Assume the following correspondance: CLERK http://data.example.com/roles/general-office NIGHTGUARD http://data.example.com/roles/security ENGINEER http://data.example.com/roles/engineering <http://data.example.com/employee/7369> ex:role <http://data.example.com/roles/general-office>.
  • 24. + Translating DB codes to IRIs <#TriplesMap1> rr:logicalTable [ rr:sqlQuery """ SELECT EMP.*, (CASE JOB WHEN 'CLERK' THEN 'general-office' WHEN 'NIGHTGUARD' THEN 'security' WHEN 'ENGINEER' THEN 'engineering' END) ROLE FROM EMP """ ]; rr:subjectMap [ rr:template "http://data.example.com/employee/{EMPNO}"; ]; rr:predicateObjectMap [ rr:predicate ex:role; rr:objectMap [ rr:template "http://data.example.com/roles/{ROLE}" ]; ].
  • 26. + Data errors  A data error is a condition of the data in the input database that would lead to the generation of an invalid RDF term. The following conditions give rise to data errors:  A term map with term type rr:IRI results in the generation of an invalid IRI.  A term map whose natural RDF datatype is overridden with a specified datatype produces an ill-typed literal (see datatypeoverride RDF literal).
  • 27. + Data errors  A data error is a condition of the data in the input database that would lead to the generation of an invalid RDF term. The following conditions give rise to data errors:  A term map with term type rr:IRI results in the generation of an invalid IRI.  A term map whose natural RDF datatype is overridden with athe Data errors cannot generally be detected by analyzing specified datatype produces an ill-typed literal (see datatype- data table schema of the database, but only by scanning the override RDF tables. For large and rapidly changing databases, this in the literal). can be impractical. Therefore, R2RML processors are allowed to answer queries that do not “touch” a data error, and the behavior of such operations is well-defined. For the same reason, the conformance of R2RML mappings is defined without regard for the presence of data errors.
  • 28. + Default Mappings  An R2RML processor may include an R2RML default mapping generator.  The default mapping should be such that its output is the Direct Graph corresponding to the input database (Direct Mapping).  Duplicate row preservation: For tables without a primary key, the Direct Graph requires that a fresh blank node is created for each row. This ensures that duplicate rows in such tables are preserved. This requirement is relaxed for R2RML default mappings: They may reuse the same blank node for multiple duplicate rows. This behaviour does not preserve duplicate rows.
  • 29. + Logical Tables A logical table is a tabular SQL query result that is to be mapped to RDF triples. A logical table is either • a SQL base table or view, or • an R2RML view. Every logical table has an effective SQL query that, if executed over the SQL connection, produces as its result the contents of the logical table.
  • 30. + Base Tables and SQL Views (rr:tableName)  A SQL base table or view is a logical table containing SQL data from a base table or view in the input database. A SQL base table or view is represented by a resource that has exactly one rr:tableName property. The value of rr:tableName specifies the table or view name of the base table or view. Its value must be a valid schemaqualified name that names an existing base table or view in the input database.  The effective SQL query of a SQL base table or view is: SELECT * FROM {table}
  • 31. + Example of mapping to a base table @prefix rr: <http://www.w3.org/ns/r2rml#>. @prefix ex: <http://example.com/ns#>. <#TriplesMap1> rr:logicalTable [ rr:tableName "EMP" ]; rr:subjectMap [ rr:template "http://data.example.com/employee/{EMPNO}"; rr:class ex:Employee; ]; rr:predicateObjectMap [ rr:predicate ex:name; rr:objectMap [ rr:column "ENAME" ]; ].
  • 32. + R2RML Views (rr:sqlQuery, rr:sqlVersion) An R2RML view is a logical table whose contents are the result of executing a SQL query against the input database. It is represented by a resource that has exactly one rr:sqlQuery property, whose value is a literal with a lexical form that is a valid SQL query. Data transformation R2RML mappings sometimes require data transformation, computation, or filtering before generating triples from the database. This can be achieved by defining a SQL view in the input database and referring to it with rr:tableName. However, this approach may sometimes not be practical for lack of database privileges or other reasons. R2RML views achieve the same effect without requiring changes to the input database.
  • 33. + R2RML Views (rr:sqlQuery)  Duplicated columns are not allowed: SELECT EMP.DEPTNO, 1 AS DEPTNO FROM EMP;  Unnamed columns are not recommended SELECT DEPTNO, COUNT(EMPNO) FROM EMP GROUP BY DEPTNO;
  • 34. + Example of mappings to views <#DeptTableView> rr:sqlQuery """ SELECT DEPTNO, DNAME, LOC, (SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS STAFF FROM DEPT; <#TriplesMap2> """. rr:logicalTable <#DeptTableView>; rr:subjectMap [ rr:template "http://data.example.com/department/{DEPTNO}"; rr:class ex:Department; ]; rr:predicateObjectMap [ rr:predicate ex:name; rr:objectMap [ rr:column "DNAME" ]; ]; rr:predicateObjectMap [ rr:predicate ex:staff; rr:objectMap [ rr:column "STAFF" ]; ].
  • 35. + R2RML Views (rr:sqlVersion)  An R2RML view may have one or more SQL version identifiers. They must be valid IRIs and are represented as values of the rr:sqlVersion property. The following SQL version identifier indicates that the SQL query conforms to Core SQL 2008: http://www.w3.org/ns/r2rml#SQL2008  The absence of a SQL version identifier indicates that no claim to Core SQL 2008 conformance is made.  Additional identifiers, not normative, an be found at: http://www.w3.org/2001/sw/wiki/RDB2RDF/SQL_Version_IRIs
  • 36. + Example @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix ex: <http://example.com/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery """ SELECT "ID”, "Name” FROM "Student” """; rr:sqlVersion rr:SQL2008 ]; rr:subjectMap [ rr:template "http://example.com/{"ID"}/{"Name"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column ""Name"" ] ] .
  • 37.
  • 38. + Mapping Logical Tables to RDF with Triples Maps A triples map specifies a rule for translating each row of a logical table to zero or more RDF triples.
  • 39. + Mapping Logical Tables to RDF with Triples Maps The RDF triples generated from one row in the logical table all share the same subject. A triples map is represented by a resource that references the following other resources: • It must have exactly one rr:logicalTable property. Its value is a logical table that specifies a SQL query result to be mapped to triples. • It must have exactly one subject map that specifies how to generate a subject for each row of the logical table. It may be specified in two ways: • using the rr:subjectMap property, whose value must be the subject map, or • using the constant shortcut property rr:subject. • It may have zero or more rr:predicateObjectMap properties, whose values must be predicate-object maps. They specify pairs of predicate maps and object maps that, together with the subjects generated by the subject map, may form one or more RDF triples for each row.
  • 40. + Mapping Logical Tables to RDF with Triples Maps [] rr:logicalTable [ rr:tableName "DEPT" ]; rr:subjectMap [ rr:template "http://data.example.com/department/{DEPTNO}" ]; rr:predicateObjectMap [ rr:predicate ex:name; rr:objectMap [ rr:column "DNAME" ]; ]; rr:predicateObjectMap [ rr:predicate ex:location; rr:objectMap [ rr:column "LOC" ]; ].
  • 41. + Mapping Logical Tables to RDF with Triples Maps @prefix rr: <http://www.w3.org/ns/r2rml#>. @prefix ex: <http://example.com/ns#>. <#TriplesMap1> rr:logicalTable [ rr:tableName "EMP" ]; rr:subjectMap [ rr:template "http://data.example.com/employee/{EMPNO}"; rr:class ex:Employee; ]; rr:predicateObjectMap [ rr:predicate ex:name; rr:objectMap [ rr:column "ENAME" ]; ].
  • 42. + Creating Resources with Subject Maps  A subject map is a term map. It specifies a rule for generating the subjects of the RDF triples generated by a triples map.  Term maps are used to generate the subjects, predicates and objects of the RDF triples that are generated by a triples map. Consequently, there are several kinds of term maps, depending on where in the mapping they occur: subject maps, predicate maps, object maps and graph maps.  A term map must be exactly one of the following:    a constant-valued term map, a column-valued term map, a template-valued term map.
  • 43. + Example with template @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix ex: <http://example.com/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName ""IOUs"" ]; rr:subjectMap [ rr:template "http://example.com/{"fname"};{"lname"}"; rr:class foaf:Person ]; rr:predicateObjectMap [ rr:predicate rr:objectMap ]; . ex:owes ; [ rr:column ""amount""; ]
  • 44.
  • 45. + Example with constants @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix ex: <http://example.com/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName ""Student"" ]; rr:subjectMap [ rr:constant ex:BadStudent ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:constant ex:description ]; rr:objectMap [ rr:constant "Bad Student"; ] ] .
  • 46.
  • 47. + Creating Resources with Subject Maps <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:sqlQuery "”” Select ('Student' || "ID" ) AS StudentId , "ID”, "Name” from "Student” ""” ]; rr:subjectMap [ rr:column "StudentId"; rr:termType rr:BlankNode; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column ""Name"" ] ] .
  • 48.
  • 49. + Creating Properties and Values with Predicate-Object Maps  A predicate-object map is a function that creates one or more predicate-object pairs for each logical table row of a logical table. It is used in conjunction with a subject map to generate RDF triples in a triples map.
  • 50. + Creating Properties and Values with Predicate-Object Maps  A predicate-object map is represented by a resource that references the following other resources:   One or more predicate maps. Each of them may be specified in one of two ways:  using the rr:predicateMap property, whose value must be a predicate map, or  using the constant shortcut property rr:predicate. One or more object maps or referencing object maps. Each of them may be specified in one of two ways:   using the rr:objectMap property, whose value must be either an object map, or a referencing object map. using the constant shortcut property rr:object.  A predicate map is a term map.  An object map is a term map.
  • 51. + Example with shortcuts <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName ""Student""; ]; rr:subjectMap [ rr:template "http://example.com/Student/{"ID"}/{"Name"}"; rr:graph ex:PersonGraph; ]; rr:predicateObjectMap [ rr:predicaterdf:type; rr:object ]; rr:predicateObjectMap [ rr:predicate rr:objectMap ] foaf:Person; foaf:name; [ rr:column ""Name"" ]
  • 52. + Example with constants @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix ex: <http://example.com/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @base <http://example.com/base/> . <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName ""Student"" ]; rr:subjectMap [ rr:constant ex:BadStudent ] ; rr:predicateObjectMap [ rr:predicateMap [ rr:constant ex:description ]; rr:objectMap [ rr:constant "Bad Student"; ] ] .
  • 53. + Creating Properties and Values with Predicate-Object Maps A referencing object map allows using the subjects of another triples map as the objects generated by a predicate-object map. Since both triples maps may be based on different logical tables, this may require a join between the logical tables. This is not restricted to 1:1 joins. A referencing object map is represented by a resource that:  has exactly one rr:parentTriplesMap property, whose value must be a triples map, known as the referencing object map's parent triples map.  may have one or more rr:joinCondition properties, whose values must be join conditions. A join condition is represented by a resource that has exactly one value for each of the following two properties:  rr:child, whose value is known as the join condition's child column and must be a column name that exists in the logical table of the triples map that contains the referencing object map  rr:parent, whose value is known as the join condition's parent column and must be a column name that exists in the logical table of the referencing object map's parent triples map.
  • 54. <TriplesMap1> a rr:TriplesMap; rr:logicalTable [ rr:tableName ""Student"" ]; rr:subjectMap [ rr:template "http://example.com/resource/student_{"ID"}"; ]; rr:predicateObjectMap [ rr:predicate foaf:name ; rr:objectMap [ rr:column ""Name""; ]; ]; rr:predicateObjectMap [ rr:predicate <http://example.com/ontology/practises> ; rr:objectMap [ a rr:RefObjectMap ; rr:parentTriplesMap <TriplesMap2>; rr:joinCondition [ rr:child ""Sport"" ; rr:parent ""ID"" ; ] ]; ]; . <TriplesMap2> a rr:TriplesMap; rr:logicalTable [ rr:tableName ""Sport"" ]; rr:subjectMap [ rr:template "http://example.com/resource/sport_{"ID"}"; ]; rr:predicateObjectMap [ rr:predicate rdfs:label ; rr:objectMap [ rr:column ""Name""; ]; ]; .