install(namespace('geom2d')); install(namespace('geo')); setHomeAndTopic(resource("http://www.mapbureau.com/rdfmapper/2.0/examples/ex1")); 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); rs . geom2d:x = x.geo:long; rs . geom2d:y = x.geo:lat; return rs; } return nil ~ geom2d:Point; } geom2d:Point function extractTopicLocation(Resource itm) { if (count(itm,foaf:topic)>0) return extractGeoLatLong(itm.foaf:topic); return nil ~ geom2d:Point; }