Database Reference
In-Depth Information
a
SalesKey ProductKey CustomerKey TimeKey Quantity
s1
p1
c1
t1
100
s2
p1
c2
t2
100
···
···
···
···
···
b
ProductKey ProductName QuantityPerUnit UnitPrice Discontinued CategoryName
p1
prod1
25
60
No
c1
p2
prod2
45
60
No
c1
···
···
···
···
···
···
Fig. 14.2 An excerpt of a simplified version of the Northwind data warehouse.
( a ) Sales fact table. ( b ) Product dimension table
The World Wide Web Consortium (W3C) has proposed two ways of
mapping relational data to RDF: the direct mapping and the R2RML
mapping, which we present next.
Direct Mapping
The direct mapping 7 defines an RDF graph representation of the data in a
relational database. This mapping takes as input the schema and instance of a
relational database and produces an RDF graph called the direct graph ,whose
triples are formed concatenating column names and values with a base IRI .
In the examples below, the base IRI is < http://example.org/ > . The mapping
also accounts for the foreign keys in the databases being mapped. The direct
mapping for the Sales fact table and the Product dimension table in Fig. 14.2
results in an RDF graph, from which we show below some triples:
@base < http://example.org/ >
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
< Sales/SalesKey= '' s1 '' > rdf:type < Sales > .
< Sales/SalesKey= '' s1 '' >< Sales#SalesKey > '' s1 '' .
< Sales/SalesKey= '' s1 '' >< Sales#ProductKey > '' p1 '' .
< Sales/SalesKey= '' s1 '' >< Sales#ref-ProductKey >< Product/ProductKey= '' p1 '' > .
< Sales/SalesKey= '' s1 '' >< Sales#CustomerKey > '' c1 '' .
< Sales/SalesKey= '' s1 '' >< Sales#ref-CustomerKey >
< Customer/CustomerKey= '' c1 '' > .
< Sales/SalesKey= '' s1 '' >< Sales#TimeKey > '' t1 '' .
< Sales/SalesKey= '' s1 '' >< Sales#ref-TimeKey >< Time/TimeKey= '' t1 '' > .
< Sales/SalesKey= '' s1 '' >< Sales#Quantity > '' 100 '' .
...
7 http://www.w3.org/TR/rdb-direct-mapping/
 
Search WWH ::




Custom Search