updates for VIVO-413 and VIVO-409

This commit is contained in:
tworrall 2013-10-25 17:09:07 -04:00
parent f1abafa3aa
commit e6bd71e6ba
5 changed files with 41 additions and 27 deletions

View file

@ -26,16 +26,16 @@
WHERE {
?subject ?property ?awardReceipt .
?awardReceipt a core:AwardReceipt .
OPTIONAL { ?awardReceipt rdfs:label ?receiptLabel }
OPTIONAL { ?awardReceipt core:relates ?award .
OPTIONAL { ?awardReceipt rdfs:label ?receiptLabel }
OPTIONAL { ?awardReceipt core:relates ?award .
?award a core:Award .
?award core:relatedBy ?awardReceipt
OPTIONAL { ?award rdfs:label ?awardLabel }
OPTIONAL { ?award core:assignedBy ?assignedBy
OPTIONAL { ?assignedBy rdfs:label ?assignedByLabel }
}
}
OPTIONAL { ?awardReceipt core:dateTimeInterval ?dateTimeInterval
?award core:relatedBy ?awardReceipt .
?award rdfs:label ?awardLabel
}
OPTIONAL { ?awardReceipt core:assignedBy ?assignedBy .
?assignedBy rdfs:label ?assignedByLabel
}
OPTIONAL { ?awardReceipt core:dateTimeInterval ?dateTimeInterval
OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart
}
@ -65,7 +65,7 @@
?award a core:Award .
?award core:relatedBy ?awardReceipt .
?award rdfs:label ?awardLabel .
?award core:assignedBy ?assignedBy .
?awardReceipt core:assignedBy ?assignedBy .
?assignedBy rdfs:label ?assignedByLabel .
?awardReceipt core:dateTimeValue ?dateTimeValue .
?dateTimeValue core:dateTime ?dateTime
@ -89,9 +89,7 @@
?subject ?property ?awardReceipt .
?awardReceipt a core:AwardReceipt .
?awardReceipt rdfs:label ?receiptLabel .
?awardReceipt core:relates ?award .
?award a core:Award .
?award core:assignedBy ?assignedBy .
?awardReceipt core:assignedBy ?assignedBy .
?assignedBy rdfs:label ?assignedByLabel
} UNION {
?subject ?property ?awardReceipt .
@ -122,8 +120,8 @@
<query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT {
?subject ?property ?awardReceipt .
?awardReceipt a core:AwardReceipt .
?subject ?property ?awardReceipt .
?awardReceipt a core:AwardReceipt .
?awardReceipt core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd

View file

@ -12,6 +12,8 @@
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&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;
PREFIX obo: &lt;http://purl.obolibrary.org/obo/&gt;
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
SELECT <collated> ?subclass </collated>
?object
@ -37,7 +39,11 @@
?classGroup a vitro:ClassGroup
}
OPTIONAL { ?object core:preferredTitle ?title }
OPTIONAL { ?object obo:ARG_2000028 ?vcard .
?vcard vcard:hasTitle ?titleObj .
?titleObj vcard:title ?title
}
<collated>
OPTIONAL { ?object a ?subclass }
@ -75,6 +81,8 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&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;
PREFIX obo: &lt;http://purl.obolibrary.org/obo/&gt;
PREFIX vcard: &lt;http://www.w3.org/2006/vcard/ns#&gt;
CONSTRUCT {
?subject ?property ?object .
@ -82,7 +90,9 @@
?typeUri vitro:inClassGroup ?classGroup .
?classGroup a vitro:ClassGroup .
?typeUri rdfs:label ?type .
?object core:preferredTitle ?title .
?object obo:ARG_2000028 ?vcard .
?vcard vcard:hasTitle ?titleObj .
?titleObj vcard:title ?title
} WHERE {
{
?subject ?property ?object .
@ -92,7 +102,9 @@
?classGroup a vitro:ClassGroup
} UNION {
?subject ?property ?object .
?object core:preferredTitle ?title .
?object obo:ARG_2000028 ?vcard .
?vcard vcard:hasTitle ?titleObj .
?titleObj vcard:title ?title
}
}
</query-construct>

View file

@ -4,6 +4,7 @@
<#-- Template for adding a grant role, such as principal investigator, to a foaf:Persons -->
<#--Retrieve certain edit configuration information-->
<#assign editMode = editConfiguration.pageData.editMode />
<#assign rangeUri = editConfiguration.pageData.rangeUri />
<#assign literalValues = editConfiguration.existingLiteralValues />
<#assign uriValues = editConfiguration.existingUriValues />
<#assign htmlForElements = editConfiguration.pageData.htmlForElements />
@ -34,9 +35,9 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#assign formHeading = "${i18n().investigator_entry_for}"/>
<#assign submitButtonLabel = "${i18n().investigator_capitalized}" />
<#if editConfiguration.predicateUri?ends_with("hasPrincipalInvestigatorRole") >
<#if rangeUri?contains("#PrincipalInvestigatorRole") >
<#assign formHeading = "${i18n().principal_investigator_entry_for}"/>
<#elseif editConfiguration.predicateUri?ends_with("hasCo-PrincipalInvestigatorRole") >
<#elseif rangeUri?contains("#CoPrincipalInvestigatorRole") >
<#assign formHeading = "${i18n().co_principal_investigator_entry_for}"/>
</#if>

View file

@ -729,6 +729,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) {
HashMap<String, Object> formSpecificData = new HashMap<String, Object>();
formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase());
formSpecificData.put("rangeUri", getRangeUri(vreq));
//In this case, passing back a sparql query
formSpecificData.put("sparqlForAcFilter", getSparqlForAcFilter(vreq));
//Put in the fact that we require field
@ -747,8 +748,10 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator
return query;
}
private String getRangeUri(VitroRequest vreq) {
String rangeUri = vreq.getParameter("rangeUri");
return rangeUri;
}
}

View file

@ -262,9 +262,8 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
final static String existingOrgQuery =
"SELECT ?existingOrg WHERE { \n" +
" ?awardReceipt <" + receiptOfPred + "> ?existingAward . \n" +
" ?existingAward a <" + awardClass + "> . \n" +
" ?existingAward<" + awardConferredByPred + "> ?existingOrg . \n" +
" ?awardReceipt <" + awardConferredByPred + "> ?existingOrg . \n" +
" ?existingOrg a <" + orgClass + "> . \n" +
" ?existingOrg <" + awardConferredPred + "> ?existingAward . }";
final static String awardReceiptLabelQuery =
@ -281,7 +280,8 @@ public class PersonHasAwardOrHonorGenerator extends VivoBaseGenerator implements
final static String orgLabelQuery =
"SELECT ?existingOrgLabel WHERE { \n" +
" ?award <" + awardConferredByPred + "> ?existingOrg . \n" +
" ?awardReceipt <" + awardConferredByPred + "> ?existingOrg . \n" +
" ?existingOrg a <" + orgClass + "> . \n" +
" ?existingOrg <" + label + "> ?existingOrgLabel . \n" +
"}";