diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzAllProperties.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzAllProperties.java index 92371c1cc..669f9011d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzAllProperties.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/sparql/GetClazzAllProperties.java @@ -3,6 +3,7 @@ package edu.cornell.mannlib.vitro.webapp.sparql; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -63,17 +64,16 @@ public class GetClazzAllProperties extends BaseEditController { return; } - String respo = ""; - respo += ""; + Map hm = new HashMap(); // Get Data Properties // Add rdfs:label to the list - respo += ""; - + hm.put("label", "http://www.w3.org/2000/01/rdf-schema#label0"); + /* + * respo += ""; + */ DataPropertyDao ddao = vreq.getFullWebappDaoFactory() .getDataPropertyDao(); @@ -88,11 +88,15 @@ public class GetClazzAllProperties extends BaseEditController { DataProperty dprop = (DataProperty) ddao .getDataPropertyByURI(dp.getURI()); if (dprop != null) { - respo += ""; + if (dprop.getLocalName() != null + || !dprop.getLocalName().equals("")) { + hm.put(dprop.getLocalName(), dprop.getURI() + "0"); + } + /* + * respo += ""; + */ } } } @@ -135,15 +139,32 @@ public class GetClazzAllProperties extends BaseEditController { ObjectProperty oprop = (ObjectProperty) odao .getObjectPropertyByURI(pi.getPropertyURI()); if (oprop != null) { - respo += ""; + /* + * respo += ""; + */ + if (oprop.getLocalName() != null + || !oprop.getLocalName().equals("")) { + hm.put(oprop.getLocalName(), oprop.getURI() + "1"); + } + } } } + String respo = ""; + respo += ""; + Object[] keys = hm.keySet().toArray(); + Arrays.sort(keys); + for (int i = 0; i < keys.length; i++) { + String key = (String) keys[i]; + String value = hm.get(key); + respo += ""; + } respo += ""; response.setContentType("text/xml"); response.setCharacterEncoding("UTF-8");