From c0c802af961f0ee98c3b9e958d85a2266c626468 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Sat, 3 Apr 2010 20:16:53 +0000 Subject: [PATCH] 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. --- .../forms/personHasEducationalBackground.jsp | 38 +++++++++---------- .../edit/forms/personHasPositionHistory.jsp | 31 ++++++++------- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/productMods/edit/forms/personHasEducationalBackground.jsp b/productMods/edit/forms/personHasEducationalBackground.jsp index c088d668..23e7c85b 100644 --- a/productMods/edit/forms/personHasEducationalBackground.jsp +++ b/productMods/edit/forms/personHasEducationalBackground.jsp @@ -45,16 +45,15 @@ - <%-- 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 - ?newOrg <${type}> ?newOrgType . + ?newOrg a ?newOrgType . @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}> . - ?newOrg <${label}> ?newOrgName . - ?newOrg <${type}> ?newOrgType . + ?newOrg <${label}> ?newOrgName ; + a ?newOrgType ; + a <${flagURI}> . + ?edBackgroundUri <${orgGrantingDegree}> ?newOrg . - ?newOrg <${type}> <${flagURI}> . ${edBackgroundClass} @@ -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 <%-- NB This will be the button text when Javascript is disabled. --%> - + <% } else { // adding new entry %> diff --git a/productMods/edit/forms/personHasPositionHistory.jsp b/productMods/edit/forms/personHasPositionHistory.jsp index cff66d53..7fe7d589 100644 --- a/productMods/edit/forms/personHasPositionHistory.jsp +++ b/productMods/edit/forms/personHasPositionHistory.jsp @@ -42,10 +42,8 @@ %> - - @@ -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) --%> - ?positionUri <${titlePred}> ?title . - ?positionUri <${label}> ?title. + ?positionUri <${titlePred}> ?title ; + <${label}> ?title. @@ -101,10 +99,10 @@ SELECT ?existingPositionType WHERE { - ?positionUri <${type}> ?existingPositionType } + ?positionUri a ?existingPositionType } - ?positionUri <${type}> ?positionType . + ?positionUri a ?positionType . @@ -112,24 +110,26 @@ - ?newOrg <${type}> ?newOrgType . + ?newOrg a ?newOrgType . @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}> . - ?newOrg <${label}> ?newOrgName . - ?newOrg <${type}> ?newOrgType . ?positionUri <${positionInOrgPred}> ?newOrg . - ?newOrg <${orgForPositionPred}> ?positionUri . - ?newOrg <${type}> <${flagURI}> . + + ?newOrg <${label}> ?newOrgName ; + a ?newOrgType ; + <${orgForPositionPred}> ?positionUri ; + a <${flagURI}> . ${positionClass} @@ -157,8 +157,7 @@ "urisInScope" : { }, "literalsInScope": { }, "urisOnForm" : [ "organizationUri", "newOrgType", "positionType" ], - "literalsOnForm" : [ "title", "newOrgName", - "startYear", "endYear" ], + "literalsOnForm" : [ "title", "newOrgName", "startYear", "endYear" ], "filesOnForm" : [ ], "sparqlForLiterals" : { }, "sparqlForUris" : { },