NIHVIVO-193, NIHVIVO-194. Cleaned up n3 statements in position history and educational background forms. Restored degree to required status in educational background status; had temporarily been made optional due to bugs related to the degree which have now been fixed.

This commit is contained in:
rjy7 2010-04-03 20:16:53 +00:00
parent af70c12a6a
commit c0c802af96
2 changed files with 33 additions and 36 deletions

View file

@ -45,16 +45,15 @@
<c:set var="rdf" value="<%= VitroVocabulary.RDF %>" />
<c:set var="rdfs" value="<%= VitroVocabulary.RDFS %>" />
<c:set var="label" value="${rdfs}label" />
<c:set var="type" value="${rdf}type" />
<c:set var="edBackgroundClass" value="${vivoCore}EducationalBackground" />
<c:set var="orgClass" value="http://xmlns.com/foaf/0.1/Organization" />
<c:set var="degreeClass" value="${vivoCore}AcademicDegree" />
<%--
Classes:
core:EducationalBackground - new entity
foaf:Person
foaf:Organization
core:AcademicDegree
core:EducationalBackground - primary new individual being created
foaf:Person - existing individual
foaf:Organization - new or existing individual
core:AcademicDegree - existing individual
Data properties of EducationalBackground:
core:majorField
@ -72,9 +71,6 @@ core:awardedTo (AcademicDegree : EducationalBackground) - inverse of degreeTypeA
core:organizationGrantingDegree (EducationalBackground : Organization) - no inverse
--%>
<%-- Data properties --%>
<%-- Then enter a SPARQL query for each field, by convention concatenating the field id with "Existing"
to convey that the expression is used to retrieve any existing value for the field in an existing individual.
@ -160,23 +156,25 @@ core:organizationGrantingDegree (EducationalBackground : Organization) - no inve
</v:jsonset>
<v:jsonset var="newOrgTypeAssertion">
?newOrg <${type}> ?newOrgType .
?newOrg a ?newOrgType .
</v:jsonset>
<v:jsonset var="n3ForStmtToPerson">
@prefix core: <${vivoCore}> .
?person core:educationalBackground ?edBackgroundUri .
?edBackgroundUri core:educationalBackgroundOf ?person .
?edBackgroundUri <${type}> core:EducationalBackground .
?edBackgroundUri <${type}> <${flagURI}> .
?person core:educationalBackground ?edBackgroundUri .
?edBackgroundUri core:educationalBackgroundOf ?person ;
a core:EducationalBackground ;
a <${flagURI}> .
</v:jsonset>
<v:jsonset var="n3ForNewOrg">
?newOrg <${label}> ?newOrgName .
?newOrg <${type}> ?newOrgType .
?newOrg <${label}> ?newOrgName ;
a ?newOrgType ;
a <${flagURI}> .
?edBackgroundUri <${orgGrantingDegree}> ?newOrg .
?newOrg <${type}> <${flagURI}> .
</v:jsonset>
<v:jsonset var="edBackgroundClassUriJson">${edBackgroundClass}</v:jsonset>
@ -193,11 +191,11 @@ core:organizationGrantingDegree (EducationalBackground : Organization) - no inve
"predicate" : ["predicate", "${predicateUriJson}" ],
"object" : ["edBackgroundUri", "${objectUriJson}", "URI" ],
"n3required" : [ "${n3ForStmtToPerson}", "${majorFieldAssertion}", "${yearAssertion}" ],
"n3required" : [ "${n3ForStmtToPerson}", "${degreeAssertion}", "${majorFieldAssertion}", "${yearAssertion}" ],
"n3optional" : [ "${organizationUriAssertion}",
"${n3ForNewOrg}", "${newOrgNameAssertion}", "${newOrgTypeAssertion}",
"${deptAssertion}", "${infoAssertion}", "${degreeAssertion}" ],
"${deptAssertion}", "${infoAssertion}" ],
"newResources" : { "edBackgroundUri" : "${defaultNamespace}",
"newOrg" : "${defaultNamespace}" },
@ -222,7 +220,7 @@ core:organizationGrantingDegree (EducationalBackground : Organization) - no inve
"fields" : {
"degreeUri" : {
"newResource" : "false",
"validators" : [ ],
"validators" : [ "nonempty" ],
"optionsType" : "INDIVIDUALS_VIA_VCLASS",
"literalOptions" : [ "Select one" ],
"predicateUri" : "",
@ -338,7 +336,7 @@ core:organizationGrantingDegree (EducationalBackground : Organization) - no inve
<c:set var="editType" value="edit" />
<c:set var="title" value="Edit educational background entry for ${subjectName}" />
<%-- NB This will be the button text when Javascript is disabled. --%>
<c:set var="submitLabel" value="Save changes" />
<c:set var="submitLabel" value="Save Changes" />
<%
} else { // adding new entry
%>

View file

@ -42,10 +42,8 @@
%>
<c:set var="vivoCore" value="http://vivoweb.org/ontology/core#" />
<c:set var="rdf" value="<%= VitroVocabulary.RDF %>" />
<c:set var="rdfs" value="<%= VitroVocabulary.RDFS %>" />
<c:set var="label" value="${rdfs}label" />
<c:set var="type" value="${rdf}type" />
<c:set var="positionClass" value="${vivoCore}Position" />
<c:set var="orgClass" value="http://xmlns.com/foaf/0.1/Organization" />
@ -63,8 +61,8 @@
The actual assertion inserted in the model will be created via string substitution into the ? variables.
NOTE the pattern of punctuation (a period after the prefix URI and after the ?field) --%>
<v:jsonset var="titleAssertion" >
?positionUri <${titlePred}> ?title .
?positionUri <${label}> ?title.
?positionUri <${titlePred}> ?title ;
<${label}> ?title.
</v:jsonset>
<c:set var="startYearPred" value="${vivoCore}startYear" />
@ -101,10 +99,10 @@
<v:jsonset var="positionTypeExisting">
SELECT ?existingPositionType WHERE {
?positionUri <${type}> ?existingPositionType }
?positionUri a ?existingPositionType }
</v:jsonset>
<v:jsonset var="positionTypeAssertion">
?positionUri <${type}> ?positionType .
?positionUri a ?positionType .
</v:jsonset>
<v:jsonset var="newOrgNameAssertion">
@ -112,24 +110,26 @@
</v:jsonset>
<v:jsonset var="newOrgTypeAssertion">
?newOrg <${type}> ?newOrgType .
?newOrg a ?newOrgType .
</v:jsonset>
<v:jsonset var="n3ForStmtToPerson">
@prefix core: <${vivoCore}> .
?person core:personInPosition ?positionUri .
?positionUri core:positionForPerson ?person .
?positionUri <${type}> ?positionType .
?positionUri <${type}> <${flagURI}> .
?positionUri core:positionForPerson ?person ;
a ?positionType ;
a <${flagURI}> .
</v:jsonset>
<v:jsonset var="n3ForNewOrg">
?newOrg <${label}> ?newOrgName .
?newOrg <${type}> ?newOrgType .
?positionUri <${positionInOrgPred}> ?newOrg .
?newOrg <${orgForPositionPred}> ?positionUri .
?newOrg <${type}> <${flagURI}> .
?newOrg <${label}> ?newOrgName ;
a ?newOrgType ;
<${orgForPositionPred}> ?positionUri ;
a <${flagURI}> .
</v:jsonset>
<v:jsonset var="positionClassUriJson">${positionClass}</v:jsonset>
@ -157,8 +157,7 @@
"urisInScope" : { },
"literalsInScope": { },
"urisOnForm" : [ "organizationUri", "newOrgType", "positionType" ],
"literalsOnForm" : [ "title", "newOrgName",
"startYear", "endYear" ],
"literalsOnForm" : [ "title", "newOrgName", "startYear", "endYear" ],
"filesOnForm" : [ ],
"sparqlForLiterals" : { },
"sparqlForUris" : { },