update geo focus map to use localName first, then label

This commit is contained in:
tworrall 2013-11-19 16:22:29 -05:00
parent 2474be9072
commit 6927e7b86d
3 changed files with 39 additions and 13 deletions

View file

@ -36,7 +36,8 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
+ "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(DISTINCT ?person) AS ?count) \n"
+ "PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> "
+ "SELECT DISTINCT ?label ?location (afn:localname(?location) AS ?localName) (COUNT(DISTINCT ?person) AS ?count) \n"
+ "WHERE { { \n"
+ " ?location rdf:type core:GeographicRegion . \n"
+ " ?location rdfs:label ?label . \n"
@ -77,6 +78,7 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
String label = map.get("label");
String html = map.get("count");
String uri = map.get("location");
String local = map.get("localName");
if ( uri != null ) {
uri = UrlBuilder.urlEncode(uri);
}
@ -107,6 +109,8 @@ public class GeoFocusMapLocations extends AbstractAjaxResponder {
+ radius
+ ",\"uri\": \""
+ uri
+ "\",\"local\": \""
+ local
+ "\"}},";
response += tempStr;
previousLabel = label;