VIVO-340 new custom form et al for advisee in and a refactored form for the advisor side

This commit is contained in:
tworrall 2013-10-10 10:14:55 -04:00
parent 2876b4d21d
commit db6e2dd358
16 changed files with 1357 additions and 104 deletions

View file

@ -99,8 +99,9 @@ temporal_graph_capitalized = Gráfico temporal
websites = Websites
advisee_label = etiqueta aconsejado
advisor_label = etiqueta asesor
candidate = candidato
advisory_label = Etiqueta de advertencia
advisingRel_label = Etiqueta de advertencia
editor_abbreviated = Ed.
volume_abbreviated = Ed.
@ -453,10 +454,13 @@ degree_candidacy = Candidatura Grado
subject_area = Asignatura
selected_subject_area = Tema Seleccionado Area
selected_advisee = Aconsejado Seleccionado
selected_advisor = Asesor Seleccionado
advisee_capitalized = Aconsejado
advisor_capitalized = Asesor
advising_relationship_type = Asesoramiento Tipo de Relacion
select_advising_relationship_type = Por favor seleccione una Asesoría Tipo de relación.
advising_relationship_entry_for = asesorar a la entrada de la relación
advisor_relationship_entry_for = la entrade para la relación asesor
advisee_relationship_entry_for = la entrade para la relación aconsejada
years_participating = Años de Participación
award_or_honor_for = premio o el honor de

View file

@ -0,0 +1,238 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!-- See guidelines in vitro/doc/list_view_configuration_guidelines.txt -->
<list-view-config>
<query-select>
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
SELECT DISTINCT <collated>?subclass</collated>
?adviseeRole
?advisingRel
?advisingRelLabel
?localName
?advisor
?advisorLabel
?degreeLabel
?degreeAbbr
?dateTimeStart
?dateTimeEnd
WHERE {
?subject ?property ?adviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
LET ( ?localName := afn:localname(?advisingRel) )
OPTIONAL { ?advisingRel rdfs:label ?advisingRelLabel }
OPTIONAL { ?advisingRel core:relates ?advisor .
?advisor a foaf:Person .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
?advisorRole a core:AdvisorRole .
OPTIONAL { ?advisor rdfs:label ?advisorLabel }
}
OPTIONAL { ?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
OPTIONAL { ?degree rdfs:label ?degreeLabel }
OPTIONAL { ?degree core:abbreviation ?degreeAbbr }
}
<collated>
OPTIONAL { ?advisingRel vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf core:AdvisingRelationship
}
</collated>
OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
}
}
OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd
}
}
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd)
</query-select>
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT {
?subclass rdfs:subClassOf core:AdvisingRelationship
} WHERE {
?subclass rdfs:subClassOf core:AdvisingRelationship
}
</query-construct>
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel ?advisingRelProperty ?advisingRelValue .
?advisingRel rdfs:label ?advisingRelLabel .
} WHERE {
{
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel ?advisingRelProperty ?advisingRelValue
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel ?advisingRelProperty ?advisingRelValue .
?advisingRel rdfs:label ?advisingRelLabel
}
}
</query-construct>
<query-construct>
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
CONSTRUCT {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?advisor .
?advisor a foaf:Person .
?advisor rdfs:label ?advisorLabel .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel .
?degree core:abbreviation ?degreeAbbr
} WHERE {
{
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?advisor .
?advisor a foaf:Person .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
?advisorRole a core:AdvisorRole
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?advisor .
?advisor a foaf:Person .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisor rdfs:label ?advisorLabel
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel
} UNION {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel .
?degree core:abbreviation ?degreeAbbr
}
}
</query-construct>
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
} WHERE {
?subject ?property ?advisingRel .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
}
</query-construct>
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd
} WHERE {
?subject ?property ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?adviseeRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd
}
</query-construct>
<template>propStatement-adviseeIn.ftl</template>
</list-view-config>

View file

