Minor code improvements
This commit is contained in:
parent
d87bb782eb
commit
d97544b991
50 changed files with 344 additions and 405 deletions
|
@ -73,43 +73,38 @@ public class FormUtils {
|
||||||
|
|
||||||
Method[] meths = beanClass.getMethods();
|
Method[] meths = beanClass.getMethods();
|
||||||
|
|
||||||
for (int i=0; i<meths.length; i++) {
|
for (Method currMeth : meths) {
|
||||||
|
|
||||||
if (meths[i].getName().indexOf("set") == 0) {
|
if (currMeth.getName().indexOf("set") == 0) {
|
||||||
|
|
||||||
// we have a setter method
|
// we have a setter method
|
||||||
Method currMeth = meths[i];
|
|
||||||
Class[] currMethParamTypes = currMeth.getParameterTypes();
|
Class[] currMethParamTypes = currMeth.getParameterTypes();
|
||||||
Class currMethType = currMethParamTypes[0];
|
Class currMethType = currMethParamTypes[0];
|
||||||
|
|
||||||
if (SUPPORTED_TYPE_LIST.contains(currMethType)) {
|
if (SUPPORTED_TYPE_LIST.contains(currMethType)) {
|
||||||
//we only want people directly to type in ints, strings, and dates
|
//we only want people directly to type in ints, strings, and dates
|
||||||
//of course, most of the ints are probably foreign keys anyway...
|
//of course, most of the ints are probably foreign keys anyway...
|
||||||
|
|
||||||
String elementName = currMeth.getName().substring(
|
String elementName = currMeth.getName().substring(
|
||||||
3,currMeth.getName().length());
|
3, currMeth.getName().length());
|
||||||
|
|
||||||
//see if there's something in the bean using
|
//see if there's something in the bean using
|
||||||
//the related getter method
|
//the related getter method
|
||||||
|
|
||||||
Class[] paramClass = new Class[1];
|
|
||||||
paramClass[0] = currMethType;
|
|
||||||
try {
|
try {
|
||||||
Method getter = beanClass.getMethod(
|
Method getter = beanClass.getMethod(
|
||||||
"get" + elementName, (Class[]) null);
|
"get" + elementName, (Class[]) null);
|
||||||
Object existingData = null;
|
Object existingData = null;
|
||||||
try {
|
try {
|
||||||
existingData = getter.invoke(bean, (Object[]) null);
|
existingData = getter.invoke(bean, (Object[]) null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error ("Exception invoking getter method");
|
log.error("Exception invoking getter method");
|
||||||
}
|
}
|
||||||
String value = "";
|
String value = "";
|
||||||
if (existingData != null){
|
if (existingData != null) {
|
||||||
if (existingData instanceof String){
|
if (existingData instanceof String) {
|
||||||
value += existingData;
|
value += existingData;
|
||||||
}
|
} else if (!(existingData instanceof Integer
|
||||||
else if (!(existingData instanceof Integer
|
&& (Integer) existingData < 0)) {
|
||||||
&& (Integer)existingData < 0)) {
|
|
||||||
value += existingData.toString();
|
value += existingData.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -375,9 +370,9 @@ public class FormUtils {
|
||||||
public static Map beanParamMapFromString(String params) {
|
public static Map beanParamMapFromString(String params) {
|
||||||
String[] param = params.split(";");
|
String[] param = params.split(";");
|
||||||
Map beanParamMap = new HashMap();
|
Map beanParamMap = new HashMap();
|
||||||
for (int i=0; i<param.length; i++) {
|
for (String aParam : param) {
|
||||||
String[] p = param[i].split(":");
|
String[] p = aParam.split(":");
|
||||||
beanParamMap.put(p[0],new String(Base64.decodeBase64(p[1].getBytes())));
|
beanParamMap.put(p[0], new String(Base64.decodeBase64(p[1].getBytes())));
|
||||||
}
|
}
|
||||||
return beanParamMap;
|
return beanParamMap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -549,8 +549,8 @@ class Stemmer
|
||||||
{
|
{
|
||||||
char[] w = new char[501];
|
char[] w = new char[501];
|
||||||
Stemmer s = new Stemmer();
|
Stemmer s = new Stemmer();
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (String arg : args) {
|
||||||
System.out.println( StemString( args[i], 100 ));
|
System.out.println(StemString(arg, 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,8 +73,8 @@ public class Controllers {
|
||||||
if (Controllers.letters == null) {
|
if (Controllers.letters == null) {
|
||||||
char c[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
|
char c[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
|
||||||
Controllers.letters = new ArrayList<String>(c.length);
|
Controllers.letters = new ArrayList<String>(c.length);
|
||||||
for (int i = 0; i < c.length; i++) {
|
for (char aC : c) {
|
||||||
letters.add("" + c[i]);
|
letters.add("" + aC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Controllers.letters;
|
return Controllers.letters;
|
||||||
|
|
|
@ -72,43 +72,43 @@ public class Classes2ClassesOperationController extends BaseEditController {
|
||||||
if ((subclassURIstrs != null) && (subclassURIstrs.length > 1)) {
|
if ((subclassURIstrs != null) && (subclassURIstrs.length > 1)) {
|
||||||
String superclassURIstr = request.getParameter("SuperclassURI");
|
String superclassURIstr = request.getParameter("SuperclassURI");
|
||||||
if (superclassURIstr != null) {
|
if (superclassURIstr != null) {
|
||||||
for (int i=0; i<subclassURIstrs.length; i++) {
|
for (String subclassURIstr : subclassURIstrs) {
|
||||||
switch (modeStr) {
|
switch (modeStr) {
|
||||||
case "disjointWith":
|
case "disjointWith":
|
||||||
vcDao.removeDisjointWithClass(superclassURIstr, subclassURIstrs[i]);
|
vcDao.removeDisjointWithClass(superclassURIstr, subclassURIstr);
|
||||||
break;
|
break;
|
||||||
case "equivalentClass":
|
case "equivalentClass":
|
||||||
vcDao.removeEquivalentClass(superclassURIstr, subclassURIstrs[i]);
|
vcDao.removeEquivalentClass(superclassURIstr, subclassURIstr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Classes2Classes c2c = new Classes2Classes();
|
Classes2Classes c2c = new Classes2Classes();
|
||||||
c2c.setSubclassURI(subclassURIstrs[i]);
|
c2c.setSubclassURI(subclassURIstr);
|
||||||
c2c.setSuperclassURI(superclassURIstr);
|
c2c.setSuperclassURI(superclassURIstr);
|
||||||
vcDao.deleteClasses2Classes(c2c);
|
vcDao.deleteClasses2Classes(c2c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String subclassURIstr = subclassURIstrs[0];
|
String subclassURIstr = subclassURIstrs[0];
|
||||||
String[] superclassURIstrs = request.getParameterValues("SuperclassURI");
|
String[] superclassURIstrs = request.getParameterValues("SuperclassURI");
|
||||||
if (superclassURIstrs != null) {
|
if (superclassURIstrs != null) {
|
||||||
for (int i=0; i<superclassURIstrs.length; i++) {
|
for (String superclassURIstr : superclassURIstrs) {
|
||||||
switch (modeStr) {
|
switch (modeStr) {
|
||||||
case "disjointWith":
|
case "disjointWith":
|
||||||
vcDao.removeDisjointWithClass(superclassURIstrs[i], subclassURIstr);
|
vcDao.removeDisjointWithClass(superclassURIstr, subclassURIstr);
|
||||||
break;
|
break;
|
||||||
case "equivalentClass":
|
case "equivalentClass":
|
||||||
vcDao.removeEquivalentClass(subclassURIstr, superclassURIstrs[i]);
|
vcDao.removeEquivalentClass(subclassURIstr, superclassURIstr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Classes2Classes c2c = new Classes2Classes();
|
Classes2Classes c2c = new Classes2Classes();
|
||||||
c2c.setSuperclassURI(superclassURIstrs[i]);
|
c2c.setSuperclassURI(superclassURIstr);
|
||||||
c2c.setSubclassURI(subclassURIstr);
|
c2c.setSubclassURI(subclassURIstr);
|
||||||
vcDao.deleteClasses2Classes(c2c);
|
vcDao.deleteClasses2Classes(c2c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (request.getParameter("operation").equals("add")) {
|
} else if (request.getParameter("operation").equals("add")) {
|
||||||
|
|
|
@ -211,7 +211,7 @@ public class EntityEditController extends BaseEditController {
|
||||||
|
|
||||||
public void doPost (HttpServletRequest request, HttpServletResponse response) {
|
public void doPost (HttpServletRequest request, HttpServletResponse response) {
|
||||||
log.trace("Please don't POST to the "+this.getClass().getName()+". Use GET instead as there should be no change of state.");
|
log.trace("Please don't POST to the "+this.getClass().getName()+". Use GET instead as there should be no change of state.");
|
||||||
doPost(request,response);
|
doGet(request,response);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,9 +67,9 @@ public class IndividualTypeOperationController extends BaseEditController {
|
||||||
String[] typeURIstrs = request.getParameterValues("TypeURI");
|
String[] typeURIstrs = request.getParameterValues("TypeURI");
|
||||||
String individualURIstr = request.getParameter("individualURI");
|
String individualURIstr = request.getParameter("individualURI");
|
||||||
if (individualURIstr != null) {
|
if (individualURIstr != null) {
|
||||||
for (int i=0; i<typeURIstrs.length; i++) {
|
for (String typeURIstr : typeURIstrs) {
|
||||||
dao.removeVClass(individualURIstr, typeURIstrs[i]);
|
dao.removeVClass(individualURIstr, typeURIstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (request.getParameter("operation").equals("add")) {
|
} else if (request.getParameter("operation").equals("add")) {
|
||||||
dao.addVClass(request.getParameter("individualURI"),request.getParameter("TypeURI"));
|
dao.addVClass(request.getParameter("individualURI"),request.getParameter("TypeURI"));
|
||||||
|
|
|
@ -60,10 +60,9 @@ public class IndividualTypeRetryController extends BaseEditController {
|
||||||
sortForPickList(allVClasses, vreq);
|
sortForPickList(allVClasses, vreq);
|
||||||
|
|
||||||
Set<String> prohibitedURIset = new HashSet<String>();
|
Set<String> prohibitedURIset = new HashSet<String>();
|
||||||
for (Iterator<VClass> indClassIt = ind.getVClasses(false).iterator(); indClassIt.hasNext(); ) {
|
for (VClass vc : ind.getVClasses(false)) {
|
||||||
VClass vc = indClassIt.next();
|
if (vc.isAnonymous()) {
|
||||||
if(vc.isAnonymous()) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
prohibitedURIset.add(vc.getURI());
|
prohibitedURIset.add(vc.getURI());
|
||||||
prohibitedURIset.addAll(vcDao.getDisjointWithClassURIs(vc.getURI()));
|
prohibitedURIset.addAll(vcDao.getDisjointWithClassURIs(vc.getURI()));
|
||||||
|
|
|
@ -128,25 +128,25 @@ public class Properties2PropertiesOperationController extends
|
||||||
if ((subpropertyURIstrs != null) && (subpropertyURIstrs.length > 1)) {
|
if ((subpropertyURIstrs != null) && (subpropertyURIstrs.length > 1)) {
|
||||||
String superpropertyURIstr = request.getParameter("SuperpropertyURI");
|
String superpropertyURIstr = request.getParameter("SuperpropertyURI");
|
||||||
if (superpropertyURIstr != null) {
|
if (superpropertyURIstr != null) {
|
||||||
for (int i=0; i<subpropertyURIstrs.length; i++) {
|
for (String subpropertyURIstr : subpropertyURIstrs) {
|
||||||
if (modeStr.equals("equivalentProperty")) {
|
if (modeStr.equals("equivalentProperty")) {
|
||||||
opDao.removeEquivalentProperty(superpropertyURIstr, subpropertyURIstrs[i]);
|
opDao.removeEquivalentProperty(superpropertyURIstr, subpropertyURIstr);
|
||||||
} else {
|
} else {
|
||||||
opDao.removeSuperproperty(subpropertyURIstrs[i], superpropertyURIstr);
|
opDao.removeSuperproperty(subpropertyURIstr, superpropertyURIstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String subpropertyURIstr = subpropertyURIstrs[0];
|
String subpropertyURIstr = subpropertyURIstrs[0];
|
||||||
String[] superpropertyURIstrs = request.getParameterValues("SuperpropertyURI");
|
String[] superpropertyURIstrs = request.getParameterValues("SuperpropertyURI");
|
||||||
if (superpropertyURIstrs != null) {
|
if (superpropertyURIstrs != null) {
|
||||||
for (int i=0; i<superpropertyURIstrs.length; i++) {
|
for (String superpropertyURIstr : superpropertyURIstrs) {
|
||||||
if (modeStr.equals("equivalentProperty")) {
|
if (modeStr.equals("equivalentProperty")) {
|
||||||
opDao.removeEquivalentProperty(subpropertyURIstr,superpropertyURIstrs[i]);
|
opDao.removeEquivalentProperty(subpropertyURIstr, superpropertyURIstr);
|
||||||
} else {
|
} else {
|
||||||
opDao.removeSuperproperty(subpropertyURIstr,superpropertyURIstrs[i]);
|
opDao.removeSuperproperty(subpropertyURIstr, superpropertyURIstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (operation == ADD) {
|
} else if (operation == ADD) {
|
||||||
|
|
|
@ -141,9 +141,8 @@ public class RefactorOperationController extends BaseEditController {
|
||||||
results.add(" With: "+goodState.toString());
|
results.add(" With: "+goodState.toString());
|
||||||
fixed++;
|
fixed++;
|
||||||
}
|
}
|
||||||
for(int i = 0; i<queue.size(); i++)
|
for (Statement aQueue : queue) {
|
||||||
{
|
ontModel.add(aQueue);
|
||||||
ontModel.add(queue.get(i));
|
|
||||||
}
|
}
|
||||||
ontModel.remove(toRemove);
|
ontModel.remove(toRemove);
|
||||||
badStatements.close();
|
badStatements.close();
|
||||||
|
@ -267,9 +266,9 @@ public class RefactorOperationController extends BaseEditController {
|
||||||
if ( (refererStr = epo.getReferer()) != null) {
|
if ( (refererStr = epo.getReferer()) != null) {
|
||||||
String controllerStr = null;
|
String controllerStr = null;
|
||||||
String[] controllers = {"entityEdit", "propertyEdit", "datapropEdit", "ontologyEdit", "vclassEdit"};
|
String[] controllers = {"entityEdit", "propertyEdit", "datapropEdit", "ontologyEdit", "vclassEdit"};
|
||||||
for (int i=0; i<controllers.length; i++) {
|
for (String controller : controllers) {
|
||||||
if (refererStr.indexOf(controllers[i]) > -1) {
|
if (refererStr.indexOf(controller) > -1) {
|
||||||
controllerStr = controllers[i];
|
controllerStr = controller;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (controllerStr != null) {
|
if (controllerStr != null) {
|
||||||
|
|
|
@ -100,12 +100,12 @@ public class VclassEditController extends BaseEditController {
|
||||||
|
|
||||||
boolean foundComment = false;
|
boolean foundComment = false;
|
||||||
StringBuffer commSb = null;
|
StringBuffer commSb = null;
|
||||||
for (Iterator<String> commIt = request.getUnfilteredWebappDaoFactory().getCommentsForResource(vcl.getURI()).iterator(); commIt.hasNext();) {
|
for (String s : request.getUnfilteredWebappDaoFactory().getCommentsForResource(vcl.getURI())) {
|
||||||
if (commSb==null) {
|
if (commSb == null) {
|
||||||
commSb = new StringBuffer();
|
commSb = new StringBuffer();
|
||||||
foundComment=true;
|
foundComment = true;
|
||||||
}
|
}
|
||||||
commSb.append(commIt.next()).append(" ");
|
commSb.append(s).append(" ");
|
||||||
}
|
}
|
||||||
if (!foundComment) {
|
if (!foundComment) {
|
||||||
commSb = new StringBuffer("no comments yet");
|
commSb = new StringBuffer("no comments yet");
|
||||||
|
|
|
@ -83,15 +83,15 @@ public class DataPropertyStatementListingController extends BaseEditController {
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (Iterator<DataPropertyStatement> i = dpsDao.getDataPropertyStatements(dp,startAt,endAt).iterator(); i.hasNext();) {
|
for (DataPropertyStatement dataPropertyStatement : dpsDao.getDataPropertyStatements(dp, startAt, endAt)) {
|
||||||
count++;
|
count++;
|
||||||
DataPropertyStatement dps = i.next();
|
DataPropertyStatement dps = dataPropertyStatement;
|
||||||
Individual subj = iDao.getIndividualByURI(dps.getIndividualURI());
|
Individual subj = iDao.getIndividualByURI(dps.getIndividualURI());
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
results.add(ListingControllerWebUtils.formatIndividualLink(subj));
|
results.add(ListingControllerWebUtils.formatIndividualLink(subj));
|
||||||
results.add(dp.getPublicName());
|
results.add(dp.getPublicName());
|
||||||
results.add(dps.getData());
|
results.add(dps.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
|
|
|
@ -115,30 +115,30 @@ public class ObjectPropertyStatementListingController extends
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
|
||||||
for (Iterator<ObjectPropertyStatement> i = opsDao.getObjectPropertyStatements(op,startAt,endAt).iterator(); i.hasNext();) {
|
for (ObjectPropertyStatement objectPropertyStatement : opsDao.getObjectPropertyStatements(op, startAt, endAt)) {
|
||||||
count++;
|
count++;
|
||||||
ObjectPropertyStatement ops = i.next();
|
ObjectPropertyStatement ops = objectPropertyStatement;
|
||||||
Individual subj = iDao.getIndividualByURI(ops.getSubjectURI());
|
Individual subj = iDao.getIndividualByURI(ops.getSubjectURI());
|
||||||
Individual obj = iDao.getIndividualByURI(ops.getObjectURI());
|
Individual obj = iDao.getIndividualByURI(ops.getObjectURI());
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
results.add(ListingControllerWebUtils.formatIndividualLink(subj));
|
results.add(ListingControllerWebUtils.formatIndividualLink(subj));
|
||||||
if (showVClasses) {
|
if (showVClasses) {
|
||||||
try {
|
try {
|
||||||
results.add(ListingControllerWebUtils.formatVClassLinks(subj.getVClasses(true)));
|
results.add(ListingControllerWebUtils.formatVClassLinks(subj.getVClasses(true)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
results.add("?");
|
results.add("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
results.add(op.getDomainPublic());
|
results.add(op.getDomainPublic());
|
||||||
results.add(ListingControllerWebUtils.formatIndividualLink(obj));
|
results.add(ListingControllerWebUtils.formatIndividualLink(obj));
|
||||||
if (showVClasses) {
|
if (showVClasses) {
|
||||||
try {
|
try {
|
||||||
results.add(ListingControllerWebUtils.formatVClassLinks(obj.getVClasses(true)));
|
results.add(ListingControllerWebUtils.formatVClassLinks(obj.getVClasses(true)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
results.add("?");
|
results.add("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
results.add("XX");
|
results.add("XX");
|
||||||
|
|
|
@ -84,35 +84,34 @@ public class GrefinePropertyListServlet extends VitroHttpServlet {
|
||||||
ObjectNode completeJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode completeJson = JsonNodeFactory.instance.objectNode();
|
||||||
ArrayNode propertiesJsonArr = JsonNodeFactory.instance.arrayNode();
|
ArrayNode propertiesJsonArr = JsonNodeFactory.instance.arrayNode();
|
||||||
if (classPropertiesMap.size() > 0) {
|
if (classPropertiesMap.size() > 0) {
|
||||||
for (Iterator<VClass> iter = classPropertiesMap.keySet().iterator(); iter.hasNext();) { // add results to schema
|
for (VClass vc : classPropertiesMap.keySet()) { // add results to schema
|
||||||
VClass vc = (VClass) iter.next();
|
|
||||||
//System.out.println("vc uri: " + vc.getURI());
|
//System.out.println("vc uri: " + vc.getURI());
|
||||||
//System.out.println("vc name: " + vc.getName());
|
//System.out.println("vc name: " + vc.getName());
|
||||||
|
|
||||||
ArrayList<DataProperty> vcProps = (ArrayList<DataProperty>)classPropertiesMap.get(vc);
|
ArrayList<DataProperty> vcProps = (ArrayList<DataProperty>) classPropertiesMap.get(vc);
|
||||||
for (DataProperty prop: vcProps) {
|
for (DataProperty prop : vcProps) {
|
||||||
String nameStr = prop.getPublicName()==null ? prop.getName() : prop.getPublicName();
|
String nameStr = prop.getPublicName() == null ? prop.getName() : prop.getPublicName();
|
||||||
//System.out.println("--- uri: " + prop.getURI());
|
//System.out.println("--- uri: " + prop.getURI());
|
||||||
//System.out.println("--- name: " + nameStr);
|
//System.out.println("--- name: " + nameStr);
|
||||||
// top level
|
// top level
|
||||||
ObjectNode propertiesItemJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode propertiesItemJson = JsonNodeFactory.instance.objectNode();
|
||||||
ObjectNode rootSchemaJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode rootSchemaJson = JsonNodeFactory.instance.objectNode();
|
||||||
rootSchemaJson.put("id", vc.getURI());
|
rootSchemaJson.put("id", vc.getURI());
|
||||||
rootSchemaJson.put("name", vc.getName());
|
rootSchemaJson.put("name", vc.getName());
|
||||||
rootSchemaJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
rootSchemaJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
||||||
propertiesItemJson.put("schema", rootSchemaJson);
|
propertiesItemJson.put("schema", rootSchemaJson);
|
||||||
// second level
|
// second level
|
||||||
propertiesItemJson.put("id", prop.getURI());
|
propertiesItemJson.put("id", prop.getURI());
|
||||||
propertiesItemJson.put("name", nameStr);
|
propertiesItemJson.put("name", nameStr);
|
||||||
propertiesItemJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
propertiesItemJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
||||||
|
|
||||||
ObjectNode expectsJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode expectsJson = JsonNodeFactory.instance.objectNode();
|
||||||
expectsJson.put("id", prop.getURI());
|
expectsJson.put("id", prop.getURI());
|
||||||
expectsJson.put("name", nameStr);
|
expectsJson.put("name", nameStr);
|
||||||
expectsJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
expectsJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
||||||
propertiesItemJson.put("expects", expectsJson);
|
propertiesItemJson.put("expects", expectsJson);
|
||||||
|
|
||||||
propertiesJsonArr.add(propertiesItemJson);
|
propertiesJsonArr.add(propertiesItemJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,36 +147,35 @@ public class GrefinePropertyListServlet extends VitroHttpServlet {
|
||||||
HashMap<VClass, List<DataProperty>> lvl2ClassPropertiesMap =
|
HashMap<VClass, List<DataProperty>> lvl2ClassPropertiesMap =
|
||||||
populateClassPropertiesMap(vcDao, dao, lvl2Class.getURI(), propURIs);
|
populateClassPropertiesMap(vcDao, dao, lvl2Class.getURI(), propURIs);
|
||||||
if (lvl2ClassPropertiesMap.size() > 0) {
|
if (lvl2ClassPropertiesMap.size() > 0) {
|
||||||
for (Iterator<VClass> iter = lvl2ClassPropertiesMap.keySet().iterator(); iter.hasNext();) { // add results to schema
|
for (VClass vc : lvl2ClassPropertiesMap.keySet()) { // add results to schema
|
||||||
VClass vc = (VClass) iter.next();
|
ArrayList<DataProperty> vcProps = (ArrayList<DataProperty>) lvl2ClassPropertiesMap.get(vc);
|
||||||
ArrayList<DataProperty> vcProps = (ArrayList<DataProperty>)lvl2ClassPropertiesMap.get(vc);
|
for (DataProperty prop : vcProps) {
|
||||||
for (DataProperty prop: vcProps) {
|
String nameStr = prop.getPublicName() == null ? prop.getName() : prop.getPublicName();
|
||||||
String nameStr = prop.getPublicName()==null ? prop.getName() : prop.getPublicName();
|
// top level
|
||||||
// top level
|
ObjectNode propertiesItemJson = JsonNodeFactory.instance.objectNode();
|
||||||
ObjectNode propertiesItemJson = JsonNodeFactory.instance.objectNode();
|
|
||||||
|
|
||||||
ObjectNode rootSchemaJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode rootSchemaJson = JsonNodeFactory.instance.objectNode();
|
||||||
rootSchemaJson.put("id", topClass.getURI());
|
rootSchemaJson.put("id", topClass.getURI());
|
||||||
rootSchemaJson.put("name", topClass.getName());
|
rootSchemaJson.put("name", topClass.getName());
|
||||||
rootSchemaJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
rootSchemaJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
||||||
propertiesItemJson.put("schema", rootSchemaJson);
|
propertiesItemJson.put("schema", rootSchemaJson);
|
||||||
|
|
||||||
// second level
|
// second level
|
||||||
propertiesItemJson.put("id", vc.getURI());
|
propertiesItemJson.put("id", vc.getURI());
|
||||||
propertiesItemJson.put("name", vc.getName());
|
propertiesItemJson.put("name", vc.getName());
|
||||||
propertiesItemJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
propertiesItemJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
||||||
|
|
||||||
propertiesItemJson.put("id2", prop.getURI());
|
propertiesItemJson.put("id2", prop.getURI());
|
||||||
propertiesItemJson.put("name2", nameStr);
|
propertiesItemJson.put("name2", nameStr);
|
||||||
propertiesItemJson.put("alias2", JsonNodeFactory.instance.arrayNode());
|
propertiesItemJson.put("alias2", JsonNodeFactory.instance.arrayNode());
|
||||||
|
|
||||||
ObjectNode expectsJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode expectsJson = JsonNodeFactory.instance.objectNode();
|
||||||
expectsJson.put("id", prop.getURI());
|
expectsJson.put("id", prop.getURI());
|
||||||
expectsJson.put("name", nameStr);
|
expectsJson.put("name", nameStr);
|
||||||
expectsJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
expectsJson.put("alias", JsonNodeFactory.instance.arrayNode());
|
||||||
propertiesItemJson.put("expects", expectsJson);
|
propertiesItemJson.put("expects", expectsJson);
|
||||||
|
|
||||||
propertiesJsonArr.add(propertiesItemJson);
|
propertiesJsonArr.add(propertiesItemJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,8 +134,7 @@ public class JSONReconcileServlet extends VitroHttpServlet {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < queries.size(); i++) {
|
for (String queryStr : queries) {
|
||||||
String queryStr = queries.get(i);
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
JsonNode json = mapper.readTree(queryStr);
|
JsonNode json = mapper.readTree(queryStr);
|
||||||
|
|
||||||
|
@ -147,7 +146,7 @@ public class JSONReconcileServlet extends VitroHttpServlet {
|
||||||
searchNoTypeMap.put(INTERNAL_QUERY_NAME, json);
|
searchNoTypeMap.put(INTERNAL_QUERY_NAME, json);
|
||||||
}
|
}
|
||||||
} else { // multiple queries
|
} else { // multiple queries
|
||||||
for (Iterator<String> iter = json.fieldNames(); iter.hasNext();) {
|
for (Iterator<String> iter = json.fieldNames(); iter.hasNext(); ) {
|
||||||
ArrayList<JsonNode> jsonList = new ArrayList<JsonNode>();
|
ArrayList<JsonNode> jsonList = new ArrayList<JsonNode>();
|
||||||
String key = iter.next();
|
String key = iter.next();
|
||||||
JsonNode jsonLvl2 = json.get(key);
|
JsonNode jsonLvl2 = json.get(key);
|
||||||
|
@ -218,10 +217,10 @@ public class JSONReconcileServlet extends VitroHttpServlet {
|
||||||
}
|
}
|
||||||
// process and add to json defaultTypes
|
// process and add to json defaultTypes
|
||||||
ArrayNode defaultTypesJsonArr = JsonNodeFactory.instance.arrayNode();
|
ArrayNode defaultTypesJsonArr = JsonNodeFactory.instance.arrayNode();
|
||||||
for (int i = 0; i<idNameArray.length; i++) {
|
for (String[] anIdNameArray : idNameArray) {
|
||||||
ObjectNode defaultTypesJson = JsonNodeFactory.instance.objectNode();
|
ObjectNode defaultTypesJson = JsonNodeFactory.instance.objectNode();
|
||||||
defaultTypesJson.put("id", idNameArray[i][0].trim());
|
defaultTypesJson.put("id", anIdNameArray[0].trim());
|
||||||
defaultTypesJson.put("name", idNameArray[i][1].trim());
|
defaultTypesJson.put("name", anIdNameArray[1].trim());
|
||||||
defaultTypesJsonArr.add(defaultTypesJson);
|
defaultTypesJsonArr.add(defaultTypesJson);
|
||||||
}
|
}
|
||||||
json.put("defaultTypes", defaultTypesJsonArr);
|
json.put("defaultTypes", defaultTypesJsonArr);
|
||||||
|
|
|
@ -230,10 +230,9 @@ public class JenaAdminActions extends BaseEditController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Iterator<Statement> removeIt = statementsToRemove.iterator(); removeIt.hasNext(); ) {
|
for (Statement stmt : statementsToRemove) {
|
||||||
Statement stmt = removeIt.next();
|
memoryModel.remove(stmt);
|
||||||
memoryModel.remove(stmt);
|
}
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
memoryModel.leaveCriticalSection();
|
memoryModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,8 +304,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
// there's got to be a better way to do this
|
// there's got to be a better way to do this
|
||||||
byte[] badCharBytes = String.valueOf(cece.getBadChar()).getBytes();
|
byte[] badCharBytes = String.valueOf(cece.getBadChar()).getBytes();
|
||||||
StringBuilder errorMsg = new StringBuilder("Cannot encode character with byte values: (decimal) ");
|
StringBuilder errorMsg = new StringBuilder("Cannot encode character with byte values: (decimal) ");
|
||||||
for (int i=0; i<badCharBytes.length; i++) {
|
for (byte badCharByte : badCharBytes) {
|
||||||
errorMsg.append(badCharBytes[i]);
|
errorMsg.append(badCharByte);
|
||||||
}
|
}
|
||||||
throw new RuntimeException(errorMsg.toString(), cece);
|
throw new RuntimeException(errorMsg.toString(), cece);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -344,8 +344,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
JenaIngestUtils utils = new JenaIngestUtils();
|
JenaIngestUtils utils = new JenaIngestUtils();
|
||||||
if(sourceModel != null && sourceModel.length != 0) {
|
if(sourceModel != null && sourceModel.length != 0) {
|
||||||
List<Model> sourceModelList = new ArrayList<Model>();
|
List<Model> sourceModelList = new ArrayList<Model>();
|
||||||
for (int i = 0; i < sourceModel.length ; i++) {
|
for (String aSourceModel : sourceModel) {
|
||||||
Model m = maker.getModel(sourceModel[i]);
|
Model m = maker.getModel(aSourceModel);
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
sourceModelList.add(m);
|
sourceModelList.add(m);
|
||||||
}
|
}
|
||||||
|
@ -740,9 +740,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
files = new File[1];
|
files = new File[1];
|
||||||
files[0] = file;
|
files[0] = file;
|
||||||
}
|
}
|
||||||
for (int i=0; i<files.length; i++) {
|
for (File currentFile : files) {
|
||||||
File currentFile = files[i];
|
log.info("Reading file " + currentFile.getName());
|
||||||
log.info("Reading file "+currentFile.getName());
|
|
||||||
FileInputStream fis;
|
FileInputStream fis;
|
||||||
try {
|
try {
|
||||||
fis = new FileInputStream(currentFile);
|
fis = new FileInputStream(currentFile);
|
||||||
|
@ -794,8 +793,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
source.addSubModel(
|
source.addSubModel(
|
||||||
(Model) vreq.getSession().getAttribute("csv2rdfResult"));
|
(Model) vreq.getSession().getAttribute("csv2rdfResult"));
|
||||||
} else {
|
} else {
|
||||||
for (int i=0; i<sourceModel.length; i++) {
|
for (String aSourceModel : sourceModel) {
|
||||||
Model m = getModel(sourceModel[i],vreq);
|
Model m = getModel(aSourceModel, vreq);
|
||||||
source.addSubModel(m);
|
source.addSubModel(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -825,8 +824,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
private void doSmushSingleModel(VitroRequest vreq) {
|
private void doSmushSingleModel(VitroRequest vreq) {
|
||||||
OntModel source = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
|
OntModel source = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
|
||||||
String[] sourceModel = vreq.getParameterValues("sourceModelName");
|
String[] sourceModel = vreq.getParameterValues("sourceModelName");
|
||||||
for (int i=0; i<sourceModel.length; i++) {
|
for (String aSourceModel : sourceModel) {
|
||||||
Model m = getModel(sourceModel[i],vreq);
|
Model m = getModel(aSourceModel, vreq);
|
||||||
source.addSubModel(m);
|
source.addSubModel(m);
|
||||||
}
|
}
|
||||||
Model destination = getModel(vreq.getParameter("destinationModelName"),vreq);
|
Model destination = getModel(vreq.getParameter("destinationModelName"),vreq);
|
||||||
|
@ -845,8 +844,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
|
OntModel jenaOntModel = ModelAccess.on(getServletContext()).getOntModel();
|
||||||
OntModel source = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
|
OntModel source = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
|
||||||
String[] sourceModel = vreq.getParameterValues("sourceModelName");
|
String[] sourceModel = vreq.getParameterValues("sourceModelName");
|
||||||
for (int i=0; i<sourceModel.length; i++) {
|
for (String aSourceModel : sourceModel) {
|
||||||
Model m = getModel(sourceModel[i],vreq);
|
Model m = getModel(aSourceModel, vreq);
|
||||||
source.addSubModel(m);
|
source.addSubModel(m);
|
||||||
}
|
}
|
||||||
Model destination = getModel(vreq.getParameter("destinationModelName"),vreq);
|
Model destination = getModel(vreq.getParameter("destinationModelName"),vreq);
|
||||||
|
@ -924,8 +923,8 @@ public class JenaIngestController extends BaseEditController {
|
||||||
public void doGenerateTBox(VitroRequest vreq) {
|
public void doGenerateTBox(VitroRequest vreq) {
|
||||||
OntModel source = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
|
OntModel source = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
|
||||||
String[] sourceModel = vreq.getParameterValues("sourceModelName");
|
String[] sourceModel = vreq.getParameterValues("sourceModelName");
|
||||||
for (int i=0; i<sourceModel.length; i++) {
|
for (String aSourceModel : sourceModel) {
|
||||||
Model m = getModel(sourceModel[i],vreq);
|
Model m = getModel(aSourceModel, vreq);
|
||||||
source.addSubModel(m);
|
source.addSubModel(m);
|
||||||
}
|
}
|
||||||
String destinationModelStr = vreq.getParameter("destinationModelName");
|
String destinationModelStr = vreq.getParameter("destinationModelName");
|
||||||
|
@ -1025,13 +1024,13 @@ public class JenaIngestController extends BaseEditController {
|
||||||
char[] cleanChars = new char[chars.length];
|
char[] cleanChars = new char[chars.length];
|
||||||
int cleanPos = 0;
|
int cleanPos = 0;
|
||||||
boolean badChar = false;
|
boolean badChar = false;
|
||||||
for (int i=0; i<chars.length; i++) {
|
for (char aChar : chars) {
|
||||||
if (java.lang.Character.getNumericValue(chars[i])>31 && java.lang.Character.isDefined(chars[i])) {
|
if (Character.getNumericValue(aChar) > 31 && Character.isDefined(aChar)) {
|
||||||
cleanChars[cleanPos] = chars[i];
|
cleanChars[cleanPos] = aChar;
|
||||||
cleanPos++;
|
cleanPos++;
|
||||||
} else {
|
} else {
|
||||||
log.error("Bad char in " + lex);
|
log.error("Bad char in " + lex);
|
||||||
log.error("Numeric value " + java.lang.Character.getNumericValue(chars[i]));
|
log.error("Numeric value " + Character.getNumericValue(aChar));
|
||||||
badChar = true;
|
badChar = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -393,8 +393,7 @@ public class RDFUploadController extends JenaIngestController {
|
||||||
files = new File[1];
|
files = new File[1];
|
||||||
files[0] = file;
|
files[0] = file;
|
||||||
}
|
}
|
||||||
for (int i=0; i<files.length; i++) {
|
for (File currentFile : files) {
|
||||||
File currentFile = files[i];
|
|
||||||
log.debug("Reading file " + currentFile.getName());
|
log.debug("Reading file " + currentFile.getName());
|
||||||
try {
|
try {
|
||||||
readIntoModel(fileStream.getInputStream(), language,
|
readIntoModel(fileStream.getInputStream(), language,
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class WebappDaoFactoryConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<FullPropertyKey, String> getCustomListViewConfigFileMap() {
|
public Map<FullPropertyKey, String> getCustomListViewConfigFileMap() {
|
||||||
return this.getCustomListViewConfigFileMap();
|
return customListViewConfigFileMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCustomListViewConfigFileMap(
|
public void setCustomListViewConfigFileMap(
|
||||||
|
|
|
@ -236,8 +236,7 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
}
|
}
|
||||||
List<VClass> vclasses = ent.getVClasses(false);
|
List<VClass> vclasses = ent.getVClasses(false);
|
||||||
if (vclasses != null) {
|
if (vclasses != null) {
|
||||||
for (Iterator<VClass> typeIt = vclasses.iterator(); typeIt.hasNext(); ) {
|
for (VClass vc : vclasses) {
|
||||||
VClass vc = typeIt.next();
|
|
||||||
ind.addRDFType(ResourceFactory.createResource(vc.getURI()));
|
ind.addRDFType(ResourceFactory.createResource(vc.getURI()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,24 +315,21 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
|
||||||
if (vcl == null) {
|
if (vcl == null) {
|
||||||
conservativeTypeDeletion = true; // if the bean has null here instead of an empty list, we don't want to trust it and just start deleting any existing types. So we'll just update the Vitro flag-related types and leave the rest alone.
|
conservativeTypeDeletion = true; // if the bean has null here instead of an empty list, we don't want to trust it and just start deleting any existing types. So we'll just update the Vitro flag-related types and leave the rest alone.
|
||||||
} else {
|
} else {
|
||||||
for (Iterator<VClass> typeIt = vcl.iterator(); typeIt.hasNext(); ) {
|
for (VClass vc : vcl) {
|
||||||
VClass vc = typeIt.next();
|
|
||||||
newTypeURIsSet.add(vc.getURI());
|
newTypeURIsSet.add(vc.getURI());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e, e);
|
log.error(e, e);
|
||||||
}
|
}
|
||||||
for (Iterator<String> oldIt = oldTypeURIsSet.iterator(); oldIt.hasNext();) {
|
for (String uri : oldTypeURIsSet) {
|
||||||
String uri = oldIt.next();
|
|
||||||
if (!newTypeURIsSet.contains(uri)) {
|
if (!newTypeURIsSet.contains(uri)) {
|
||||||
if ( (!conservativeTypeDeletion) || (uri.indexOf(VitroVocabulary.vitroURI) == 0) ) {
|
if ((!conservativeTypeDeletion) || (uri.indexOf(VitroVocabulary.vitroURI) == 0)) {
|
||||||
ind.removeRDFType(ResourceFactory.createResource(uri));
|
ind.removeRDFType(ResourceFactory.createResource(uri));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Iterator<String> newIt = newTypeURIsSet.iterator(); newIt.hasNext();) {
|
for (String uri : newTypeURIsSet) {
|
||||||
String uri = newIt.next();
|
|
||||||
if (!oldTypeURIsSet.contains(uri)) {
|
if (!oldTypeURIsSet.contains(uri)) {
|
||||||
ind.addRDFType(ResourceFactory.createResource(uri));
|
ind.addRDFType(ResourceFactory.createResource(uri));
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,12 +348,11 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
||||||
if (this.propertyList == null) {
|
if (this.propertyList == null) {
|
||||||
getObjectPropertyList();
|
getObjectPropertyList();
|
||||||
}
|
}
|
||||||
for (Iterator i = this.propertyList.iterator(); i.hasNext();) {
|
for (ObjectProperty op : this.propertyList) {
|
||||||
ObjectProperty op = (ObjectProperty) i.next();
|
if (op.getURI() != null) {
|
||||||
if (op.getURI() != null) {
|
map.put(op.getURI(), op);
|
||||||
map.put(op.getURI(), op);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this.objectPropertyMap = map;
|
this.objectPropertyMap = map;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -402,12 +401,11 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
||||||
if (this.datatypePropertyList == null) {
|
if (this.datatypePropertyList == null) {
|
||||||
getDataPropertyList();
|
getDataPropertyList();
|
||||||
}
|
}
|
||||||
for (Iterator i = this.datatypePropertyList.iterator(); i.hasNext();) {
|
for (DataProperty dp : this.datatypePropertyList) {
|
||||||
DataProperty dp = (DataProperty) i.next();
|
if (dp.getURI() != null) {
|
||||||
if (dp.getURI() != null) {
|
map.put(dp.getURI(), dp);
|
||||||
map.put(dp.getURI(), dp);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this.dataPropertyMap = map;
|
this.dataPropertyMap = map;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
@ -602,12 +602,11 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
if (this.propertyList == null) {
|
if (this.propertyList == null) {
|
||||||
getObjectPropertyList();
|
getObjectPropertyList();
|
||||||
}
|
}
|
||||||
for (Iterator i = this.propertyList.iterator(); i.hasNext();) {
|
for (ObjectProperty op : this.propertyList) {
|
||||||
ObjectProperty op = (ObjectProperty) i.next();
|
if (op.getURI() != null) {
|
||||||
if (op.getURI() != null) {
|
map.put(op.getURI(), op);
|
||||||
map.put(op.getURI(), op);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this.objectPropertyMap = map;
|
this.objectPropertyMap = map;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -660,12 +659,11 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
if (this.datatypePropertyList == null) {
|
if (this.datatypePropertyList == null) {
|
||||||
getDataPropertyList();
|
getDataPropertyList();
|
||||||
}
|
}
|
||||||
for (Iterator i = this.datatypePropertyList.iterator(); i.hasNext();) {
|
for (DataProperty dp : this.datatypePropertyList) {
|
||||||
DataProperty dp = (DataProperty) i.next();
|
if (dp.getURI() != null) {
|
||||||
if (dp.getURI() != null) {
|
map.put(dp.getURI(), dp);
|
||||||
map.put(dp.getURI(), dp);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
this.dataPropertyMap = map;
|
this.dataPropertyMap = map;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,9 +93,7 @@ public class JenaModelUtils {
|
||||||
try {
|
try {
|
||||||
List<VClass> rootClasses = myWebappDaoFactory.getVClassDao()
|
List<VClass> rootClasses = myWebappDaoFactory.getVClassDao()
|
||||||
.getRootClasses();
|
.getRootClasses();
|
||||||
for (Iterator<VClass> rootClassIt = rootClasses.iterator();
|
for (VClass rootClass : rootClasses) {
|
||||||
rootClassIt.hasNext(); ) {
|
|
||||||
VClass rootClass = rootClassIt.next();
|
|
||||||
Individual classGroup = modelForClassgroups.createIndividual(
|
Individual classGroup = modelForClassgroups.createIndividual(
|
||||||
wadf.getDefaultNamespace() + "vitroClassGroup" +
|
wadf.getDefaultNamespace() + "vitroClassGroup" +
|
||||||
rootClass.getLocalName(), classGroupClass);
|
rootClass.getLocalName(), classGroupClass);
|
||||||
|
@ -105,10 +103,8 @@ public class JenaModelUtils {
|
||||||
rootClass.getURI());
|
rootClass.getURI());
|
||||||
modelForClassgroupAnnotations.add(
|
modelForClassgroupAnnotations.add(
|
||||||
rootClassRes, inClassGroupProperty, classGroup);
|
rootClassRes, inClassGroupProperty, classGroup);
|
||||||
for (Iterator<String> childIt = myWebappDaoFactory.getVClassDao()
|
for (String childURI : myWebappDaoFactory.getVClassDao()
|
||||||
.getAllSubClassURIs(rootClass.getURI()).iterator();
|
.getAllSubClassURIs(rootClass.getURI())) {
|
||||||
childIt.hasNext(); ) {
|
|
||||||
String childURI = childIt.next();
|
|
||||||
Resource childClass = modelForClassgroupAnnotations
|
Resource childClass = modelForClassgroupAnnotations
|
||||||
.getResource(childURI);
|
.getResource(childURI);
|
||||||
if (!modelForClassgroupAnnotations.contains(
|
if (!modelForClassgroupAnnotations.contains(
|
||||||
|
|
|
@ -310,9 +310,8 @@ public class PropertyDaoJena extends JenaBaseDao implements PropertyDao {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeEquivalentProperty(Property property,
|
public void removeEquivalentProperty(Property property, Property equivalentProperty) {
|
||||||
Property equivalentProperty) {
|
removeEquivalentProperty(property.getURI(), equivalentProperty.getURI());
|
||||||
removeEquivalentProperty(property, equivalentProperty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeABoxStatementsWithPredicate(Property predicate) {
|
protected void removeABoxStatementsWithPredicate(Property predicate) {
|
||||||
|
|
|
@ -115,37 +115,37 @@ public class WebappDaoFactorySDB extends WebappDaoFactoryJena {
|
||||||
public static String getFilterBlock(String[] graphVars,
|
public static String getFilterBlock(String[] graphVars,
|
||||||
SDBDatasetMode datasetMode) {
|
SDBDatasetMode datasetMode) {
|
||||||
StringBuilder filterBlock = new StringBuilder();
|
StringBuilder filterBlock = new StringBuilder();
|
||||||
for (int i = 0; i < graphVars.length; i++) {
|
for (String graphVar : graphVars) {
|
||||||
switch (datasetMode) {
|
switch (datasetMode) {
|
||||||
case ASSERTIONS_ONLY :
|
case ASSERTIONS_ONLY:
|
||||||
filterBlock.append("FILTER (")
|
filterBlock.append("FILTER (")
|
||||||
.append("(!bound(").append(graphVars[i])
|
.append("(!bound(").append(graphVar)
|
||||||
.append(")) || (")
|
.append(")) || (")
|
||||||
.append(graphVars[i])
|
.append(graphVar)
|
||||||
.append(" != <")
|
.append(" != <")
|
||||||
.append(ModelNames.ABOX_INFERENCES)
|
.append(ModelNames.ABOX_INFERENCES)
|
||||||
.append("> ")
|
.append("> ")
|
||||||
.append("&& ").append(graphVars[i]).append(" != <")
|
.append("&& ").append(graphVar).append(" != <")
|
||||||
.append(ModelNames.TBOX_INFERENCES)
|
.append(ModelNames.TBOX_INFERENCES)
|
||||||
.append(">")
|
.append(">")
|
||||||
.append(") ) \n");
|
.append(") ) \n");
|
||||||
break;
|
break;
|
||||||
case INFERENCES_ONLY :
|
case INFERENCES_ONLY:
|
||||||
filterBlock.append("FILTER (")
|
filterBlock.append("FILTER (")
|
||||||
.append("(!bound(").append(graphVars[i])
|
.append("(!bound(").append(graphVar)
|
||||||
.append(")) || (")
|
.append(")) || (")
|
||||||
.append(graphVars[i])
|
.append(graphVar)
|
||||||
.append(" = <")
|
.append(" = <")
|
||||||
.append(ModelNames.ABOX_INFERENCES)
|
.append(ModelNames.ABOX_INFERENCES)
|
||||||
.append("> || ").append(graphVars[i])
|
.append("> || ").append(graphVar)
|
||||||
.append(" = <")
|
.append(" = <")
|
||||||
.append(ModelNames.TBOX_INFERENCES)
|
.append(ModelNames.TBOX_INFERENCES)
|
||||||
.append(">) )\n");
|
.append(">) )\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return filterBlock.toString();
|
return filterBlock.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class IndividualDataPropertyStatementProcessor implements ChangeListener
|
||||||
while (dpmIt.hasNext()) {
|
while (dpmIt.hasNext()) {
|
||||||
String key = (String) dpmIt.next();
|
String key = (String) dpmIt.next();
|
||||||
String[] data = (String[])dpm.get(key);
|
String[] data = (String[])dpm.get(key);
|
||||||
for (int dataRow=0; dataRow<data.length; ++dataRow){
|
for (String aData : data) {
|
||||||
String[] keyArg = key.split("_");
|
String[] keyArg = key.split("_");
|
||||||
String rowId = keyArg[2];
|
String rowId = keyArg[2];
|
||||||
DataPropertyStatement dataPropertyStmt = new DataPropertyStatementImpl();
|
DataPropertyStatement dataPropertyStmt = new DataPropertyStatementImpl();
|
||||||
|
@ -55,50 +55,50 @@ public class IndividualDataPropertyStatementProcessor implements ChangeListener
|
||||||
dataPropertyStmt = new DataPropertyStatementImpl();
|
dataPropertyStmt = new DataPropertyStatementImpl();
|
||||||
try {
|
try {
|
||||||
Map beanParamMap = FormUtils.beanParamMapFromString(keyArg[3]);
|
Map beanParamMap = FormUtils.beanParamMapFromString(keyArg[3]);
|
||||||
String dataPropertyURI = (String)beanParamMap.get("DatatypePropertyURI");
|
String dataPropertyURI = (String) beanParamMap.get("DatatypePropertyURI");
|
||||||
if (!deletedDataPropertyURIs.contains(dataPropertyURI)) {
|
if (!deletedDataPropertyURIs.contains(dataPropertyURI)) {
|
||||||
deletedDataPropertyURIs.add(dataPropertyURI);
|
deletedDataPropertyURIs.add(dataPropertyURI);
|
||||||
dataPropertyStatementDao.deleteDataPropertyStatementsForIndividualByDataProperty(((Individual)epo.getNewBean()).getURI(),dataPropertyURI);
|
dataPropertyStatementDao.deleteDataPropertyStatementsForIndividualByDataProperty(((Individual) epo.getNewBean()).getURI(), dataPropertyURI);
|
||||||
}
|
}
|
||||||
dataPropertyStmt.setDatapropURI(dataPropertyURI);
|
dataPropertyStmt.setDatapropURI(dataPropertyURI);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Messed up beanParamMap?");
|
log.error("Messed up beanParamMap?");
|
||||||
}
|
}
|
||||||
dataPropertyStmt.setData(data[dataRow]);
|
dataPropertyStmt.setData(aData);
|
||||||
Individual individual = null;
|
Individual individual = null;
|
||||||
// need to rethink this
|
// need to rethink this
|
||||||
if (((Individual)epo.getOriginalBean()).getURI() != null) {
|
if (((Individual) epo.getOriginalBean()).getURI() != null) {
|
||||||
individual = (Individual) epo.getOriginalBean();
|
individual = (Individual) epo.getOriginalBean();
|
||||||
dataPropertyStmt.setIndividualURI(individual.getURI());
|
dataPropertyStmt.setIndividualURI(individual.getURI());
|
||||||
} else {
|
} else {
|
||||||
individual = (Individual) epo.getNewBean();
|
individual = (Individual) epo.getNewBean();
|
||||||
dataPropertyStmt.setIndividualURI(individual.getURI());
|
dataPropertyStmt.setIndividualURI(individual.getURI());
|
||||||
}
|
}
|
||||||
if (dataPropertyStmt.getData().length()>0 && rowId != null) {
|
if (dataPropertyStmt.getData().length() > 0 && rowId != null) {
|
||||||
|
|
||||||
DataPropertyDao dataPropertyDao = (DataPropertyDao)epo.getAdditionalDaoMap().get("DataProperty");
|
DataPropertyDao dataPropertyDao = (DataPropertyDao) epo.getAdditionalDaoMap().get("DataProperty");
|
||||||
DataProperty dp = dataPropertyDao.getDataPropertyByURI(dataPropertyStmt.getDatapropURI());
|
DataProperty dp = dataPropertyDao.getDataPropertyByURI(dataPropertyStmt.getDatapropURI());
|
||||||
if (dp != null) {
|
if (dp != null) {
|
||||||
String rangeDatatypeURI = dataPropertyDao.getRequiredDatatypeURI(individual, dp);
|
String rangeDatatypeURI = dataPropertyDao.getRequiredDatatypeURI(individual, dp);
|
||||||
if (rangeDatatypeURI != null) {
|
if (rangeDatatypeURI != null) {
|
||||||
dataPropertyStmt.setDatatypeURI(rangeDatatypeURI);
|
dataPropertyStmt.setDatatypeURI(rangeDatatypeURI);
|
||||||
String validationMsg = BasicValidationVTwo.validateAgainstDatatype(dataPropertyStmt.getData(), rangeDatatypeURI);
|
String validationMsg = BasicValidationVTwo.validateAgainstDatatype(dataPropertyStmt.getData(), rangeDatatypeURI);
|
||||||
// Since this backend editing system is de facto deprecated,
|
// Since this backend editing system is de facto deprecated,
|
||||||
// not worrying about implementing per-field validation
|
// not worrying about implementing per-field validation
|
||||||
if (validationMsg != null) {
|
if (validationMsg != null) {
|
||||||
validationMsg = "'" + dataPropertyStmt.getData() + "'"
|
validationMsg = "'" + dataPropertyStmt.getData() + "'"
|
||||||
+ " is invalid. "
|
+ " is invalid. "
|
||||||
+ validationMsg;
|
+ validationMsg;
|
||||||
throw new RuntimeException(validationMsg);
|
throw new RuntimeException(validationMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dataPropertyStatementDao.insertNewDataPropertyStatement(dataPropertyStmt);
|
dataPropertyStatementDao.insertNewDataPropertyStatement(dataPropertyStmt);
|
||||||
} //else if (dataPropertyStmt.getData().length()>0 && rowId != null) {
|
} //else if (dataPropertyStmt.getData().length()>0 && rowId != null) {
|
||||||
// dataPropertyStatementDao.updateDataPropertyStatement(dataPropertyStmt);
|
// dataPropertyStatementDao.updateDataPropertyStatement(dataPropertyStmt);
|
||||||
//} else if (dataPropertyStmt.getData().length()==0 && rowId != null) {
|
//} else if (dataPropertyStmt.getData().length()==0 && rowId != null) {
|
||||||
// dataPropertyStatementDao.deleteDataPropertyStatement(dataPropertyStmt);
|
// dataPropertyStatementDao.deleteDataPropertyStatement(dataPropertyStmt);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,9 @@ public class IndividualsViaVClassOptions implements FieldOptions {
|
||||||
throw new Exception("vclassURIs must not be null or empty ");
|
throw new Exception("vclassURIs must not be null or empty ");
|
||||||
|
|
||||||
this.vclassURIs = new ArrayList<String>(vclassURIs.length);
|
this.vclassURIs = new ArrayList<String>(vclassURIs.length);
|
||||||
for(int i=0;i<vclassURIs.length;i++){
|
for (String vclassURI : vclassURIs) {
|
||||||
if( vclassURIs[i] != null && !vclassURIs[i].trim().isEmpty() )
|
if (vclassURI != null && !vclassURI.trim().isEmpty())
|
||||||
this.vclassURIs.add(vclassURIs[i]);
|
this.vclassURIs.add(vclassURI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,25 +32,24 @@ public class RdfTypeOptions implements FieldOptions {
|
||||||
WebappDaoFactory wdf) {
|
WebappDaoFactory wdf) {
|
||||||
Map<String,String> uriToLabel = new HashMap<String,String>();
|
Map<String,String> uriToLabel = new HashMap<String,String>();
|
||||||
|
|
||||||
for(int i=0;i<typeURIs.length; i++){
|
for (String uri : typeURIs) {
|
||||||
String uri = typeURIs[i];
|
VClass vc = wdf.getVClassDao().getVClassByURI(uri);
|
||||||
VClass vc = wdf.getVClassDao().getVClassByURI( uri );
|
if (vc == null) {
|
||||||
if( vc == null ){
|
uriToLabel.put(uri, uri);
|
||||||
uriToLabel.put(uri,uri);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
uriToLabel.put(uri,vc.getPickListName());
|
uriToLabel.put(uri, vc.getPickListName());
|
||||||
List<String> subclassUris = wdf.getVClassDao().getAllSubClassURIs( uri );
|
List<String> subclassUris = wdf.getVClassDao().getAllSubClassURIs(uri);
|
||||||
if( subclassUris == null )
|
if (subclassUris == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for( String subUri : subclassUris ){
|
for (String subUri : subclassUris) {
|
||||||
VClass subVc = wdf.getVClassDao().getVClassByURI( subUri );
|
VClass subVc = wdf.getVClassDao().getVClassByURI(subUri);
|
||||||
if( vc != null ){
|
if (vc != null) {
|
||||||
uriToLabel.put(subUri,subVc.getPickListName());
|
uriToLabel.put(subUri, subVc.getPickListName());
|
||||||
}else{
|
} else {
|
||||||
uriToLabel.put(subUri,subUri);
|
uriToLabel.put(subUri, subUri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,13 +43,6 @@ public class DefaultAddMissingIndividualFormGenerator implements EditConfigurati
|
||||||
private String template = "defaultAddMissingIndividualForm.ftl";
|
private String template = "defaultAddMissingIndividualForm.ftl";
|
||||||
private static String createCommand = "create";
|
private static String createCommand = "create";
|
||||||
protected static String objectVarName = "newIndividual";
|
protected static String objectVarName = "newIndividual";
|
||||||
private static HashMap<String,String> defaultsForXSDtypes ;
|
|
||||||
|
|
||||||
static {
|
|
||||||
defaultsForXSDtypes = new HashMap<String,String>();
|
|
||||||
//defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","2001-01-01T12:00:00");
|
|
||||||
defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","#Unparseable datetime defaults to now");
|
|
||||||
}
|
|
||||||
|
|
||||||
//Method which checks whether this particular generator should be employed
|
//Method which checks whether this particular generator should be employed
|
||||||
public static final boolean isCreateNewIndividual(VitroRequest vreq, HttpSession session) {
|
public static final boolean isCreateNewIndividual(VitroRequest vreq, HttpSession session) {
|
||||||
|
|
|
@ -29,12 +29,6 @@ public class DefaultDeleteGenerator extends BaseEditConfigurationGenerator imple
|
||||||
private DataPropertyStatement dps = null;
|
private DataPropertyStatement dps = null;
|
||||||
private String dataLiteral = null;
|
private String dataLiteral = null;
|
||||||
private String template = "confirmDeletePropertyForm.ftl";
|
private String template = "confirmDeletePropertyForm.ftl";
|
||||||
private static HashMap<String,String> defaultsForXSDtypes ;
|
|
||||||
static {
|
|
||||||
defaultsForXSDtypes = new HashMap<String,String>();
|
|
||||||
//defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","2001-01-01T12:00:00");
|
|
||||||
defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","#Unparseable datetime defaults to now");
|
|
||||||
}
|
|
||||||
|
|
||||||
//In this case, simply return the edit configuration currently saved in session
|
//In this case, simply return the edit configuration currently saved in session
|
||||||
//Since this is forwarding from another form, an edit configuration should already exist in session
|
//Since this is forwarding from another form, an edit configuration should already exist in session
|
||||||
|
|
|
@ -68,14 +68,6 @@ public class DefaultObjectPropertyFormGenerator implements EditConfigurationGene
|
||||||
protected long maxNonACRangeIndividualCount = 300;
|
protected long maxNonACRangeIndividualCount = 300;
|
||||||
protected String customErrorMessages = null;
|
protected String customErrorMessages = null;
|
||||||
|
|
||||||
private static HashMap<String,String> defaultsForXSDtypes ;
|
|
||||||
static {
|
|
||||||
defaultsForXSDtypes = new HashMap<String,String>();
|
|
||||||
//defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","2001-01-01T12:00:00");
|
|
||||||
defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","#Unparseable datetime defaults to now");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq,
|
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq,
|
||||||
HttpSession session) throws Exception {
|
HttpSession session) throws Exception {
|
||||||
|
|
|
@ -36,13 +36,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
|
|
||||||
private String template = "newIndividualForm.ftl";
|
private String template = "newIndividualForm.ftl";
|
||||||
|
|
||||||
private static HashMap<String,String> defaultsForXSDtypes ;
|
|
||||||
static {
|
|
||||||
defaultsForXSDtypes = new HashMap<String,String>();
|
|
||||||
//defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","2001-01-01T12:00:00");
|
|
||||||
defaultsForXSDtypes.put("http://www.w3.org/2001/XMLSchema#dateTime","#Unparseable datetime defaults to now");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
||||||
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
||||||
|
|
|
@ -120,9 +120,9 @@ class VitroURL {
|
||||||
if (len>0) {
|
if (len>0) {
|
||||||
String[] temp = new String[len];
|
String[] temp = new String[len];
|
||||||
int tempI = 0;
|
int tempI = 0;
|
||||||
for (int i=0; i<splitStr.length; i++) {
|
for (String aSplitStr : splitStr) {
|
||||||
if (!splitStr[i].equals("")) {
|
if (!aSplitStr.equals("")) {
|
||||||
temp[tempI] = splitStr[i];
|
temp[tempI] = aSplitStr;
|
||||||
tempI++;
|
tempI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,27 +350,23 @@ public abstract class RDFServiceImpl implements RDFService {
|
||||||
@Override
|
@Override
|
||||||
public long countTriples(RDFNode subject, RDFNode predicate, RDFNode object) throws RDFServiceException {
|
public long countTriples(RDFNode subject, RDFNode predicate, RDFNode object) throws RDFServiceException {
|
||||||
StringBuilder whereClause = new StringBuilder();
|
StringBuilder whereClause = new StringBuilder();
|
||||||
StringBuilder orderBy = new StringBuilder();
|
|
||||||
|
|
||||||
if ( subject != null ) {
|
if ( subject != null ) {
|
||||||
appendNode(whereClause.append(' '), subject);
|
appendNode(whereClause.append(' '), subject);
|
||||||
} else {
|
} else {
|
||||||
whereClause.append(" ?s");
|
whereClause.append(" ?s");
|
||||||
orderBy.append(" ?s");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( predicate != null ) {
|
if ( predicate != null ) {
|
||||||
appendNode(whereClause.append(' '), predicate);
|
appendNode(whereClause.append(' '), predicate);
|
||||||
} else {
|
} else {
|
||||||
whereClause.append(" ?p");
|
whereClause.append(" ?p");
|
||||||
orderBy.append(" ?p");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( object != null ) {
|
if ( object != null ) {
|
||||||
appendNode(whereClause.append(' '), object);
|
appendNode(whereClause.append(' '), object);
|
||||||
} else {
|
} else {
|
||||||
whereClause.append(" ?o");
|
whereClause.append(" ?o");
|
||||||
orderBy.append(" ?o");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long estimate = -1;
|
long estimate = -1;
|
||||||
|
|
|
@ -508,8 +508,8 @@ public class UpdateKnowledgeBase {
|
||||||
"containing RDF files.");
|
"containing RDF files.");
|
||||||
}
|
}
|
||||||
File[] rdfFiles = directory.listFiles();
|
File[] rdfFiles = directory.listFiles();
|
||||||
for (int i = 0; i < rdfFiles.length; i++) {
|
for (File rdfFile : rdfFiles) {
|
||||||
readFile(rdfFiles[i], om, directoryPath);
|
readFile(rdfFile, om, directoryPath);
|
||||||
}
|
}
|
||||||
return om;
|
return om;
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,8 +147,8 @@ public class GetClazzAllProperties extends BaseEditController {
|
||||||
respo.append("<options>");
|
respo.append("<options>");
|
||||||
Object[] keys = hm.keySet().toArray();
|
Object[] keys = hm.keySet().toArray();
|
||||||
Arrays.sort(keys);
|
Arrays.sort(keys);
|
||||||
for (int i = 0; i < keys.length; i++) {
|
for (Object key1 : keys) {
|
||||||
String key = (String) keys[i];
|
String key = (String) key1;
|
||||||
String value = hm.get(key);
|
String value = hm.get(key);
|
||||||
|
|
||||||
respo.append("<option>" + "<key>").append(key).append("</key>").append("<value>").append(value.substring(0, value.length() - 1)).append("</value>").append("<type>").append(value.charAt(value.length() - 1)).append("</type>").append("</option>");
|
respo.append("<option>" + "<key>").append(key).append("</key>").append("<value>").append(value.substring(0, value.length() - 1)).append("</value>").append("<type>").append(value.charAt(value.length() - 1)).append("</type>").append("</option>");
|
||||||
|
|
|
@ -148,9 +148,8 @@ public final class JsonToFmModel
|
||||||
{
|
{
|
||||||
sb.append(tabs).append("[\n");
|
sb.append(tabs).append("[\n");
|
||||||
List l = (List)entry.getValue();
|
List l = (List)entry.getValue();
|
||||||
for (int i = 0; i < l.size(); i++)
|
for (Object aL : l) {
|
||||||
{
|
sb.append(tabs).append(aL).append(":").append((aL != null) ? aL.getClass() : "null").append("\n");
|
||||||
sb.append(tabs).append(l.get(i)).append(":").append((l.get(i) != null) ? l.get(i).getClass() : "null").append("\n");
|
|
||||||
}
|
}
|
||||||
sb.append(tabs).append("]\n");
|
sb.append(tabs).append("]\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,9 +548,9 @@ public class Stemmer
|
||||||
{
|
{
|
||||||
char[] w = new char[501];
|
char[] w = new char[501];
|
||||||
Stemmer s = new Stemmer();
|
Stemmer s = new Stemmer();
|
||||||
for (int i = 0; i < args.length; i++) {
|
for (String arg : args) {
|
||||||
log.trace( StemString( args[i], 100 ));
|
log.trace(StemString(arg, 100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -383,8 +383,8 @@ public class JenaIngestUtils {
|
||||||
Literal lit = (Literal) obj;
|
Literal lit = (Literal) obj;
|
||||||
String unsplitStr = lit.getLexicalForm();
|
String unsplitStr = lit.getLexicalForm();
|
||||||
String[] splitPieces = delimiterPattern.split(unsplitStr);
|
String[] splitPieces = delimiterPattern.split(unsplitStr);
|
||||||
for (int i=0; i<splitPieces.length; i++) {
|
for (String splitPiece : splitPieces) {
|
||||||
String newLexicalForm = splitPieces[i];
|
String newLexicalForm = splitPiece;
|
||||||
if (trim) {
|
if (trim) {
|
||||||
newLexicalForm = newLexicalForm.trim();
|
newLexicalForm = newLexicalForm.trim();
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ public class JenaIngestUtils {
|
||||||
newLiteral = outModel.createLiteral(newLexicalForm);
|
newLiteral = outModel.createLiteral(newLexicalForm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outModel.add(subj,newProp,newLiteral);
|
outModel.add(subj, newProp, newLiteral);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,10 +116,9 @@ public class PropertyGroupTemplateModel extends BaseTemplateModel {
|
||||||
@Override
|
@Override
|
||||||
public String toString(){
|
public String toString(){
|
||||||
StringBuilder ptmStr = new StringBuilder();
|
StringBuilder ptmStr = new StringBuilder();
|
||||||
for( int i=0; i < properties.size() ; i ++ ){
|
for (PropertyTemplateModel ptm : properties) {
|
||||||
PropertyTemplateModel ptm = properties.get(i);
|
|
||||||
String spacer = "\n ";
|
String spacer = "\n ";
|
||||||
if( ptm != null )
|
if (ptm != null)
|
||||||
ptmStr.append(spacer).append(ptm.toString());
|
ptmStr.append(spacer).append(ptm.toString());
|
||||||
}
|
}
|
||||||
return String.format("\nPropertyGroupTemplateModel %s[%s] ",name, ptmStr.toString());
|
return String.format("\nPropertyGroupTemplateModel %s[%s] ",name, ptmStr.toString());
|
||||||
|
|
|
@ -301,8 +301,8 @@ public class StartupManagerTest extends AbstractTestClass {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
for (int i = 0; i < classes.length; i++) {
|
for (Class<?> aClass : classes) {
|
||||||
result.append(classes[i].getName()).append('\n');
|
result.append(aClass.getName()).append('\n');
|
||||||
}
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,11 +39,11 @@ public class VClassGroupDaoStub implements VClassGroupDao {
|
||||||
public List<VClassGroup> getPublicGroupsWithVClasses() {
|
public List<VClassGroup> getPublicGroupsWithVClasses() {
|
||||||
List<VClassGroup> list = new ArrayList<>();
|
List<VClassGroup> list = new ArrayList<>();
|
||||||
for (VClassGroup group: groups) {
|
for (VClassGroup group: groups) {
|
||||||
if (!group.isEmpty()) {
|
if (group != null) {
|
||||||
list.add(group);
|
list.add(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return groups;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -4,4 +4,4 @@
|
||||||
whichfile = test_config_default
|
whichfile = test_config_default
|
||||||
|
|
||||||
# This ends with a blank, in order to test the removal of whitespace
|
# This ends with a blank, in order to test the removal of whitespace
|
||||||
trimmed = whitespace_test\u0020
|
trimmed = whitespace_test
|
||||||
|
|
|
@ -234,7 +234,7 @@ verbose_turn_off = Apagar
|
||||||
resource_uri = URI de recursos
|
resource_uri = URI de recursos
|
||||||
|
|
||||||
individual_not_found = Individual no encontrado
|
individual_not_found = Individual no encontrado
|
||||||
individual_not_found_msg = El individuo no se encontró en el sistema.
|
individual_not_found_msg = El individuo no se encontr<EFBFBD> en el sistema.
|
||||||
entity_to_query_for = Este id es el identificador de la entidad para consultar. netid también funciona.
|
entity_to_query_for = Este id es el identificador de la entidad para consultar. netid también funciona.
|
||||||
|
|
||||||
menu_ordering = Menú pedidos
|
menu_ordering = Menú pedidos
|
||||||
|
@ -424,12 +424,12 @@ run_sdb_setup = Ejecutar la instalación SDB
|
||||||
unrecognized_user = Usuario no reconocido
|
unrecognized_user = Usuario no reconocido
|
||||||
no_individual_associated_with_id = Por alguna razón, no hay ninguna persona en VIVO que se asocia con su ID de red. Tal vez usted debería ponerse en contacto con el administrador de VIVO.
|
no_individual_associated_with_id = Por alguna razón, no hay ninguna persona en VIVO que se asocia con su ID de red. Tal vez usted debería ponerse en contacto con el administrador de VIVO.
|
||||||
|
|
||||||
page_not_created = página no pudo ser creado
|
page_not_created = p<EFBFBD>gina no pudo ser creado
|
||||||
page_not_created_msg = Se ha producido un error al crear la página, por favor, compruebe los registros.
|
page_not_created_msg = Se ha producido un error al crear la p<EFBFBD>gina, por favor, compruebe los registros.
|
||||||
page_not_found = Página no encontrada
|
page_not_found = P<EFBFBD>gina no encontrada
|
||||||
page_not_found_msg = La página no se ha encontrado en el sistema.
|
page_not_found_msg = La p<EFBFBD>gina no se ha encontrado en el sistema.
|
||||||
page_uri_missing = No se especifica la página URI
|
page_uri_missing = No se especifica la p<EFBFBD>gina URI
|
||||||
page_uri_missing_msg = No se pudo generar la página pd no estaba claro en qué página se está solicitando. Una asignación de dirección URL es posible que falte.
|
page_uri_missing_msg = No se pudo generar la p<EFBFBD>gina pd no estaba claro en qu<71> p<>gina se est<73> solicitando. Una asignaci<63>n de direcci<63>n URL es posible que falte.
|
||||||
|
|
||||||
#
|
#
|
||||||
# site admin templates ( /templates/freemarker/body/siteAdmin )
|
# site admin templates ( /templates/freemarker/body/siteAdmin )
|
||||||
|
|
Loading…
Add table
Reference in a new issue