Removing assertions from fields
This commit is contained in:
parent
5b1847dd4c
commit
ee90023581
4 changed files with 40 additions and 147 deletions
|
@ -63,8 +63,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
@Override
|
@Override
|
||||||
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
||||||
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
||||||
//Set n3 generator
|
|
||||||
editConfiguration.setN3Generator(new EditN3GeneratorVTwo(editConfiguration));
|
|
||||||
|
|
||||||
//process subject, predicate, object parameters
|
//process subject, predicate, object parameters
|
||||||
this.initProcessParameters(vreq, session, editConfiguration);
|
this.initProcessParameters(vreq, session, editConfiguration);
|
||||||
|
@ -164,9 +162,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
//this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method
|
//this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method
|
||||||
//pretends this is a data property editing statement and throws an error
|
//pretends this is a data property editing statement and throws an error
|
||||||
//TODO: Check if null in case no object uri exists but this is still an object property
|
//TODO: Check if null in case no object uri exists but this is still an object property
|
||||||
if(objectUri != null) {
|
|
||||||
editConfiguration.setObjectResource(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -465,7 +460,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
|
@ -481,10 +475,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add(getN3ForGrantRole(vreq));
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -497,7 +487,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
|
|
||||||
//Not really interested in validators here
|
//Not really interested in validators here
|
||||||
|
@ -518,11 +507,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add(getN3ForGrantLabel(vreq));
|
|
||||||
assertions.add(getN3ForGrantRole(vreq));
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -535,7 +519,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
|
|
||||||
//Not really interested in validators here
|
//Not really interested in validators here
|
||||||
|
@ -551,9 +534,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
field.setRangeDatatypeUri(null);
|
field.setRangeDatatypeUri(null);
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,7 +543,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
field.setValidators(validators);
|
field.setValidators(validators);
|
||||||
|
@ -578,11 +557,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
//empty
|
//empty
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.addAll(getN3ForStart());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
|
|
||||||
//This logic was originally after edit configuration object created from json in original jsp
|
//This logic was originally after edit configuration object created from json in original jsp
|
||||||
field.setEditElement(
|
field.setEditElement(
|
||||||
new DateTimeWithPrecisionVTwo(field,
|
new DateTimeWithPrecisionVTwo(field,
|
||||||
|
@ -599,7 +573,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
field.setValidators(validators);
|
field.setValidators(validators);
|
||||||
|
@ -614,10 +587,6 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
|
||||||
//empty
|
//empty
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.addAll(getN3ForEnd());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
//Set edit element
|
//Set edit element
|
||||||
field.setEditElement(
|
field.setEditElement(
|
||||||
new DateTimeWithPrecisionVTwo(field,
|
new DateTimeWithPrecisionVTwo(field,
|
||||||
|
|
|
@ -101,8 +101,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
@Override
|
@Override
|
||||||
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
||||||
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
||||||
//Set n3 generator
|
|
||||||
editConfiguration.setN3Generator(new EditN3GeneratorVTwo(editConfiguration));
|
|
||||||
|
|
||||||
//process subject, predicate, object parameters
|
//process subject, predicate, object parameters
|
||||||
this.initProcessParameters(vreq, session, editConfiguration);
|
this.initProcessParameters(vreq, session, editConfiguration);
|
||||||
|
@ -203,9 +201,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
//this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method
|
//this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method
|
||||||
//pretends this is a data property editing statement and throws an error
|
//pretends this is a data property editing statement and throws an error
|
||||||
//TODO: Check if null in case no object uri exists but this is still an object property
|
//TODO: Check if null in case no object uri exists but this is still an object property
|
||||||
if(objectUri != null) {
|
|
||||||
editConfiguration.setObjectResource(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -231,7 +226,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
return n3ForEdit;
|
return n3ForEdit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<String> generateN3Optional() {
|
private List<String> generateN3Optional() {
|
||||||
List<String> n3Optional = new ArrayList<String>();
|
List<String> n3Optional = new ArrayList<String>();
|
||||||
//n3 for activity label
|
//n3 for activity label
|
||||||
|
@ -681,7 +675,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
|
|
||||||
//Not really interested in validators here
|
//Not really interested in validators here
|
||||||
|
@ -698,10 +691,7 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add("?roleActivity ?activityToRolePredicate ?role .");
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -717,7 +707,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
|
|
||||||
//Not really interested in validators here
|
//Not really interested in validators here
|
||||||
|
@ -734,10 +723,7 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add("?role ?roleToActivityPredicate ?roleActivity .");
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -753,10 +739,8 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
//If add mode or repair, etc. need to add label required validator
|
//If add mode or repair, etc. need to add label required validator
|
||||||
if(isAddMode(vreq) || isRepairMode(vreq)) {
|
if(isAddMode(vreq) || isRepairMode(vreq)) {
|
||||||
|
@ -776,10 +760,7 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add(getN3ForActivityLabel());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,9 +773,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(true);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
|
||||||
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
if(isAddMode(vreq) || isRepairMode(vreq)) {
|
if(isAddMode(vreq) || isRepairMode(vreq)) {
|
||||||
|
@ -822,10 +800,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
}
|
}
|
||||||
field.setLiteralOptions(fieldLiteralOptions);
|
field.setLiteralOptions(fieldLiteralOptions);
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add(getN3ForActivityType());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -838,7 +812,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(true);
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
field.setValidators(validators);
|
field.setValidators(validators);
|
||||||
|
@ -853,14 +826,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
//empty
|
//empty
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
//N3ForRoleToActivity
|
|
||||||
String n3ForRoleToActivity = "@prefix core: <" + getVivoCoreNamespace() + "> ." +
|
|
||||||
"?role " + getRoleToActivityPredicate(vreq) + " ?roleActivity ." +
|
|
||||||
"?roleActivity " + getActivityToRolePredicate(vreq) + " ?role .";
|
|
||||||
assertions.add(n3ForRoleToActivity);
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -870,10 +835,8 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
String fieldName = "roleLabel";
|
String fieldName = "roleLabel";
|
||||||
String stringDatatypeUri = XSD.xstring.toString();
|
String stringDatatypeUri = XSD.xstring.toString();
|
||||||
|
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
validators.add("datatype:" + stringDatatypeUri);
|
validators.add("datatype:" + stringDatatypeUri);
|
||||||
|
@ -892,10 +855,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
//empty
|
//empty
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.add(getN3RoleLabelAssertion());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -908,7 +867,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
field.setValidators(validators);
|
field.setValidators(validators);
|
||||||
|
@ -923,11 +881,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
//empty
|
//empty
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.addAll(getN3ForStart());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
|
|
||||||
//This logic was originally after edit configuration object created from json in original jsp
|
//This logic was originally after edit configuration object created from json in original jsp
|
||||||
field.setEditElement(
|
field.setEditElement(
|
||||||
new DateTimeWithPrecisionVTwo(field,
|
new DateTimeWithPrecisionVTwo(field,
|
||||||
|
@ -944,7 +897,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
|
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName(fieldName);
|
field.setName(fieldName);
|
||||||
field.setNewResource(false);
|
|
||||||
|
|
||||||
List<String> validators = new ArrayList<String>();
|
List<String> validators = new ArrayList<String>();
|
||||||
field.setValidators(validators);
|
field.setValidators(validators);
|
||||||
|
@ -959,10 +911,6 @@ public abstract class AddRoleToPersonTwoStageGenerator implements EditConfigurat
|
||||||
//empty
|
//empty
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
assertions.addAll(getN3ForEnd());
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
//Set edit element
|
//Set edit element
|
||||||
field.setEditElement(
|
field.setEditElement(
|
||||||
new DateTimeWithPrecisionVTwo(field,
|
new DateTimeWithPrecisionVTwo(field,
|
||||||
|
|
|
@ -67,8 +67,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
@Override
|
@Override
|
||||||
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
|
||||||
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo();
|
||||||
//Set n3 generator
|
|
||||||
editConfiguration.setN3Generator(new EditN3GeneratorVTwo(editConfiguration));
|
|
||||||
|
|
||||||
//process subject, predicate, object parameters
|
//process subject, predicate, object parameters
|
||||||
this.initProcessParameters(vreq, session, editConfiguration);
|
this.initProcessParameters(vreq, session, editConfiguration);
|
||||||
|
@ -187,13 +185,11 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
//this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method
|
//this needs to be set for the editing to be triggered properly, otherwise the 'prepare' method
|
||||||
//pretends this is a data property editing statement and throws an error
|
//pretends this is a data property editing statement and throws an error
|
||||||
//TODO: Check if null in case no object uri exists but this is still an object property
|
//TODO: Check if null in case no object uri exists but this is still an object property
|
||||||
if(objectUri != null) {
|
|
||||||
editConfiguration.setObjectResource(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processDataPropForm(VitroRequest vreq, EditConfigurationVTwo editConfiguration) {
|
private void processDataPropForm(VitroRequest vreq, EditConfigurationVTwo editConfiguration) {
|
||||||
editConfiguration.setObjectResource(false);
|
|
||||||
//set data prop value, data prop key str,
|
//set data prop value, data prop key str,
|
||||||
editConfiguration.setDatapropKey((datapropKeyStr==null)?"":datapropKeyStr);
|
editConfiguration.setDatapropKey((datapropKeyStr==null)?"":datapropKeyStr);
|
||||||
editConfiguration.setVarNameForObject(dataLiteral);
|
editConfiguration.setVarNameForObject(dataLiteral);
|
||||||
|
@ -298,7 +294,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
VitroRequest vreq, Map<String, FieldVTwo> fields) {
|
VitroRequest vreq, Map<String, FieldVTwo> fields) {
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName("lastName");
|
field.setName("lastName");
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
String stringDatatypeUri = XSD.xstring.toString();
|
String stringDatatypeUri = XSD.xstring.toString();
|
||||||
|
|
||||||
|
@ -319,9 +314,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -330,7 +322,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
VitroRequest vreq, Map<String, FieldVTwo> fields) {
|
VitroRequest vreq, Map<String, FieldVTwo> fields) {
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName("firstName");
|
field.setName("firstName");
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
String stringDatatypeUri = XSD.xstring.toString();
|
String stringDatatypeUri = XSD.xstring.toString();
|
||||||
|
|
||||||
|
@ -351,9 +342,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,7 +351,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
VitroRequest vreq, Map<String, FieldVTwo> fields) {
|
VitroRequest vreq, Map<String, FieldVTwo> fields) {
|
||||||
FieldVTwo field = new FieldVTwo();
|
FieldVTwo field = new FieldVTwo();
|
||||||
field.setName("label");
|
field.setName("label");
|
||||||
field.setNewResource(false);
|
|
||||||
//queryForExisting is not being used anywhere in Field
|
//queryForExisting is not being used anywhere in Field
|
||||||
String stringDatatypeUri = XSD.xstring.toString();
|
String stringDatatypeUri = XSD.xstring.toString();
|
||||||
|
|
||||||
|
@ -384,9 +371,6 @@ public class NewIndividualFormGenerator implements EditConfigurationGenerator {
|
||||||
|
|
||||||
field.setLiteralOptions(new ArrayList<List<String>>());
|
field.setLiteralOptions(new ArrayList<List<String>>());
|
||||||
|
|
||||||
//set assertions
|
|
||||||
List<String> assertions = new ArrayList<String>();
|
|
||||||
field.setAssertions(assertions);
|
|
||||||
fields.put(field.getName(), field);
|
fields.put(field.getName(), field);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.rdf.model.Model;
|
||||||
import com.hp.hpl.jena.vocabulary.XSD;
|
import com.hp.hpl.jena.vocabulary.XSD;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
|
@ -113,49 +114,41 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("degree").
|
setName("degree").
|
||||||
setOptionsType( FieldVTwo.OptionsType.INDIVIDUALS_VIA_VCLASS ).
|
setOptionsType( FieldVTwo.OptionsType.INDIVIDUALS_VIA_VCLASS ).
|
||||||
setObjectClassUri( degreeClass ).
|
setObjectClassUri( degreeClass ));
|
||||||
setAssertions( degreeAssertion ));
|
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("majorField").
|
setName("majorField").
|
||||||
setRangeDatatypeUri( XSD.xstring.toString() ).
|
setRangeDatatypeUri( XSD.xstring.toString() ));
|
||||||
setAssertions( majorFieldAssertion ));
|
|
||||||
//setValidators( ) datatype:stringDatatypeUriJson
|
//setValidators( ) datatype:stringDatatypeUriJson
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("org").
|
setName("org").
|
||||||
setOptionsType(FieldVTwo.OptionsType.INDIVIDUALS_VIA_VCLASS).
|
setOptionsType(FieldVTwo.OptionsType.INDIVIDUALS_VIA_VCLASS).
|
||||||
setObjectClassUri( orgClass ).
|
setObjectClassUri( orgClass ));
|
||||||
setAssertions( n3ForEdTrainingToOrg ));
|
|
||||||
//setLiteralOptions( [ "Select One" } )
|
//setLiteralOptions( [ "Select One" } )
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("orgLabel").
|
setName("orgLabel").
|
||||||
setRangeDatatypeUri(XSD.xstring.toString() ).
|
setRangeDatatypeUri(XSD.xstring.toString() ));
|
||||||
setAssertions( orgLabelAssertion));
|
|
||||||
//setValidators( ["nonempty"] )
|
//setValidators( ["nonempty"] )
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("orgType").
|
setName("orgType").
|
||||||
setOptionsType(FieldVTwo.OptionsType.CHILD_VCLASSES).
|
setOptionsType(FieldVTwo.OptionsType.CHILD_VCLASSES).
|
||||||
setObjectClassUri( orgClass ).
|
setObjectClassUri( orgClass ));
|
||||||
setAssertions( orgTypeAssertion ));
|
|
||||||
//setValidators( ["nonempty"])
|
//setValidators( ["nonempty"])
|
||||||
//setLiteralOptions( [ "Select one" ] )
|
//setLiteralOptions( [ "Select one" ] )
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("dept").
|
setName("dept").
|
||||||
setRangeDatatypeUri( XSD.xstring.toString() ).
|
setRangeDatatypeUri( XSD.xstring.toString() ));
|
||||||
setAssertions( deptAssertion ));
|
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("info").
|
setName("info").
|
||||||
setRangeDatatypeUri( XSD.xstring.toString() ).
|
setRangeDatatypeUri( XSD.xstring.toString() ));
|
||||||
setAssertions( infoAssertion));
|
|
||||||
|
|
||||||
conf.addField(new FieldVTwo().
|
conf.addField(new FieldVTwo().
|
||||||
setName("startField").
|
setName("startField").
|
||||||
setAssertions(n3ForStart).
|
|
||||||
setEditElement(
|
setEditElement(
|
||||||
new DateTimeWithPrecisionVTwo(null,
|
new DateTimeWithPrecisionVTwo(null,
|
||||||
VitroVocabulary.Precision.YEAR.uri(),
|
VitroVocabulary.Precision.YEAR.uri(),
|
||||||
|
@ -163,7 +156,6 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
|
||||||
|
|
||||||
conf.addField( new FieldVTwo().
|
conf.addField( new FieldVTwo().
|
||||||
setName("endField").
|
setName("endField").
|
||||||
setAssertions(n3ForEnd).
|
|
||||||
setEditElement(
|
setEditElement(
|
||||||
new DateTimeWithPrecisionVTwo(null,
|
new DateTimeWithPrecisionVTwo(null,
|
||||||
VitroVocabulary.Precision.YEAR.uri(),
|
VitroVocabulary.Precision.YEAR.uri(),
|
||||||
|
@ -230,7 +222,7 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
|
||||||
final static String orgLabelQuery =
|
final static String orgLabelQuery =
|
||||||
"SELECT ?existingOrgLabel WHERE {\n"+
|
"SELECT ?existingOrgLabel WHERE {\n"+
|
||||||
"?edTraining <"+ trainingAtOrg +"> ?existingOrg .\n"+
|
"?edTraining <"+ trainingAtOrg +"> ?existingOrg .\n"+
|
||||||
"?existingOrg "+ label +" ?existingOrgLabel .\n"+
|
"?existingOrg <"+ label +"> ?existingOrgLabel .\n"+
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
/* Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another
|
/* Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another
|
||||||
|
@ -240,12 +232,12 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
|
||||||
"SELECT ?existingOrgType WHERE {\n"+
|
"SELECT ?existingOrgType WHERE {\n"+
|
||||||
"?edTraining <"+ trainingAtOrg +"> ?existingOrg .\n"+
|
"?edTraining <"+ trainingAtOrg +"> ?existingOrg .\n"+
|
||||||
"?existingOrg a ?existingOrgType .\n"+
|
"?existingOrg a ?existingOrgType .\n"+
|
||||||
"?existingOrgType rdfs:subClassOf "+ orgClass +" .\n"+
|
"?existingOrgType rdfs:subClassOf <"+ orgClass +"> .\n"+
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
final static String degreeQuery =
|
final static String degreeQuery =
|
||||||
"SELECT ?existingDegree WHERE {\n"+
|
"SELECT ?existingDegree WHERE {\n"+
|
||||||
"?edTraining "+ degreeEarned +" ?existingDegree . }";
|
"?edTraining <"+ degreeEarned +"> ?existingDegree . }";
|
||||||
|
|
||||||
final static String majorFieldQuery =
|
final static String majorFieldQuery =
|
||||||
"SELECT ?existingMajorField WHERE {\n"+
|
"SELECT ?existingMajorField WHERE {\n"+
|
||||||
|
|
Loading…
Add table
Reference in a new issue