Database Reference
In-Depth Information
27. d2rq:property admin:spatiallyContainedIn;
28. d2rq:column “Regions.F_NAME”.
29.
30.map:parishMap latitude a d2rq:PropertyBridge;
31. d2rq:belongsToClassMap map:parishMap;
32. d2rq:property geo:lat;
33. d2rq:sqlExpression “SELECT Regions.DEG_LAT + Regions.MIN_LAT/60”.
34.
35.map:parishMap longitude a d2rq:PropertyBridge;
36. d2rq:belongsToClassMap map:parishMap;
37. d2rq:property geo:long;
38. d2rq:sqlExpression “SELECT Regions.DEG_LONG + Regions.MIN_
LONG/60”.
Lines 20 to 23 create the mapping for the property admin:hasPlaceName. Line 21
states that it belongs to the d2rq:ClassMap parishMap. So, triples will be created that
have subject URIs of the form in line 16, the predicates will be admin:hasPlaceName,
and the objects will be literal values from the database table Regions, column
“DEF_NAME.” A similar pattern is followed in lines 25 to 28 to create the mapping
for admin:spatiallyContains. Lines 30 to 33 and 35 to 38 specify the mappings for
the geo:lat and geo:long properties, respectively. The value of the triple's object is
the result of the SQL query stated in d2rq:sqlExpression (lines 33 and 38), namely,
the sum of the values in the DEG_LAT and MIN_LAT/60 columns (or DEG_LONG
and MIN_LONG/60). In this way, the conversion from degrees and minutes to deci-
mal latitude and longitude can be specified in the mapping itself. However, carrying
out this kind of calculation on the fly tends to degrade performance, and it might
be better to create a new database table, or at least View on the database, that had
precalculated the latitude and longitude in decimal format.
7.5.3.5 R2RML
A standard language, R2RML, to express mappings from RDBs to RDF is cur-
rently being developed by the W3C RDB2RDF Working Group (Das, Sundara, and
Cyganiak, 2011). Since the mappings are themselves RDF graphs, the knowledge
encoded in the mappings are made explicit and more easily understandable than
information encoded in any of the proprietary mapping languages. Hence, this ini-
tiative will go some way to resolving the problem of knowledge being hidden in the
mapping itself. It will also enable the mappings to be reused should the underlying
RDB be migrated to a different vendor's and simplify programming applications that
access multiple data sources. Thus, currently there is no “perfect” solution to recom-
mend to Merea Maps, although as we have seen, Virtuoso and D2R Server offer two
useful options, the former commercially supported and the latter open source.
7.5.4 D ata S oUrceS WIth apI S
So far, we have discussed data sources that are text documents, structured data
such as CSV files or spreadsheets, and RDB sources. But, what happens when the
data is hidden behind a proprietary Web API, such as the Flickr, Amazon, Twitter,
Search WWH ::




Custom Search