Starting to add editing of existing role to custom form. NIHVIVO-629

This commit is contained in:
bdc34 2010-07-14 23:59:42 +00:00
parent 4094b45b87
commit a5ed081ecd

View file

@ -120,7 +120,6 @@
?person ?rolePredicate ?role. ?person ?rolePredicate ?role.
?role a <${roleType}> . ?role a <${roleType}> .
?role core:roleIn ?roleActivity . ?role core:roleIn ?roleActivity .
?role <${label}> ?roleLabel .
?roleActivity core:relatedRole ?role . ?roleActivity core:relatedRole ?role .
</v:jsonset> </v:jsonset>
@ -128,15 +127,15 @@
?roleActivity a ?roleActivityType . ?roleActivity a ?roleActivityType .
</v:jsonset> </v:jsonset>
<v:jsonset var="n3ForNewActivityTitle"> <v:jsonset var="n3ForNewActivityLabel">
?roleActivity <${label}> ?title . ?roleActivity <${label}> ?activityLabel .
</v:jsonset> </v:jsonset>
<v:jsonset var="n3ForInverse"> <v:jsonset var="n3ForInverse">
?role ?inverseRolePredicate ?person. ?role ?inverseRolePredicate ?person.
</v:jsonset> </v:jsonset>
<v:jsonset var="titleQuery"> <v:jsonset var="activityLabelQuery">
PREFIX core: <${vivoCore}> PREFIX core: <${vivoCore}>
PREFIX rdfs: <${rdfs}> PREFIX rdfs: <${rdfs}>
SELECT ?existingTitle WHERE { SELECT ?existingTitle WHERE {
@ -173,8 +172,8 @@
"predicate" : ["rolePredicate", "${predicateUriJson}" ], "predicate" : ["rolePredicate", "${predicateUriJson}" ],
"object" : ["role", "${objectUriJson}", "URI" ], "object" : ["role", "${objectUriJson}", "URI" ],
"n3required" : [ "${n3ForNewRole}", "${roleLabel}", "${startYearAssertion}" ], "n3required" : [ "${n3ForNewRole}", "${roleLabel}", "${startYearAssertion}", "${roleLabelAssertion}" ],
"n3optional" : [ "${n3ForNewActivityTitle}", "${n3ForNewActivityType}", "${n3ForInverse}", "${endYearAssertion}" ], "n3optional" : [ "${n3ForNewActivityLabel}", "${n3ForNewActivityType}", "${n3ForInverse}", "${endYearAssertion}" ],
"newResources" : { "role" : "${defaultNamespace}", "newResources" : { "role" : "${defaultNamespace}",
"roleActivity" : "${defaultNamespace}" }, "roleActivity" : "${defaultNamespace}" },
@ -182,14 +181,14 @@
"urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" }, "urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" },
"literalsInScope": { }, "literalsInScope": { },
"urisOnForm" : [ "roleActivity", "roleActivityType" ], "urisOnForm" : [ "roleActivity", "roleActivityType" ],
"literalsOnForm" : [ "title", "roleLabel", "startYear", "endYear" ], "literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear" ],
"filesOnForm" : [ ], "filesOnForm" : [ ],
"sparqlForLiterals" : { }, "sparqlForLiterals" : { },
"sparqlForUris" : { }, "sparqlForUris" : { },
"sparqlForExistingLiterals" : { "title":"${titleQuery}", "roleLabel":"${roleLabelQuery}", "startYearMonth":"${startYearMonthQuery}", "endYearMonth":"${endYearMonthQuery}" }, "sparqlForExistingLiterals" : { "activityLabel":"${activityLabelQuery}", "roleLabel":"${roleLabelQuery}", "startYearMonth":"${startYearMonthQuery}", "endYearMonth":"${endYearMonthQuery}" },
"sparqlForExistingUris" : { "roleActivity":"${activityQuery}" }, "sparqlForExistingUris" : { "roleActivity":"${activityQuery}" },
"fields" : { "fields" : {
"title" : { "activityLabel" : {
"newResource" : "false", "newResource" : "false",
"validators" : [ ${labelRequired} "datatype:${stringDatatypeUriJson}" ], "validators" : [ ${labelRequired} "datatype:${stringDatatypeUriJson}" ],
"optionsType" : "UNDEFINED", "optionsType" : "UNDEFINED",
@ -198,7 +197,7 @@
"objectClassUri" : "", "objectClassUri" : "",
"rangeDatatypeUri" : "${stringDatatypeUriJson}", "rangeDatatypeUri" : "${stringDatatypeUriJson}",
"rangeLang" : "", "rangeLang" : "",
"assertions" : ["${n3ForNewActivityTitle}" ] "assertions" : ["${n3ForNewActivityLabel}" ]
}, },
"roleActivityType" : { "roleActivityType" : {
"newResource" : "true", "newResource" : "true",
@ -306,7 +305,7 @@
<div class="fullViewOnly"> <div class="fullViewOnly">
<p><v:input type="text" id="label" name="title" label="Title" cssClass="acSelector" size="50" /></p> <p><v:input type="text" id="activityLabel" name="activityLabel" label="Title" cssClass="acSelector" size="50" /></p>
<div class="acSelection"> <div class="acSelection">
<%-- RY maybe make this a label and input field. See what looks best. --%> <%-- RY maybe make this a label and input field. See what looks best. --%>
@ -314,7 +313,7 @@
<input type="hidden" id="roleActivityURI" name="roleActivity" class="acReceiver" value="" /> <!-- Field value populated by JavaScript --> <input type="hidden" id="roleActivityURI" name="roleActivity" class="acReceiver" value="" /> <!-- Field value populated by JavaScript -->
</div> </div>
<p><v:input type="text" id="roleLabel" name="roleLabel" label="Role in X ${requiredHint}" cssClass="acSelector" size="50" /></p> <p><v:input type="text" id="roleLabel" name="roleLabel" label="Role in X ${requiredHint}" size="50" /></p>
<h4>Dates of Participation</h4> <h4>Dates of Participation</h4>
<v:input type="text" label="Start Year ${requiredHint} ${yearHint}" id="startYear" size="7"/> <v:input type="text" label="Start Year ${requiredHint} ${yearHint}" id="startYear" size="7"/>