Database Reference
In-Depth Information
logical table ,a subject map , and zero or more predicate object maps . A logical
table is either a base table or a view (using the predicate rr:tableName )or
an SQL query (using the predicate rr:sqlQuery ). A predicate object map is
composed of a predicate map and an object map. Subject maps, predicate
maps, and object maps are either constants ( rr:constant ), column-based
maps ( rr:column ), or template-based maps ( rr:template ). Templates use brace-
enclosed column names as placeholders. As an example, Fig. 14.3 shows how
a portion of the dimension table Product is mapped to RDF using R2RML.
This mapping can be then applied to any instance of the table to produce
the triples. We next show the mapping document, which, together with the
instance of the table, will produce the RDF graph:
#TriplesMap_Product
rr:logicalTable
rr:subjectMap
rr:predicateObjectMap
rr:predicate
rr:objectMap
rr:predicate
rr:objectMap
rr:tableName
rr:template
rr:class
Product
../{ProductKey}
ex:product
ex:productName
ex:unitPrice
rr:column
rr:column
ProductName
UnitPrice
Fig. 14.3 R2RML mapping of the Product dimension
@prefix rr: < http://www.w3.org/ns/r2rml# > .
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix rdfs: < http://www.w3.org/2000/01/rdf-schema# > .
@prefix ex: < http://example.org/ > .
< #TriplesMap Product >
a rr:TriplesMap ;
rr:logicalTable [ rr:tableName '' Product '' ];
rr:subjectMap [
rr:template '' http://example.org/product/
{
ProductKey
}
'' ;
rr:class ex:product ] ;
rr:predicateObjectMap [
rr:predicate ex:productName ;
rr:objectMap [ rr:column '' ProductName '' ; rr:language '' en '' ];];
rr:predicateObjectMap [
rr:predicate ex:unitPrice ;
rr:objectMap [ rr:column '' UnitPrice '' ; rr:datatype rdfs:integer ] ; ] .
The triples map above (corresponding to the table Product ) is called
< #TriplesMap Product > . The logical table is the table Product ,andthe
 
Search WWH ::




Custom Search