home page map changes: the map now distinguishes countries from regions and counts are rolled up -- states or provinces into countries, countries into regions. Note: to see the roll up may require data curation to ensure the relations exist among the geographic regions.

This commit is contained in:
tworrall 2013-06-14 10:51:26 -04:00
parent f0a83018f0
commit 8c4103006b
7 changed files with 71 additions and 14 deletions

View file

@ -30,18 +30,33 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
private static final Log log = LogFactory.getLog(GeoFocusMapLocations.class.getName());
private List<Map<String,String>> geoLocations;
private static String GEO_FOCUS_QUERY = ""
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
+ "SELECT DISTINCT ?label ?location (COUNT(?person) AS ?count) \n"
+ "WHERE {"
+ " ?location rdf:type core:GeographicRegion . \n"
+ " ?location rdfs:label ?label . "
+ " ?location core:geographicFocusOf ?person . \n"
+ " ?person rdf:type foaf:Person \n"
+ "} \n"
+ "GROUP BY ?label ?location \n";
+ "PREFIX geo: <http://aims.fao.org/aos/geopolitical.owl#> \n"
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
+ "PREFIX foaf: <http://xmlns.com/foaf/0.1/> \n"
+ "PREFIX vivoc: <http://vivo.library.cornell.edu/ns/0.1#> \n"
+ "SELECT DISTINCT ?label ?location (COUNT(?person) AS ?count) \n"
+ "WHERE { { \n"
+ " ?location rdf:type core:GeographicRegion . \n"
+ " ?location rdfs:label ?label . \n"
+ " ?location core:geographicFocusOf ?person . \n"
+ " ?person rdf:type foaf:Person . \n"
+ " FILTER (NOT EXISTS {?location a core:StateOrProvince}) \n"
+ "} UNION { \n"
+ " ?location rdf:type core:GeographicRegion . \n"
+ " ?location core:geographicallyContains ?sublocation . \n"
+ " ?location rdfs:label ?label . \n"
+ " ?sublocation core:geographicFocusOf ?person . \n"
+ " ?person rdf:type foaf:Person \n"
+ "} UNION { \n"
+ " ?location rdf:type core:GeographicRegion . \n"
+ " ?location geo:hasMember ?sublocation . \n"
+ " ?location rdfs:label ?label . \n"
+ " ?sublocation core:geographicFocusOf ?person . \n"
+ " ?person rdf:type foaf:Person \n"
+ "} } \n"
+ "GROUP BY ?label ?location \n";
public GeoFocusMapLocations(HttpServlet parent, VitroRequest vreq,
HttpServletResponse resp) {