Database Reference
In-Depth Information
subject is the template for the key, ProductKey . Applied to the input
table, this will produce the subject of the triples. For each such subject,
the predicate-object mapping will produce the mapping of the columns we
wish to map. For example, rr:predicate ex:productName will map the column
ProductName . Note that this procedure allows us to customize the name of
the column, for example, according to a given vocabulary. Below, we show
some of the triples produced by this mapping when applied to the table
Product in Fig. 14.2 b:
< http://example.org/product/p1 >
a < http://example.org/product > ;
< http://example.org/productName > '' prod1 '' @en ;
< http://example.org/unitPrice > '' 60 '' ∧∧
< http://www.w3.org/2000/01/rdf-schema#integer >
.... ;
Foreign keys are handled through referencing object maps , which use the
subjects of another triples map as the objects generated by a predicate-object
map:
< #TriplesMap Sales >
rr:predicateObjectMap [
rr:predicate ex:product ;
rr:objectMap [
rr:parentTriplesMap < #TriplesMap Product > ;
rr:joinCondition [
rr:child '' ProductKey '' ;
rr:parent '' ProductKey '' ];];].
The rr:parentTriplesMap predicate references an existing triples map in the
same mapping file that generates the desired resource. In the example above,
in the mapping file for the Sales fact table, when mapping the foreign key
for the table Product , we reference the mapping for the latter (which we
have called < #TriplesMap Product > ). The join condition ( rr:joinCondition )
contains two elements, namely, rr:child and rr:parent . The former is associated
with a column name of the logical table of the triples map containing the
referencing object map. The latter is associated with a logical column name
of the referenced triples map.
14.2 SPARQL
SPARQL 9 is the standard query language for RDF graphs. SPARQL queries
are built using variables, which are denoted using either ' ? 'or' $ 'asaprefix,
although the former is normally used. The query evaluation mechanism of
9 http://www.w3.org/TR/sparql11-query/
 
Search WWH ::




Custom Search