
Map Health Code Violations with RDFMapper #21
Chapter 2, Mapping Your Neighborhood
|
95
HACK
Most of the remaining parameters denote functions defined in the Fabl pro-
gramming language, an open source language designed specifically for
manipulating RDF. (Fabl is implemented within RDF as well; see http://fabl.
net for more details.) Parameters naming Fabl functions may take the form:
<function_name>
or
<URL-of-Fabl-code-file>#<function_name>
In the former case, the function is taken from a library of utility functions for
RDFMapper, available at http://www.mapbureau.com/libsrc/rdfmapper_utils-
2.0.fbl. In the latter case, the function is taken from the specified Fabl code
file. See the rdfmapper_utils-2.0.fbl file for documentation of the utilities
used in the previous example, such as
itemGen1, extractTopicLocation, and
so on. If, as is often the case, the functions appearing in the library suit the
purposes of an application, there is no need to develop new versions.
The
extractor parameter denotes a Fabl function that, when given an RDF
resource, returns a
geom2d:Point representing its location, or nil. RDFMap-
per maps everything (that is, all resources) in the content file for which
extractor returns a non-nil value. Here’s a sample extractor:
geom2d:Point function extractGeoLatLong(Resource x) {
var geom2d:Point rs;
if ((count(x,geo:lat)>0) && (count(x,geo:long)>0))
{
rs = new(geom2d:Point);