VIVO-370: fixed incorrect middleName property uri

This commit is contained in:
tworrall 2013-10-16 15:54:44 -04:00
parent bec7c7e872
commit 902fbbc4cd
9 changed files with 59 additions and 21 deletions

View file

@ -43,6 +43,7 @@
?publisherObj rdfs:label ?publisher ?publisherObj rdfs:label ?publisher
} }
OPTIONAL { ?infoResource core:relatedBy ?editorship . OPTIONAL { ?infoResource core:relatedBy ?editorship .
?editorship a core:Editorship .
?editorship core:relates ?editorObj . ?editorship core:relates ?editorObj .
?editorObj rdfs:label ?editor ?editorObj rdfs:label ?editor
} }
@ -89,6 +90,7 @@
PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX bibo: <http://purl.org/ontology/bibo/>
CONSTRUCT { CONSTRUCT {
?subject ?property ?authorship . ?subject ?property ?authorship .
?authorship a core:Authorship .
?authorship ?authorshipProperty ?authorshipValue . ?authorship ?authorshipProperty ?authorshipValue .
?authorship core:relates ?infoResource . ?authorship core:relates ?infoResource .
?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> .
@ -196,6 +198,7 @@
?authorship core:relates ?infoResource . ?authorship core:relates ?infoResource .
?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> .
?infoResource core:relatedBy ?editorship . ?infoResource core:relatedBy ?editorship .
?editorship a core:Editorship .
?editorship core:relates ?editorObj . ?editorship core:relates ?editorObj .
?editorObj rdfs:label ?editor ?editorObj rdfs:label ?editor
} UNION { } UNION {

View file

@ -6,18 +6,22 @@
<list-view-config> <list-view-config>
<query-select> <query-select>
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt; PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
SELECT DISTINCT ?vcard ?fullName SELECT DISTINCT ?vcard ?fullName
?firstName ?firstName
?middleName ?middleName
?lastName ?lastName
?suffix
?prefix
WHERE { WHERE {
?subject ?property ?vcard . ?subject ?property ?vcard .
?vcard vcard:hasName ?fullName ?vcard vcard:hasName ?fullName
OPTIONAL { ?fullName vcard:givenName ?firstName } OPTIONAL { ?fullName vcard:givenName ?firstName }
OPTIONAL { ?fullName vcard:middleName ?middleName } OPTIONAL { ?fullName core:middleName ?middleName }
OPTIONAL { ?fullName vcard:familyName ?lastName } OPTIONAL { ?fullName vcard:familyName ?lastName }
OPTIONAL { ?fullName vcard:honorificSuffix ?suffix }
OPTIONAL { ?fullName vcard:honorificPrefix ?prefix }
} }
</query-select> </query-select>

View file

@ -11,7 +11,10 @@
<#macro showFullName statement> <#macro showFullName statement>
<#if statement.fullName?has_content> <#if statement.fullName?has_content>
${statement.firstName!}&nbsp;${statement.middleName!}&nbsp;${statement.lastName!} <#if statement.prefix??>${statement.prefix!}</#if>
${statement.firstName!}
${statement.middleName!}
${statement.lastName!}<#if statement.suffix??>, ${statement.suffix!}</#if>
</#if> </#if>
</#macro> </#macro>

View file

@ -19,6 +19,8 @@
<#assign firstNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "firstName") /> <#assign firstNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "firstName") />
<#assign middleNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "middleName") /> <#assign middleNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "middleName") />
<#assign lastNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "lastName") /> <#assign lastNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "lastName") />
<#assign suffixValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "suffix") />
<#assign prefixValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "prefix") />
<#--If edit submission exists, then retrieve validation errors if they exist--> <#--If edit submission exists, then retrieve validation errors if they exist-->
@ -63,13 +65,15 @@
<form id="addFullNameToPerson" class="customForm noIE67" action="${submitUrl}" role="add/edit name"> <form id="addFullNameToPerson" class="customForm noIE67" action="${submitUrl}" role="add/edit name">
<p> <p>
<label for="firstName">${i18n().first_name} ${requiredHint}</label> <label for="firstName">${i18n().first_name} ${requiredHint}<span style="padding-left:300px">name_prefix</span></label>
<input size="25" type="text" id="firstName" name="firstName" value="${firstNameValue}" /> <input size="25" type="text" id="firstName" name="firstName" value="${firstNameValue}" />
<input style="margin-left:138px" size="12" type="text" id="prefix" name="prefix" value="${prefixValue}" />
</p> </p>
<p> <p>
<label for="middleName">${i18n().middle_name}</label> <label for="middleName">${i18n().middle_name}<span style="padding-left:293px">name_suffix</span></label>
<input size="25" type="text" id="middleName" name="middleName" value="${middleNameValue}" /> <input size="25" type="text" id="middleName" name="middleName" value="${middleNameValue}" />
<input style="margin-left:138px" size="12" type="text" id="suffix" name="suffix" value="${suffixValue}" />
</p> </p>
<p> <p>

View file

@ -125,7 +125,7 @@
<#if (group.individualCount > 0) && group.displayName == "research" > <#if (group.individualCount > 0) && group.displayName == "research" >
<#assign foundClassGroup = true /> <#assign foundClassGroup = true />
<#list group.classes as class> <#list group.classes as class>
<#if (class.individualCount > 0) && (class.name == "Academic Article" || class.name == "Book" || class.name == "Chapter" ||class.name == "Conference Paper" || class.name == "Proceedings" || class.name == "Report") > <#if (class.individualCount > 0) && (class.uri?contains("Academic Article") || class.uri?contains("Book") || class.uri?contains("Chapter") ||class.uri?contains("Conference Paper") || class.uri?contains("Proceedings") || class.uri?contains("Report")) >
<li role="listitem"> <li role="listitem">
<span>${class.individualCount!}</span>&nbsp; <span>${class.individualCount!}</span>&nbsp;
<a href='${urls.base}/individuallist?vclassId=${class.uri?replace("#","%23")!}'> <a href='${urls.base}/individuallist?vclassId=${class.uri?replace("#","%23")!}'>

View file

@ -153,10 +153,10 @@ public class AddAuthorsToInformationResourceGenerator extends VivoBaseGenerator
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" + "@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" + "?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" +
"?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" + "?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" +
"?vcardPerson a <http://www.w3.org/2006/vcard/ns#Individual> . \n" + "?vcardPerson a vcard:Individual . \n" +
"?vcardPerson vcard:hasName ?vcardName . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" +
"?vcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" + "?vcardName a vcard:Name . \n" +
"?vcardName vcard:middleName ?middleName ."; "?vcardName <http://vivoweb.org/ontology/core#middleName> ?middleName .";
} }
private String getN3NewPersonLastName() { private String getN3NewPersonLastName() {

View file

@ -149,10 +149,10 @@ public class AddEditorsToInformationResourceGenerator extends VivoBaseGenerator
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" + "@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" + "?newPerson <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardPerson . \n" +
"?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" + "?vcardPerson <http://purl.obolibrary.org/obo/ARG_2000029> ?newPerson . \n" +
"?vcardPerson a <http://www.w3.org/2006/vcard/ns#Individual> . \n" + "?vcardPerson a vcard:Individual . \n" +
"?vcardPerson vcard:hasName ?vcardName . \n" + "?vcardPerson vcard:hasName ?vcardName . \n" +
"?vcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" + "?vcardName a vcard:Name . \n" +
"?vcardName vcard:middleName ?middleName ."; "?vcardName <http://vivoweb.org/ontology/core#middleName> ?middleName .";
} }
private String getN3NewPersonLastName() { private String getN3NewPersonLastName() {

View file

@ -47,16 +47,18 @@ public class AddFullNameToPersonGenerator extends VivoBaseGenerator implements
conf.setVarNameForObject("individualVcard"); conf.setVarNameForObject("individualVcard");
conf.setN3Required( Arrays.asList( n3ForNewName ) ); conf.setN3Required( Arrays.asList( n3ForNewName ) );
conf.setN3Optional( Arrays.asList( firstNameAssertion, middleNameAssertion, lastNameAssertion ) ); conf.setN3Optional( Arrays.asList( firstNameAssertion, middleNameAssertion, lastNameAssertion, suffixAssertion, prefixAssertion ) );
conf.addNewResource("fullName", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("fullName", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("individualVcard", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.setLiteralsOnForm(Arrays.asList("firstName", "middleName", "lastName" )); conf.setLiteralsOnForm(Arrays.asList("firstName", "middleName", "lastName", "suffix", "prefix" ));
conf.addSparqlForExistingLiteral("firstName", firstNameQuery); conf.addSparqlForExistingLiteral("firstName", firstNameQuery);
conf.addSparqlForExistingLiteral("middleName", middleNameQuery); conf.addSparqlForExistingLiteral("middleName", middleNameQuery);
conf.addSparqlForExistingLiteral("lastName", lastNameQuery); conf.addSparqlForExistingLiteral("lastName", lastNameQuery);
conf.addSparqlForExistingLiteral("suffix", suffixQuery);
conf.addSparqlForExistingLiteral("prefix", prefixQuery);
conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery); conf.addSparqlForAdditionalUrisInScope("individualVcard", individualVcardQuery);
if ( conf.isUpdate() ) { if ( conf.isUpdate() ) {
@ -79,6 +81,14 @@ public class AddFullNameToPersonGenerator extends VivoBaseGenerator implements
.setRangeDatatypeUri( XSD.xstring.toString() ). .setRangeDatatypeUri( XSD.xstring.toString() ).
setValidators( list("nonempty") )); setValidators( list("nonempty") ));
conf.addField( new FieldVTwo().
setName("suffix")
.setRangeDatatypeUri( XSD.xstring.toString()) );
conf.addField( new FieldVTwo().
setName("prefix")
.setRangeDatatypeUri( XSD.xstring.toString()) );
conf.addValidator(new AntiXssValidation()); conf.addValidator(new AntiXssValidation());
prepare(vreq, conf); prepare(vreq, conf);
@ -98,11 +108,17 @@ public class AddFullNameToPersonGenerator extends VivoBaseGenerator implements
"?fullName <http://www.w3.org/2006/vcard/ns#givenName> ?firstName ."; "?fullName <http://www.w3.org/2006/vcard/ns#givenName> ?firstName .";
final static String middleNameAssertion = final static String middleNameAssertion =
"?fullName <http://www.w3.org/2006/vcard/ns#middleName> ?middleName ."; "?fullName <http://vivoweb.org/ontology/core#middleName> ?middleName .";
final static String lastNameAssertion = final static String lastNameAssertion =
"?fullName <http://www.w3.org/2006/vcard/ns#familyName> ?lastName ."; "?fullName <http://www.w3.org/2006/vcard/ns#familyName> ?lastName .";
final static String suffixAssertion =
"?fullName <http://www.w3.org/2006/vcard/ns#honorificSuffix> ?suffix .";
final static String prefixAssertion =
"?fullName <http://www.w3.org/2006/vcard/ns#honorificPrefix> ?prefix .";
/* Queries for editing an existing entry */ /* Queries for editing an existing entry */
final static String individualVcardQuery = final static String individualVcardQuery =
@ -116,12 +132,20 @@ public class AddFullNameToPersonGenerator extends VivoBaseGenerator implements
final static String middleNameQuery = final static String middleNameQuery =
"SELECT ?existingMiddleName WHERE {\n"+ "SELECT ?existingMiddleName WHERE {\n"+
"?fullName <http://www.w3.org/2006/vcard/ns#middleName> ?existingMiddleName . }"; "?fullName <http://vivoweb.org/ontology/core#middleName> ?existingMiddleName . }";
final static String lastNameQuery = final static String lastNameQuery =
"SELECT ?existingLastName WHERE {\n"+ "SELECT ?existingLastName WHERE {\n"+
"?fullName <http://www.w3.org/2006/vcard/ns#familyName> ?existingLastName . }"; "?fullName <http://www.w3.org/2006/vcard/ns#familyName> ?existingLastName . }";
final static String suffixQuery =
"SELECT ?existingSuffix WHERE {\n"+
"?fullName <http://www.w3.org/2006/vcard/ns#honorificSuffix> ?existingSuffix . }";
final static String prefixQuery =
"SELECT ?existingPrefix WHERE {\n"+
"?fullName <http://www.w3.org/2006/vcard/ns#honorificPrefix> ?existingPrefix . }";
private String getFullNameUri(VitroRequest vreq) { private String getFullNameUri(VitroRequest vreq) {
String fullNameUri = vreq.getParameter("fullNameUri"); String fullNameUri = vreq.getParameter("fullNameUri");

View file

@ -46,12 +46,12 @@ public class NewIndividualFormGenerator extends BaseEditConfigurationGenerator i
N3_PREFIX + "@prefix vcard:<http://www.w3.org/2006/vcard/ns#> .\n" N3_PREFIX + "@prefix vcard:<http://www.w3.org/2006/vcard/ns#> .\n"
+ " ?newInd <http://purl.obolibrary.org/obo/ARG_2000028> ?newVcardInd . \n" + " ?newInd <http://purl.obolibrary.org/obo/ARG_2000028> ?newVcardInd . \n"
+ " ?newVcardInd <http://purl.obolibrary.org/obo/ARG_2000029> ?newInd . \n" + " ?newVcardInd <http://purl.obolibrary.org/obo/ARG_2000029> ?newInd . \n"
+ " ?newVcardInd a <http://www.w3.org/2006/vcard/ns#Individual> . \n" + " ?newVcardInd a vcard:Individual . \n"
+ " ?newVcardInd vcard:hasName ?newVcardName . \n" + " ?newVcardInd vcard:hasName ?newVcardName . \n"
+ " ?newVcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" + " ?newVcardName a vcard:Name . \n"
+ " ?newVcardName vcard:givenName ?firstName . \n" + " ?newVcardName vcard:givenName ?firstName . \n"
+ " ?newVcardName vcard:familyName ?lastName .", + " ?newVcardName vcard:familyName ?lastName . \n"
"?newVcardName <http://www.w3.org/2006/vcard/ns#middleName> ?middleName .", + " ?newVcardName <http://vivoweb.org/ontology/core#middleName> ?middleName .",
N3_PREFIX + " ?newInd <" + RDFS.label.getURI() + "> ?label ." N3_PREFIX + " ?newInd <" + RDFS.label.getURI() + "> ?label ."
)); ));
@ -90,7 +90,7 @@ public class NewIndividualFormGenerator extends BaseEditConfigurationGenerator i
//This combines the first and last name into the rdfs:label //This combines the first and last name into the rdfs:label
// currently being done via javascript in the template. May use this again // currently being done via javascript in the template. May use this again
// when/if updated to IFS ontology. tlw72 // when/if updated to ISF ontology. tlw72
// config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor()); // config.addModelChangePreprocessor(new FoafNameToRdfsLabelPreprocessor());
String formUrl = EditConfigurationUtils.getFormUrlWithoutContext(vreq); String formUrl = EditConfigurationUtils.getFormUrlWithoutContext(vreq);