diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index 6cc2978d..ecdb73af 100644 --- a/productMods/config/listViewConfig-authorInAuthorship.xml +++ b/productMods/config/listViewConfig-authorInAuthorship.xml @@ -47,7 +47,7 @@ ?editorship core:relates ?editorObj . ?editorObj rdfs:label ?editor } - OPTIONAL { ?infoResource core:partOf ?partOfObj . + OPTIONAL { ?infoResource <http://purl.obolibrary.org/obo/BFO_0000050> ?partOfObj . ?partOfObj rdfs:label ?partOf } OPTIONAL { ?infoResource vitro:mostSpecificType ?subclass } @@ -152,7 +152,7 @@ ?editorship a core:Editorship . ?editorship core:relates ?editorObj . ?editorObj a foaf:Person . - ?infoResource core:partOf ?partOfObj . + ?infoResource <http://purl.obolibrary.org/obo/BFO_0000050> ?partOfObj . ?appearsInObj rdfs:label ?appearsIn . ?publisherObj rdfs:label ?publisher . ?editorObj rdfs:label ?editor . @@ -206,7 +206,7 @@ ?authorship a core:Authorship . ?authorship core:relates ?infoResource . ?infoResource a <http://purl.obolibrary.org/obo/IAO_0000030> . - ?infoResource core:partOf ?partOfObj . + ?infoResource <http://purl.obolibrary.org/obo/BFO_0000050> ?partOfObj . ?partOfObj rdfs:label ?partOf } } diff --git a/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml b/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml index fa6e2804..04b433fd 100644 --- a/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml +++ b/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml @@ -33,12 +33,13 @@ } OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel } OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . @@ -65,7 +66,8 @@ PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?subject ?property ?role . ?role a core:CoPrincipalInvestigatorRole . @@ -73,9 +75,10 @@ ?activity a core:Grant . ?role ?roleProperty ?roleValue . ?activity rdfs:label ?activityLabel . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } WHERE { { @@ -96,14 +99,18 @@ ?role a core:CoPrincipalInvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . + ?awardedBy a foaf:Organization . ?awardedBy rdfs:label ?awardedByLabel } UNION { ?subject ?property ?role . ?role a core:CoPrincipalInvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole a core:AdminsitratorRole. + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy a foaf:Organization . ?adminedBy rdfs:label ?adminedByLabel } } diff --git a/productMods/config/listViewConfig-hasInvestigatorRole.xml b/productMods/config/listViewConfig-hasInvestigatorRole.xml index 0e494ac9..baecbdc1 100644 --- a/productMods/config/listViewConfig-hasInvestigatorRole.xml +++ b/productMods/config/listViewConfig-hasInvestigatorRole.xml @@ -34,12 +34,13 @@ } OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel } OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . @@ -67,7 +68,8 @@ PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?subject ?property ?role . ?role a core:InvestigatorRole . @@ -75,9 +77,10 @@ ?activity a core:Grant . ?role ?roleProperty ?roleValue . ?activity rdfs:label ?activityLabel . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } WHERE { { @@ -98,14 +101,18 @@ ?role a core:InvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . + ?awardedBy a foaf:Organization . ?awardedBy rdfs:label ?awardedByLabel } UNION { ?subject ?property ?role . ?role a core:InvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole a core:AdminsitratorRole. + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy a foaf:Organization . ?adminedBy rdfs:label ?adminedByLabel } } diff --git a/productMods/config/listViewConfig-hasPresenterRole.xml b/productMods/config/listViewConfig-hasPresenterRole.xml index 6b799937..88be9a91 100644 --- a/productMods/config/listViewConfig-hasPresenterRole.xml +++ b/productMods/config/listViewConfig-hasPresenterRole.xml @@ -52,16 +52,16 @@ } OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . ?presentation a vivo:Presentation . - ?presentation vivo:inEventWithin ?series . - ?series vivo:seriesForEvent ?presentation . + ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?series rdfs:label ?seriesLabel } OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . ?presentation a vivo:Presentation . ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . - ?workshop vivo:inEventSeries ?series . - ?series vivo:seriesForEvent ?workshop . + ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . ?series rdfs:label ?seriesLabel } @@ -200,8 +200,8 @@ ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . ?presentation a vivo:Presentation . ?series a vivo:EventSeries . - ?presentation vivo:inEventSeries ?series . - ?series vivo:seriesForEvent ?presentation . + ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?series rdfs:label ?seriesLabel } WHERE { @@ -214,8 +214,8 @@ ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . ?presentation a vivo:Presentation . ?series a vivo:EventSeries . - ?presentation vivo:inEventSeries ?series . - ?series vivo:seriesForEvent ?presentation . + ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?series rdfs:label ?seriesLabel } } @@ -234,8 +234,8 @@ ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?workshop a bibo:Workshop . - ?workshop vivo:inEventSeries ?series . - ?series vivo:seriesForEvent ?workshop . + ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . ?series a vivo:EventSeries . ?series rdfs:label ?seriesLabel } WHERE { @@ -250,8 +250,8 @@ ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?workshop a bibo:Workshop . - ?workshop vivo:inEventSeries ?series . - ?series vivo:seriesForEvent ?workshop . + ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . ?series a vivo:EventSeries . ?series rdfs:label ?seriesLabel } diff --git a/productMods/config/listViewConfig-hasPrincipalInvestigatorRole.xml b/productMods/config/listViewConfig-hasPrincipalInvestigatorRole.xml index 023a1765..71a0c8f9 100644 --- a/productMods/config/listViewConfig-hasPrincipalInvestigatorRole.xml +++ b/productMods/config/listViewConfig-hasPrincipalInvestigatorRole.xml @@ -33,12 +33,13 @@ } OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel } OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . @@ -65,7 +66,8 @@ PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?subject ?property ?role . ?role a core:PrincipalInvestigatorRole . @@ -73,9 +75,10 @@ ?activity a core:Grant . ?role ?roleProperty ?roleValue . ?activity rdfs:label ?activityLabel . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } WHERE { { @@ -96,14 +99,18 @@ ?role a core:PrincipalInvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:grantAwardedBy ?awardedBy . + ?activity core:assignedBy ?awardedBy . + ?awardedBy a foaf:Organization . ?awardedBy rdfs:label ?awardedByLabel } UNION { ?subject ?property ?role . ?role a core:PrincipalInvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . ?activity a core:Grant . - ?activity core:administeredBy ?adminedBy . + ?activity core:relates ?adminedByRole . + ?adminedByRole a core:AdminsitratorRole. + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy a foaf:Organization . ?adminedBy rdfs:label ?adminedByLabel } } diff --git a/productMods/config/listViewConfig-organizationForTraining.xml b/productMods/config/listViewConfig-organizationForTraining.xml index 43ba280b..9530b30c 100644 --- a/productMods/config/listViewConfig-organizationForTraining.xml +++ b/productMods/config/listViewConfig-organizationForTraining.xml @@ -1,146 +1,199 @@ - - - - - - - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> - PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - - SELECT DISTINCT ?subclass - ?localName - ?training - ?person - ?personName - ?degree - ?degreeName - ?degreeAbbr - ?field - ?suppInfo - ?dateTimeStart ?dateTimeEnd - WHERE { - ?subject ?property ?training - LET ( ?localName := afn:localname(?training) ) - OPTIONAL { ?training core:educationalTrainingOf ?person - OPTIONAL { ?person rdfs:label ?personName } - } - OPTIONAL { ?training core:degreeEarned ?degree - OPTIONAL { ?degree rdfs:label ?degreeName } - OPTIONAL { ?degree core:abbreviation ?degreeAbbr } - } - - OPTIONAL { ?training vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf core:EducationalTraining - } - - - OPTIONAL { ?training rdfs:label ?trainingLabel } - OPTIONAL { ?training core:majorField ?field } - OPTIONAL { ?training core:supplementalInformation ?suppInfo } - OPTIONAL { ?training core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } - } - - FILTER ( bound(?person) ) - - } ORDER BY ?subclass ?personName - - - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> - CONSTRUCT { - ?subject ?property ?training . - ?training vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf core:EducationalTraining - } WHERE { - ?subject ?property ?training . - ?training vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf core:EducationalTraining - } - - - - PREFIX core: <http://vivoweb.org/ontology/core#> - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - CONSTRUCT { - ?subject ?property ?training . - ?training ?trainingProperty ?trainingValue . - ?person rdfs:label ?personName - } WHERE { - { - ?subject ?property ?training - } UNION { - ?subject ?property ?training . - ?training ?trainingProperty ?trainingValue - } UNION { - ?subject ?property ?training . - ?training core:educationalTrainingOf ?person . - ?person rdfs:label ?personName - } - } - - - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX core: <http://vivoweb.org/ontology/core#> - - CONSTRUCT { - ?degree rdfs:label ?degreeName . - ?degree core:abbreviation ?degreeAbbr - } WHERE { - { - ?subject ?property ?training . - ?training core:degreeEarned ?degree . - ?degree rdfs:label ?degreeName - } UNION { - ?subject ?property ?training . - ?training core:degreeEarned ?degree . - ?degree core:abbreviation ?degreeAbbr - } - } - - - - PREFIX core: <http://vivoweb.org/ontology/core#> - CONSTRUCT { - ?subject ?property ?position . - ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } WHERE { - ?subject ?property ?position . - ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - - - - PREFIX core: <http://vivoweb.org/ontology/core#> - CONSTRUCT { - ?subject ?property ?position . - ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } WHERE { - ?subject ?property ?position . - ?position core:dateTimeInterval ?dateTimeInterval . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } - - - - + + + + + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + SELECT DISTINCT ?subclass + ?edTraining + ?person ?personName + ?awardedDegree + ?degree + ?degreeName ?degreeAbbr + ?majorField ?info + ?dateTimeStart ?dateTimeEnd + WHERE { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess + OPTIONAL { ?edTraining vitro:mostSpecificType ?subclass . } + OPTIONAL { ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName + } + OPTIONAL { ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree core:abbreviation ?degreeAbbr + } + OPTIONAL { ?edTraining <http://purl.obolibrary.org/obo/RO_0000057> ?person . + ?person a foaf:Person . + ?person rdfs:label ?personName + } + OPTIONAL { ?edTraining core:majorField ?majorField } + OPTIONAL { ?edTraining core:supplementalInformation ?info } + OPTIONAL { ?edTraining core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?edTraining core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?edTraining vitro:mostSpecificType ?subclass + } WHERE { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining vitro:mostSpecificType ?subclass . + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining ?edTrainingProp ?edTrainingValue . + ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?edTraining core:dateTimeInterval ?dateTimeInterval + } WHERE { + { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess + } + UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining ?edTrainingProp ?edTrainingValue + } + UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + } + UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree + } + UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining core:dateTimeInterval ?dateTimeInterval + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + + CONSTRUCT { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining ?edTrainingProp ?edTrainingValue . + ?edTraining <http://purl.obolibrary.org/obo/RO_0000057> ?person . + ?person a foaf:Person . + ?person rdfs:label ?personName + } WHERE { + { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess + } + UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining ?edTrainingProp ?edTrainingValue + } + UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining <http://purl.obolibrary.org/obo/RO_0000057> ?person . + ?person a foaf:Person . + ?person rdfs:label ?personName + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName . + ?degree core:abbreviation ?degreeAbbr + } WHERE { + { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree rdfs:label ?degreeName + } UNION { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . + ?degree core:abbreviation ?degreeAbbr + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart . + } WHERE { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart . + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?edTraining . + ?edTraining a core:EducationalProcess . + ?edTraining core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index 175973b6..fa9f6b17 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -3,8 +3,6 @@ - diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-adviseeIn.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-adviseeIn.ftl index 780765d4..f0fc41b8 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-adviseeIn.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-adviseeIn.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#mailingAddress. +<#-- Custom object property statement view for faux property "advisee of". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-advisorIn.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-advisorIn.ftl index 341c3299..88e310c0 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-advisorIn.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-advisorIn.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#mailingAddress. +<#-- Custom object property statement view for faux property "advisees". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl index b8cd6c1c..52638212 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#authorInAuthorship. +<#-- Custom object property statement view for faux property "selected publications". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl index 9c61e94a..6f4943e9 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-awardOrHonor.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#awardOrHonor. +<#-- Custom object property statement view for faux property "awards and honors". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl index 2f2f4bda..1e04bde5 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-editorship.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#authorInEditorship. +<#-- Custom object property statement view for faux property "editor of". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl index 3521a717..d81062bd 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#educationalTraining. +<#-- Custom object property statement view for faux property "education and training". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasAttendeeRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasAttendeeRole.ftl index 0c948b3e..9035f684 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasAttendeeRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasAttendeeRole.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#hasAttendeeRole. +<#-- Custom object property statement view for faux property "attended". See the PropertyConfig.3 file for details.. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl index 6ead71df..74ef1621 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasEditReviewRole.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for core:hasEditorRole and core:hasReviewerRole. +<#-- Custom object property statement view for faux property "reviewer of". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl index d458c4dd..84de10ae 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasInvestigatorRole.ftl @@ -1,6 +1,7 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#hasRole and its child properties. +<#-- Custom object property statement view for faux property "investigator on," "principal investigator on" and + "co-principal investigator on." See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl index bfc1e92d..c1068d2d 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasPresenterRole.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#hasPresenterRole. +<#-- Custom object property statement view for faux property "presentations". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl index fca3b9dd..c89de407 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -1,6 +1,7 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#hasRole and its child properties. +<#-- Custom object property statement view for the roleRealizedIn, roleContributesTo, researchActivities, hasRole + and hasClinicalActivities custom list views. See those list view and the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl index 06978922..df612dfe 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#informationResourceInAuthorship. +<#-- Custom object property statement view for faux property "authors". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInEditorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInEditorship.ftl index 3d6c16e3..93bb908d 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInEditorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInEditorship.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#informationResourceInAuthorship. +<#-- Custom object property statement view for faux property "editors". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl index 5b18d090..6375a22f 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#mailingAddress. +<#-- Custom object property statement view for faux property "mailing address". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl index d5719b82..3d877560 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#organizationForPosition. +<#-- Custom object property statement view for faux property "people". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl index 4ad826c2..ce7ddb2a 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#organizationForPosition. +<#-- Custom object property statement view for faux property "organization for training". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. @@ -24,13 +24,15 @@ <#local detailedInfo> <#if statement.degree??> - ${statement.degreeAbbr!} ${i18n().in} ${statement.field!} - <#elseif statement.field??> - ${statement.field!}, ${statement.suppInfo!} + ${statement.degreeAbbr!} <#if statement.majorField??> ${i18n().in} ${statement.majorField!} + <#elseif statement.majorField??> + ${statement.majorField!}, ${statement.info!} <#else> - ${statement.suppInfo!} + ${statement.info!} - <@s.join [ linkedIndividual, detailedInfo ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + <@s.join [ linkedIndividual, detailedInfo ] /> + + + - \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl index fa0afb41..e6aebc47 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl @@ -1,6 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#personInPosition. +<#-- Custom object property statement view for faux property "positions". See the PropertyConfig.3 file for details. This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl index e11838f0..21187494 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl @@ -1,8 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#relatedRole and - http://vivoweb.org/ontology/core#linkedRole. - +<#-- This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. --> diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl index 9e589c10..3059fd1b 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-researchAreaOf.ftl @@ -1,7 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Custom object property statement view for http://vivoweb.org/ontology/core#organizationForPosition. - +<#-- This template must be self-contained and not rely on other variables set for the individual page, because it is also used to generate the property statement during a deletion. --> diff --git a/productMods/templates/freemarker/edit/forms/addClinicalRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addClinicalRoleToPerson.ftl index affa452e..0599c096 100644 --- a/productMods/templates/freemarker/edit/forms/addClinicalRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addClinicalRoleToPerson.ftl @@ -1,35 +1,35 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#--Two stage form for clinical role--> - -<#-- -Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are: -roleDescriptor. -The other required values (roleType, optionsType, objectClassUri, and literalOptions are -set in the JAVA class corresponding to the form, e.g. AddClinicalRoleToPersonGenerator.java. - -Optional values can be set in Freemarker, but each of these has default values -set in addRoleToPersonTwoStage.ftl: - -buttonText -typeSelectorLabel -numDateFields -roleExamples - -Optional values set in JAVA include -ShowRoleLabelField -ActivityToRolePredicate -RoleToActivityPredicate ---> - - -<#--Variable assignments for Add Clinical Role To Person--> -<#assign roleDescriptor = "${i18n().clinical_activity}" /> -<#assign typeSelectorLabel = "${i18n().clinical_activity_type}" /> -<#assign genericLabel = "${i18n().clinical_activity?capitalize}" /> - -<#assign acMultipleTypes = "'true'" /> -<#assign acTypes = "{activity: 'http://vivoweb.org/ontology/core#Project,http://vivoweb.org/ontology/core#Service'}" /> - - -<#--Each of the two stage forms will include the form below--> +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#--Two stage form for clinical role--> + +<#-- +Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are: +roleDescriptor. +The other required values (roleType, optionsType, objectClassUri, and literalOptions are +set in the JAVA class corresponding to the form, e.g. AddClinicalRoleToPersonGenerator.java. + +Optional values can be set in Freemarker, but each of these has default values +set in addRoleToPersonTwoStage.ftl: + +buttonText +typeSelectorLabel +numDateFields +roleExamples + +Optional values set in JAVA include +ShowRoleLabelField +ActivityToRolePredicate +RoleToActivityPredicate +--> + + +<#--Variable assignments for Add Clinical Role To Person--> +<#assign roleDescriptor = "${i18n().clinical_activity}" /> +<#assign typeSelectorLabel = "${i18n().clinical_activity_type}" /> +<#assign genericLabel = "${i18n().clinical_activity?capitalize}" /> + +<#assign acMultipleTypes = "'true'" /> +<#assign acTypes = "{activity: 'http://vivoweb.org/ontology/core#Project,http://purl.obolibrary.org/obo/ERO_0000005'}" /> + + +<#--Each of the two stage forms will include the form below--> <#include "addRoleToPersonTwoStage.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/edit/forms/js/organizationForTrainingUtils.js b/productMods/templates/freemarker/edit/forms/js/organizationForTrainingUtils.js new file mode 100644 index 00000000..963ffd14 --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/js/organizationForTrainingUtils.js @@ -0,0 +1,95 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +var orgForTrainingUtils = { + + onLoad: function(blankSentinel) { + + this.sentinel = ''; + if ( blankSentinel ) { this.sentinel = blankSentinel; } + + this.initObjectReferences(); + this.bindEventListeners(); + + $.extend(this, vitro.customFormUtils); + $.extend(this, i18nStrings); + + if ( this.findValidationErrors() ) { + this.resetLastNameLabel(); + } + }, + + initObjectReferences: function() { + + this.form = $('#organizationForTraining'); + this.person = $('#person'); + this.fauxLabel = $('#maskLabelBuilding'); + this.firstName = $('#firstName'); + this.lastName = $('#lastName'); + this.personUri = $('#personUri'); + this.aDLabel = $('#awardedDegreeLabel'); + this.degreeSelector = $('#degreeUri'); + + // may not need this + this.firstName.attr('disabled', ''); + + }, + + bindEventListeners: function() { + this.idCache = {}; + + this.form.submit(function() { + orgForTrainingUtils.resolveFirstLastNames(); + + }); + }, + + resolveFirstLastNames: function() { + var firstName, + lastName, + name; + + // If selecting an existing person, don't submit name fields + if (this.personUri.val() == '' || this.personUri.val() == this.sentinel ) { + firstName = this.firstName.val(); + lastName = this.person.val(); + + name = lastName; + + if (firstName) { + name += ', ' + firstName; + } + + // we don't want the user to see the label getting built, so hide the acSelector + // field and display a bogus field that just has the last name in it. + this.fauxLabel.val(lastName); + this.person.hide(); + this.fauxLabel.show(); + this.person.val(name); + this.lastName.val(lastName); + } + else { + this.firstName.attr('disabled', 'disabled'); + this.lastName.attr('disabled', 'disabled'); + } + orgForTrainingUtils.setAwardedDegreeLabel(this.person.val()); + }, + + resetLastNameLabel: function() { + var indx = this.person.val().indexOf(", "); + if ( indx != -1 ) { + var temp = this.person.val().substr(0,indx); + this.person.val(temp); + } + }, + + setAwardedDegreeLabel: function(name) { + var degreeLabel = ""; + if ( name == '' || name == null ) { + degreeLabel = $('span.acSelectionInfo').text() + ": " + this.degreeSelector.find(":selected").text(); + } + else { + degreeLabel = name + ": " + this.degreeSelector.find(":selected").text(); + } + this.aDLabel.val(degreeLabel); + } +} diff --git a/productMods/templates/freemarker/edit/forms/organizationForTraining.ftl b/productMods/templates/freemarker/edit/forms/organizationForTraining.ftl new file mode 100644 index 00000000..b3d6561b --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/organizationForTraining.ftl @@ -0,0 +1,229 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- this is in request.subject.name --> + +<#-- leaving this edit/add mode code in for reference in case we decide we need it --> + +<#import "lib-vivo-form.ftl" as lvf> + +<#assign subjectName=""/> +<#assign roleActivityUri="mysteryRoleActivityURI"/> +<#assign personLabel="mysteryPersonLabel"/> + +<#--Retrieve certain edit configuration information--> +<#assign editMode = editConfiguration.pageData.editMode /> +<#assign htmlForElements = editConfiguration.pageData.htmlForElements /> + +<#--The blank sentinel indicates what value should be put in a URI when no autocomplete result has been selected. +If the blank value is non-null or non-empty, n3 editing for an existing object will remove the original relationship +if nothing is selected for that object--> +<#assign blankSentinel = "" /> +<#if editConfigurationConstants?has_content && editConfigurationConstants?keys?seq_contains("BLANK_SENTINEL")> + <#assign blankSentinel = editConfigurationConstants["BLANK_SENTINEL"] /> + + +<#--This flag is for clearing the label field on submission for an existing object being selected from autocomplete. +Set this flag on the input acUriReceiver where you would like this behavior to occur. --> +<#assign flagClearLabelForExisting = "flagClearLabelForExisting" /> + +<#--Retrieve variables needed--> +<#assign firstNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "firstName")/> +<#assign lastNameValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "lastName") /> +<#assign personLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "personLabel") /> +<#assign personLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "personLabelDisplay") /> +<#assign deptValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "dept") /> +<#assign infoValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "info") /> +<#assign majorFieldValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "majorField") /> +<#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degreeType") /> +<#assign awardedDegreeLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "awardedDegreeLabel") /> +<#assign existingPersonValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingPerson") /> +<#assign trainingTypeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "trainingType")/> + +<#-- If edit submission exists, then retrieve validation errors if they exist--> +<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content> + <#assign submissionErrors = editSubmission.validationErrors/> + + +<#if editMode == "edit" || editMode == "repair"> + <#assign titleVerb="${i18n().edit_capitalized}"> + <#assign submitButtonText="${i18n().save_changes}"> + <#assign disabledVal="disabled"> +<#else> + <#assign titleVerb="${i18n().create_capitalized}"> + <#assign submitButtonText="${i18n().create_entry}"> + <#assign disabledVal=""/> + + +<#assign requiredHint = " *" /> +<#assign yearHint = "(${i18n().year_hint_format})" /> + + +

${titleVerb} ${i18n().educational_training_for} ${editConfiguration.subjectName}

+ +<#--Display error messages if any--> +<#if submissionErrors?has_content> + <#if personLabelDisplayValue?has_content > + <#assign personLabelValue = personLabelDisplayValue /> + + + + +<@lvf.unsupportedBrowser urls.base /> + +
+ +
+ +

+ + + +
+ + +

+ +
+

+ + + (${i18n().verify_match_capitalized} ${i18n().or} + ${i18n().change_selection}) +

+ +
+ + <#assign trainingTypeOpts = editConfiguration.pageData.trainingType /> + +

+ + +

+ +
+ + + <#assign degreeOpts = editConfiguration.pageData.degreeType /> + + +
+ +

+ + +

+ +

+ + + +

+

+ <#--Need to draw edit elements for dates here--> + <#if htmlForElements?keys?seq_contains("startField")> + + ${htmlForElements["startField"]} ${yearHint} + +

+ <#if htmlForElements?keys?seq_contains("endField")> + + ${htmlForElements["endField"]} ${yearHint} + + + <#--End draw elements--> + +

+ ${i18n().or} + ${i18n().cancel_link} +

+ +

* ${i18n().required_fields}

+ +
+ + + + +
+ +${stylesheets.add('')} +${stylesheets.add('')} +${stylesheets.add('')} + + +${scripts.add('', + '', + '', + '', + '', + '', + '')} + + diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index f92b8f4e..3acff04c 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -319,6 +319,21 @@ local:educationalTrainingConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEducationalTraining"^^ ; :propertyGroup . +local:organizationForTrainingContext a :ConfigContext ; + :hasConfiguration local:organizationForTrainingConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:organizationForTrainingConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-organizationForTraining.xml"^^xsd:string ; + :displayName "organization for training" ; + vitro:displayRankAnnot 1; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.OrganizationForTrainingGenerator"^^ ; + :propertyGroup . + local:adviseeRoleContext a :ConfigContext ; :hasConfiguration local:adviseeRoleConfig ; :configContextFor ; @@ -556,14 +571,14 @@ local:primaryEmailConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEmailGenerator"^^ ; :propertyGroup . -local:webpageContext a :ConfigContext ; - :hasConfiguration local:webpageConfig ; +local:webpagePersonContext a :ConfigContext ; + :hasConfiguration local:webpagePersonConfig ; :configContextFor ; :qualifiedByDomain ; :qualifiedByRoot ; :qualifiedBy . -local:webpageConfig a :ObjectPropertyDisplayConfig ; +local:webpagePersonConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ; :displayName "webpage" ; vitro:displayRankAnnot 40; @@ -572,14 +587,46 @@ local:webpageConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator"^^ ; :propertyGroup . -local:webpageContext a :ConfigContext ; - :hasConfiguration local:webpageConfig ; +local:webpageOrgContext a :ConfigContext ; + :hasConfiguration local:webpageOrgConfig ; :configContextFor ; :qualifiedByDomain ; :qualifiedByRoot ; :qualifiedBy . -local:webpageConfig a :ObjectPropertyDisplayConfig ; +local:webpageOrgConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ; + :displayName "webpage" ; + vitro:displayRankAnnot 40; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator"^^ ; + :propertyGroup . + +local:webpageInfoContext a :ConfigContext ; + :hasConfiguration local:webpageInfoConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedByRoot ; + :qualifiedBy . + +local:webpageInfoConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ; + :displayName "webpage" ; + vitro:displayRankAnnot 40; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.ManageWebpagesForIndividualGenerator"^^ ; + :propertyGroup . + +local:webpageEventContext a :ConfigContext ; + :hasConfiguration local:webpageEventConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedByRoot ; + :qualifiedBy . + +local:webpageEventConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ; :displayName "webpage" ; vitro:displayRankAnnot 40; diff --git a/rdf/display/everytime/vivoListViewConfig.rdf b/rdf/display/everytime/vivoListViewConfig.rdf index 5edf3469..d085c9b2 100644 --- a/rdf/display/everytime/vivoListViewConfig.rdf +++ b/rdf/display/everytime/vivoListViewConfig.rdf @@ -15,45 +15,6 @@ xmlns:rdfs="&rdfs;" xmlns:vitro="&vitro;"> - - listViewConfig-authorInAuthorship.xml - - - - listViewConfig-educationalTraining.xml - - - - listViewConfig-informationResourceInAuthorship.xml - - - - listViewConfig-personInPosition.xml - - - - listViewConfig-organizationForPosition.xml - - - - listViewConfig-organizationForTraining.xml - - - - listViewConfig-mailingAddress.xml - - - - listViewConfig-awardOrHonor.xml - - - listViewConfig-advisorIn.xml - - - - listViewConfig-hasRole.xml - - listViewConfig-researchAreaOf.xml diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java index b753bc0e..0ac4d3a7 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddEditWebpageFormGenerator.java @@ -31,17 +31,6 @@ Custom form for adding or editing a webpage associated with an individual. The p ManageWebpagesForIndividual, should forward to this page if: (a) we are adding a new page, or (b) an edit link in the Manage Webpages view has been clicked. But right now (a) is not implemented. -Object properties: -core:webpage (range: core:URLLink) -core:webpageOf (domain: core:URLLink) (inverse of core:webpage) - -Class: -core:URLLink - the link to be added to the individual - -Data properties of core:URLLink: -core:linkUrlPredicate -core:linkAnchorText -core:rank */ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java index 8a8bfc08..1a94e2d8 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java @@ -39,12 +39,6 @@ import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; * Custom form for adding a grant to an person for the predicates hasCo-PrincipalInvestigatorRole and hasPrincipalInvestigatorRole. -This is intended to create a set of statements like: - -?person core:hasPrincipalInvestigatorRole ?newRole. -?newRole rdf:type core:PrincipalInvestigatorRole ; - core:relatedRole ?someGrant . - * */ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator { @@ -664,12 +658,12 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator //Some values will have a default value //grantToRolePredicate public String getDefaultgrantToRolePredicate() { - return "http://vivoweb.org/ontology/core#relatedRole"; + return "http://vivoweb.org/ontology/core#relates"; } //roleToGrantPredicate public String getDefaultroleToGrantPredicate() { - return "http://vivoweb.org/ontology/core#roleIn"; + return "http://purl.obolibrary.org/obo/BFO_0000054"; } diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java index 59377190..d5eaf054 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddPublicationToPersonGenerator.java @@ -351,28 +351,28 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri <" + presentedAtPred + "> ?newConference . \n" + "?newConference a <" + conferenceClass + "> . \n" + - "?newConference vivo:includesEvent ?pubUri . \n" + + "?newConference ?pubUri . \n" + "?newConference <" + label + "> ?conference ."; } private String getN3ForConference() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?pubUri <" + presentedAtPred + "> ?conferenceUri . \n" + - "?conferenceUri vivo:includesEvent ?pubUri . "; + "?conferenceUri ?pubUri . "; } private String getN3ForNewConferenceNewPub() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication <" + presentedAtPred + "> ?newConference . \n" + "?newConference a <" + conferenceClass + "> . \n" + - "?newConference vivo:includesEvent ?newPublication . \n" + + "?newConference ?newPublication . \n" + "?newConference <" + label + "> ?conference ."; } private String getN3ForConferenceNewPub() { return "@prefix vivo: <" + vivoCore + "> . \n" + "?newPublication <" + presentedAtPred + "> ?conferenceUri . \n" + - "?conferenceUri vivo:includesEvent ?newPublication . "; + "?conferenceUri ?newPublication . "; } private String getN3ForNewEvent() { @@ -911,7 +911,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement literalOptions.add(list("http://purl.org/ontology/bibo/Report", "Report")); literalOptions.add(list("http://vivoweb.org/ontology/core#ResearchProposal", "Research Proposal")); literalOptions.add(list("http://vivoweb.org/ontology/core#Review", "Review")); - literalOptions.add(list("http://vivoweb.org/ontology/core#Software", "Software")); + literalOptions.add(list("http://purl.obolibrary.org/obo/ERO_0000071 ", "Software")); literalOptions.add(list("http://vivoweb.org/ontology/core#Speech", "Speech")); literalOptions.add(list("http://purl.org/ontology/bibo/Thesis", "Thesis")); literalOptions.add(list("http://vivoweb.org/ontology/core#Video", "Video")); @@ -941,7 +941,7 @@ public class AddPublicationToPersonGenerator extends VivoBaseGenerator implement } public EditMode getEditMode(VitroRequest vreq) { - return EditModeUtils.getEditMode(vreq, list("http://vivoweb.org/ontology/core#linkedInformationResource")); + return EditModeUtils.getEditMode(vreq, list("http://vivoweb.org/ontology/core#relates")); } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java new file mode 100644 index 00000000..b4f6c604 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java @@ -0,0 +1,388 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import javax.servlet.http.HttpSession; + +import com.hp.hpl.jena.vocabulary.XSD; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeIntervalValidationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.DateTimeWithPrecisionVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesWithParent; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaVClassOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; +import edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode; +import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; + +public class OrganizationForTrainingGenerator extends VivoBaseGenerator implements EditConfigurationGenerator{ + + //TODO: can we get rid of the session and get it form the vreq? + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { + + EditConfigurationVTwo conf = new EditConfigurationVTwo(); + + initBasics(conf, vreq); + initPropertyParameters(vreq, session, conf); + initObjectPropForm(conf, vreq); + + conf.setTemplate("organizationForTraining.ftl"); + + conf.setVarNameForSubject("organization"); + conf.setVarNameForPredicate("predicate"); + conf.setVarNameForObject("edTraining"); + + conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); + conf.setN3Optional(Arrays.asList( majorFieldAssertion, n3ForAwardedDegree, n3ForNewPersonanization, n3ForExistingPersonanization, + n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, n3ForEnd )); + + conf.addNewResource("edTraining", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("awardedDegree",DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("newPerson",DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("intervalNode",DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("startNode",DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("endNode",DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("vcardPerson", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE); + + //uris in scope: none + //literals in scope: none + + conf.setUrisOnform( Arrays.asList( "existingPerson", "personType", "degreeType", "trainingType")); + conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "awardedDegreeLabel", + "majorField", "dept", "info", "firstName", "lastName")); + + conf.addSparqlForExistingLiteral("personLabel", personLabelQuery); + conf.addSparqlForExistingLiteral("majorField", majorFieldQuery); + conf.addSparqlForExistingLiteral("dept", deptQuery); + conf.addSparqlForExistingLiteral("info", infoQuery); + conf.addSparqlForExistingLiteral("startField-value", existingStartDateQuery); + conf.addSparqlForExistingLiteral("endField-value", existingEndDateQuery); + + + conf.addSparqlForExistingUris("awardedDegree", existingAwardedDegreeQuery); + conf.addSparqlForExistingUris("existingPerson", existingPersonQuery); +// conf.addSparqlForExistingUris("personType", personTypeQuery); + conf.addSparqlForExistingUris("trainingType", trainingTypeQuery); + conf.addSparqlForExistingUris("degreeType", degreeTypeQuery); + conf.addSparqlForExistingUris("intervalNode",existingIntervalNodeQuery); + conf.addSparqlForExistingUris("startNode", existingStartNodeQuery); + conf.addSparqlForExistingUris("endNode", existingEndNodeQuery); + conf.addSparqlForExistingUris("startField-precision", existingStartPrecisionQuery); + conf.addSparqlForExistingUris("endField-precision", existingEndPrecisionQuery); + //Add sparql to include inverse property as well + conf.addSparqlForAdditionalUrisInScope("inverseTrainingAtPerson", inverseTrainingAtPersonQuery); + + conf.addField( new FieldVTwo(). + setName("degreeType"). + setOptions( new IndividualsViaVClassOptions( + degreeTypeClass))); + + conf.addField( new FieldVTwo(). + setName("majorField"). + setRangeDatatypeUri( XSD.xstring.toString() ). + setValidators(list("datatype:" + XSD.xstring.toString()))); + + conf.addField( new FieldVTwo(). + setName("existingPerson") + //options will be added in browser by auto complete JS + ); + + conf.addField( new FieldVTwo(). + setName("awardedDegree") + //options will be added in browser by auto complete JS + ); + + conf.addField( new FieldVTwo(). + setName("personLabel"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()))); + + conf.addField( new FieldVTwo(). + setName("awardedDegreeLabel"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()))); + + conf.addField( new FieldVTwo(). + setName("existingAwardedDegreeLabel"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()))); + + conf.addField( new FieldVTwo(). + setName("personLabelDisplay"). + setRangeDatatypeUri(XSD.xstring.toString() )); + + conf.addField( new FieldVTwo(). + setName("firstName"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()) ) + ); + + conf.addField( new FieldVTwo(). + setName("lastName"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()) ) + ); + + conf.addField( new FieldVTwo(). + setName("trainingType"). + setValidators( list("nonempty") ). + setOptions( + new ChildVClassesWithParent(edProcessClass))); + + conf.addField( new FieldVTwo(). + setName("dept"). + setRangeDatatypeUri( XSD.xstring.toString() ). + setValidators(list("datatype:" + XSD.xstring.toString()))); + + conf.addField( new FieldVTwo(). + setName("info"). + setRangeDatatypeUri( XSD.xstring.toString() ). + setValidators(list("datatype:" + XSD.xstring.toString()))); + + FieldVTwo startField = new FieldVTwo(). + setName("startField"); + conf.addField(startField. + setEditElement( + new DateTimeWithPrecisionVTwo(startField, + VitroVocabulary.Precision.YEAR.uri(), + VitroVocabulary.Precision.NONE.uri()))); + + FieldVTwo endField = new FieldVTwo(). + setName("endField"); + conf.addField( endField. + setEditElement( + new DateTimeWithPrecisionVTwo(endField, + VitroVocabulary.Precision.YEAR.uri(), + VitroVocabulary.Precision.NONE.uri()))); + //Add validator + conf.addValidator(new DateTimeIntervalValidationVTwo("startField","endField")); + conf.addValidator(new AntiXssValidation()); + + //Adding additional data, specifically edit mode + addFormSpecificData(conf, vreq); + prepare(vreq, conf); + return conf; + } + + /* N3 assertions for working with educational training */ + + final static String n3ForNewEdTraining = + "@prefix core: <"+ vivoCore +"> .\n"+ + "?organization ?edTraining .\n" + + "?edTraining a core:EducationalProcess .\n" + + "?edTraining ?organization ."; + + final static String trainingTypeAssertion = + "?edTraining a ?trainingType ."; + + final static String n3ForAwardedDegree = + "@prefix core: <"+ vivoCore +"> .\n"+ + "?edTraining ?awardedDegree . \n" + + "?awardedDegree ?edTraining . \n" + + "?awardedDegree ?organization . \n" + + "?organization ?awardedDegree . \n" + + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + + "?awardedDegree ?degreeType .\n"+ + "?degreeType ?awardedDegree . \n"+ + "?awardedDegree a core:AwardedDegree ."; + + final static String n3ForNewPersonanization = + "?edTraining ?newPerson . \n" + + "?newPerson ?edTraining . \n" + + "?newPerson a . \n" + + "?newPerson <"+ label +"> ?personLabel . "; + + final static String n3ForExistingPersonanization = + "?edTraining ?existingPerson . \n" + + "?existingPerson ?edTraining . \n" + + "?existingPerson a ?personType . "; + + final static String n3ForNewPersonAwardedDegree = + "?awardedDegree ?newPerson . \n" + + "?newPerson ?awardedDegree . \n" + + "?newPerson a . \n" + + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + + "?newPerson <"+ label +"> ?personLabel . "; + + final static String firstNameAssertion = + "@prefix vcard: . \n" + + "?newPerson ?vcardPerson . \n" + + "?vcardPerson ?newPerson . \n" + + "?vcardPerson a . \n" + + "?vcardPerson vcard:hasName ?vcardName . \n" + + "?vcardName a . \n" + + "?vcardName vcard:givenName ?firstName ."; + + final static String lastNameAssertion = + "@prefix vcard: . \n" + + "?newPerson ?vcardPerson . \n" + + "?vcardPerson ?newPerson . \n" + + "?vcardPerson a . \n" + + "?vcardPerson vcard:hasName ?vcardName . \n" + + "?vcardName a . \n" + + "?vcardName vcard:familyName ?lastName ."; + + final static String n3ForExistingPersonAwardedDegree = + "?awardedDegree ?existingPerson . \n" + + "?existingPerson ?awardedDegree . \n" + + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + + "?existingPerson a . "; + + final static String majorFieldAssertion = + "?edTraining <"+ majorFieldPred +"> ?majorField ."; + + final static String n3ForStart = + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToStart +"> ?startNode .\n"+ + "?startNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ + "?startNode <"+ dateTimeValue +"> ?startField-value .\n"+ + "?startNode <"+ dateTimePrecision +"> ?startField-precision ."; + + final static String n3ForEnd = + "?edTraining <"+ toInterval +"> ?intervalNode . \n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToEnd +"> ?endNode .\n"+ + "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ + "?endNode <"+ dateTimeValue +"> ?endField-value .\n"+ + "?endNode <"+ dateTimePrecision +"> ?endField-precision ."; + + final static String deptAssertion = + "?edTraining <"+ deptPred +"> ?dept ."; + + final static String infoAssertion = + "?edTraining <"+ infoPred +"> ?info ."; + + /* Queries for editing an existing educational training entry */ + + final static String existingAwardedDegreeQuery = + "SELECT ?existingAwardedDegree WHERE {\n"+ + "?edTraining ?existingAwardedDegree . }\n"; + + final static String existingAwardedDegreeLabelQuery = + "SELECT ?existingAwardedDegreeLabel WHERE {\n"+ + "?edTraining ?existingAwardedDegree . \n" + + "?existingAwardedDegree <"+ label +"> ?existingAwardedDegreeLabel }\n"; + + final static String existingPersonQuery = + "PREFIX rdfs: <"+ rdfs +"> \n"+ + "SELECT ?existingPerson WHERE {\n"+ + "?edTraining ?existingPerson . \n" + + "?existingPerson ?edTraining . \n" + + "?existingPerson a . \n " + + " }"; + + final static String personLabelQuery = + "PREFIX rdfs: <"+ rdfs +"> \n"+ + "SELECT ?existingPersonLabel WHERE {\n"+ + "?edTraining ?existingPerson . \n" + + "?existingPerson ?edTraining .\n"+ + "?existingPerson <"+ label +"> ?existingPersonLabel .\n"+ + "?existingPerson a . \n " + + " }"; + + final static String trainingTypeQuery = + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + + "SELECT ?existingTrainingType WHERE { \n" + + " ?edTraining vitro:mostSpecificType ?existingTrainingType . }"; + + final static String degreeTypeQuery = + "PREFIX core: <"+ vivoCore +"> \n"+ + "SELECT ?existingDegreeType WHERE {\n"+ + "?edTraining ?existingAwardedDegree . \n"+ + "?existingAwardedDegree a core:AwardedDegree . \n"+ + "?existingAwardedDegree core:relates ?existingDegreeType . \n" + + "?existingDegreeType a core:AcademicDegree }"; + + final static String majorFieldQuery = + "SELECT ?existingMajorField WHERE {\n"+ + "?edTraining <"+ majorFieldPred +"> ?existingMajorField . }"; + + final static String deptQuery = + "SELECT ?existingDept WHERE {\n"+ + "?edTraining <"+ deptPred +"> ?existingDept . }"; + + final static String infoQuery = + "SELECT ?existingInfo WHERE {\n"+ + "?edTraining <"+ infoPred +"> ?existingInfo . }"; + + final static String existingIntervalNodeQuery = + "SELECT ?existingIntervalNode WHERE {\n"+ + "?edTraining <"+ toInterval +"> ?existingIntervalNode .\n"+ + "?existingIntervalNode <"+ type +"> <"+ intervalType +"> . }"; + + final static String existingStartNodeQuery = + "SELECT ?existingStartNode WHERE {\n"+ + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToStart +"> ?existingStartNode . \n"+ + "?existingStartNode <"+ type +"> <"+ dateTimeValueType +"> .}"; + + final static String existingStartDateQuery = + "SELECT ?existingDateStart WHERE {\n"+ + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToStart +"> ?startNode .\n"+ + "?startNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ + "?startNode <"+ dateTimeValue +"> ?existingDateStart . }"; + + final static String existingStartPrecisionQuery = + "SELECT ?existingStartPrecision WHERE {\n"+ + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToStart +"> ?startNode .\n"+ + "?startNode <"+ type +"> <"+ dateTimeValueType +"> . \n"+ + "?startNode <"+ dateTimePrecision +"> ?existingStartPrecision . }"; + + final static String existingEndNodeQuery = + "SELECT ?existingEndNode WHERE { \n"+ + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToEnd +"> ?existingEndNode . \n"+ + "?existingEndNode <"+ type +"> <"+ dateTimeValueType +"> .}"; + + final static String existingEndDateQuery = + "SELECT ?existingEndDate WHERE {\n"+ + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToEnd +"> ?endNode .\n"+ + "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ + "?endNode <"+ dateTimeValue +"> ?existingEndDate . }"; + + final static String existingEndPrecisionQuery = + "SELECT ?existingEndPrecision WHERE {\n"+ + "?edTraining <"+ toInterval +"> ?intervalNode .\n"+ + "?intervalNode <"+ type +"> <"+ intervalType +"> .\n"+ + "?intervalNode <"+ intervalToEnd +"> ?endNode .\n"+ + "?endNode <"+ type +"> <"+ dateTimeValueType +"> .\n"+ + "?endNode <"+ dateTimePrecision +"> ?existingEndPrecision . }"; + + //Query for inverse property + final static String inverseTrainingAtPersonQuery = + "PREFIX owl: " + + " SELECT ?inverseTrainingAtPerson " + + " WHERE { ?inverseTrainingAtPerson owl:inverseOf . } "; + + + //Adding form specific data such as edit mode + public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap formSpecificData = new HashMap(); + formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); + editConfiguration.setFormSpecificData(formSpecificData); + } + + public EditMode getEditMode(VitroRequest vreq) { + List predicates = new ArrayList(); + predicates.add("http://vivoweb.person/ontology/core#relates"); + return EditModeUtils.getEditMode(vreq, predicates); + } +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java index 6e91629a..6ff53e79 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasEducationalTraining.java @@ -27,46 +27,24 @@ import edu.cornell.mannlib.vitro.webapp.utils.generators.EditModeUtils; Form for adding an educational attainment to an individual Classes: - core:EducationalTraining - primary new individual being created + core:EducationalProcess - primary new individual being created foaf:Person - existing individual foaf:Organization - new or existing individual - core:AcademicdegreeType - existing individual + core:AcademicDegree - existing individual + core:AwardedDegree - new or existing individual - Data properties of EducationalTraining: - core:majorField - core:departmentOrSchool - core:supplementalInformation - - Object properties (domain : range) - - core:educationalTraining (Person : EducationalTraining) - inverse of core:educationalTrainingOf - core:educationalTrainingOf (EducationalTraining : Person) - inverse of core:educationalTraining - - core:degreeTypeEarned (EducationalTraining : AcademicdegreeType) - inverse of core:degreeTypeOutcomeOf - core:degreeTypeOutcomeOf (AcademicdegreeType : EducationalTraining) - inverse of core:degreeTypeEarned - - core:organizationGrantingdegreeType (EducationalTraining : Organization) - no inverse - - Future version - -------------- - Classes: - core:DateTimeValue - core:DateTimeValuePrecision - Object properties: - core:dateTimeValue (EducationalTraining : DateTimeValue) - core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision) There are 4 modes that this form can be in: 1. Add, there is a subject and a predicate but no position and nothing else. 2. normal edit where everything should already be filled out. There is a subject, a object and an individual on - the other end of the object's core:trainingAtOrganization stmt. + the other end of the object's relationship. 3. Repair a bad role node. There is a subject, prediate and object but there is no individual on the - other end of the object's core:trainingAtOrganization stmt. This should be similar to an add but the form should be expanded. + other end of the object's relationship. This should be similar to an add but the form should be expanded. - 4. Really bad node. multiple core:trainingAtOrganization statements. + 4. Really bad node. multiple statements on the other end of the object's relationship. * @author bdc34 * diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java index 3ec5ea23..85fd35f1 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java @@ -68,7 +68,7 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { String filterRule = "?predicate = j.2:mainImage " - + "|| ?predicate = core:preferredTitle " +// + "|| ?predicate = core:preferredTitle " + "|| ?predicate = rdfs:label"; QueryRunner profileQueryHandler =