VIVO-112: more updates for educational training and a change for organizationHasPositionHistory

This commit is contained in:
tworrall 2013-09-10 11:33:20 -04:00
parent c367ce4fd6
commit fbf2c4b651
6 changed files with 97 additions and 63 deletions

View file

@ -26,7 +26,13 @@
?trainingType rdfs:subClassOf core:EducationalProcess . ?trainingType rdfs:subClassOf core:EducationalProcess .
?trainingType rdfs:label ?typeName ?trainingType rdfs:label ?typeName
} }
OPTIONAL { ?edTraining core:relates ?org . OPTIONAL { ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree .
?awardedDegree core:relates ?degree .
?degree a core:AcademicDegree
OPTIONAL { ?degree rdfs:label ?degreeName }
OPTIONAL { ?degree core:abbreviation ?degreeAbbr }
}
OPTIONAL { ?awardedDegree core:assignedBy ?org .
?org rdfs:label ?orgName ?org rdfs:label ?orgName
<collated> <collated>
OPTIONAL { ?org vitro:mostSpecificType ?subclass . OPTIONAL { ?org vitro:mostSpecificType ?subclass .
@ -34,12 +40,6 @@
} }
</collated> </collated>
} }
OPTIONAL { ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree .
?awardedDegree core:relates ?degree .
?degree a core:AcademicDegree
OPTIONAL { ?degree rdfs:label ?degreeName }
OPTIONAL { ?degree core:abbreviation ?degreeAbbr }
}
OPTIONAL { ?edTraining core:majorField ?majorField } OPTIONAL { ?edTraining core:majorField ?majorField }
OPTIONAL { ?edTraining core:departmentOrSchool ?deptOrSchool } OPTIONAL { ?edTraining core:departmentOrSchool ?deptOrSchool }
OPTIONAL { ?edTraining core:supplementalInformation ?info } OPTIONAL { ?edTraining core:supplementalInformation ?info }
@ -74,9 +74,9 @@
?subject ?property ?edTraining . ?subject ?property ?edTraining .
?edTraining a core:EducationalProcess . ?edTraining a core:EducationalProcess .
?edTraining ?edTrainingProp ?edTrainingValue . ?edTraining ?edTrainingProp ?edTrainingValue .
?edTraining core:relates ?org .
?org rdfs:label ?orgName .
?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree . ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree .
?awardedDegree core:assignedBy ?org .
?org rdfs:label ?orgName .
?awardedDegree core:relates ?degree . ?awardedDegree core:relates ?degree .
?edTraining core:dateTimeInterval ?dateTimeInterval ?edTraining core:dateTimeInterval ?dateTimeInterval
} WHERE { } WHERE {
@ -92,13 +92,14 @@
UNION { UNION {
?subject ?property ?edTraining . ?subject ?property ?edTraining .
?edTraining a core:EducationalProcess . ?edTraining a core:EducationalProcess .
?edTraining core:relates ?org . ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree .
?org rdfs:label ?orgName
} }
UNION { UNION {
?subject ?property ?edTraining . ?subject ?property ?edTraining .
?edTraining a core:EducationalProcess . ?edTraining a core:EducationalProcess .
?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree . ?edTraining &lt;http://purl.obolibrary.org/obo/RO_0002234&gt; ?awardedDegree .
?awardedDegree core:assignedBy ?org .
?org rdfs:label ?orgName
} }
UNION { UNION {
?subject ?property ?edTraining . ?subject ?property ?edTraining .

View file

@ -31,7 +31,7 @@
LET (?activityName := afn:localname(?activity)) LET (?activityName := afn:localname(?activity))
OPTIONAL { ?activity rdfs:label ?activityLabel } OPTIONAL { ?activity rdfs:label ?activityLabel }
} }
OPTIONAL { ?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity OPTIONAL { ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity
LET (?activityName := afn:localname(?activity)) LET (?activityName := afn:localname(?activity))
OPTIONAL { ?activity rdfs:label ?activityLabel } OPTIONAL { ?activity rdfs:label ?activityLabel }
} }
@ -49,7 +49,7 @@
?dateTimeEndValueRole core:dateTime ?dateTimeEndRole ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole
} }
} }
OPTIONAL { ?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?grant . OPTIONAL { ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?grant .
?grant core:dateTimeInterval ?dateTimeIntervalGrant ?grant core:dateTimeInterval ?dateTimeIntervalGrant
OPTIONAL { ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . OPTIONAL { ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant .
?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant
@ -77,7 +77,7 @@
{ {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity
} UNION } UNION
{ {
?subject ?property ?role . ?subject ?property ?role .
@ -96,18 +96,18 @@
CONSTRUCT { CONSTRUCT {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity rdfs:label ?activityLabel ?activity rdfs:label ?activityLabel
} WHERE { } WHERE {
{ {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity
} UNION } UNION
{ {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity rdfs:label ?activityLabel ?activity rdfs:label ?activityLabel
} }
} }
@ -135,7 +135,7 @@
} UNION { } UNION {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity rdfs:label ?activityName ?activity rdfs:label ?activityName
} UNION { } UNION {
?subject ?property ?role . ?subject ?property ?role .
@ -145,23 +145,23 @@
} UNION { } UNION {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity core:grantAwardedBy ?awardedBy ?activity core:grantAwardedBy ?awardedBy
} UNION { } UNION {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity core:grantAwardedBy ?awardedBy . ?activity core:grantAwardedBy ?awardedBy .
?awardedBy rdfs:label ?awardedByLabel ?awardedBy rdfs:label ?awardedByLabel
} UNION { } UNION {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity core:administeredBy ?adminedBy ?activity core:administeredBy ?adminedBy
} UNION { } UNION {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?activity . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?activity .
?activity core:administeredBy ?adminedBy . ?activity core:administeredBy ?adminedBy .
?adminedBy rdfs:label ?adminedByLabel ?adminedBy rdfs:label ?adminedByLabel
} }
@ -206,14 +206,14 @@
CONSTRUCT { CONSTRUCT {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?grant . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?grant .
?grant core:dateTimeInterval ?dateTimeIntervalGrant . ?grant core:dateTimeInterval ?dateTimeIntervalGrant .
?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant .
?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant
} WHERE { } WHERE {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?grant . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?grant .
?grant core:dateTimeInterval ?dateTimeIntervalGrant . ?grant core:dateTimeInterval ?dateTimeIntervalGrant .
?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant .
?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant
@ -225,14 +225,14 @@
CONSTRUCT { CONSTRUCT {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?grant . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?grant .
?grant core:dateTimeInterval ?dateTimeIntervalGrant . ?grant core:dateTimeInterval ?dateTimeIntervalGrant .
?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant .
?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant
} WHERE { } WHERE {
?subject ?property ?role . ?subject ?property ?role .
?role a ?objectType . ?role a ?objectType .
?role &lt;http://vivoweb.org/ontology/core#relatedBy&gt; ?grant . ?role &lt;http://vivoweb.org/ontology/core#relates&gt; ?grant .
?grant core:dateTimeInterval ?dateTimeIntervalGrant . ?grant core:dateTimeInterval ?dateTimeIntervalGrant .
?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant .
?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant

View file

@ -9,6 +9,7 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt; PREFIX afn: &lt;http://jena.hpl.hp.com/ARQ/function#&gt;
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt; PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
SELECT DISTINCT <collated> ?subclass </collated> SELECT DISTINCT <collated> ?subclass </collated>
?position ?position
@ -19,6 +20,7 @@
WHERE { WHERE {
?subject ?property ?position ?subject ?property ?position
OPTIONAL { ?position core:relates ?person . OPTIONAL { ?position core:relates ?person .
?person a foaf:Person .
?person rdfs:label ?personName ?person rdfs:label ?personName
} }
<collated> <collated>
@ -51,9 +53,11 @@
PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt; PREFIX vitro: &lt;http://vitro.mannlib.cornell.edu/ns/vitro/0.7#&gt;
CONSTRUCT { CONSTRUCT {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position vitro:mostSpecificType ?subclass ?position vitro:mostSpecificType ?subclass
} WHERE { } WHERE {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position vitro:mostSpecificType ?subclass ?position vitro:mostSpecificType ?subclass
} }
</query-construct> </query-construct>
@ -61,19 +65,26 @@
<query-construct> <query-construct>
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/&gt;
CONSTRUCT { CONSTRUCT {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position ?positionProperty ?positionValue . ?position ?positionProperty ?positionValue .
?position core:relates ?person .
?person a foaf:Person .
?person rdfs:label ?personName ?person rdfs:label ?personName
} WHERE { } WHERE {
{ {
?subject ?property ?position ?subject ?property ?position .
?position a core:Position .
} UNION { } UNION {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position ?positionProperty ?positionValue ?position ?positionProperty ?positionValue
} UNION { } UNION {
?subject ?property ?position . ?subject ?property ?position .
?position core:positionForPerson ?person . ?position core:relates ?person .
?person a foaf:Person .
?person rdfs:label ?personName ?person rdfs:label ?personName
} }
} }
@ -83,11 +94,13 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT { CONSTRUCT {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position core:dateTimeInterval ?dateTimeInterval . ?position core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart ?dateTimeStartValue core:dateTime ?dateTimeStart
} WHERE { } WHERE {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position core:dateTimeInterval ?dateTimeInterval . ?position core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeInterval core:start ?dateTimeStartValue .
?dateTimeStartValue core:dateTime ?dateTimeStart ?dateTimeStartValue core:dateTime ?dateTimeStart
@ -98,11 +111,13 @@
PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt; PREFIX core: &lt;http://vivoweb.org/ontology/core#&gt;
CONSTRUCT { CONSTRUCT {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position core:dateTimeInterval ?dateTimeInterval . ?position core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue . ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd ?dateTimeEndValue core:dateTime ?dateTimeEnd
} WHERE { } WHERE {
?subject ?property ?position . ?subject ?property ?position .
?position a core:Position .
?position core:dateTimeInterval ?dateTimeInterval . ?position core:dateTimeInterval ?dateTimeInterval .
?dateTimeInterval core:end ?dateTimeEndValue . ?dateTimeInterval core:end ?dateTimeEndValue .
?dateTimeEndValue core:dateTime ?dateTimeEnd ?dateTimeEndValue core:dateTime ?dateTimeEnd

View file

@ -44,7 +44,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<#assign submissionErrors = editSubmission.validationErrors/> <#assign submissionErrors = editSubmission.validationErrors/>
</#if> </#if>
<#if editMode == "edit"> <#if editMode == "edit" || editMode == "repair">
<#assign titleVerb="${i18n().edit_capitalized}"> <#assign titleVerb="${i18n().edit_capitalized}">
<#assign submitButtonText="${i18n().save_changes}"> <#assign submitButtonText="${i18n().save_changes}">
<#assign disabledVal="disabled"> <#assign disabledVal="disabled">
@ -164,7 +164,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o
<option value="${key}" <#if degreeValue = key>selected</#if>>${degreeOpts[key]}</option> <option value="${key}" <#if degreeValue = key>selected</#if>>${degreeOpts[key]}</option>
</#list> </#list>
</select> </select>
<#if editMode == "edit"> <#if editMode == "edit" || editMode == "repair">
<input type="hidden" id="newAwardedDegreeLabel" name="awardedDegreeLabel" value=""/> <input type="hidden" id="newAwardedDegreeLabel" name="awardedDegreeLabel" value=""/>
<input type="hidden" id="awardedDegreeLabel" name="existingAwardedDegreeLabel" value="${existingADLabelValue!}"/> <input type="hidden" id="awardedDegreeLabel" name="existingAwardedDegreeLabel" value="${existingADLabelValue!}"/>
<#else> <#else>

View file

@ -43,13 +43,13 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n" + "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "SELECT ?existingPerson WHERE { \n" + "SELECT ?existingPerson WHERE { \n"
+ " ?position core:positionForPerson ?existingPerson .}"; + " ?position core:relates ?existingPerson .}";
private static final String QUERY_EXISTING_PERSON_LABEL = "" private static final String QUERY_EXISTING_PERSON_LABEL = ""
+ "PREFIX core: <http://vivoweb.org/ontology/core#> \n" + "PREFIX core: <http://vivoweb.org/ontology/core#> \n"
+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
+ "SELECT ?existingPersonLabel WHERE { \n" + "SELECT ?existingPersonLabel WHERE { \n"
+ " ?position core:positionForPerson ?existingPerson . \n" + " ?position core:relates ?existingPerson . \n"
+ " ?existingPerson rdfs:label ?existingPersonLabel . }"; + " ?existingPerson rdfs:label ?existingPersonLabel . }";
private static final String QUERY_EXISTING_INTERVAL_NODE = "" private static final String QUERY_EXISTING_INTERVAL_NODE = ""
@ -113,18 +113,18 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator
private static final String N3_NEW_POSITION = "" private static final String N3_NEW_POSITION = ""
+ "@prefix core: <http://vivoweb.org/ontology/core#> . \n" + "@prefix core: <http://vivoweb.org/ontology/core#> . \n"
+ "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . \n" + "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . \n"
+ "?organization core:organizationForPosition ?position . \n" + "?organization core:relatedBy ?position . \n"
+ "?position a core:Position . \n" + "?position a core:Position . \n"
+ "?position a ?positionType . \n" + "?position a ?positionType . \n"
+ "?position rdfs:label ?positionTitle . \n" + "?position rdfs:label ?positionTitle . \n"
+ "?position core:positionInOrganization ?organization . "; + "?position core:relates ?organization . ";
private static final String N3_NEW_PERSON = "" private static final String N3_NEW_PERSON = ""
+ "@prefix core: <http://vivoweb.org/ontology/core#> . \n" + "@prefix core: <http://vivoweb.org/ontology/core#> . \n"
+ "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . \n" + "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . \n"
+ "@prefix foaf: <http://xmlns.com/foaf/0.1/> . \n" + "@prefix foaf: <http://xmlns.com/foaf/0.1/> . \n"
+ "?position core:positionForPerson ?person . \n" + "?position core:relates ?person . \n"
+ "?person core:personInPosition ?position . \n" + "?person core:relatedBy ?position . \n"
+ "?person a foaf:Person . \n" + "?person a foaf:Person . \n"
+ "?person rdfs:label ?personLabel . "; + "?person rdfs:label ?personLabel . ";
@ -138,8 +138,8 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator
private static final String N3_EXISTING_PERSON = "" private static final String N3_EXISTING_PERSON = ""
+ "@prefix core: <http://vivoweb.org/ontology/core#> . \n" + "@prefix core: <http://vivoweb.org/ontology/core#> . \n"
+ "?position core:positionForPerson ?existingPerson . \n" + "?position core:relates ?existingPerson . \n"
+ "?existingPerson core:personInPosition ?position . \n"; + "?existingPerson core:relatedBy ?position . \n";
private static final String N3_NEW_START_NODE = "" private static final String N3_NEW_START_NODE = ""
+ "@prefix core: <http://vivoweb.org/ontology/core#> . \n" + "@prefix core: <http://vivoweb.org/ontology/core#> . \n"

View file

@ -90,8 +90,8 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) );
conf.setN3Optional(Arrays.asList( conf.setN3Optional(Arrays.asList(
n3ForNewOrg, n3ForExistingOrg, n3ForNewAwardedDegree, n3ForNewOrgExistingAwardedDegree, n3ForExistingOrgExistingAwardedDegree, n3ForNewAwardedDegreeNewOrg,
majorFieldAssertion, majorFieldAssertion, n3ForNewAwardedDegreeExistingOrg,
//existingDegreeTypeAssertion, //existingDegreeTypeAssertion,
existingAwardedDegreeLabel, deptAssertion, infoAssertion, n3ForStart, n3ForEnd )); existingAwardedDegreeLabel, deptAssertion, infoAssertion, n3ForStart, n3ForEnd ));
@ -229,15 +229,30 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
final static String trainingTypeAssertion = final static String trainingTypeAssertion =
"?edTraining a ?trainingType ."; "?edTraining a ?trainingType .";
final static String n3ForNewAwardedDegree = final static String n3ForNewAwardedDegreeNewOrg =
"@prefix core: <"+ vivoCore +"> .\n"+ "@prefix core: <"+ vivoCore +"> .\n"+
"?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?newAwardedDegree . \n" + "?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?newAwardedDegree . \n" +
"?newAwardedDegree <http://purl.obolibrary.org/obo/RO_0002353> ?edTraining . \n" + "?newAwardedDegree <http://purl.obolibrary.org/obo/RO_0002353> ?edTraining . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?person . \n" + "?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?person . \n" +
"?person <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n" + "?person <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n" +
"?newAwardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?newAwardedDegree <"+ label +"> ?awardedDegreeLabel . \n" +
"?newOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?newOrg . \n" + "?newAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?newOrg . \n" +
"?newOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newOrg a ?orgType . \n" +
"?newOrg <"+ label +"> ?orgLabel . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\n"+
"?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+
"?newAwardedDegree a core:AwardedDegree .";
final static String n3ForNewAwardedDegreeExistingOrg =
"@prefix core: <"+ vivoCore +"> .\n"+
"?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?newAwardedDegree . \n" +
"?newAwardedDegree <http://purl.obolibrary.org/obo/RO_0002353> ?edTraining . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?person . \n" +
"?person <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n" +
"?newAwardedDegree <"+ label +"> ?awardedDegreeLabel . \n" +
"?existingOrg <http://vivoweb.org/ontology/core#assigns> ?newAwardedDegree . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg . \n" +
"?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\n"+ "?newAwardedDegree <http://vivoweb.org/ontology/core#relates> ?degreeType .\n"+
"?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+ "?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?newAwardedDegree . \n"+
"?newAwardedDegree a core:AwardedDegree ."; "?newAwardedDegree a core:AwardedDegree .";
@ -249,15 +264,15 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
"?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?existingAwardedDegree . \n"+ "?degreeType <http://vivoweb.org/ontology/core#relatedBy> ?existingAwardedDegree . \n"+
"?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel . " ; "?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel . " ;
final static String n3ForNewOrg = final static String n3ForNewOrgExistingAwardedDegree =
"?edTraining <http://vivoweb.org/ontology/core#relates> ?newOrg . \n" + "?existingAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?newOrg . \n" +
"?newOrg <http://vivoweb.org/ontology/core#relatedBy> ?edTraining . \n" + "?newOrg <http://vivoweb.org/ontology/core#assigns> ?existingAwardedDegree . \n" +
"?newOrg <"+ label +"> ?orgLabel . \n" + "?newOrg <"+ label +"> ?orgLabel . \n" +
"?newOrg a ?orgType ."; "?newOrg a ?orgType .";
final static String n3ForExistingOrg = final static String n3ForExistingOrgExistingAwardedDegree =
"?edTraining <http://vivoweb.org/ontology/core#relates> ?existingOrg . \n" + "?existingAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg . \n" +
"?existingOrg <http://vivoweb.org/ontology/core#relatedBy> ?edTraining . \n" + "?existingOrg <http://vivoweb.org/ontology/core#assigns> ?existingAwardedDegree . \n" +
"?existingOrg a ?orgType . "; "?existingOrg a ?orgType . ";
final static String majorFieldAssertion = final static String majorFieldAssertion =
@ -287,16 +302,6 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
/* Queries for editing an existing educational training entry */ /* Queries for editing an existing educational training entry */
final static String existingOrgQuery =
"SELECT ?existingOrg WHERE {\n"+
"?edTraining <http://vivoweb.org/ontology/core#relates> ?existingOrg . }\n";
final static String orgLabelQuery =
"SELECT ?existingOrgLabel WHERE {\n"+
"?edTraining <http://vivoweb.org/ontology/core#relates> ?existingOrg .\n"+
"?existingOrg <"+ label +"> ?existingOrgLabel .\n"+
"}";
final static String existingAwardedDegreeQuery = final static String existingAwardedDegreeQuery =
"SELECT ?existingAwardedDegree WHERE {\n"+ "SELECT ?existingAwardedDegree WHERE {\n"+
"?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . }\n"; "?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . }\n";
@ -306,12 +311,25 @@ public class PersonHasEducationalTraining extends VivoBaseGenerator implements
"?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . \n" + "?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . \n" +
"?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel }\n"; "?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel }\n";
final static String existingOrgQuery =
"SELECT ?existingOrg WHERE {\n"+
"?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . \n" +
"?existingAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg . }\n";
final static String orgLabelQuery =
"SELECT ?existingOrgLabel WHERE {\n"+
"?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . \n" +
"?existingAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg .\n"+
"?existingOrg <"+ label +"> ?existingOrgLabel .\n"+
"}";
/* Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another /* Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another
type is returned and we don't get a match to the select element options. */ type is returned and we don't get a match to the select element options. */
final static String orgTypeQuery = final static String orgTypeQuery =
"PREFIX rdfs: <"+ rdfs +"> \n"+ "PREFIX rdfs: <"+ rdfs +"> \n"+
"SELECT ?existingOrgType WHERE {\n"+ "SELECT ?existingOrgType WHERE {\n"+
"?edTraining <http://vivoweb.org/ontology/core#relates> ?existingOrg .\n"+ "?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?existingAwardedDegree . \n" +
"?existingAwardedDegree <http://vivoweb.org/ontology/core#assignedBy> ?existingOrg .\n"+
"?existingOrg a ?existingOrgType .\n"+ "?existingOrg a ?existingOrgType .\n"+
"?existingOrgType rdfs:subClassOf <"+ orgClass +"> .\n"+ "?existingOrgType rdfs:subClassOf <"+ orgClass +"> .\n"+
"}"; "}";