Database Reference
In-Depth Information
< Product/ProductKey= '' p1 '' > rdf:type < Product > .
< Product/ProductKey= '' p1 '' >< Product#ProductKey > '' p1 '' .
< Product/ProductKey= '' p1 '' >< Sales#ProductName > '' prod1 '' .
< Product/ProductKey= '' p1 '' >< Sales#QuantityPerUnit > '' 25 '' .
< Product/ProductKey= '' p1 '' >< Sales#UnitPrice > '' 60 '' .
< Product/ProductKey= '' p1 '' >< Sales#Discontinued > '' No '' .
< Product/ProductKey= '' p1 '' >< Sales#CategoryKey > '' c1 '' .
< Product/ProductKey= '' p1 '' >< Sales#ref-CategoryKey >
< Category/CategoryKey= '' c1 '' > .
...
Each row in Sales produces a set of triples with a common subject. The
subject is an IRI formed from the concatenation of the base IRI, the table
name, the primary key column name ( SalesKey ), and the primary key value
( s1 for the first tuple). The predicate for each column is an IRI formed as
the concatenation of the base IRI, the table name, and the column name.
The values are RDF literals taken from the column values. Each foreign
key produces a triple with a predicatecomposedoftheforeignkeycolumn
names, the referenced table, and the referenced column names. The object of
these triples is the row identifier for the referenced triple. The reference row
identifiers must coincide with the subject used for the triples generated from
the referenced row. For example, the triple
< Sales/SalesKey= '' s1 '' >< Sales#ref-ProductKey >< Product/ProductKey= '' p1 '' >
tells that the subject (the first row in Sales ) contains a foreign key in the
column ProductKey (the predicate in the triple) which refers to the triple iden-
tified in the object (the triple whose subject is < Product/ProductKey= '' p1 '' > ).
As can be seen, the direct mapping is very straightforward, although
rigid, in the sense that it does not allow any kind of customization. Indeed,
the structure of the resulting RDF graph directly reflects the structure of
the database, the target RDF vocabulary directly reflects the names of
database schema elements, and neither the structure nor the vocabulary can
be changed.
R2RML Mapping
R2RML 8 is a language for expressing mappings from relational databases
to RDF data sets. Such mappings provide the ability to view relational data
in RDF using a customized structure and vocabulary. As with the direct
mapping, an R2RML mapping results in an RDF graph.
An R2RML mapping is an RDF graph written in Turtle syntax, called
the mapping document . The main object of an R2RML mapping is the so-
called triples map . Each triples map is a collection of triples, composed of a
8 http://www.w3.org/TR/r2rml
Search WWH ::




Custom Search