@ -14,8 +14,9 @@
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
SELECT DISTINCT <collated>?subclass</collated>
?advisory
?advisoryLabel
?advisorRole
?advisingRel
?advisingRelLabel
?localName
?advisee
?adviseeLabel
@ -25,38 +26,38 @@
?dateTimeEnd
WHERE {
?subject ?property ?advisory .
?advisory core:relates ?advisor .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
LET ( ?localName := afn:localname(?advisory) )
OPTIONAL { ?advisory rdfs:label ?advisoryLabel }
OPTIONAL { ?advisory core:relates ?advisee .
?subject ?property ?advisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
LET ( ?localName := afn:localname(?advisingRel) )
OPTIONAL { ?advisingRel rdfs:label ?advisingRelLabel }
OPTIONAL { ?advisingRel core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole .
OPTIONAL { ?advisee rdfs:label ?adviseeLabel }
}
OPTIONAL { ?advisory core:relates ?degree .
OPTIONAL { ?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
OPTIONAL { ?degree rdfs:label ?degreeLabel }
OPTIONAL { ?degree core:abbreviation ?degreeAbbr }
}
<collated>
OPTIONAL { ?advisory vitro:mostSpecificType ?subclass .
OPTIONAL { ?advisingRel vitro:mostSpecificType ?subclass .
?subclass rdfs:subClassOf core:AdvisingRelationship
}
</collated>
OPTIONAL { ?advisory core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
}
}
OPTIONAL { ?advisory core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd
}
}
FILTER ( ?subject != ?advisee )
} ORDER BY <collated>?subclass</collated> DESC(?dateTimeEnd)
</query-select>
@ -74,43 +75,39 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
CONSTRUCT {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue .
?advisory rdfs:label ?advisoryLabel .
?advisory core:relates ?advisor .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
?advisorRole a core:AdvisorRole
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel ?advisingRelProperty ?advisingRelValue .
?advisingRel rdfs:label ?advisingRelLabel .
} WHERE {
{
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel ?advisingRelProperty ?advisingRelValue
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue .
?advisory rdfs:label ?advisoryLabel
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory ?advisoryProperty ?advisoryValue .
?advisory core:relates ?advisor .
?advisor &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?advisorRole .
?advisorRole a core:AdvisorRole
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel ?advisingRelProperty ?advisingRelValue .
?advisingRel rdfs:label ?advisingRelLabel
}
}
</query-construct>
OPTIONAL { ?advisory core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole
<query-construct>
PREFIX bibo: &lt;http://purl.org/ontology/bibo/&gt;
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
@ -118,51 +115,72 @@
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
CONSTRUCT {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory core:relates ?advisee .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?advisee .
?advisee a foaf:Person .
?advisee rdfs:label ?adviseeLabel .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?advisory core:relates ?degree .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel .
?degree core:abbreviation ?degreeAbbr
} WHERE {
{
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
} UNION {
?subject ?property ?advisory.
?advisory a core:AdvisingRelationship .
?advisory core:relates ?advisee .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory core:relates ?advisee .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?advisee .
?advisee a foaf:Person .
?advisee &lt;http://purl.obolibrary.org/obo/RO_0000053&gt; ?adviseeRole .
?adviseeRole a core:AdviseeRole .
?advisee rdfs:label ?adviseeLabel
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory core:relates ?degree .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory core:relates ?degree .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel
} UNION {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?advisory core:relates ?degree .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?advisingRel core:relates ?degree .
?degree a core:AcademicDegree .
?degree rdfs:label ?degreeLabel .
?degree core:abbreviation ?degreeAbbr
@ -173,14 +191,20 @@
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
} WHERE {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?subject ?property ?advisingRel .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
@ -190,14 +214,20 @@
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd
} WHERE {
?subject ?property ?advisory .
?advisory a core:AdvisingRelationship .
?subject ?property ?advisorRole .
?advisorRole a core:AdvisorRole .
?advisorRole core:relatedBy ?advisingRel .
?subject core:relatedBy ?advisingRel .
?advisingRel a core:AdvisingRelationship .
?award core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd

View file

@ -0,0 +1,33 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Custom object property statement view for http://vivoweb.org/ontology/core#mailingAddress.
This template must be self-contained and not rely on other variables set for the individual page, because it
is also used to generate the property statement during a deletion.
-->
<#import "lib-datetime.ftl" as dt>
<@showAdviseeIn statement />
<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the
next statement -->
<#macro showAdviseeIn statement>
<#-- It's possible that adviseeIn relationships were created before the custom form and only have
an rdfs:label. So check to see if there's an advisor first. If not, just display the label. -->
<#local linkedIndividual>
<#if statement.advisor??>
<#if statement.degreeLabel?? || statement.dateTimeStart?? || statement.dateTimeEnd?? >
<a href="${profileUrl(statement.uri("advisor"))}" title="${i18n().advisor_label}">${statement.advisorLabel!}</a>,
<#else>
<a href="${profileUrl(statement.uri("advisor"))}" title="${i18n().advisor_label}">${statement.advisorLabel!}</a>
</#if>
<#if statement.degreeLabel??>
${statement.degreeAbbr!statement.degreeLabel!}
<#if statement.dateTimeStart?? || statement.dateTimeEnd?? >&nbsp;${i18n().candidate},<#else>&nbsp;${i18n().candidate}</#if>
</#if>
<#elseif statement.advisingRelLabel??>
<a href="${profileUrl(statement.uri("advisingRel"))}" title="${i18n().advisingRel_label}">${statement.advisingRelLabel!statement.localName}</a>
</#if>
</#local>
${linkedIndividual} <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
</#macro>

View file

@ -24,8 +24,8 @@
${statement.degreeAbbr!statement.degreeLabel!}
<#if statement.dateTimeStart?? || statement.dateTimeEnd?? >&nbsp;${i18n().candidate},<#else>&nbsp;${i18n().candidate}</#if>
</#if>
<#elseif statement.advisoryLabel??>
<a href="${profileUrl(statement.uri("advisory"))}" title="${i18n().advisory_label}">${statement.advisoryLabel!statement.localName}</a>
<#elseif statement.advisingRelLabel??>
<a href="${profileUrl(statement.uri("advisingRel"))}" title="${i18n().advisingRel_label}">${statement.advisingRelLabel!statement.localName}</a>
</#if>
</#local>

View file

@ -10,7 +10,7 @@
<#macro showStatement statement>
<#-- The query retrieves a type only for Persons. Post-processing will remove all but one. -->
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a> ${statement.title!statement.type!}
<a href="${profileUrl(statement.uri("object"))}" title="${i18n().name}">${statement.label!statement.localName!}</a>&nbsp; ${statement.title!statement.type!}
</#macro>

View file

@ -49,6 +49,6 @@
</#if>
</#local>
${linkedIndividual} ${roleLabel!} <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
${linkedIndividual}&nbsp;${roleLabel!}&nbsp;<@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" />
</#macro>

View file

@ -0,0 +1,114 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var adviseeRelUtils = {
onLoad: function(subject,blankSentinel) {
this.subjName = '';
if ( subject ) { this.subjName = subject; }
this.sentinel = '';
if ( blankSentinel ) { this.sentinel = blankSentinel; }
this.initObjectReferences();
this.bindEventListeners();
$.extend(this, vitro.customFormUtils);
$.extend(this, i18nStrings);
if ( this.findValidationErrors() ) {
this.resetLastNameLabel();
}
},
initObjectReferences: function() {
this.form = $('#personHasAdvisingRelationship');
this.adRelshiplabel = $('#advisingRelLabel');
this.advisor = $('#advisor');
this.subjArea = $('#SubjectArea');
this.firstName = $('#firstName');
this.lastName = $('#lastName');
this.advisorUri = $('#advisorUri');
this.subjAreaUri = $('#subjAreaUri');
this.saveAdvisorLabel = $('#saveAdvisorLabel');
this.advisorAcSelection = $('div#advisorAcSelection');
// may not need this
this.firstName.attr('disabled', '');
},
bindEventListeners: function() {
this.idCache = {};
// we want to use the advisor label in the relationship label.
// since the former gets cleared on submit in some cases, store
// the value in a hidden field and map to relationship label
this.advisor.change( function(objEvent) {
window.setTimeout('adviseeRelUtils.mapAdvisorValue()', 180);
});
this.advisor.blur( function(objEvent) {
window.setTimeout('adviseeRelUtils.mapAdvisorValue()', 180);
});
this.form.submit(function() {
adviseeRelUtils.resolveAdvisorNames();
adviseeRelUtils.buildAdvisingRelLabel();
alert(this.adRelshiplabel.val());
return false;
});
},
mapAdvisorValue: function() {
if ( this.advisorAcSelection.attr('class').indexOf('userSelected') != -1 ) {
this.saveAdvisorLabel.val(this.advisor.val());
}
},
resolveAdvisorNames: function() {
var firstName,
lastName,
name;
// If selecting an existing person, don't submit name fields
if (this.advisorUri.val() == '' || this.advisorUri.val() == this.sentinel ) {
firstName = this.firstName.val();
lastName = this.advisor.val();
name = lastName;
if (firstName) {
name += ', ' + firstName;
}
this.advisor.val(name);
this.lastName.val(lastName);
}
else {
this.firstName.attr('disabled', 'disabled');
this.lastName.attr('disabled', 'disabled');
}
},
buildAdvisingRelLabel: function() {
alert("here");
if ( this.advisor.val() != "" ) {
this.adRelshiplabel.val(this.advisor.val() + " " + adviseeRelUtils.advisingString + " " + this.subjName);
}
else if ( this.saveAdvisorLabel.val() != "" ){
this.adRelshiplabel.val(this.saveAdvisorLabel.val() + " " + adviseeRelUtils.advisingString + " " + this.subjName);
}
else {
this.adRelshiplabel.val(this.subjName + " " + adviseeRelUtils.advisingRelationshipString);
}
},
resetLastNameLabel: function() {
var indx = this.advisor.val().indexOf(", ");
if ( indx != -1 ) {
var temp = this.advisor.val().substr(0,indx);
this.advisor.val(temp);
}
}
}

View file

@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var advisingRelUtils = {
var advisorRelUtils = {
onLoad: function(subject,blankSentinel) {
this.subjName = '';
@ -46,16 +46,16 @@ var advisingRelUtils = {
// since the former gets cleared on submit in some cases, store
// the value in a hidden field and map to relationship label
this.advisee.change( function(objEvent) {
window.setTimeout('advisingRelUtils.mapAdviseeValue()', 180);
window.setTimeout('advisorRelUtils.mapAdviseeValue()', 180);
});
this.advisee.blur( function(objEvent) {
window.setTimeout('advisingRelUtils.mapAdviseeValue()', 180);
window.setTimeout('advisorRelUtils.mapAdviseeValue()', 180);
});
this.form.submit(function() {
advisingRelUtils.resolveAdviseeNames();
advisingRelUtils.buildAdvisingRelLabel();
advisorRelUtils.resolveAdviseeNames();
advisorRelUtils.buildAdvisingRelLabel();
});
},
@ -90,13 +90,13 @@ var advisingRelUtils = {
buildAdvisingRelLabel: function() {
if ( this.advisee.val() != "" ) {
this.adRelshiplabel.val(this.subjName + " " + advisingRelUtils.advisingString + " " + this.advisee.val());
this.adRelshiplabel.val(this.subjName + " " + advisorRelUtils.advisingString + " " + this.advisee.val());
}
else if ( this.saveAdviseeLabel.val() != "" ){
this.adRelshiplabel.val(this.subjName + " " + advisingRelUtils.advisingString + " " + this.saveAdviseeLabel.val());
this.adRelshiplabel.val(this.subjName + " " + advisorRelUtils.advisingString + " " + this.saveAdviseeLabel.val());
}
else {
this.adRelshiplabel.val(this.subjName + " " + advisingRelUtils.advisingRelationshipString);
this.adRelshiplabel.val(this.subjName + " " + advisorRelUtils.advisingRelationshipString);
}
},

View file

@ -0,0 +1,245 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected.
If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship
if nothing is selected for that object-->
<#assign blankSentinel = "" />
<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")>
<#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] />
</#if>
<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete.
Set this flag on the input acUriReceiver where you would like this behavior to occur. -->
<#assign flagClearLabelForExisting = "flagClearLabelForExisting" />
<#import "lib-vivo-form.ftl" as lvf>
<#--Retrieve certain edit configuration information-->
<#if editConfiguration.objectUri?has_content>
<#assign editMode = "edit">
<#else>
<#assign editMode = "add">
</#if>
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#--Retrieve variables needed-->
<#assign advisorValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingAdvisor") />
<#assign advisorLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "advisorLabel") />
<#assign advisorLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "advisorLabelDisplay") />
<#assign firstNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "firstName") />
<#assign lastNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "lastName") />
<#assign advisingRelTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "advisingRelType") />
<#assign advisingRelLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "advisingRelLabel") />
<#assign subjAreaValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingSubjArea") />
<#assign subjAreaLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "subjAreaLabel") />
<#assign subjAreaLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "subjAreaLabelDisplay") />
<#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degree") />
<#assign acFilterForIndividuals = "['" + editConfiguration.subjectUri + "']" />
<#assign sparqlForAcFilter = editConfiguration.pageData.sparqlForAcFilter />
<#--If edit submission exists, then retrieve validation errors if they exist-->
<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content>
<#assign submissionErrors = editSubmission.validationErrors/>
</#if>
<#if editMode == "edit">
<#assign titleVerb="${i18n().edit_capitalized}">
<#assign submitButtonText="${i18n().save_changes}">
<#assign disabledVal="disabled">
<#else>
<#assign titleVerb="${i18n().create_capitalized}">
<#assign submitButtonText="${i18n().create_entry}">
<#assign disabledVal=""/>
</#if>
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
<#assign yearHint = "<span class='hint'>(${i18n().year_hint_format})</span>" />
<h2>${titleVerb}&nbsp;${i18n().advisee_relationship_entry_for} ${editConfiguration.subjectName}</h2>
<#--Display error messages if any-->
<#if submissionErrors?has_content>
<#if advisorLabelDisplayValue?has_content >
<#assign advisorLabelValue = advisorLabelDisplayValue />
</#if>
<#if subjAreaLabelDisplayValue?has_content >
<#assign subjAreaLabelValue = subjAreaLabelDisplayValue />
</#if>
<section id="error-alert" role="alert">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alt="${i18n().error_alert_icon}" />
<p>
<#--Checking if any required fields are empty-->
<#if lvf.submissionErrorExists(editSubmission, "advisingRelType")>
${i18n().select_advising_relationship_type}<br />
</#if>
<#list submissionErrors?keys as errorFieldName>
<#if errorFieldName == "startField">
<#if submissionErrors[errorFieldName]?contains("before")>
${i18n().start_year_must_precede_end}
<#else>
${submissionErrors[errorFieldName]}
</#if>
<#elseif errorFieldName == "endField">
<#if submissionErrors[errorFieldName]?contains("after")>
${i18n().end_year_must_be_later}
<#else>
${submissionErrors[errorFieldName]}
</#if>
<#elseif errorFieldName == "advisingRelType">
<#else>
${submissionErrors[errorFieldName]}
</#if><br />
</#list>
</p>
</section>
</#if>
<@lvf.unsupportedBrowser urls.base />
<section id="personHasAdvisingRelationship" role="region">
<form id="personHasAdvisingRelationship" class="customForm noIE67" action="${submitUrl}" role="add/edit AdvisingRelationship">
<p class="inline">
<label for="orgType">${i18n().advising_relationship_type}<#if editMode != "edit"> ${requiredHint}<#else>:</#if></label>
<#assign advisingRelTypeOpts = editConfiguration.pageData.advisingRelType />
<#if editMode == "edit">
<#list advisingRelTypeOpts?keys as key>
<#if advisingRelTypeValue = key >
<span class="readOnly">${advisingRelTypeOpts[key]}</span>
<input type="hidden" id="typeSelectorInput" name="advisingRelType" value="${advisingRelTypeValue}" >
</#if>
</#list>
<#else>
<select id="selector" name="advisingRelType" ${disabledVal} >
<option value="" selected="selected">${i18n().select_one}</option>
<#list advisingRelTypeOpts?keys as key>
<option value="${key}" <#if advisingRelTypeValue = key>selected</#if>>${advisingRelTypeOpts[key]}</option>
</#list>
</select>
</#if>
</p>
<p >
<label for="advisor">${i18n().advisor_capitalized}: ${i18n().last_name} ${requiredHint}<span style="padding-left:322px">${i18n().first_name} ${requiredHint}</span></label>
<input class="acSelector" size="50" type="text" acGroupName="advisor" id="advisor" name="advisorLabel" value="${advisorLabelValue}" >
<input size="30" type="text" id="firstName" name="firstName" value="${firstNameValue}" ><br />
<input type="hidden" id="lastName" name="lastName" value="">
<input class="display" type="hidden" acGroupName="advisor" id="advisorDisplay" name="advisorLabelDisplay" value="${advisorLabelDisplayValue}" >
</p>
<div class="acSelection" acGroupName="advisor" id="advisorAcSelection">
<p class="inline">
<label>${i18n().selected_advisor}
<span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="${i18n().verify_match_capitalized}">(${i18n().verify_match_capitalized}</a> ${i18n().or}
<a href="#" class="changeSelection" id="changeSelection">${i18n().change_selection})</a>
</p>
<input class="acUriReceiver" type="hidden" id="advisorUri" name="existingAdvisor" value="${advisorValue}" ${flagClearLabelForExisting}="true"/>
</div>
<p>
<label for="SubjectArea">${i18n().subject_area}</label>
<input class="acSelector" size="50" type="text" id="SubjectArea" acGroupName="SubjectArea" name="subjAreaLabel" value="${subjAreaLabelValue}" />
<input class="display" type="hidden" id="SubjectAreaDisplay" acGroupName="SubjectArea" name="subjAreaLabelDisplay" value="${subjAreaLabelDisplayValue}" />
</p>
<div class="acSelection" acGroupName="SubjectArea">
<p class="inline">
<label>${i18n().selected_subject_area}:</label>
<span class="acSelectionInfo"></span>
<a href="" class="verifyMatch" title="${i18n().verify_match_capitalized}">(${i18n().verify_match_capitalized}</a> ${i18n().or}
<a href="#" class="changeSelection" id="changeSelection">${i18n().change_selection})</a>
</p>
<#--When no autocomplete value is selected, the value of this field will be set to the 'blank sentinel'.
When an autocomplete value is selected, the 'flagClearLabelField' attribute will clear out the associated label input. -->
<input class="acUriReceiver" type="hidden" id="subjAreaUri" name="existingSubjArea" value="${subjAreaValue}" ${flagClearLabelForExisting}="true"/>
</div>
<p>
<label for="degreeUri">${i18n().degree_candidacy}</label>
<#assign degreeOpts = editConfiguration.pageData.degree />
<select name="degree" id="degreeUri" >
<option value="" <#if degreeValue = "">selected</#if>>${i18n().select_one}</option>
<#list degreeOpts?keys as key>
<option value="${key}" <#if degreeValue = key>selected</#if>>${degreeOpts[key]}</option>
</#list>
</select>
</p>
<p>
<h4>${i18n().years_participating}</h4>
</p>
<#--Need to draw edit elements for dates here-->
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
<#if htmlForElements?keys?seq_contains("startField")>
<label class="dateTime" for="startField">${i18n().start_capitalized}</label>
${htmlForElements["startField"]} ${yearHint}
</#if>
<br/>
<#if htmlForElements?keys?seq_contains("endField")>
<label class="dateTime" for="endField">${i18n().end_capitalized}</label>
${htmlForElements["endField"]} ${yearHint}
</#if>
<#--End draw elements-->
<input type="hidden" id="advisingRelLabel" name="advisingRelLabel" value="${advisingRelLabelValue}"/>
<input type="hidden" id="saveAdvisorLabel" name="saveAdvisorLabel" value="${advisorLabelValue}"/>
<input type="hidden" id="editKey" name="editKey" value="${editKey}"/>
<p class="submit">
<input type="submit" class="submit" value="${submitButtonText}"/><span class="or"> ${i18n().or} </span>
<a class="cancel" href="${cancelUrl}" title="${i18n().cancel_title}">${i18n().cancel_link}</a>
</p>
<p id="requiredLegend" class="requiredHint">* ${i18n().required_fields}</p>
</form>
</section>
<#assign sparqlQueryUrl = "${urls.base}/ajax/sparqlQuery" >
<#assign doNotRemoveOriginalObject = "true" />
<script type="text/javascript">
var customFormData = {
acUrl: '${urls.base}/autocomplete?tokenize=true&stem=true',
acTypes: {advisor: 'http://xmlns.com/foaf/0.1/Person', SubjectArea: 'http://www.w3.org/2004/02/skos/core#Concept'},
editMode: '${editMode}',
defaultTypeName: 'advisor',
multipleTypeNames: {advisor: 'advisor', SubjectArea: 'Subject Area'},
sparqlForAcFilter: '${sparqlForAcFilter}',
sparqlQueryUrl: '${sparqlQueryUrl}',
acFilterForIndividuals: ${acFilterForIndividuals},
baseHref: '${urls.base}/individual?uri=',
blankSentinel: '${blankSentinel}',
flagClearLabelForExisting: '${flagClearLabelForExisting}'
};
<#--Removing this line for now from above : newUriSentinel : '${newUriSentinel}',-->
<#--Also removed this: ,doNotRemoveOriginalObject: '${doNotRemoveOriginalObject}'-->
var i18nStrings = {
selectAnExisting: '${i18n().select_an_existing}',
orCreateNewOne: '${i18n().or_create_new_one}',
selectedString: '${i18n().selected}',
advisingString: '${i18n().advising}',
advisingRelationshipString: '${i18n().advising_relationship}'
};
</script>
<script type="text/javascript">
$(document).ready(function(){
adviseeRelUtils.onLoad('${editConfiguration.subjectName}', '${blankSentinel}');
});
</script>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/smoothness/jquery-ui-1.8.9.custom.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarker/edit/forms/css/customFormWithAutocomplete.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/customFormUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/adviseeRelationshipUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>',
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/customFormWithAutocomplete.js"></script>')}

View file

@ -56,7 +56,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#assign requiredHint = "<span class='requiredHint'> *</span>" />
<#assign yearHint = "<span class='hint'>(${i18n().year_hint_format})</span>" />
<h2>${titleVerb}&nbsp;${i18n().advising_relationship_entry_for} ${editConfiguration.subjectName}</h2>
<h2>${titleVerb}&nbsp;${i18n().advisor_relationship_entry_for} ${editConfiguration.subjectName}</h2>
<#--Display error messages if any-->
<#if submissionErrors?has_content>
@ -226,7 +226,7 @@ var i18nStrings = {
<script type="text/javascript">
$(document).ready(function(){
advisingRelUtils.onLoad('${editConfiguration.subjectName}', '${blankSentinel}');
advisorRelUtils.onLoad('${editConfiguration.subjectName}', '${blankSentinel}');
});
</script>
@ -236,7 +236,7 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/templates/freemarke
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/customFormUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/advisingRelationshipUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/templates/freemarker/edit/forms/js/advisorRelationshipUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/extensions/String.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/jquery.bgiframe.pack.js"></script>',

View file

@ -315,11 +315,26 @@ local:educationalTrainingConfig a :ObjectPropertyDisplayConfig ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEducationalTraining"^^<http://www.w3.org/2001/XMLSchema#string> ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupbiography> .
local:adviseeRoleContext a :ConfigContext ;
:hasConfiguration local:adviseeRoleConfig ;
:configContextFor <http://purl.obolibrary.org/obo/RO_0000053> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedBy <http://vivoweb.org/ontology/core#AdviseeRole> .
local:adviseeRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-adviseeIn.xml"^^xsd:string ;
:displayName "advisee in" ;
vitro:displayRankAnnot 30;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasAdviseeRelationshipGenerator"^^<http://www.w3.org/2001/XMLSchema#string> ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupbiography> .
local:advisorRoleContext a :ConfigContext ;
:hasConfiguration local:advisorRoleConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relatedBy> ;
:configContextFor <http://purl.obolibrary.org/obo/RO_0000053> ;
:qualifiedByDomain <http://xmlns.com/foaf/0.1/Person> ;
:qualifiedBy <http://vivoweb.org/ontology/core#AdvisingRelationship> .
:qualifiedBy <http://vivoweb.org/ontology/core#AdvisorRole> .
local:advisorRoleConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-advisorIn.xml"^^xsd:string ;
@ -327,13 +342,13 @@ local:advisorRoleConfig a :ObjectPropertyDisplayConfig ;
vitro:displayRankAnnot 40;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasAdvisingRelationshipGenerator"^^<http://www.w3.org/2001/XMLSchema#string> ;
vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasAdvisorRelationshipGenerator"^^<http://www.w3.org/2001/XMLSchema#string> ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupteaching> .
local:informationResourceInAuthorshipContext a :ConfigContext ;
:hasConfiguration local:informationResourceInAuthorshipConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relatedBy> ;
:qualifiedByDomain <http://purl.org/ontology/bibo/Document> ;
:qualifiedByDomain <http://purl.obolibrary.org/obo/IAO_0000030> ;
:qualifiedBy <http://vivoweb.org/ontology/core#Authorship> .
local:informationResourceInAuthorshipConfig a :ObjectPropertyDisplayConfig ;
@ -511,13 +526,13 @@ local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:awardReceiptsContext a :ConfigContext ;
:hasConfiguration local:awardReceiptsConfig ;
local:awardOrHonorReceiptsContext a :ConfigContext ;
:hasConfiguration local:awardOrHonorReceiptsConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relatedBy> ;
:qualifiedByDomain <http://vivoweb.org/ontology/core#Award> ;
:qualifiedBy <http://vivoweb.org/ontology/core#AwardReceipt> .
local:awardReceiptsConfig a :ObjectPropertyDisplayConfig ;
local:awardOrHonorReceiptsConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "receipts" ;
vitro:displayRankAnnot 3;
@ -525,3 +540,61 @@ local:awardReceiptsConfig a :ObjectPropertyDisplayConfig ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupother> .
local:awardReceiptsContext a :ConfigContext ;
:hasConfiguration local:awardReceiptsConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relates> ;
:qualifiedByDomain <http://vivoweb.org/ontology/core#AwardReceipt> ;
:qualifiedBy <http://vivoweb.org/ontology/core#Award> .
local:awardReceiptsConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "receipt of" ;
vitro:displayRankAnnot 1;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
local:awardReceiptsAwardForContext a :ConfigContext ;
:hasConfiguration local:awardReceiptsAwardForConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relates> ;
:qualifiedByDomain <http://vivoweb.org/ontology/core#AwardReceipt> ;
:qualifiedBy <http://xmlns.com/foaf/0.1/Person> .
local:awardReceiptsAwardForConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-default.xml"^^xsd:string ;
:displayName "award or honor for" ;
vitro:displayRankAnnot 2;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupoverview> .
### roles using the BFO_0000055 property ###
local:bfo_0000055Context a :ConfigContext ;
:hasConfiguration local:bfo_0000055Config ;
:configContextFor <http://purl.obolibrary.org/obo/BFO_0000055> ;
:qualifiedBy <http://purl.obolibrary.org/obo/BFO_0000023> .
local:bfo_0000055Config a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-relatedRole.xml"^^xsd:string ;
:displayName "participant" ;
vitro:displayRankAnnot 1;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupother> .
### grant roles using the core:relates property ###
local:grantRelatesContext a :ConfigContext ;
:hasConfiguration local:grantRelatesConfig ;
:configContextFor <http://vivoweb.org/ontology/core#relates> ;
:qualifiedByDomain <http://vivoweb.org/ontology/core#Grant> ;
:qualifiedBy <http://vivoweb.org/ontology/core#ResearcherRole> .
local:grantRelatesConfig a :ObjectPropertyDisplayConfig ;
:listViewConfigFile "listViewConfig-relatedRole.xml"^^xsd:string ;
:displayName "contributor" ;
vitro:displayRankAnnot 1;
vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ;
vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ;
:propertyGroup <http://vivoweb.org/ontology#vitroPropertyGroupbiography> .

View file

@ -0,0 +1,95 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.edit.n3editing;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.hp.hpl.jena.rdf.model.Literal;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.N3ValidatorVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.MultiValueEditSubmission;
public class PersonHasAdvisorsValidator implements N3ValidatorVTwo {
private static String MISSING_FIRST_NAME_ERROR = "You must enter a value in the First Name field.";
private static String MISSING_LAST_NAME_ERROR = "You must enter a value in the Last Name field.";
private static String MALFORMED_LAST_NAME_ERROR = "The last name field may not contain a comma. Please enter first name in First Name field.";
@Override
public Map<String, String> validate(EditConfigurationVTwo editConfig,
MultiValueEditSubmission editSub) {
Map<String,List<String>> urisFromForm = editSub.getUrisFromForm();
Map<String,List<Literal>> literalsFromForm = editSub.getLiteralsFromForm();
Map<String,String> errors = new HashMap<String,String>();
List<String> adviseeUri = urisFromForm.get("existingAdvisor");
if (allListElementsEmpty(adviseeUri) || adviseeUri.contains(">SUBMITTED VALUE WAS BLANK<")) {
adviseeUri = null;
}
// If there's an adviseeUri, then we're done. The firstName and lastName fields are
// disabled and so don't get submitted.
if (adviseeUri != null) {
return null;
}
//Expecting only one first name in this case
//To Do: update logic if multiple first names considered
Literal firstName = null;
List<Literal> firstNameList = literalsFromForm.get("firstName");
if(firstNameList != null && firstNameList.size() > 0) {
firstName = firstNameList.get(0);
}
if( firstName != null &&
firstName.getLexicalForm() != null &&
"".equals(firstName.getLexicalForm()) )
firstName = null;
List<Literal> lastNameList = literalsFromForm.get("lastName");
Literal lastName = null;
if(lastNameList != null && lastNameList.size() > 0) {
lastName = lastNameList.get(0);
}
String lastNameValue = "";
if (lastName != null) {
lastNameValue = lastName.getLexicalForm();
if( "".equals(lastNameValue) ) {
lastName = null;
}
}
if (lastName == null) {
errors.put("lastName", MISSING_LAST_NAME_ERROR);
// Don't reject space in the last name: de Vries, etc.
} else if (lastNameValue.contains(",")) {
errors.put("lastName", MALFORMED_LAST_NAME_ERROR);
}
if (firstName == null) {
errors.put("firstName", MISSING_FIRST_NAME_ERROR);
}
return errors.size() != 0 ? errors : null;
}
private boolean allListElementsEmpty(List<String> checkList) {
if(checkList == null)
return true;
if(checkList.isEmpty()) {
return true;
}
boolean allEmpty = true;
for(String s: checkList) {
if(s.length() != 0){
allEmpty = false;
break;
}
}
return allEmpty;
}
}

View file

@ -0,0 +1,417 @@
/* $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.util.Arrays;
import java.util.HashMap;
import javax.servlet.http.HttpSession;
import com.hp.hpl.jena.vocabulary.XSD;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.PersonHasAdvisorsValidator;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeIntervalValidationVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeWithPrecisionVTwo;
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.ChildVClassesWithParent;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaVClassOptions;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation;
public class PersonHasAdviseeRelationshipGenerator extends VivoBaseGenerator implements
EditConfigurationGenerator {
final static String advisingRelClass = vivoCore + "AdvisingRelationship";
final static String subjAreaClass = "http://www.w3.org/2004/02/skos/core#Concept";
final static String degreeClass = vivoCore+"AcademicDegree";
final static String advisorClass = foaf + "Person";
final static String advisorRoleClass = "http://vivoweb.org/ontology/core#AdvisorRole";
final static String adviseeRoleClass = "http://vivoweb.org/ontology/core#AdviseeRole";
final static String advisingRelToInterval = vivoCore + "dateTimeInterval";
final static String intervalType = vivoCore + "DateTimeInterval";
final static String intervalToStart = vivoCore + "start";
final static String intervalToEnd = vivoCore + "end";
final static String dateTimeValueType = vivoCore + "DateTimeValue";
final static String dateTimeValue = vivoCore + "dateTime";
final static String dateTimePrecision = vivoCore + "dateTimePrecision";
public PersonHasAdviseeRelationshipGenerator() {}
@Override
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq,
HttpSession session) throws Exception {
EditConfigurationVTwo conf = new EditConfigurationVTwo();
initBasics(conf, vreq);
initPropertyParameters(vreq, session, conf);
initObjectPropForm(conf, vreq);
conf.setTemplate("personHasAdviseeRelationship.ftl");
conf.setVarNameForSubject("person");
conf.setVarNameForPredicate("predicate");
conf.setVarNameForObject("adviseeRole");
conf.setN3Required( Arrays.asList( n3ForNewAdvisingRelationship,
advisingRelLabelAssertion,
advisingRelTypeAssertion ) );
conf.setN3Optional( Arrays.asList( n3ForNewAdvisorAssertion,
n3ForExistingAdvisorAssertion,
degreeAssertion,
firstNameAssertion,
lastNameAssertion,
n3ForExistingSubjAreaAssertion, //relationship to existing subject area
n3ForNewSubjAreaAssertion, //this will include all the new information that needs to be captured
n3ForStart,
n3ForEnd ) );
conf.addNewResource("advisingRelationship", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("newAdvisor", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("vcardAdvisor", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("adviseeRole", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("advisorRole", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("newSubjArea", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("intervalNode", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("startNode", DEFAULT_NS_FOR_NEW_RESOURCE);
conf.addNewResource("endNode", DEFAULT_NS_FOR_NEW_RESOURCE);
//uris in scope: none
//literals in scope: none
conf.setUrisOnform(Arrays.asList("advisingRelType", "existingSubjArea", "degree", "existingAdvisor"));
conf.setLiteralsOnForm(Arrays.asList("advisingRelLabel", "subjAreaLabel", "advisorLabel", "firstName", "lastName", "subjAreaLabelDisplay", "advisorLabelDisplay" ));
conf.addSparqlForExistingLiteral("advisingRelLabel", advisingRelLabelQuery);
conf.addSparqlForExistingLiteral("advisorLabel", advisorLabelQuery);
conf.addSparqlForExistingLiteral("subjAreaLabel", subjAreaLabelQuery);
conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery);
conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery);
conf.addSparqlForExistingUris("advisingRelType", advisingRelTypeQuery);
conf.addSparqlForExistingUris("adviseeRole", existingAdviseeRoleQuery);
conf.addSparqlForExistingUris("advisorRole", existingAdvisorRoleQuery);
conf.addSparqlForExistingUris("existingSubjArea", subjAreaQuery);
conf.addSparqlForExistingUris("existingAdvisor", advisorQuery);
conf.addSparqlForExistingUris("degree", degreeQuery);
conf.addSparqlForExistingUris("intervalNode",existingIntervalNodeQuery);
conf.addSparqlForExistingUris("startNode", existingStartNodeQuery);
conf.addSparqlForExistingUris("endNode", existingEndNodeQuery);
conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery);
conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery);
conf.addField( new FieldVTwo().
setName("advisingRelType").
setValidators( list("nonempty") ).
setOptions( new ChildVClassesWithParent(advisingRelClass))
);
conf.addField( new FieldVTwo().
setName("advisingRelLabel").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().
setName("firstName").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().
setName("lastName").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo(). // options set by auto complete JS
setName("existingSubjArea")
);
conf.addField( new FieldVTwo().
setName("subjAreaLabel").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().
setName("degree").
setOptions(
new IndividualsViaVClassOptions(degreeClass))
);
conf.addField( new FieldVTwo(). // options set by auto complete JS
setName("existingAdvisor")
);
conf.addField( new FieldVTwo().
setName("advisorLabel").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().
setName("subjAreaLabelDisplay").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().
setName("advisorLabelDisplay").
setRangeDatatypeUri(XSD.xstring.toString() ).
setValidators( list("datatype:" + XSD.xstring.toString()) )
);
conf.addField( new FieldVTwo().setName("startField").
setEditElement(
new DateTimeWithPrecisionVTwo(null,
VitroVocabulary.Precision.YEAR.uri(),
VitroVocabulary.Precision.NONE.uri())
)
);
conf.addField( new FieldVTwo().setName("endField").
setEditElement(
new DateTimeWithPrecisionVTwo(null,
VitroVocabulary.Precision.YEAR.uri(),
VitroVocabulary.Precision.NONE.uri())
)
);
conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField"));
conf.addValidator(new AntiXssValidation());
conf.addValidator(new PersonHasAdvisorsValidator());
addFormSpecificData(conf, vreq);
prepare(vreq, conf);
return conf;
}
/* N3 assertions */
final static String n3ForNewAdvisingRelationship =
"@prefix vivo: <" + vivoCore + "> . \n\n" +
"?person <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . \n" +
"?advisingRelationship a <" + advisingRelClass + "> . \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?person . \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?adviseeRole . \n" +
"?adviseeRole a <" + adviseeRoleClass + "> . \n" +
"?adviseeRole <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . \n" +
"?person <http://purl.obolibrary.org/obo/RO_0000053> ?adviseeRole . \n" +
"?adviseeRole <http://purl.obolibrary.org/obo/RO_0000052> ?person . ";
final static String advisingRelLabelAssertion =
"?advisingRelationship <"+ label + "> ?advisingRelLabel .";
final static String advisingRelTypeAssertion =
"?advisingRelationship a ?advisingRelType .";
final static String n3ForNewAdvisorAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?newAdvisor . \n" +
"?newAdvisor <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . \n" +
"?newAdvisor <" + label + "> ?advisorLabel . \n" +
"?newAdvisor a <" + advisorClass + "> . \n" +
"?newAdvisor <http://purl.obolibrary.org/obo/RO_0000053> ?advisorRole . \n" +
"?advisorRole <http://purl.obolibrary.org/obo/RO_0000052> ?newAdvisor . \n" +
"?advisorRole a <" + advisorRoleClass + "> . \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?advisorRole . \n" +
"?advisorRole <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . ";
final static String n3ForExistingAdvisorAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdvisor . \n" +
"?existingAdvisor <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . \n" +
"?existingAdvisor <http://purl.obolibrary.org/obo/RO_0000053> ?advisorRole . \n" +
"?advisorRole <http://purl.obolibrary.org/obo/RO_0000052> ?existingAdvisor . \n" +
"?advisorRole a <" + advisorRoleClass + "> . \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?advisorRole . \n" +
"?advisorRole <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . ";
final static String firstNameAssertion =
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newAdvisor <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardAdvisor . \n" +
"?vcardAdvisor <http://purl.obolibrary.org/obo/ARG_2000029> ?newAdvisor . \n" +
"?vcardAdvisor a <http://www.w3.org/2006/vcard/ns#Individual> . \n" +
"?vcardAdvisor vcard:hasName ?vcardName . \n" +
"?vcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" +
"?vcardName vcard:givenName ?firstName .";
final static String lastNameAssertion =
"@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . \n" +
"?newAdvisor <http://purl.obolibrary.org/obo/ARG_2000028> ?vcardAdvisor . \n" +
"?vcardAdvisor <http://purl.obolibrary.org/obo/ARG_2000029> ?newAdvisor . \n" +
"?vcardAdvisor a <http://www.w3.org/2006/vcard/ns#Individual> . \n" +
"?vcardAdvisor vcard:hasName ?vcardName . \n" +
"?vcardName a <http://www.w3.org/2006/vcard/ns#Name> . \n" +
"?vcardName vcard:familyName ?lastName .";
final static String degreeAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?degree . \n" +
"?degree <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . ";
//This is for an existing subject area
//Where we only need the existing subject area label
final static String n3ForExistingSubjAreaAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" +
"?existingSubjArea <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . ";
//For new subject area, we include all new information
//new subject area should always be a new resource
//and the following should only get evaluated
//when there is something in the label
final static String n3ForNewSubjAreaAssertion =
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?newSubjArea . \n" +
"?newSubjArea <http://vivoweb.org/ontology/core#relatedBy> ?advisingRelationship . \n" +
"?newSubjArea <"+ label + "> ?subjAreaLabel . \n" +
"?newSubjArea a <" + subjAreaClass + "> . ";
final static String n3ForStart =
"?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
"?intervalNode a <" + intervalType + "> . \n" +
"?intervalNode <" + intervalToStart + "> ?startNode . \n" +
"?startNode a <" + dateTimeValueType + "> . \n" +
"?startNode <" + dateTimeValue + "> ?startField-value . \n" +
"?startNode <" + dateTimePrecision + "> ?startField-precision . \n";
final static String n3ForEnd =
"?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
"?intervalNode a <" + intervalType + "> . \n" +
"?intervalNode <" + intervalToEnd + "> ?endNode . \n" +
"?endNode a <" + dateTimeValueType + "> . \n" +
"?endNode <" + dateTimeValue + "> ?endField-value . \n" +
"?endNode <" + dateTimePrecision + "> ?endField-precision . \n";
/* Queries for editing an existing entry */
final static String advisingRelTypeQuery =
"PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" +
"SELECT ?advisingRelType WHERE { \n" +
" ?advisingRelationship vitro:mostSpecificType ?advisingRelType . \n" +
"}";
final static String advisorQuery =
"SELECT ?existingAdvisor WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdvisor . \n" +
" ?existingAdvisor a <" + advisorClass + "> . \n" +
" FILTER (?person != ?existingAdvisor) . \n" +
"}";
final static String existingAdviseeRoleQuery =
"SELECT ?adviseeRole WHERE { \n" +
"?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?adviseeRole . \n" +
"?adviseeRole a <" + adviseeRoleClass + "> . \n" +
"}";
final static String existingAdvisorRoleQuery =
"SELECT ?advisorRole WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?advisorRole . \n" +
" ?advisorRole a <" + advisorRoleClass + "> . \n" +
"}";
final static String advisorLabelQuery =
"SELECT ?existingAdvisorLabel WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingAdvisor . \n" +
" ?existingAdvisor a <" + advisorClass + "> . \n" +
" ?existingAdvisor <" + label + "> ?existingAdvisorLabel . \n" +
" FILTER (?person != ?existingAdvisor) . \n" +
"}";
final static String subjAreaQuery =
"SELECT ?existingSubjArea WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" +
" ?existingSubjArea a <http://www.w3.org/2004/02/skos/core#Concept> . \n" +
" ?existingSubjArea <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?type \n" +
" FILTER (?type != <http://vivoweb.org/ontology/core#AcademicDegree>) . \n" +
"}";
final static String subjAreaLabelQuery =
"SELECT ?existingSubjAreaLabel WHERE { \n" +
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingSubjArea . \n" +
" ?existingSubjArea a <http://www.w3.org/2004/02/skos/core#Concept> . \n" +
" ?existingSubjArea <" + label + "> ?existingSubjAreaLabel . \n" +
" ?existingSubjArea <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#mostSpecificType> ?type \n" +
" FILTER (?type != <http://vivoweb.org/ontology/core#AcademicDegree>) . \n" +
"}";
final static String advisingRelLabelQuery =
"SELECT ?existingAdvisingRelLabel WHERE { \n" +
" ?advisingRelationship <" + label + "> ?existingAdvisingRelLabel . \n" +
"}";
final static String degreeQuery =
"SELECT ?existingDegree WHERE {\n"+
" ?advisingRelationship <http://vivoweb.org/ontology/core#relates> ?existingDegree . \n" +
" ?existingDegree a <" + degreeClass + "> . \n" +
"}";
final static String existingStartDateQuery =
"SELECT ?existingDateStart WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
" ?intervalNode a <" + intervalType + "> . \n" +
" ?intervalNode <" + intervalToStart + "> ?startNode . \n" +
" ?startNode a <" + dateTimeValueType +"> . \n" +
" ?startNode <" + dateTimeValue + "> ?existingDateStart . }";
final static String existingEndDateQuery =
"SELECT ?existingEndDate WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
" ?intervalNode a <" + intervalType + "> . \n " +
" ?intervalNode <" + intervalToEnd + "> ?endNode . \n" +
" ?endNode a <" + dateTimeValueType + "> . \n" +
" ?endNode <" + dateTimeValue + "> ?existingEndDate . }";
final static String existingIntervalNodeQuery =
"SELECT ?existingIntervalNode WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?existingIntervalNode . \n" +
" ?existingIntervalNode a <" + intervalType + "> . }";
final static String existingStartNodeQuery =
"SELECT ?existingStartNode WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
" ?intervalNode a <" + intervalType + "> . \n" +
" ?intervalNode <" + intervalToStart + "> ?existingStartNode . \n" +
" ?existingStartNode a <" + dateTimeValueType + "> .} ";
final static String existingEndNodeQuery =
"SELECT ?existingEndNode WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
" ?intervalNode a <" + intervalType + "> . \n" +
" ?intervalNode <" + intervalToEnd + "> ?existingEndNode . \n" +
" ?existingEndNode a <" + dateTimeValueType + "> } ";
final static String existingStartPrecisionQuery =
"SELECT ?existingStartPrecision WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
" ?intervalNode a <" + intervalType + "> . \n" +
" ?intervalNode <" + intervalToStart + "> ?startNode . \n" +
" ?startNode a <" + dateTimeValueType + "> . \n" +
" ?startNode <" + dateTimePrecision + "> ?existingStartPrecision . }";
final static String existingEndPrecisionQuery =
"SELECT ?existingEndPrecision WHERE { \n" +
" ?advisingRelationship <" + advisingRelToInterval + "> ?intervalNode . \n" +
" ?intervalNode a <" + intervalType + "> . \n" +
" ?intervalNode <" + intervalToEnd + "> ?endNode . \n" +
" ?endNode a <" + dateTimeValueType + "> . \n" +
" ?endNode <" + dateTimePrecision + "> ?existingEndPrecision . }";
public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) {
HashMap<String, Object> formSpecificData = new HashMap<String, Object>();
formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq));
editConfiguration.setFormSpecificData(formSpecificData);
}
public String getSparqlForAcFilter(VitroRequest vreq) {
String subject = EditConfigurationUtils.getSubjectUri(vreq);
String predicate = EditConfigurationUtils.getPredicateUri(vreq);
//Get all objects for existing predicate, filters out results from addition and edit
String query = "SELECT ?objectVar WHERE { " +
"<" + subject + "> <" + predicate + "> ?objectVar .} ";
return query;
}
}

View file

@ -21,7 +21,7 @@ import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaVClassOptions;
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation;
public class PersonHasAdvisingRelationshipGenerator extends VivoBaseGenerator implements
public class PersonHasAdvisorRelationshipGenerator extends VivoBaseGenerator implements
EditConfigurationGenerator {
final static String advisingRelClass = vivoCore + "AdvisingRelationship";
@ -38,7 +38,7 @@ public class PersonHasAdvisingRelationshipGenerator extends VivoBaseGenerator im
final static String dateTimeValue = vivoCore + "dateTime";
final static String dateTimePrecision = vivoCore + "dateTimePrecision";
public PersonHasAdvisingRelationshipGenerator() {}
public PersonHasAdvisorRelationshipGenerator() {}
@Override
public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq,
@ -50,11 +50,11 @@ public class PersonHasAdvisingRelationshipGenerator extends VivoBaseGenerator im
initPropertyParameters(vreq, session, conf);
initObjectPropForm(conf, vreq);
conf.setTemplate("personHasAdvisingRelationship.ftl");
conf.setTemplate("personHasAdvisorRelationship.ftl");
conf.setVarNameForSubject("person");
conf.setVarNameForPredicate("predicate");
conf.setVarNameForObject("advisingRelationship");
conf.setVarNameForObject("advisorRole");
conf.setN3Required( Arrays.asList( n3ForNewAdvisingRelationship,
advisingRelLabelAssertion,

View file

@ -107,8 +107,9 @@ temporal_graph_capitalized = Temporal Graph
websites = Websites
advisee_label = advisee label
advisor_label = advisor label
candidate = candidate
advisory_label = advisory label
advisingRel_label = advisory label
editor_abbreviated = Ed.
volume_abbreviated = Ed.
@ -467,10 +468,13 @@ degree_candidacy = Degree Candidacy
subject_area = Subject Area
selected_subject_area = Selected Subject Area
selected_advisee = Selected Advisee
selected_advisor = Selected Advisor
advisee_capitalized = Advisee
advisor_capitalized = Advisor
advising_relationship_type = Advising Relationship Type
select_advising_relationship_type = Please select an Advising Relationship Type.
advising_relationship_entry_for = advising relationship entry for
advisor_relationship_entry_for = advisor relationship entry for
advisee_relationship_entry_for = advisee relationship entry for
years_participating = Years of Participation
award_or_honor_for = award or honor for
@ -687,7 +691,7 @@ error_processing_author_request = Error processing request: author not removed
author_capitalized = Author
or_add_new_one = or add a new one.
vocabulary_service_error = An error was encountered in executing this search.
vocabulary_service_unavailable = An error was encountered in executing this search.
no_serch_results_found = No search results were found.
label_type = Label (Type)
label_altLabels = Label (Alternate Labels)