diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java
index e63791df5..2ddca87c2 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualResponseBuilder.java
@@ -279,7 +279,9 @@ class IndividualResponseBuilder {
log.debug("queryStr = " + queryStr);
int theCount = 0;
try {
- ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
+ //ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
+ //Get query results across all languages in order for template to show manage labels link correctly
+ ResultSet results = QueryUtils.getLanguageNeutralQueryResults(queryStr, vreq);
if (results.hasNext()) {
QuerySolution soln = results.nextSolution();
String countStr = soln.get("labelCount").toString();
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForIndividualGenerator.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForIndividualGenerator.java
new file mode 100644
index 000000000..a9cb131d7
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManageLabelsForIndividualGenerator.java
@@ -0,0 +1,574 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators;
+
+import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.query.Dataset;
+import com.hp.hpl.jena.query.QueryExecution;
+import com.hp.hpl.jena.query.QueryExecutionFactory;
+import com.hp.hpl.jena.query.QuerySolution;
+import com.hp.hpl.jena.query.ResultSet;
+import com.hp.hpl.jena.rdf.model.Literal;
+import com.hp.hpl.jena.rdf.model.RDFNode;
+import com.hp.hpl.jena.shared.Lock;
+import com.hp.hpl.jena.sparql.resultset.ResultSetMem;
+import com.hp.hpl.jena.vocabulary.RDFS;
+import com.hp.hpl.jena.vocabulary.XSD;
+
+import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement;
+import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement;
+import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
+import edu.cornell.mannlib.vitro.webapp.beans.DataPropertyStatement;
+import edu.cornell.mannlib.vitro.webapp.beans.Individual;
+import edu.cornell.mannlib.vitro.webapp.beans.VClass;
+import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
+import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap;
+import edu.cornell.mannlib.vitro.webapp.dao.ModelAccess;
+import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
+import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
+import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils;
+import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils;
+import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
+import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo;
+import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.FoafNameToRdfsLabelPreprocessor;
+import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.ManageLabelsForIndividualPreprocessor;
+import edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionDataGetter;
+import edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectorUtilities;
+import edu.cornell.mannlib.vitro.webapp.i18n.selection.SelectedLocale;
+import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DataPropertyStatementTemplateModel;
+
+/**
+ *This allows the page to show all the labels for a particular individual and sets up code
+ *enabling the addition of a new label. Links on the page will allow for removal or editing of a given label.
+ */
+public class ManageLabelsForIndividualGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator {
+ public static Log log = LogFactory.getLog(ManageLabelsForIndividualGenerator.class);
+ private static String template = "manageLabelsForIndividual.ftl";
+ private HashMap> labelsSortedByLanguage = null;
+ private List existingLabelLiterals = null;
+ //list of language names sorted alphabetically
+ private List existingSortedLanguageNameList = null;
+ //This would be for the full list and can be used for the existing labels list as well
+
+ private HashMap fullLanguageNameToCodeMap = null;
+ private static String predicateUri = RDFS.label.getURI();
+ @Override
+ public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) {
+
+ EditConfigurationVTwo config = new EditConfigurationVTwo();
+ config.setTemplate(this.getTemplate());
+
+ initBasics(config, vreq);
+ initPropertyParameters(vreq, session, config);
+
+ //This form is technically not an object property form in the true sense
+ //or a data property form because it is used to list the various labels
+ //and allow for adding new labels
+ //URL to return to is the same page once addition is complete
+ this.setUrlToReturnTo(config, vreq);
+
+ config.setSubjectUri(EditConfigurationUtils.getSubjectUri(vreq));
+
+ setVarNames(config);
+ config.setDatapropKey( EditConfigurationUtils.getDataHash(vreq) );
+ //Add n3, fields, etc. in the case where the user wants to add a label
+ //N3 required should be empty since the addition of a label is optional in this case
+ config.setN3Required(this.generateN3Required(vreq));
+ config.setN3Optional(this.generateN3Optional(vreq));
+ this.setUrisAndLiteralsOnForm(config, vreq);
+ setUrisAndLiteralsInScope(config);
+ this.setFields(config, vreq, EditConfigurationUtils
+ .getPredicateUri(vreq));
+
+ //Get existing labels
+ //this.initExistingLabels(config, vreq);
+
+ //Add form specific data used to populate template
+ addFormSpecificData(config, vreq);
+ //This preprocessor handles getting the correct label language and putting the attribute on the label
+ config.addEditSubmissionPreprocessor(
+ new ManageLabelsForIndividualPreprocessor(config));
+ //This will handle generating the label from the first name and last name and also make sure to associate
+ //a language with that label
+ config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor());
+
+ prepare(vreq, config);
+ return config;
+ }
+
+ private void setUrlToReturnTo(EditConfigurationVTwo editConfiguration, VitroRequest vreq) {
+ editConfiguration.setUrlPatternToReturnTo(EditConfigurationUtils.getFormUrlWithoutContext(vreq));
+ }
+
+ private void setVarNames(EditConfigurationVTwo editConfiguration) {
+ editConfiguration.setVarNameForSubject("subject");
+ editConfiguration.setVarNameForPredicate("predicate");
+
+ }
+
+
+ private List generateN3Required(VitroRequest vreq) {
+ List n3Required = new ArrayList();
+ return n3Required;
+ }
+
+ private List generateN3Optional(VitroRequest vreq) {
+ List n3Optional = new ArrayList();
+ String predicateUri = EditConfigurationUtils.getPredicateUri(vreq);
+ String n3 = "?subject <" + predicateUri + "> ?label ";
+ //n3 used if the subject is a person
+ String personN3 = this.N3_PREFIX + "?subject foaf:firstName ?firstName ; foaf:lastName ?lastName .";
+ n3Optional.add(n3);
+ n3Optional.add(personN3);
+ return n3Optional;
+ }
+
+
+
+ private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) {
+ Map fields = new HashMap();
+ editConfiguration.setFields(fields);
+ editConfiguration.addField(new FieldVTwo().
+ setName("label").
+ setValidators(getLabelValidators(vreq, editConfiguration)));
+ editConfiguration.addField(new FieldVTwo(
+ ).setName("newLabelLanguage"));
+ //no validators since all of this is optional
+ //there should be error-checking client side though
+ editConfiguration.addField(new FieldVTwo().
+ setName("firstName").
+ setValidators(getFirstNameValidators(vreq, editConfiguration)));
+
+ editConfiguration.addField(new FieldVTwo().
+ setName("lastName").
+ setValidators(getLastNameValidators(vreq, editConfiguration)));
+ }
+
+ //first and last name have validators if is person is true
+ private List getFirstNameValidators(VitroRequest vreq, EditConfigurationVTwo config) {
+ List validators = new ArrayList();
+ if(isPersonType(vreq, config)) {
+ validators.add("nonempty");
+ }
+ return validators;
+ }
+
+ private List getLastNameValidators(VitroRequest vreq, EditConfigurationVTwo config) {
+ List validators = new ArrayList();
+ if(isPersonType(vreq, config)) {
+ validators.add("nonempty");
+ }
+ return validators;
+ }
+
+ //validate label if person is not true
+ private List getLabelValidators(VitroRequest vreq, EditConfigurationVTwo config) {
+ List validators = new ArrayList();
+ if(!isPersonType(vreq, config)) {
+ validators.add("nonempty");
+ }
+ return validators;
+ }
+
+
+
+ private void setUrisAndLiteralsOnForm(EditConfigurationVTwo config,
+ VitroRequest vreq) {
+ List literalsOnForm = new ArrayList();
+ literalsOnForm.add("label");
+ literalsOnForm.add("newLabelLanguage");
+ //optional for person
+ literalsOnForm.add("firstName");
+ literalsOnForm.add("lastName");
+ config.setLiteralsOnForm(literalsOnForm);
+
+ }
+
+
+ private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration) {
+ HashMap> urisInScope = new HashMap>();
+ //note that at this point the subject, predicate, and object var parameters have already been processed
+ urisInScope.put(editConfiguration.getVarNameForSubject(),
+ Arrays.asList(new String[]{editConfiguration.getSubjectUri()}));
+ urisInScope.put(editConfiguration.getVarNameForPredicate(),
+ Arrays.asList(new String[]{editConfiguration.getPredicateUri()}));
+ editConfiguration.setUrisInScope(urisInScope);
+ //Uris in scope include subject, predicate, and object var
+
+ editConfiguration.setLiteralsInScope(new HashMap>());
+ }
+
+ private void initExistingLabels(EditConfigurationVTwo config,
+ VitroRequest vreq) {
+ this.existingLabelLiterals = this.getExistingLabels(config.getSubjectUri(), vreq);
+ // this.labelsSortedByLanguage = this.getLabelsSortedByLanguage(config,vreq);
+ //language names sorted for the existing languages
+ // this.existingSortedLanguageNameList = getExistingSortedLanguageNamesList();
+
+ //Generate a label to language code hash map
+ //TODO:
+
+ //HashMap labelToLanguageCode = new HashMap();
+
+ //this.labels = getExistingLabels(config.getSubjectUri(), vreq);
+ //this.labelsSortedByLanguage = getLabelsSortedByLanguage(config.getSubjectUri(), vreq);
+
+ }
+
+
+ private List getExistingSortedLanguageNamesList() {
+ HashSet existingLanguages = new HashSet();
+ for(Literal l: this.existingLabelLiterals) {
+ String language = l.getLanguage();
+ if(!existingLanguages.contains(language)) {
+ existingLanguages.add(language);
+ }
+ }
+ List sortedNames = new ArrayList(existingLanguages);
+ //sort alphabetically
+ Collections.sort(sortedNames);
+ return sortedNames;
+ }
+
+
+ private void addFormSpecificData(EditConfigurationVTwo config,
+ VitroRequest vreq) {
+ //Get all language codes/labels in the system, and this list is sorted by language name
+ List> locales = this.getLocales(vreq);
+ //Get code to label hashmap - we use this to get the language name for the language code returned in the rdf literal
+ HashMap localeCodeToNameMap = this.getFullCodeToLanguageNameMap(locales);
+ //the labels already added by the user
+ ArrayList existingLabels = this.getExistingLabels(config.getSubjectUri(), vreq);
+ //existing labels keyed by language name and each of the list of labels is sorted by language name
+ HashMap> existingLabelsByLanguageName = this.getLabelsSortedByLanguageName(existingLabels, localeCodeToNameMap, config, vreq);
+ //Get available locales for the drop down for adding a new label, also sorted by language name
+ HashSet existingLanguageNames = new HashSet(existingLabelsByLanguageName.keySet());
+ List> availableLocalesForAdd = getAvailableLocales(locales, existingLanguageNames);
+
+
+ //Save all locales
+ config.addFormSpecificData("selectLocaleFullList", locales);
+ //Save labels sorted by language name, untyped have "untyped" as the language name value
+ config.addFormSpecificData("labelsSortedByLanguageName", existingLabelsByLanguageName);
+ config.addFormSpecificData("selectLocale",availableLocalesForAdd);
+
+
+ //How do we edit? Will need to see
+ config.addFormSpecificData("deleteWebpageUrl", "/edit/primitiveDelete");
+
+
+ Individual subject = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(config.getSubjectUri());
+ if( subject != null && subject.getName() != null ){
+ config.addFormSpecificData("subjectName", subject.getName());
+ }else{
+ config.addFormSpecificData("subjectName", null);
+ }
+
+ //Put in whether or not person type
+ if(isPersonType(vreq, config)) {
+ //Doing this b/c unsure how freemarker will handle boolean value from JAVA
+ config.addFormSpecificData("isPersonType", "true");
+ } else {
+ config.addFormSpecificData("isPersonType", "false");
+
+ }
+
+ //Include whether or not editable to enable edit/remove links and add to show up
+ config.addFormSpecificData("editable", isEditable(vreq, config));
+ }
+
+
+
+ //Based on what locales have already been selected for labels, return a list of
+ //locales for which new labels can be added and have these sorted by the name of the language
+ private List> getAvailableLocales(List> allLocales,
+ HashSet existingLabelsLanguageNames) {
+ List> availableLocales = new ArrayList>();
+ for(HashMap localeInfo: allLocales) {
+ String languageName = (String) localeInfo.get("label");
+ //If this language label is NOT in the labels sorted by language, then available
+ //for selection when creating a new label
+ //The assumption here is we don't want to allow the user to add a new label when a label
+ //already exists in that language
+ if(languageName != "untyped" && !existingLabelsLanguageNames.contains(languageName)) {
+ availableLocales.add(localeInfo);
+ }
+ }
+ //Sort list by language label and return
+ Collections.sort(availableLocales, new Comparator>() {
+ public int compare(HashMap h1, HashMap h2) {
+ String languageName1 = (String) h1.get("label");
+ String languageName2 = (String) h2.get("label");
+ return languageName1.compareTo(languageName2);
+ }
+ });
+
+ return availableLocales;
+ }
+
+
+ private Object isEditable(VitroRequest vreq, EditConfigurationVTwo config) {
+ Individual individual = EditConfigurationUtils.getIndividual(vreq, config.getSubjectUri());
+ AddDataPropertyStatement adps = new AddDataPropertyStatement(
+ vreq.getJenaOntModel(), individual.getURI(),
+ RequestActionConstants.SOME_URI);
+ AddObjectPropertyStatement aops = new AddObjectPropertyStatement(
+ vreq.getJenaOntModel(), individual.getURI(),
+ RequestActionConstants.SOME_URI,
+ RequestActionConstants.SOME_URI);
+ return PolicyHelper.isAuthorizedForActions(vreq, new Actions(adps).or(aops));
+ }
+
+
+ //Copied from NewIndividualFormGenerator
+ //TODO: Refactor so common code can be used by both generators
+ public String getFOAFPersonClassURI() {
+ return "http://xmlns.com/foaf/0.1/Person";
+ }
+
+ public boolean isPersonType(VitroRequest vreq, EditConfigurationVTwo config) {
+ WebappDaoFactory wdf = vreq.getWebappDaoFactory();
+ Boolean isPersonType = Boolean.FALSE;
+ String foafPersonType = getFOAFPersonClassURI();
+ List vclasses = this.getVClasses(config, vreq);
+ if( vclasses != null ){
+ for( VClass v: vclasses){
+ String typeUri = v.getURI();
+ if( foafPersonType.equals(typeUri)) {
+ isPersonType = Boolean.TRUE;
+ break;
+ }
+ }
+ }
+ return isPersonType;
+ }
+
+ //how to get the type of the individual in question
+ public List getVClasses(EditConfigurationVTwo config, VitroRequest vreq) {
+ Individual subject = EditConfigurationUtils.getIndividual(vreq, config.getSubjectUri());
+ //Get the vclasses appropriate for this subject
+ return subject.getVClasses();
+ }
+
+ //Languages sorted by language name
+ private HashMap> getLabelsSortedByLanguageName(List labels, Map localeCodeToNameMap, EditConfigurationVTwo config,
+ VitroRequest vreq) {
+ String subjectUri = config.getSubjectUri();
+ String propertyUri = config.getPredicateUri();
+
+
+ //Iterate through the labels and create a hashmap
+ HashMap> labelsHash= new HashMap>();
+
+ for(Literal l: labels) {
+ String languageTag = l.getLanguage();
+ String languageName = "";
+ if(languageTag == "") {
+ languageName = "untyped";
+ }
+ else if(localeCodeToNameMap.containsKey(languageTag)) {
+ languageName = localeCodeToNameMap.get(languageTag);
+ } else {
+ log.warn("This language tag " + languageTag + " does not have corresponding name in the system and was not processed");
+ }
+
+ if(languageName != "") {
+ if(!labelsHash.containsKey(languageName)) {
+ labelsHash.put(languageName, new ArrayList());
+ }
+ ArrayList labelsList = (ArrayList)labelsHash.get(languageName);
+ //This should put the label in the list
+ //Create label information instance with the required information
+ //To generate link
+ DataPropertyStatementTemplateModel dpstm = new DataPropertyStatementTemplateModel(subjectUri, propertyUri, l,
+ template, vreq);
+ labelsList.add(new LabelInformation(
+ l, dpstm.getEditUrl(), dpstm.getDeleteUrl(), languageTag, languageName));
+ }
+ }
+
+ //Sort each label list
+ LabelInformationComparator lic = new LabelInformationComparator();
+ for(String languageName: labelsHash.keySet()) {
+ List labelInfo = labelsHash.get(languageName);
+ Collections.sort(labelInfo, lic);
+ }
+ return labelsHash;
+
+ }
+
+
+ public static class LabelInformationComparator implements Comparator {
+
+ public int compare(LabelInformation l1, LabelInformation l2) {
+ return l1.getLabelStringValue().compareTo(l2.getLabelStringValue());
+ }
+ }
+
+
+ private static String LABEL_QUERY = ""
+ + "PREFIX rdfs: \n"
+ + "SELECT DISTINCT ?label WHERE { \n"
+ + " ?subject rdfs:label ?label \n"
+ + "} ORDER BY ?label";
+
+
+ private ArrayList getExistingLabels(String subjectUri, VitroRequest vreq) {
+ String queryStr = QueryUtils.subUriForQueryVar(LABEL_QUERY, "subject", subjectUri);
+ log.debug("queryStr = " + queryStr);
+
+ ArrayList labels = new ArrayList();
+ try {
+ //We want to get the labels for all the languages, not just the display language
+ ResultSet results = QueryUtils.getLanguageNeutralQueryResults(queryStr, vreq);
+ while (results.hasNext()) {
+ QuerySolution soln = results.nextSolution();
+ Literal nodeLiteral = soln.get("label").asLiteral();
+ labels.add(nodeLiteral);
+
+
+ }
+ } catch (Exception e) {
+ log.error(e, e);
+ }
+ return labels;
+}
+
+
+
+ //Putting this into a method allows overriding it in subclasses
+ protected String getEditForm() {
+ return null;
+ //return AddEditWebpageFormGenerator.class.getName();
+ }
+
+
+ protected String getTemplate() {
+ return template;
+ }
+
+
+
+ //get locales
+ public List> getLocales(VitroRequest vreq) {
+ List selectables = SelectedLocale.getSelectableLocales(vreq);
+ if (selectables.isEmpty()) {
+ return Collections.emptyList();
+ }
+ List> list = new ArrayList>();
+ Locale currentLocale = SelectedLocale.getCurrentLocale(vreq);
+ for (Locale locale : selectables) {
+ try {
+ list.add(buildLocaleMap(locale, currentLocale));
+ } catch (FileNotFoundException e) {
+ log.warn("Can't show the Locale selector for '" + locale
+ + "': " + e);
+ }
+ }
+
+ return list;
+ }
+
+
+
+ public HashMap getFullCodeToLanguageNameMap(List> localesList) {
+ HashMap codeToLanguageMap = new HashMap();
+ for(Map locale: localesList) {
+ String code = (String) locale.get("code");
+ String label = (String) locale.get("label");
+ if(!codeToLanguageMap.containsKey(code)) {
+ codeToLanguageMap.put(code, label);
+ }
+ else {
+ log.warn("Language code " + code + " for " + label + " was not associated in map becayse label already exists");
+ }
+ }
+ return codeToLanguageMap;
+ }
+
+ public List getFullLanguagesNamesSortedList(List
+
+
diff --git a/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualAddForm.ftl b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualAddForm.ftl
new file mode 100644
index 000000000..e6d6714c3
--- /dev/null
+++ b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualAddForm.ftl
@@ -0,0 +1,29 @@
+<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
+<#--The form for adding a new label-->
+
\ No newline at end of file
diff --git a/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualMacros.ftl b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualMacros.ftl
new file mode 100644
index 000000000..35839dada
--- /dev/null
+++ b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualMacros.ftl
@@ -0,0 +1,79 @@
+<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
+<#--LabelsSorted is a hash keyed by language name where the value is a list of LabelInformation class objects-->
+<#macro displayExistingLabelsForLanguage lang labelsSorted editable editGenerator>
+ <#--get label information for this language-->
+ <#assign labelList = labelsSorted[lang] />
+ <#--Reset for every language-->
+ <#assign labelSeq = []/>
+ <#list labelList as labelObject>
+ <#assign labelLiteral = labelObject.labelLiteral />
+ <#assign labelStringValue = labelObject.labelStringValue />
+ <#--Try label as label literal-->
+ <#assign label = labelLiteral />
+ <#assign labelLang = labelObject.languageName />
+ <#assign languageCode = labelObject.languageCode />
+ <#assign labelEditLink = labelObject.editLinkURL />
+ <#if label?? && ( label?index_of("@") > -1 ) >
+ <#assign labelStr = label?substring(0, label?index_of("@")) >
+ <#assign tagOrTypeStr = label?substring(label?index_of("@")) >
+ <#elseif label?? && ( label?index_of("^^") > -1 ) >
+ <#assign labelStr = label?substring(0, label?index_of("^^")) >
+ <#assign tagOrTypeStr = label?substring(label?index_of("^^")) >
+ <#assign tagOrTypeStr = tagOrTypeStr?replace("^^http","^^
+ <#assign tagOrTypeStr = tagOrTypeStr?replace("#string","#string>") >
+ <#else>
+ <#assign labelStr = label >
+ <#assign tagOrTypeStr = "" >
+ #if>
+
+ <#assign labelSeq = labelSeq + [labelStr]>
+ #list>
+ #if>
+ #list>
+#macro>
\ No newline at end of file
diff --git a/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualSubmissionErrors.ftl b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualSubmissionErrors.ftl
new file mode 100644
index 000000000..ef4f8fe95
--- /dev/null
+++ b/webapp/web/templates/freemarker/body/individual/manageLabelsForIndividualSubmissionErrors.ftl
@@ -0,0 +1,14 @@
+<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
+<#if submissionErrors?has_content >
+
+
+
+
+#if>
\ No newline at end of file
diff --git a/webapp/web/templates/freemarker/lib/lib-properties.ftl b/webapp/web/templates/freemarker/lib/lib-properties.ftl
index 7d360496a..f48adc194 100644
--- a/webapp/web/templates/freemarker/lib/lib-properties.ftl
+++ b/webapp/web/templates/freemarker/lib/lib-properties.ftl
@@ -209,13 +209,18 @@ name will be used as the label. -->
<#-- Label -->
<#macro label individual editable labelCount>
+ <#assign labelPropertyUri = ("http://www.w3.org/2000/01/rdf-schema#label"?url) />
+ <#-- Will need to deal with multiple languages as well-->
<#local label = individual.nameStatement>
${label.value}
<#if (labelCount > 1) && editable >
+ <#-- Changing this so that manage labels now goes to generator -->
-
- ${i18n().manage_labels}
-
+ <#--Previous link which went to manage labels controller-->
+ <#--a id="manageLabels" href="${urls.base}/manageLabels?subjectUri=${individual.uri!}"-->
+
+
<#else>
<@editingLinks "label" label editable />