From bd14d1543185e461f5d85a4edd425aa7f8d32978 Mon Sep 17 00:00:00 2001 From: tworrall Date: Sun, 3 Nov 2013 17:18:17 -0500 Subject: [PATCH 01/40] VIVO-481, VIVO-477, VIVO-475 and VIVO-471 --- .../listViewConfig-authorInAuthorship.xml | 6 +- ...wConfig-hasCoPrincipalInvestigatorRole.xml | 21 +- .../listViewConfig-hasInvestigatorRole.xml | 21 +- .../listViewConfig-hasPresenterRole.xml | 24 +- ...iewConfig-hasPrincipalInvestigatorRole.xml | 21 +- ...listViewConfig-organizationForTraining.xml | 345 +++++++++------- .../config/listViewConfig-relatedRole.xml | 2 - .../individual/propStatement-adviseeIn.ftl | 2 +- .../individual/propStatement-advisorIn.ftl | 2 +- .../propStatement-authorInAuthorship.ftl | 2 +- .../individual/propStatement-awardOrHonor.ftl | 2 +- .../individual/propStatement-editorship.ftl | 2 +- .../propStatement-educationalTraining.ftl | 2 +- .../propStatement-hasAttendeeRole.ftl | 2 +- .../propStatement-hasEditReviewRole.ftl | 2 +- .../propStatement-hasInvestigatorRole.ftl | 3 +- .../propStatement-hasPresenterRole.ftl | 2 +- .../individual/propStatement-hasRole.ftl | 3 +- ...tement-informationResourceInAuthorship.ftl | 2 +- ...tement-informationResourceInEditorship.ftl | 2 +- .../propStatement-mailingAddress.ftl | 2 +- .../propStatement-organizationForPosition.ftl | 2 +- .../propStatement-organizationForTraining.ftl | 16 +- .../propStatement-personInPosition.ftl | 2 +- .../individual/propStatement-relatedRole.ftl | 4 +- .../propStatement-researchAreaOf.ftl | 3 +- .../edit/forms/addClinicalRoleToPerson.ftl | 68 +-- .../forms/js/organizationForTrainingUtils.js | 95 +++++ .../edit/forms/organizationForTraining.ftl | 229 +++++++++++ rdf/display/everytime/PropertyConfig.n3 | 59 ++- rdf/display/everytime/vivoListViewConfig.rdf | 39 -- .../AddEditWebpageFormGenerator.java | 11 - .../AddGrantRoleToPersonGenerator.java | 10 +- .../AddPublicationToPersonGenerator.java | 12 +- .../OrganizationForTrainingGenerator.java | 388 ++++++++++++++++++ .../PersonHasEducationalTraining.java | 34 +- .../utilities/UtilitiesRequestHandler.java | 2 +- 37 files changed, 1099 insertions(+), 345 deletions(-) create mode 100644 productMods/templates/freemarker/edit/forms/js/organizationForTrainingUtils.js create mode 100644 productMods/templates/freemarker/edit/forms/organizationForTraining.ftl create mode 100644 src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationForTrainingGenerator.java 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 = From fbb2c069d9367f6978f075b593833c7820a9648e Mon Sep 17 00:00:00 2001 From: tworrall Date: Sun, 3 Nov 2013 17:43:04 -0500 Subject: [PATCH 02/40] VIVO-462 --- rdf/display/everytime/PropertyConfig.n3 | 2 +- .../generators/OrganizationForTrainingGenerator.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 3acff04c..49bdfced 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -677,7 +677,7 @@ local:eventWithinContext a :ConfigContext ; local:eventWithinConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; - :displayName "event within" ; + :displayName "occurs within (parent event)" ; vitro:displayRankAnnot 1; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; 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 index b4f6c604..1d8abae7 100644 --- 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 @@ -41,7 +41,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.setVarNameForObject("edTraining"); conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); - conf.setN3Optional(Arrays.asList( majorFieldAssertion, n3ForAwardedDegree, n3ForNewPersonanization, n3ForExistingPersonanization, + conf.setN3Optional(Arrays.asList( majorFieldAssertion, n3ForAwardedDegree, n3ForNewPerson, n3ForExistingPerson, n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, n3ForEnd )); conf.addNewResource("edTraining", DEFAULT_NS_FOR_NEW_RESOURCE); @@ -195,13 +195,13 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?degreeType ?awardedDegree . \n"+ "?awardedDegree a core:AwardedDegree ."; - final static String n3ForNewPersonanization = + final static String n3ForNewPerson = "?edTraining ?newPerson . \n" + "?newPerson ?edTraining . \n" + "?newPerson a . \n" + "?newPerson <"+ label +"> ?personLabel . "; - final static String n3ForExistingPersonanization = + final static String n3ForExistingPerson = "?edTraining ?existingPerson . \n" + "?existingPerson ?edTraining . \n" + "?existingPerson a ?personType . "; From 70837783453d189d81e3136b3a0ec8fffd4ca812 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Mon, 4 Nov 2013 09:40:19 -0500 Subject: [PATCH 03/40] VIVO-480 removing some obsolete URIs --- .../WEB-INF/ontologies/update/diff.tab.txt | 2 +- rdf/tbox/filegraph/classes-additional.owl | 4 +- rdf/tbox/filegraph/object-properties.owl | 34 --------- rdf/tbox/filegraph/objectDomains.rdf | 3 - rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 75 ------------------- 5 files changed, 3 insertions(+), 115 deletions(-) diff --git a/productMods/WEB-INF/ontologies/update/diff.tab.txt b/productMods/WEB-INF/ontologies/update/diff.tab.txt index f48e8d75..f1500ecb 100644 --- a/productMods/WEB-INF/ontologies/update/diff.tab.txt +++ b/productMods/WEB-INF/ontologies/update/diff.tab.txt @@ -1 +1 @@ -http://purl.org/NET/c4dm/event.owl#agent Delete z http://purl.org/NET/c4dm/event.owl#isAgentIn Delete z http://purl.org/NET/c4dm/event.owl#produced_in http://purl.obolibrary.org/obo/RO_0002353 Yes z http://purl.org/NET/c4dm/event.owl#product http://purl.obolibrary.org/obo/RO_0002234 Yes z http://purl.org/dc/elements/1.1/isVersionOf Delete z http://vivoweb.org/ontology/core#administeredBy Delete complex construct with grant administrator role http://purl.org/dc/terms/contributor Delete z http://purl.org/dc/terms/isReferencedBy Delete z http://purl.org/dc/terms/isVersionOf Delete z http://purl.org/dc/terms/publisher http://vivoweb.org/ontology/core#publisher Yes z http://purl.org/ontology/bibo/editor Delete z http://vivoweb.org/ontology/core#administers Delete complex construct with grant administrator role http://vivoweb.org/ontology/core#advisee Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#adviseeIn Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#advisingContributionTo Delete construct http://vivoweb.org/ontology/core#advisor Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#advisorIn Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#associatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#associatedWithPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#attendeeRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#authorInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardConferred http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#awardConferredBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#awardOrHonor http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardOrHonorFor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#awardsGrant http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#clinicalRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#co-PrincipalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#courseOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#credentialOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#currentMemberOf Delete construct MemberRole http://vivoweb.org/ontology/core#currentlyHeadOf Delete construct LeaderRole http://vivoweb.org/ontology/core#currentlyHeadedBy Delete construct LeaderRole http://vivoweb.org/ontology/core#degreeEarned http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#degreeOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#degreeOutcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#domesticGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#domesticGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#editor Delete CC editorship http://vivoweb.org/ontology/core#editorOf Delete CC editorship http://vivoweb.org/ontology/core#editorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#educationalTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#educationalTrainingOf http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#equipmentInFacility http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#eventWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#geographicLocationOf http://purl.obolibrary.org/obo/RO_0001015 Yes """location of""" http://vivoweb.org/ontology/core#geographicallyContains http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#geographicallyWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#grantAwardedBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#hasAttendeeRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasAttendeeRoleContext http://vivoweb.org/ontology/core#hasClinicalRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasClinicalRoleContext http://vivoweb.org/ontology/core#hasCo-PrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasCo-PrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#hasCurrentMember Delete construct MemberRole http://vivoweb.org/ontology/core#hasEditorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasEditorRoleContext http://vivoweb.org/ontology/core#hasGeographicLocation http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#hasInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasInvestigatorRoleContext http://vivoweb.org/ontology/core#hasLeaderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasLeaderRoleContext http://vivoweb.org/ontology/core#hasMemberRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasMemberRoleContext http://vivoweb.org/ontology/core#hasOrganizerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOrganizerRoleContext http://vivoweb.org/ontology/core#hasOutreachProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOutreachProviderContext http://vivoweb.org/ontology/core#hasPart http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasPresenterRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPresenterRoleContext http://vivoweb.org/ontology/core#hasPrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasResearcherRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasResearcherRoleContext http://vivoweb.org/ontology/core#hasReviewerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasReviewerRoleContext http://vivoweb.org/ontology/core#hasRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#hasRoom http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#hasServiceProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasServiceProviderRoleContext http://vivoweb.org/ontology/core#hasSubGrant http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasSubOrganization http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasTeacherRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#inEventSeries http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#includesEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#informationProduct http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#informationProductOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#informationResourceInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#internationalGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#internationalGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#investigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes """inheres in""" http://vivoweb.org/ontology/core#issuanceOfCredential http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#issuedCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#leaderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#linkedAuthor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#linkedInformationResource http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#locationOfEquipment http://purl.obolibrary.org/obo/RO_0001015 Yes z http://vivoweb.org/ontology/core#mailingAddress Delete VCard http://vivoweb.org/ontology/core#mailingAddressFor Delete VCard http://vivoweb.org/ontology/core#memberRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#offersCourse http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#offersDegree http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#organizationForPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#organizationForTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#organizerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#outcome http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#outcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#outreachProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#partOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#personInPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#positionForPerson http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#positionInOrganization http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#presenterRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#principalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#providesService http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#realizedRole http://purl.obolibrary.org/obo/BFO_0000055 Yes """realizes""" http://vivoweb.org/ontology/core#receipt http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#receiptOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#relatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#researcherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#reviewerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleIn http://purl.obolibrary.org/obo/BFO_0000054 Yes """realized in"" (or delete, since there should be subs?)" http://vivoweb.org/ontology/core#roleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleRealizedIn http://purl.obolibrary.org/obo/BFO_0000054 Yes z http://vivoweb.org/ontology/core#roomWithinBuilding http://purl.obolibrary.org/obo/RO_0001025 Yes z http://vivoweb.org/ontology/core#seriesForEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#serviceProvidedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#serviceProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#subGrantOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#subOrganizationWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#teacherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#trainingAtOrganization http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#authorRank http://vivoweb.org/ontology/core#rank Yes z http://vivoweb.org/ontology/core#preferredTitle Delete z http://vivoweb.org/ontology/core#EducationalTraining http://vivoweb.org/ontology/core#EducationalProcess Yes z http://vivoweb.org/ontology/core#ServiceProviderRole http://purl.obolibrary.org/obo/ERO_0000012 Yes z http://vivoweb.org/ontology/core#URLLink http://www.w3.org/2006/vcard/ns#URL Yes z http://vivoweb.org/ontology/core#Agreement Delete z http://vivoweb.org/ontology/core#InformationResource http://purl.obolibrary.org/obo/IAO_0000030 Yes z http://vivoweb.org/ontology/core#Service Delete z http://vivoweb.org/ontology/core#Software http://purl.obolibrary.org/obo/ERO_0000071 Yes z \ No newline at end of file +http://purl.org/NET/c4dm/event.owl#agent Delete z http://purl.org/NET/c4dm/event.owl#isAgentIn Delete z http://purl.org/NET/c4dm/event.owl#produced_in http://purl.obolibrary.org/obo/RO_0002353 Yes z http://purl.org/NET/c4dm/event.owl#product http://purl.obolibrary.org/obo/RO_0002234 Yes z http://purl.org/dc/elements/1.1/isVersionOf Delete z http://vivoweb.org/ontology/core#administeredBy Delete complex construct with grant administrator role http://purl.org/dc/terms/isReferencedBy Delete z http://purl.org/dc/terms/isVersionOf Delete z http://purl.org/dc/terms/publisher http://vivoweb.org/ontology/core#publisher Yes z http://purl.org/ontology/bibo/editor Delete z http://vivoweb.org/ontology/core#administers Delete complex construct with grant administrator role http://vivoweb.org/ontology/core#advisee Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#adviseeIn Delete CC - advising relationship plus add advisee role http://vivoweb.org/ontology/core#advisingContributionTo Delete construct http://vivoweb.org/ontology/core#advisor Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#advisorIn Delete CC - advising relationship plus add advisor role http://vivoweb.org/ontology/core#associatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#associatedWithPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#attendeeRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#authorInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardConferred http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#awardConferredBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#awardOrHonor http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#awardOrHonorFor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#awardsGrant http://vivoweb.org/ontology/core#assigns Yes z http://vivoweb.org/ontology/core#clinicalRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#co-PrincipalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#courseOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#credentialOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#currentMemberOf Delete construct MemberRole http://vivoweb.org/ontology/core#currentlyHeadOf Delete construct LeaderRole http://vivoweb.org/ontology/core#currentlyHeadedBy Delete construct LeaderRole http://vivoweb.org/ontology/core#degreeEarned http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#degreeOfferedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#degreeOutcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#domesticGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#domesticGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#editor Delete CC editorship http://vivoweb.org/ontology/core#editorOf Delete CC editorship http://vivoweb.org/ontology/core#editorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#educationalTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#educationalTrainingOf http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#equipmentInFacility http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#eventWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#geographicLocationOf http://purl.obolibrary.org/obo/RO_0001015 Yes """location of""" http://vivoweb.org/ontology/core#geographicallyContains http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#geographicallyWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#grantAwardedBy http://vivoweb.org/ontology/core#assignedBy Yes z http://vivoweb.org/ontology/core#hasAttendeeRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasAttendeeRoleContext http://vivoweb.org/ontology/core#hasClinicalRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasClinicalRoleContext http://vivoweb.org/ontology/core#hasCo-PrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasCo-PrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#hasCurrentMember Delete construct MemberRole http://vivoweb.org/ontology/core#hasEditorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasEditorRoleContext http://vivoweb.org/ontology/core#hasGeographicLocation http://purl.obolibrary.org/obo/RO_0001025 Yes """located in""" http://vivoweb.org/ontology/core#hasInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasInvestigatorRoleContext http://vivoweb.org/ontology/core#hasLeaderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasLeaderRoleContext http://vivoweb.org/ontology/core#hasMemberRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasMemberRoleContext http://vivoweb.org/ontology/core#hasOrganizerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOrganizerRoleContext http://vivoweb.org/ontology/core#hasOutreachProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasOutreachProviderContext http://vivoweb.org/ontology/core#hasPart http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasPresenterRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPresenterRoleContext http://vivoweb.org/ontology/core#hasPrincipalInvestigatorRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasPrincipalInvestigatorRoleContext http://vivoweb.org/ontology/core#hasResearcherRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasResearcherRoleContext http://vivoweb.org/ontology/core#hasReviewerRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasReviewerRoleContext http://vivoweb.org/ontology/core#hasRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#hasRoom http://purl.obolibrary.org/obo/BFO_0000051 Yes """has part""" http://vivoweb.org/ontology/core#hasServiceProviderRole http://purl.obolibrary.org/obo/RO_0000053 Yes cc:hasServiceProviderRoleContext http://vivoweb.org/ontology/core#hasSubGrant http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasSubOrganization http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#hasTeacherRole http://purl.obolibrary.org/obo/RO_0000053 Yes z http://vivoweb.org/ontology/core#inEventSeries http://purl.obolibrary.org/obo/BFO_0000050 Yes """part of""" http://vivoweb.org/ontology/core#includesEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#informationProduct http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#informationProductOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#informationResourceInAuthorship http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#internationalGeographicFocus http://vivoweb.org/ontology/core#geographicFocus Yes z http://vivoweb.org/ontology/core#internationalGeographicFocusOf http://vivoweb.org/ontology/core#geographicFocusOf Yes z http://vivoweb.org/ontology/core#investigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes """inheres in""" http://vivoweb.org/ontology/core#issuanceOfCredential http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#issuedCredential http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#leaderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#linkedAuthor http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#linkedInformationResource http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#locationOfEquipment http://purl.obolibrary.org/obo/RO_0001015 Yes z http://vivoweb.org/ontology/core#mailingAddress Delete VCard http://vivoweb.org/ontology/core#mailingAddressFor Delete VCard http://vivoweb.org/ontology/core#memberRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#offersCourse http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#offersDegree http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#organizationForPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#organizationForTraining http://purl.obolibrary.org/obo/RO_0000056 Yes z http://vivoweb.org/ontology/core#organizerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#outcome http://purl.obolibrary.org/obo/RO_0002234 Yes z http://vivoweb.org/ontology/core#outcomeOf http://purl.obolibrary.org/obo/RO_0002353 Yes z http://vivoweb.org/ontology/core#outreachProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#partOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#personInPosition http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#positionForPerson http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#positionInOrganization http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#presenterRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#principalInvestigatorRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#providesService http://vivoweb.org/ontology/core#offers Yes z http://vivoweb.org/ontology/core#realizedRole http://purl.obolibrary.org/obo/BFO_0000055 Yes """realizes""" http://vivoweb.org/ontology/core#receipt http://vivoweb.org/ontology/core#relatedBy Yes z http://vivoweb.org/ontology/core#receiptOf http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#relatedRole http://vivoweb.org/ontology/core#relates Yes z http://vivoweb.org/ontology/core#researcherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#reviewerRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleIn http://purl.obolibrary.org/obo/BFO_0000054 Yes """realized in"" (or delete, since there should be subs?)" http://vivoweb.org/ontology/core#roleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#roleRealizedIn http://purl.obolibrary.org/obo/BFO_0000054 Yes z http://vivoweb.org/ontology/core#roomWithinBuilding http://purl.obolibrary.org/obo/RO_0001025 Yes z http://vivoweb.org/ontology/core#seriesForEvent http://purl.obolibrary.org/obo/BFO_0000051 Yes z http://vivoweb.org/ontology/core#serviceProvidedBy http://vivoweb.org/ontology/core#offeredBy Yes z http://vivoweb.org/ontology/core#serviceProviderRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#subGrantOf http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#subOrganizationWithin http://purl.obolibrary.org/obo/BFO_0000050 Yes z http://vivoweb.org/ontology/core#teacherRoleOf http://purl.obolibrary.org/obo/RO_0000052 Yes z http://vivoweb.org/ontology/core#trainingAtOrganization http://purl.obolibrary.org/obo/RO_0000057 Yes z http://vivoweb.org/ontology/core#authorRank http://vivoweb.org/ontology/core#rank Yes z http://vivoweb.org/ontology/core#preferredTitle Delete z http://vivoweb.org/ontology/core#EducationalTraining http://vivoweb.org/ontology/core#EducationalProcess Yes z http://vivoweb.org/ontology/core#ServiceProviderRole http://purl.obolibrary.org/obo/ERO_0000012 Yes z http://vivoweb.org/ontology/core#URLLink http://www.w3.org/2006/vcard/ns#URL Yes z http://vivoweb.org/ontology/core#Agreement Delete z http://vivoweb.org/ontology/core#InformationResource http://purl.obolibrary.org/obo/IAO_0000030 Yes z http://vivoweb.org/ontology/core#Service Delete z http://vivoweb.org/ontology/core#Software http://purl.obolibrary.org/obo/ERO_0000071 Yes z \ No newline at end of file diff --git a/rdf/tbox/filegraph/classes-additional.owl b/rdf/tbox/filegraph/classes-additional.owl index 4e57d6f7..ebe04e37 100644 --- a/rdf/tbox/filegraph/classes-additional.owl +++ b/rdf/tbox/filegraph/classes-additional.owl @@ -773,7 +773,7 @@ - + @@ -955,7 +955,7 @@ - + diff --git a/rdf/tbox/filegraph/object-properties.owl b/rdf/tbox/filegraph/object-properties.owl index 176c40e7..4c95312e 100644 --- a/rdf/tbox/filegraph/object-properties.owl +++ b/rdf/tbox/filegraph/object-properties.owl @@ -698,7 +698,6 @@ - @@ -1145,22 +1144,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - - - - - - - - - - - - @@ -1508,14 +1491,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - - - - @@ -1534,15 +1509,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - Currently being used by a restriction on organization. - - - - diff --git a/rdf/tbox/filegraph/objectDomains.rdf b/rdf/tbox/filegraph/objectDomains.rdf index cec51c19..d50bbf34 100644 --- a/rdf/tbox/filegraph/objectDomains.rdf +++ b/rdf/tbox/filegraph/objectDomains.rdf @@ -29,9 +29,6 @@ - - - diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index 1f0823bf..b41d98c9 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -827,23 +827,6 @@ vivo:AttendeeRole vitro:prohibitedFromUpdateBelowRoleLevelAnnot . -vivo:geographicLocationOf - rdfs:label "geographic location of"@en-US ; - vitro:displayLimitAnnot - "5"^^xsd:int ; - vitro:displayRankAnnot - "60"^^xsd:int ; - vitro:fullPropertyNameAnnot - "nearestGeographicLocationFor"^^xsd:string ; - vitro:hiddenFromDisplayBelowRoleLevelAnnot - ; - vitro:prohibitedFromUpdateBelowRoleLevelAnnot - ; - vitro:publicDescriptionAnnot - """This relates a geographic location to something within that geographic location, for example, an organization within that geographic location. -"""^^xsd:string ; - vitro:selectFromExistingAnnot - "true"^^xsd:boolean . vivo:invited rdfs:label "invited"@en-US . @@ -3631,25 +3614,6 @@ vivo:WorkshopSeries vitro:prohibitedFromUpdateBelowRoleLevelAnnot . -event:isAgentIn - rdfs:label "is agent in"@en-US ; - vitro:displayLimitAnnot - "5"^^xsd:int ; - vitro:fullPropertyNameAnnot - "isAgentIn"^^xsd:string ; - vitro:hiddenFromDisplayBelowRoleLevelAnnot - ; - vitro:inPropertyGroupAnnot - ; - vitro:offerCreateNewOptionAnnot - "true"^^xsd:boolean ; - vitro:prohibitedFromUpdateBelowRoleLevelAnnot - ; - vitro:publicDescriptionAnnot - "This relates an active agent to an event."^^xsd:string ; - vitro:selectFromExistingAnnot - "true"^^xsd:boolean . - obo:ERO_0000225 rdfs:label "Educator Role"@en-US . @@ -6097,23 +6061,6 @@ geo:populationNotes vitro:prohibitedFromUpdateBelowRoleLevelAnnot . -vivo:currentMemberOf - rdfs:label "current member of"@en-US ; - vitro:fullPropertyNameAnnot - "member of"^^xsd:string ; - vitro:hiddenFromDisplayBelowRoleLevelAnnot - ; - vitro:inPropertyGroupAnnot - ; - vitro:offerCreateNewOptionAnnot - "true"^^xsd:boolean ; - vitro:prohibitedFromUpdateBelowRoleLevelAnnot - ; - vitro:publicDescriptionAnnot - "A person's formal or informal affiliation with a group."^^xsd:string ; - vitro:selectFromExistingAnnot - "true"^^xsd:boolean . - vivo:Campus rdfs:label "Campus"@en-US ; vitro:displayLimitAnnot @@ -6747,28 +6694,6 @@ geo:landAreaUnit vitro:prohibitedFromUpdateBelowRoleLevelAnnot . -vivo:hasGeographicLocation - rdfs:label "has geographic location"@en-US ; - vitro:displayLimitAnnot - "5"^^xsd:int ; - vitro:displayRankAnnot - "60"^^xsd:int ; - vitro:fullPropertyNameAnnot - "nearestGeographicLocation"^^xsd:string ; - vitro:hiddenFromDisplayBelowRoleLevelAnnot - ; - vitro:inPropertyGroupAnnot - ; - vitro:offerCreateNewOptionAnnot - "true"^^xsd:boolean ; - vitro:prohibitedFromUpdateBelowRoleLevelAnnot - ; - vitro:publicDescriptionAnnot - """This relates something to its geographic location, for example, an organization to its geographic location. -"""^^xsd:string ; - vitro:selectFromExistingAnnot - "true"^^xsd:boolean . - vcard:hasSound rdfs:label "has sound"@en-US . From 3d66980416165ec579a191a5a0208fa02971ad40 Mon Sep 17 00:00:00 2001 From: tworrall Date: Mon, 4 Nov 2013 11:25:36 -0500 Subject: [PATCH 04/40] VIVO-461 new custom form, list view, etc for organization for training --- .../propStatement-organizationForTraining.ftl | 2 +- .../OrganizationForTrainingGenerator.java | 58 +++++++++---------- ...ganizationHasPositionHistoryGenerator.java | 20 +++++-- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl index ce7ddb2a..711d2ee7 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForTraining.ftl @@ -19,7 +19,7 @@ ${statement.personName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${i18n().missing_person_in_posn} + ${i18n().missing_person_in_posn} <#local detailedInfo> 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 index 1d8abae7..c7070d8b 100644 --- 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 @@ -42,7 +42,8 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.setN3Required( Arrays.asList( n3ForNewEdTraining, trainingTypeAssertion ) ); conf.setN3Optional(Arrays.asList( majorFieldAssertion, n3ForAwardedDegree, n3ForNewPerson, n3ForExistingPerson, - n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, n3ForEnd )); + n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, + n3ForEnd, firstNameAssertion, lastNameAssertion )); conf.addNewResource("edTraining", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("awardedDegree",DEFAULT_NS_FOR_NEW_RESOURCE); @@ -56,7 +57,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme //uris in scope: none //literals in scope: none - conf.setUrisOnform( Arrays.asList( "existingPerson", "personType", "degreeType", "trainingType")); + conf.setUrisOnform( Arrays.asList( "existingPerson", "degreeType", "trainingType")); conf.setLiteralsOnForm( Arrays.asList("personLabel", "personLabelDisplay", "awardedDegreeLabel", "majorField", "dept", "info", "firstName", "lastName")); @@ -70,7 +71,6 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme conf.addSparqlForExistingUris("awardedDegree", existingAwardedDegreeQuery); conf.addSparqlForExistingUris("existingPerson", existingPersonQuery); -// conf.addSparqlForExistingUris("personType", personTypeQuery); conf.addSparqlForExistingUris("trainingType", trainingTypeQuery); conf.addSparqlForExistingUris("degreeType", degreeTypeQuery); conf.addSparqlForExistingUris("intervalNode",existingIntervalNodeQuery); @@ -177,38 +177,38 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme final static String n3ForNewEdTraining = "@prefix core: <"+ vivoCore +"> .\n"+ - "?organization ?edTraining .\n" + + "?organization ?edTraining .\n" + "?edTraining a core:EducationalProcess .\n" + - "?edTraining ?organization ."; + "?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" + + "?edTraining ?awardedDegree . \n" + + "?awardedDegree ?edTraining . \n" + + "?awardedDegree ?organization . \n" + + "?organization ?awardedDegree . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + - "?awardedDegree ?degreeType .\n"+ - "?degreeType ?awardedDegree . \n"+ + "?awardedDegree ?degreeType .\n"+ + "?degreeType ?awardedDegree . \n"+ "?awardedDegree a core:AwardedDegree ."; final static String n3ForNewPerson = - "?edTraining ?newPerson . \n" + - "?newPerson ?edTraining . \n" + + "?edTraining ?newPerson . \n" + + "?newPerson ?edTraining . \n" + "?newPerson a . \n" + "?newPerson <"+ label +"> ?personLabel . "; final static String n3ForExistingPerson = - "?edTraining ?existingPerson . \n" + - "?existingPerson ?edTraining . \n" + - "?existingPerson a ?personType . "; + "?edTraining ?existingPerson . \n" + + "?existingPerson ?edTraining . \n" + + " "; final static String n3ForNewPersonAwardedDegree = - "?awardedDegree ?newPerson . \n" + - "?newPerson ?awardedDegree . \n" + + "?awardedDegree ?newPerson . \n" + + "?newPerson ?awardedDegree . \n" + "?newPerson a . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?newPerson <"+ label +"> ?personLabel . "; @@ -232,8 +232,8 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme "?vcardName vcard:familyName ?lastName ."; final static String n3ForExistingPersonAwardedDegree = - "?awardedDegree ?existingPerson . \n" + - "?existingPerson ?awardedDegree . \n" + + "?awardedDegree ?existingPerson . \n" + + "?existingPerson ?awardedDegree . \n" + "?awardedDegree <"+ label +"> ?awardedDegreeLabel . \n" + "?existingPerson a . "; @@ -266,26 +266,26 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme final static String existingAwardedDegreeQuery = "SELECT ?existingAwardedDegree WHERE {\n"+ - "?edTraining ?existingAwardedDegree . }\n"; + "?edTraining ?existingAwardedDegree . }\n"; final static String existingAwardedDegreeLabelQuery = "SELECT ?existingAwardedDegreeLabel WHERE {\n"+ - "?edTraining ?existingAwardedDegree . \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" + + "?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"+ + "?edTraining ?existingPerson . \n" + + "?existingPerson ?edTraining .\n"+ "?existingPerson <"+ label +"> ?existingPersonLabel .\n"+ "?existingPerson a . \n " + " }"; @@ -298,7 +298,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme final static String degreeTypeQuery = "PREFIX core: <"+ vivoCore +"> \n"+ "SELECT ?existingDegreeType WHERE {\n"+ - "?edTraining ?existingAwardedDegree . \n"+ + "?edTraining ?existingAwardedDegree . \n"+ "?existingAwardedDegree a core:AwardedDegree . \n"+ "?existingAwardedDegree core:relates ?existingDegreeType . \n" + "?existingDegreeType a core:AcademicDegree }"; @@ -370,7 +370,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme final static String inverseTrainingAtPersonQuery = "PREFIX owl: " + " SELECT ?inverseTrainingAtPerson " - + " WHERE { ?inverseTrainingAtPerson owl:inverseOf . } "; + + " WHERE { ?inverseTrainingAtPerson owl:inverseOf . } "; //Adding form specific data such as edit mode @@ -382,7 +382,7 @@ public class OrganizationForTrainingGenerator extends VivoBaseGenerator impleme public EditMode getEditMode(VitroRequest vreq) { List predicates = new ArrayList(); - predicates.add("http://vivoweb.person/ontology/core#relates"); + predicates.add("http://vivoweb.org/ontology/core#relates"); return EditModeUtils.getEditMode(vreq, predicates); } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java index ac562d48..aad3d6b5 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/OrganizationHasPositionHistoryGenerator.java @@ -129,12 +129,22 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator + "?person rdfs:label ?personLabel . "; private static final String N3_NEW_FIRST_NAME = "" - + "@prefix foaf: . \n" - + "?person foaf:firstName ?firstName ."; + + "@prefix vcard: . \n" + + "?person ?vcardPerson . \n" + + "?vcardPerson ?person . \n" + + "?vcardPerson a . \n" + + "?vcardPerson vcard:hasName ?vcardName . \n" + + "?vcardName a . \n" + + "?vcardName vcard:givenName ?firstName ."; private static final String N3_NEW_LAST_NAME = "" - + "@prefix foaf: . \n" - + "?person foaf:lastName ?lastName ."; + + "@prefix vcard: . \n" + + "?person ?vcardPerson . \n" + + "?vcardPerson ?person . \n" + + "?vcardPerson a . \n" + + "?vcardPerson vcard:hasName ?vcardName . \n" + + "?vcardName a . \n" + + "?vcardName vcard:familyName ?lastName ."; private static final String N3_EXISTING_PERSON = "" + "@prefix core: . \n" @@ -179,6 +189,8 @@ public class OrganizationHasPositionHistoryGenerator extends VivoBaseGenerator conf.addNewResource("position", DEFAULT_NS_FOR_NEW_RESOURCE); conf.addNewResource("person", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("vcardName", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("vcardPerson", 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); From cad30a359d1f0265bc79a49772d3fef8b18e0b54 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Mon, 4 Nov 2013 11:35:28 -0500 Subject: [PATCH 05/40] VIVO-460 offerCreateNew settings for various properties --- rdf/display/everytime/PropertyConfig.n3 | 17 ++++- rdf/tbox/filegraph/classes-additional.owl | 66 -------------------- rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 14 ++++- 3 files changed, 27 insertions(+), 70 deletions(-) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 49bdfced..704bde9e 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -768,7 +768,7 @@ local:collegeOffersDegreeConfig a :ObjectPropertyDisplayConfig ; :propertyGroup . local:deptOffersDegreeContext a :ConfigContext ; - :hasConfiguration local:debtOffersDegreeConfig ; + :hasConfiguration local:deptOffersDegreeConfig ; :configContextFor vivo:offers ; :qualifiedByDomain vivo:AcademicDepartment ; :qualifiedBy vivo:AcademicDegree . @@ -795,6 +795,21 @@ local:uniOffersDegreeConfig a :ObjectPropertyDisplayConfig ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; :propertyGroup . +local:labOffersServiceContext a :ConfigContext ; + :hasConfiguration local:labOffersServiceConfig ; + :configContextFor vivo:offers ; + :qualifiedByDomain vivo:Laboratory ; + :qualifiedBy . + +local:labOffersServiceConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "offers service" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ; + :propertyGroup . + local:grantAwardedByContext a :ConfigContext ; :hasConfiguration local:grantAwardedByConfig ; :configContextFor vivo:assignedBy ; diff --git a/rdf/tbox/filegraph/classes-additional.owl b/rdf/tbox/filegraph/classes-additional.owl index ebe04e37..8bc74eed 100644 --- a/rdf/tbox/filegraph/classes-additional.owl +++ b/rdf/tbox/filegraph/classes-additional.owl @@ -559,27 +559,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -687,23 +666,6 @@ - - - - - - - - - - - - - - - - - @@ -947,21 +909,6 @@ - - - - - - - - - - - - - - - @@ -1040,19 +987,6 @@ - - - - - - - - - - - - - diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index b41d98c9..570b4b20 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -660,6 +660,8 @@ vivo:reproduces ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean ; vitro:selectFromExistingAnnot "true"^^xsd:boolean . @@ -2054,7 +2056,9 @@ bibo:number "A generic item or document number. Not to be confused with issue number. A barcode, perhaps?"^^xsd:string . obo:RO_0001025 - rdfs:label "located in"@en-US . + rdfs:label "located in"@en-US ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean . vivo:Location rdfs:label "Location"@en-US ; @@ -6176,7 +6180,9 @@ obo:ERO_0000789 rdfs:label "Staff Role"@en-US . obo:BFO_0000050 - rdfs:label "part of"@en-US . + rdfs:label "part of"@en-US ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean . bibo:Letter rdfs:label "Letter"@en-US ; @@ -6264,7 +6270,9 @@ obo:RO_0002351 rdfs:label "has member"@en-US . obo:BFO_0000051 - rdfs:label "has part"@en-US . + rdfs:label "has part"@en-US ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean . obo:ARG_2000008 rdfs:label "Topic Weight Measurement"@en-US . From 11a37ed0786bad79592170d5b14d8b8c682d6834 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Mon, 4 Nov 2013 11:46:26 -0500 Subject: [PATCH 06/40] VIVO-457 additional property visibility --- rdf/display/everytime/PropertyConfig.n3 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 704bde9e..47f25725 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -725,6 +725,20 @@ local:eventLocationConfig a :ObjectPropertyDisplayConfig ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; :propertyGroup . +local:hasRoomContext a :ConfigContext ; + :hasConfiguration local:hasRoomConfig ; + :configContextFor ; + :qualifiedByDomain vivo:Building ; + :qualifiedBy vivo:Room . + +local:hasRoomConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "has room" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + local:courseOfferedByContext a :ConfigContext ; :hasConfiguration local:courseOfferedByConfig ; :configContextFor vivo:offeredBy ; From 8dbf9969c2c8895d3745d59f406c1c8850f68628 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Mon, 4 Nov 2013 11:50:54 -0500 Subject: [PATCH 07/40] VIVO-408 hiding dateTimeValue property --- rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index 570b4b20..d1586c88 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -65,13 +65,13 @@ vivo:dateTimeValue vitro:displayRankAnnot "5"^^xsd:int ; vitro:hiddenFromDisplayBelowRoleLevelAnnot - ; + ; vitro:inPropertyGroupAnnot ; vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot - ; + ; vitro:selectFromExistingAnnot "false"^^xsd:boolean . From 5f71827f934a44f63ecb8981b27b98190c2e481c Mon Sep 17 00:00:00 2001 From: hudajkhan Date: Mon, 4 Nov 2013 11:52:36 -0500 Subject: [PATCH 08/40] search part of page needs to be broken out to include search box in jsp pages --- themes/wilma/templates/page.ftl | 15 +-------------- themes/wilma/templates/search.ftl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 themes/wilma/templates/search.ftl diff --git a/themes/wilma/templates/page.ftl b/themes/wilma/templates/page.ftl index 61a2b3c4..b826291c 100644 --- a/themes/wilma/templates/page.ftl +++ b/themes/wilma/templates/page.ftl @@ -10,20 +10,7 @@ <#include "identity.ftl"> - - - + <#include "search.ftl" > <#include "menu.ftl"> <#-- VIVO OpenSocial Extension by UCSF --> diff --git a/themes/wilma/templates/search.ftl b/themes/wilma/templates/search.ftl new file mode 100644 index 00000000..a3825eea --- /dev/null +++ b/themes/wilma/templates/search.ftl @@ -0,0 +1,17 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#--Breaking this out so this can be utilized by other pages such as the jsp advanced tools pages--> + + + \ No newline at end of file From 35ec65eebe70466486e2ffaf1178eafcf4f19377 Mon Sep 17 00:00:00 2001 From: j2blake Date: Mon, 4 Nov 2013 12:48:13 -0500 Subject: [PATCH 09/40] VIVO-415 OpenSocial template was in Wilma - should be in VIVO. --- .../freemarker/body/individual}/individual-openSocial.ftl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {themes/wilma/templates => productMods/templates/freemarker/body/individual}/individual-openSocial.ftl (100%) diff --git a/themes/wilma/templates/individual-openSocial.ftl b/productMods/templates/freemarker/body/individual/individual-openSocial.ftl similarity index 100% rename from themes/wilma/templates/individual-openSocial.ftl rename to productMods/templates/freemarker/body/individual/individual-openSocial.ftl From 9f854b6490b05fa36fdf34040a1e482c3fd4dbaa Mon Sep 17 00:00:00 2001 From: j2blake Date: Mon, 4 Nov 2013 12:50:19 -0500 Subject: [PATCH 10/40] VIVO-482 replace core:URLLink with card:URL --- rdf/display/everytime/vivoSearchProhibited.n3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf/display/everytime/vivoSearchProhibited.n3 b/rdf/display/everytime/vivoSearchProhibited.n3 index 17985305..8e7b7063 100644 --- a/rdf/display/everytime/vivoSearchProhibited.n3 +++ b/rdf/display/everytime/vivoSearchProhibited.n3 @@ -27,7 +27,7 @@ vitroDisplay:excludeClass core:DateTimeValuePrecision ; vitroDisplay:excludeClass core:DateTimeInterval ; vitroDisplay:excludeClass core:AcademicDegree ; - vitroDisplay:excludeClass core:URLLink ; + vitroDisplay:excludeClass vcard:URL ; vitroDisplay:excludeClass vcard:Communication ; vitroDisplay:excludeClass vcard:Code ; vitroDisplay:excludeClass vcard:Explanatory ; From 50d788adb44774b86b9fc91250c85d6ee9eabcda Mon Sep 17 00:00:00 2001 From: j2blake Date: Mon, 4 Nov 2013 12:55:02 -0500 Subject: [PATCH 11/40] Refine the script that scans for obsolete URIs --- .../obsoleteUris/directory_walker.rb | 6 +- .../obsoleteUris/{doit2 => doit} | 4 +- .../ISF-transition/obsoleteUris/doit_old | 2 + .../obsoleteUris/vivo_known_exceptions.txt | 56 ++++++++++++++----- ...ns_2.txt => vivo_known_exceptions_old.txt} | 33 +++++------ 5 files changed, 64 insertions(+), 37 deletions(-) rename utilities/ISF-transition/obsoleteUris/{doit2 => doit} (64%) create mode 100755 utilities/ISF-transition/obsoleteUris/doit_old rename utilities/ISF-transition/obsoleteUris/{vivo_known_exceptions_2.txt => vivo_known_exceptions_old.txt} (91%) diff --git a/utilities/ISF-transition/obsoleteUris/directory_walker.rb b/utilities/ISF-transition/obsoleteUris/directory_walker.rb index 5ccaa89c..3a499bdb 100644 --- a/utilities/ISF-transition/obsoleteUris/directory_walker.rb +++ b/utilities/ISF-transition/obsoleteUris/directory_walker.rb @@ -10,6 +10,8 @@ class DirectoryWalker if FileTest.directory?(path) if File.basename(path).start_with?(".") Find.prune # Don't look any further into this directory. + elsif @known_exceptions.skip?(path) + Find.prune else next end @@ -33,13 +35,13 @@ class DirectoryWalker def scan_line(path, line_number, line) @obsolete_uris.uris.each do |uri| - next if @known_exceptions.skip?(path, line_number, uri) +# next if @known_exceptions.skip?(path, line_number, uri) @report.add_event(Event.new(path, line_number, line, uri)) if line =~ Regexp.new("\\b#{Regexp.quote(uri)}\\b") end if @complete @obsolete_uris.localnames.each do |localname| term = ":#{localname}" - next if @known_exceptions.skip?(path, line_number, term) +# next if @known_exceptions.skip?(path, line_number, term) @report.add_event(Event.new(path, line_number, line, term)) if line =~ Regexp.new("#{Regexp.quote(term)}\\b") end end diff --git a/utilities/ISF-transition/obsoleteUris/doit2 b/utilities/ISF-transition/obsoleteUris/doit similarity index 64% rename from utilities/ISF-transition/obsoleteUris/doit2 rename to utilities/ISF-transition/obsoleteUris/doit index 2f8a8b33..157ddc6d 100755 --- a/utilities/ISF-transition/obsoleteUris/doit2 +++ b/utilities/ISF-transition/obsoleteUris/doit @@ -1,7 +1,7 @@ ruby obsoleteUriChecker.rb /Users/jeb228/git/VIVO \ ../../../productMods/WEB-INF/ontologies/update/diff.tab.txt \ - vivo_known_exceptions_2.txt complete > scan_VIVO_maint_branch + vivo_known_exceptions.txt complete > scan_VIVO_maint_branch ruby obsoleteUriChecker.rb /Users/jeb228/git/Vitro \ ../../../productMods/WEB-INF/ontologies/update/diff.tab.txt \ - vivo_known_exceptions_2.txt complete > scan_Vitro_maint_branch + vivo_known_exceptions.txt complete > scan_Vitro_maint_branch diff --git a/utilities/ISF-transition/obsoleteUris/doit_old b/utilities/ISF-transition/obsoleteUris/doit_old new file mode 100755 index 00000000..5be4adc8 --- /dev/null +++ b/utilities/ISF-transition/obsoleteUris/doit_old @@ -0,0 +1,2 @@ +ruby obsoleteUriChecker.rb /Users/jeb228/Documents/Releases/VIVO\ 1.6/vivo-rel-1.6-rc1 ../../../productMods/WEB-INF/ontologies/update/diff.tab.txt vivo_known_exceptions.txt complete + diff --git a/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions.txt b/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions.txt index 3409da4c..ae8dfa94 100644 --- a/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions.txt +++ b/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions.txt @@ -1,17 +1,23 @@ -.GIF -.as -.class -.fla -.gif -.gz -.ico -.jar -.jpg -.psd -.png -.swf -.war -.zip + +bin +utilities/ISF-transition/obsoleteUris + +*.GIF +*.as +*.class +*.fla +*.gif +*.gz +*.ico +*.jar +*.jpg +*.psd +*.png +*.swf +*.war +*.zip + +**/.* # # first_pass: no excluded files. everything was duplicated in the .bin directory, and @@ -39,3 +45,25 @@ productMods/WEB-INF/ontologies/update/oldVersion/vivo-bibo-1.5.owl productMods/WEB-INF/ontologies/update/oldVersion/scires-1.5.owl productMods/WEB-INF/ontologies/update/oldVersion/vivo-dcterms-1.5.owl productMods/WEB-INF/ontologies/update/oldVersion/vivo-dcelements-1.5.owl + +# +# Exclude old performance tests +# +utilities/LoadTesting/distros/release1.4/deploy.properties.template + +# +# Exclude the migration code itself +# +productMods/WEB-INF/ontologies/update/**/* + +# +# This is commented out. +# +src/edu/cornell/mannlib/vitro/webapp/visualization/utilities/UtilitiesRequestHandler.java + +# +# The URI is obsolete, but it has been replaced by another URI with the same localname. +# http://purl.org/dc/terms/publisher http://vivoweb.org/ontology/core#publisher +# How to catch this? +# + diff --git a/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_2.txt b/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_old.txt similarity index 91% rename from utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_2.txt rename to utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_old.txt index 8d1d4e7e..3409da4c 100644 --- a/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_2.txt +++ b/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_old.txt @@ -1,22 +1,17 @@ -.* -bin - -*.GIF -*.as -*.class -*.fla -*.gif -*.gz -*.ico -*.jar -*.jpg -*.psd -*.png -*.swf -*.war -*.zip - -**/.* +.GIF +.as +.class +.fla +.gif +.gz +.ico +.jar +.jpg +.psd +.png +.swf +.war +.zip # # first_pass: no excluded files. everything was duplicated in the .bin directory, and From 6fd299301cd23eaf98e819f5e7284a38ec98c91e Mon Sep 17 00:00:00 2001 From: tworrall Date: Mon, 4 Nov 2013 14:45:43 -0500 Subject: [PATCH 12/40] VIVO-485 convert datagetter to ajax call --- productMods/js/homePageMaps.js | 26 +++++- .../freemarker/lib/lib-home-page.ftl | 14 --- rdf/display/everytime/homePageDataGetters.n3 | 23 +---- .../ajax/GeoFocusResearcherCount.java | 83 +++++++++++++++++ .../ajax/HomePageAjaxController.java | 88 ++++++++++--------- themes/wilma/templates/page-home.ftl | 1 - 6 files changed, 152 insertions(+), 83 deletions(-) create mode 100644 src/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java diff --git a/productMods/js/homePageMaps.js b/productMods/js/homePageMaps.js index 06283d1e..c41b6fbc 100644 --- a/productMods/js/homePageMaps.js +++ b/productMods/js/homePageMaps.js @@ -6,11 +6,12 @@ $(document).ready(function(){ var countryMapBuilt = false; var localMapBuilt = false; var researchAreas = { "type": "FeatureCollection", "features": []}; + var geoResearcherCount = "0"; $.extend(this, urlsBase); $.extend(this, i18nStrings); - $.extend(this, geoResearcherCount); + getGeoFocusResearcherCount(); getGeoJsonForMaps(); $('a#globalLink').click(function() { @@ -367,9 +368,26 @@ $(document).ready(function(){ }); } + function getGeoFocusResearcherCount() { + $.ajax({ + url: urlsBase + "/homePageAjax", + dataType: "json", + data: { + action: "getGeoFocusResearcherCount", + }, + complete: function(xhr, status) { + + var results = $.parseJSON(xhr.responseText); + // there will only ever be one key/value pair + if ( results != null ) { + geoResearcherCount = results.count; + } + } + }); + } + function getResearcherCount(area) { - var researcherCount = this.geoResearcherCount; var areaCount = 0; var text = ""; if ( area == "global" ) { @@ -391,7 +409,7 @@ $(document).ready(function(){ if ( areaCount == 1 && text == " states.") { text = " " + i18nStrings.stateString; } - if ( researcherCount == 1 ) { + if ( geoResearcherCount == 1 ) { researcherText = " " + i18nStrings.researcherString + " " + i18nStrings.inString; } else { @@ -399,7 +417,7 @@ $(document).ready(function(){ } $('div#researcherTotal').html("" - + researcherCount + + geoResearcherCount + " " + researcherText + " " + areaCount + "" + text); } diff --git a/productMods/templates/freemarker/lib/lib-home-page.ftl b/productMods/templates/freemarker/lib/lib-home-page.ftl index f105863c..7235a394 100644 --- a/productMods/templates/freemarker/lib/lib-home-page.ftl +++ b/productMods/templates/freemarker/lib/lib-home-page.ftl @@ -204,17 +204,3 @@ var urlsBase = "${urls.base}"; --> - -<#-- retrieves a count, the number of researchers with a geographic focus, --> -<#-- and saves it as a js variable to be used by the homePageMaps.js file --> -<#macro getGeoResearcherCount> - - diff --git a/rdf/display/everytime/homePageDataGetters.n3 b/rdf/display/everytime/homePageDataGetters.n3 index 48bbcd1c..02184a68 100644 --- a/rdf/display/everytime/homePageDataGetters.n3 +++ b/rdf/display/everytime/homePageDataGetters.n3 @@ -17,35 +17,14 @@ display:academicDeptsDataGetter display:saveToVar "academicDeptDG" ; display:query """ PREFIX rdfs: - PREFIX rdf: PREFIX vivo: SELECT DISTINCT ?theURI (str(?label) as ?name) WHERE { - ?theURI rdf:type vivo:AcademicDepartment . + ?theURI a vivo:AcademicDepartment . ?theURI rdfs:label ?label } """ . - display:hasDataGetter display:researcherCountDataGetter . - -display:researcherCountDataGetter - a ; - display:saveToVar "researcherCountDG" ; - display:query """ - PREFIX geo: - PREFIX rdfs: - PREFIX rdf: - PREFIX core: - PREFIX foaf: - PREFIX vivoc: - - SELECT DISTINCT (COUNT(DISTINCT ?person) AS ?count) - WHERE { - ?person rdf:type foaf:Person . - ?person core:geographicFocus ?focus - } - - """ . diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java b/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java new file mode 100644 index 00000000..fa177450 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/GeoFocusResearcherCount.java @@ -0,0 +1,83 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.controller.ajax; + +import java.io.IOException; +import java.lang.Integer; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONException; + +import com.hp.hpl.jena.query.QuerySolution; +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.rdf.model.RDFNode; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils; + +public class GeoFocusResearcherCount extends AbstractAjaxResponder { + + private static final Log log = LogFactory.getLog(GeoFocusResearcherCount.class.getName()); + private List> geoFocusCount; + private static String GEO_FOCUS_COUNT_QUERY = "" + + "PREFIX core: \n" + + "PREFIX foaf: \n" + + "SELECT DISTINCT (COUNT(DISTINCT ?person) AS ?count) \n" + + "WHERE { \n" + + " ?person a foaf:Person . \n" + + " ?person core:geographicFocus ?focus \n" + + "}" ; + + public GeoFocusResearcherCount(HttpServlet parent, VitroRequest vreq, + HttpServletResponse resp) { + super(parent, vreq, resp); + } + + @Override + public String prepareResponse() throws IOException, JSONException { + try { + geoFocusCount = getGeoFocusCount(vreq); + + String response = "{ "; + + for (Map map: geoFocusCount) { + String theCount = map.get("count"); + response += "\"count\": \"" + theCount + "\""; + } + response += " }"; + log.debug(response); + return response; + } catch (Exception e) { + log.error("Failed geographic focus count", e); + return EMPTY_RESPONSE; + } + } + + private List> getGeoFocusCount(VitroRequest vreq) { + + String queryStr = GEO_FOCUS_COUNT_QUERY; + log.debug("queryStr = " + queryStr); + List> count = new ArrayList>(); + try { + ResultSet results = QueryUtils.getQueryResults(queryStr, vreq); + while (results.hasNext()) { + QuerySolution soln = results.nextSolution(); + count.add(QueryUtils.querySolutionToStringValueMap(soln)); + } + } catch (Exception e) { + log.error(e, e); + } + + return count; + } +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java b/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java index e5f2c437..3674d7cf 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/ajax/HomePageAjaxController.java @@ -1,42 +1,46 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - -package edu.cornell.mannlib.vitro.webapp.controller.ajax; - -import java.io.IOException; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletResponse; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController; - -/** - * Handle the AJAX functions that are specific to the "new" home page sections, at - * this point just the mapping of geographic locations. - */ -public class HomePageAjaxController extends VitroAjaxController { - private static final Log log = LogFactory - .getLog(HomePageAjaxController.class); - - private static final String PARAMETER_ACTION = "action"; - - @Override - protected void doRequest(VitroRequest vreq, HttpServletResponse resp) - throws ServletException, IOException { - try { - String function = vreq.getParameter(PARAMETER_ACTION); - if ("getGeoFocusLocations".equals(function)) { - new GeoFocusMapLocations(this, vreq, resp).processRequest(); - } else { - resp.getWriter().write("[]"); - } - } catch (Exception e) { - log.error(e, e); - resp.getWriter().write("[]"); - } - } - -} +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.controller.ajax; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.ajax.VitroAjaxController; + +/** + * Handle the AJAX functions that are specific to the "new" home page sections, at + * this point just the mapping of geographic locations. + */ +public class HomePageAjaxController extends VitroAjaxController { + private static final Log log = LogFactory + .getLog(HomePageAjaxController.class); + + private static final String PARAMETER_ACTION = "action"; + + @Override + protected void doRequest(VitroRequest vreq, HttpServletResponse resp) + throws ServletException, IOException { + try { + String function = vreq.getParameter(PARAMETER_ACTION); + if ("getGeoFocusLocations".equals(function)) { + new GeoFocusMapLocations(this, vreq, resp).processRequest(); + } + else if ("getGeoFocusResearcherCount".equals(function)) { + new GeoFocusResearcherCount(this, vreq, resp).processRequest(); + } + else { + resp.getWriter().write("[]"); + } + } catch (Exception e) { + log.error(e, e); + resp.getWriter().write("[]"); + } + } + +} diff --git a/themes/wilma/templates/page-home.ftl b/themes/wilma/templates/page-home.ftl index 8547e0b8..d28a80b5 100644 --- a/themes/wilma/templates/page-home.ftl +++ b/themes/wilma/templates/page-home.ftl @@ -110,6 +110,5 @@ $('input.search-homepage').attr("value","${i18n().limit_search} \u2192"); } - <@lh.getGeoResearcherCount/> \ No newline at end of file From 2de7bab3b2ca7968194e7629700900a180347e72 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Mon, 4 Nov 2013 15:17:10 -0500 Subject: [PATCH 13/40] VIVO-391 permitting migration of standalone advisee and advising relationship --- ...singRelationship.sparql => AdviseeRole.sparql} | 8 -------- .../sparqlConstructs/additions/AdvisorRole.sparql | 15 +++++++++++++++ .../deletions/AdvisingRelationshipDel.sparql | 6 ------ .../deletions/AdvisingRelationshipDel2.sparql | 13 +++++++++++++ 4 files changed, 28 insertions(+), 14 deletions(-) rename productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/{AdvisingRelationship.sparql => AdviseeRole.sparql} (57%) create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisingRelationship.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql similarity index 57% rename from productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisingRelationship.sparql rename to productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql index 71d12749..799823c3 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisingRelationship.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql @@ -6,18 +6,10 @@ CONSTRUCT { ?advisee _:AdviseeRole . _:AdviseeRole ?advisee . _:AdviseeRole a vivo:AdviseeRole . - ?advisor _:AdvisorRole . - _:AdvisorRole ?advisor . - _:AdvisorRole a vivo:AdvisorRole . _:AdviseeRole vivo:relatedBy ?advisingRelationship . ?advisingRelationship vivo:relates _:AdviseeRole . - _:AdvisorRole vivo:relatedBy ?advisingRelationship . - ?advisingRelationship vivo:relates _:AdvisorRole . ?advisingRelationship vivo:relates ?advisee . - ?advisingRelationship vivo:relates ?advisor . ?advisee vivo:relatedBy ?advisingRelationship . - ?advisor vivo:relatedBy ?advisingRelationship . } WHERE { ?advisee vivo:adviseeIn ?advisingRelationship . - ?advisor vivo:advisorIn ?advisingRelationship . } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql new file mode 100644 index 00000000..685a93e1 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql @@ -0,0 +1,15 @@ +PREFIX vivo: +PREFIX owl: +PREFIX foaf: + +CONSTRUCT { + ?advisor _:AdvisorRole . + _:AdvisorRole ?advisor . + _:AdvisorRole a vivo:AdvisorRole . + _:AdvisorRole vivo:relatedBy ?advisingRelationship . + ?advisingRelationship vivo:relates _:AdvisorRole . + ?advisingRelationship vivo:relates ?advisor . + ?advisor vivo:relatedBy ?advisingRelationship . +} WHERE { + ?advisor vivo:advisorIn ?advisingRelationship . +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql index 5a47e087..3bb114bd 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel.sparql @@ -3,15 +3,9 @@ PREFIX owl: PREFIX foaf: CONSTRUCT { - ?advisee vivo:adviseeIn ?advisingRelationship . - ?advisingRelationship vivo:advisee ?advisee . ?advisor vivo:advisorIn ?advisingRelationship . ?advisingRelationship vivo:advisor ?advisor } WHERE { - ?advisee vivo:adviseeIn ?advisingRelationship . - OPTIONAL { - ?advisingRelationship vivo:advisee ?advisee . - } ?advisor vivo:advisorIn ?advisingRelationship . OPTIONAL { ?advisingRelationship vivo:advisor ?advisor diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql new file mode 100644 index 00000000..6ef6c59e --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/AdvisingRelationshipDel2.sparql @@ -0,0 +1,13 @@ +PREFIX vivo: +PREFIX owl: +PREFIX foaf: + +CONSTRUCT { + ?advisee vivo:adviseeIn ?advisingRelationship . + ?advisingRelationship vivo:advisee ?advisee . +} WHERE { + ?advisee vivo:adviseeIn ?advisingRelationship . + OPTIONAL { + ?advisingRelationship vivo:advisee ?advisee . + } +} From b435a487bf16c528c4fbb03f997aca04775fcc17 Mon Sep 17 00:00:00 2001 From: j2blake Date: Mon, 4 Nov 2013 16:57:05 -0500 Subject: [PATCH 14/40] VIVO-473 Fix "short views" test case to work with ISF --- .../suites/ShortViews/shortview_config.n3 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 b/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 index 37e20113..1c0a1866 100644 --- a/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 +++ b/utilities/acceptance-tests/suites/ShortViews/shortview_config.n3 @@ -52,9 +52,10 @@ mydomain:facultyDepartmentDG display:query """ PREFIX rdfs: PREFIX vivo: +PREFIX obo: SELECT ?deptName WHERE { -?individualUri vivo:hasMemberRole ?membership . +?individualUri obo:RO_0000053 ?membership . ?membership vivo:roleContributesTo ?deptUri . ?deptUri a vivo:AcademicDepartment ; @@ -98,11 +99,11 @@ mydomain:departmentLocationDG display:saveToVar "locations" ; display:query """ PREFIX rdfs: -PREFIX vivo: +PREFIX obo: SELECT ?label WHERE { -?location vivo:geographicLocationOf ?individualUri ; +?location obo:RO_0001015 ?individualUri ; rdfs:label ?label . } LIMIT 20 @@ -113,12 +114,13 @@ mydomain:departmentHeadDG display:saveToVar "deptHead" ; display:query """ PREFIX rdfs: +PREFIX obo: PREFIX vivo: SELECT ?label WHERE { ?individualUri vivo:contributingRole ?role . -?role vivo:leaderRoleOf ?head . +?role obo:RO_0000052 ?head . ?head rdfs:label ?label . } LIMIT 1 From 6ef8cb6b800ef2e6b3e2aec1ad1ef0222c7a119f Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 5 Nov 2013 09:57:09 -0500 Subject: [PATCH 15/40] VIVO-429 and VIVO-486 --- productMods/config/listViewConfig-webpage.xml | 4 ++-- .../edit/forms/addGrantRoleToPerson.ftl | 2 +- .../forms/manageWebpagesForIndividual.ftl | 3 ++- .../AddEditWebpageFormGenerator.java | 22 +++++++++++++++++-- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/productMods/config/listViewConfig-webpage.xml b/productMods/config/listViewConfig-webpage.xml index 58ddf13c..9c97cad7 100644 --- a/productMods/config/listViewConfig-webpage.xml +++ b/productMods/config/listViewConfig-webpage.xml @@ -23,8 +23,8 @@ OPTIONAL { ?link vcard:url ?url } OPTIONAL { ?link core:rank ?rank } - FILTER ( bound(?url) ) - + FILTER ( bound(?link) ) + } ORDER BY ?rank ?label
diff --git a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl index 1fe602ef..7d65a5fa 100644 --- a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl @@ -180,4 +180,4 @@ ${scripts.add('')} ${scripts.add('')} ${scripts.add('')} - \ No newline at end of file + diff --git a/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl b/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl index c4f0b1d0..81f38396 100644 --- a/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl +++ b/productMods/templates/freemarker/edit/forms/manageWebpagesForIndividual.ftl @@ -11,6 +11,7 @@ <#assign deleteWebpageUrl=editConfiguration.pageData.deleteWebpageUrl!"deleteWebpageUrl is undefined"> <#assign showAddFormUrl=editConfiguration.pageData.showAddFormUrl!"showAddFormUrl is undefined"> <#assign predicateUri=editConfiguration.predicateUri!"undefined"> +<#assign domainUri = editConfiguration.predicateProperty.domainVClassURI!""> <#if (editConfiguration.pageData.subjectName??) >

${editConfiguration.pageData.subjectName}

@@ -56,7 +57,7 @@ <#-- There is no editConfig at this stage, so we don't need to go through postEditCleanup.jsp on cancel. These can just be ordinary links, rather than a v:input element, as in addAuthorsToInformationResource.jsp. --> - ${i18n().add_new_web_page} + ${i18n().add_new_web_page} ${i18n().return_to_profile} 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 0ac4d3a7..4a742623 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 @@ -12,6 +12,9 @@ import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.rdf.model.Literal; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.RDFNode; import com.hp.hpl.jena.vocabulary.XSD; @@ -44,7 +47,7 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator prepare(vreq, config); return config; } - + //Have broken this method down into two portions to allow for overriding of edit configuration //without having to copy the entire method and before prepare is called @@ -58,6 +61,9 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator initPropertyParameters(vreq, session, config); initObjectPropForm(config, vreq); String linkUri = getLinkUri(vreq); + String domainUri = vreq.getParameter("domainUri"); + String vcardIndividualType = "http://www.w3.org/2006/vcard/ns#Kind"; + config.setVarNameForSubject("subject"); config.setVarNameForObject("vcard"); @@ -73,11 +79,22 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator config.addUrisInScope("linkUrlPredicate", list( "http://www.w3.org/2006/vcard/ns#url" )); config.addUrisInScope("linkLabelPredicate", list( "http://www.w3.org/2000/01/rdf-schema#label" )); config.addUrisInScope("rankPredicate", list( core + "rank")); - config.addSparqlForAdditionalUrisInScope("vcard", individualVcardQuery); + config.addUrisInScope("vcardType", list( vcardIndividualType )); + if ( config.isUpdate() ) { config.addUrisInScope("link", list( linkUri )); } + else { + if ( domainUri.equals("http://xmlns.com/foaf/0.1/Person") ) { + vcardIndividualType = "http://www.w3.org/2006/vcard/ns#Individual"; + } + else if ( domainUri.equals("http://xmlns.com/foaf/0.1/Organization") ) { + vcardIndividualType = "http://www.w3.org/2006/vcard/ns#Organization"; + } + } + config.addSparqlForAdditionalUrisInScope("vcard", individualVcardQuery); + config.setUrisOnForm("urlType"); config.setLiteralsOnForm(list("url","label","rank")); @@ -129,6 +146,7 @@ public class AddEditWebpageFormGenerator extends BaseEditConfigurationGenerator static String N3_FOR_WEBPAGE = "?subject ?webpageProperty ?vcard . \n"+ "?vcard ?inverseProperty ?subject . \n"+ + "?vcard a ?vcardType . \n" + "?vcard ?link ."+ "?link a . \n" + "?link ?linkUrlPredicate ?url ."; From a68ef819ee4cd4eed4f64cfda89962cd990877ca Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 10:01:46 -0500 Subject: [PATCH 16/40] VIVO-403 safeguards against duplicate context node creation in migration --- .../additions/AdviseeRole.sparql | 4 +++ .../additions/AdvisorRole.sparql | 4 +++ .../additions/Editorship.sparql | 4 +++ .../additions/LeaderRole.sparql | 4 +++ .../additions/MemberRole.sparql | 4 +++ .../additions/grantAdmin.sparql | 5 +++ .../additions/post/awardedDegree.sparql | 4 +++ .../additions/vcard1-0.sparql | 24 ------------- .../additions/vcard1-0a.sparql | 15 ++++++++ .../additions/vcard1-0b.sparql | 15 ++++++++ .../additions/vcard1-0c.sparql | 15 ++++++++ .../additions/vcard1-0d.sparql | 16 +++++++++ .../additions/vcard1-0e.sparql | 16 +++++++++ .../additions/vcard1-0f.sparql | 16 +++++++++ .../additions/vcard1-0g.sparql | 16 +++++++++ .../additions/vcard1-0h.sparql | 16 +++++++++ .../additions/vcard1-0i.sparql | 16 +++++++++ .../additions/vcard1-0j.sparql | 16 +++++++++ .../additions/vcard1-1.sparql | 21 ----------- .../additions/vcard1-1d.sparql | 16 +++++++++ .../additions/vcard1-1e.sparql | 16 +++++++++ .../additions/vcard1-1f.sparql | 16 +++++++++ .../additions/vcard1-1g.sparql | 16 +++++++++ .../additions/vcard1-1h.sparql | 16 +++++++++ .../additions/vcard1-1i.sparql | 16 +++++++++ .../additions/vcard1-1j.sparql | 16 +++++++++ .../additions/vcard1-2.sparql | 21 ----------- .../additions/vcard1-2d.sparql | 16 +++++++++ .../additions/vcard1-2e.sparql | 16 +++++++++ .../additions/vcard1-2f.sparql | 16 +++++++++ .../additions/vcard1-2g.sparql | 16 +++++++++ .../additions/vcard1-2h.sparql | 16 +++++++++ .../additions/vcard1-2i.sparql | 16 +++++++++ .../additions/vcard1-2j.sparql | 16 +++++++++ .../sparqlConstructs/additions/vcard2.sparql | 36 ------------------- .../sparqlConstructs/additions/vcard22.sparql | 5 ++- .../sparqlConstructs/additions/vcard2a.sparql | 17 +++++++++ .../sparqlConstructs/additions/vcard2b.sparql | 13 +++++++ .../sparqlConstructs/additions/vcard2c.sparql | 17 +++++++++ .../sparqlConstructs/additions/vcard2d.sparql | 13 +++++++ .../sparqlConstructs/additions/vcard2e.sparql | 17 +++++++++ .../sparqlConstructs/additions/vcard2f.sparql | 13 +++++++ .../sparqlConstructs/additions/vcard2g.sparql | 17 +++++++++ .../sparqlConstructs/additions/vcard2h.sparql | 13 +++++++ .../sparqlConstructs/additions/vcard2i.sparql | 17 +++++++++ .../sparqlConstructs/additions/vcard2j.sparql | 13 +++++++ .../sparqlConstructs/additions/vcard3.sparql | 5 ++- .../sparqlConstructs/additions/vcard4.sparql | 6 +++- .../sparqlConstructs/additions/vcard5.sparql | 5 ++- .../sparqlConstructs/additions/vcard6.sparql | 6 +++- .../sparqlConstructs/additions/vcard7.sparql | 6 +++- .../sparqlConstructs/additions/vcard8.sparql | 13 ++++--- .../sparqlConstructs/additions/vcard9.sparql | 5 ++- rdf/tbox/filegraph/data-properties.owl | 3 -- 54 files changed, 599 insertions(+), 117 deletions(-) delete mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0a.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0b.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0d.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0e.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0f.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0g.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0h.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0i.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0j.sparql delete mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1d.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1e.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1f.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1g.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1h.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1i.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1j.sparql delete mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2d.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2e.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2f.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2g.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2h.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2i.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2j.sparql delete mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2a.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2b.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2c.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2e.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2f.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2g.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2h.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2i.sparql create mode 100644 productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2j.sparql diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql index 799823c3..c79d5687 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql @@ -12,4 +12,8 @@ CONSTRUCT { ?advisee vivo:relatedBy ?advisingRelationship . } WHERE { ?advisee vivo:adviseeIn ?advisingRelationship . + FILTER NOT EXISTS { + ?advisee ?adviseeRoleNode . + ?adviseeRoleNode vivo:relatedBy ?advisingRelationship . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql index 685a93e1..8a389c08 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql @@ -12,4 +12,8 @@ CONSTRUCT { ?advisor vivo:relatedBy ?advisingRelationship . } WHERE { ?advisor vivo:advisorIn ?advisingRelationship . + FILTER NOT EXISTS { + ?advisor ?advisorRoleNode . + ?advisorRoleNode vivo:relatedBy ?advisingRelationship . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/Editorship.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/Editorship.sparql index 79e50249..204664f8 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/Editorship.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/Editorship.sparql @@ -14,5 +14,9 @@ CONSTRUCT { } UNION { ?document vivo:editor ?person FILTER NOT EXISTS { ?person vivo:editorOf ?document } + } + FILTER NOT EXISTS { + ?person vivo:relatedBy ?editorshipNode . + ?editorshipNode vivo:relates ?document . } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/LeaderRole.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/LeaderRole.sparql index b5236339..2a09ef27 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/LeaderRole.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/LeaderRole.sparql @@ -14,4 +14,8 @@ CONSTRUCT { { ?org vivo:currentlyHeadedBy ?person FILTER NOT EXISTS { ?person vivo:currentlyHeadOf ?org } } + FILTER NOT EXISTS { + ?person ?leaderRoleNode . + ?leaderRoleNode vivo:roleContributesTo ?org . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/MemberRole.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/MemberRole.sparql index fecea0cc..85a5b275 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/MemberRole.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/MemberRole.sparql @@ -14,4 +14,8 @@ CONSTRUCT { { ?org vivo:hasCurrentMember ?person FILTER NOT EXISTS { ?person vivo:currentMemberOf ?org } } + FILTER NOT EXISTS { + ?person ?memberRoleNode . + ?memberRoleNode vivo:roleContributesTo ?org . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/grantAdmin.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/grantAdmin.sparql index d76c98d7..72315e11 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/grantAdmin.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/grantAdmin.sparql @@ -16,4 +16,9 @@ CONSTRUCT { { ?grant vivo:administeredBy ?agent FILTER NOT EXISTS { ?agent vivo:administers ?grant } } + FILTER NOT EXISTS { + ?agent ?adminRoleNode . + ?adminRoleNode a vivo:AdministratorRole . + ?adminRoleNode vivo:relatedBy ?grant . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/awardedDegree.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/awardedDegree.sparql index 8d90cd6d..5beaf5a2 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/awardedDegree.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/awardedDegree.sparql @@ -22,4 +22,8 @@ CONSTRUCT { ?educationalProcess ?org . ?org a foaf:Organization } + FILTER NOT EXISTS { + ?educationalProcess ?awardedDegreeNode . + ?person vivo:relatedBy ?awardedDegreeNode . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0.sparql deleted file mode 100644 index a9262a27..00000000 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0.sparql +++ /dev/null @@ -1,24 +0,0 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: - -CONSTRUCT { - ?s arg:ARG_2000028 _:vcard . - _:vcard arg:ARG_2000029 ?s . - _:vcard a v:Individual . -} WHERE { - ?s a foaf:Person - FILTER ( - EXISTS { ?s foaf:firstName ?firstName } || - EXISTS { ?s foaf:lastName ?lastName } || - EXISTS { ?s vivo:middleName ?middleName } || - EXISTS { ?s vivo:email ?email } || - EXISTS { ?s vivo:primaryEmail ?primaryEmail } || - EXISTS { ?s vivo:phoneNumber ?phoneNumber } || - EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || - EXISTS { ?s vivo:faxNumber ?faxNumber } || - EXISTS { ?s vivo:mailingAddress ?address } || - EXISTS { ?s vivo:webpage ?webpage } - ) -} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0a.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0a.sparql new file mode 100644 index 00000000..193cc5aa --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0a.sparql @@ -0,0 +1,15 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s foaf:firstName ?firstName + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0b.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0b.sparql new file mode 100644 index 00000000..f41fd0bc --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0b.sparql @@ -0,0 +1,15 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s foaf:lastName ?lastName + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql new file mode 100644 index 00000000..03405d95 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql @@ -0,0 +1,15 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:middleName ?middleName + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0d.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0d.sparql new file mode 100644 index 00000000..1842a23a --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0d.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:email ?email . + ?s a foaf:Person . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0e.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0e.sparql new file mode 100644 index 00000000..f392f36e --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0e.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:primaryEmail ?email . + ?s a foaf:Person . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0f.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0f.sparql new file mode 100644 index 00000000..d01698a8 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0f.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:phoneNumber ?phoneNumber . + ?s a foaf:Person . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0g.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0g.sparql new file mode 100644 index 00000000..a578d3e0 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0g.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:primaryPhoneNumber ?primaryPhoneNumber . + ?s a foaf:Person + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0h.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0h.sparql new file mode 100644 index 00000000..8abf7951 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0h.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:faxNumber ?faxNumber . + ?s a foaf:Person + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0i.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0i.sparql new file mode 100644 index 00000000..1e966109 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0i.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:mailingAddress ?address . + ?s a foaf:Person + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0j.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0j.sparql new file mode 100644 index 00000000..22857e64 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0j.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Individual . +} WHERE { + ?s vivo:webpage ?webpage . + ?s a foaf:Person + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1.sparql deleted file mode 100644 index a15d4d0f..00000000 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1.sparql +++ /dev/null @@ -1,21 +0,0 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: - -CONSTRUCT { - ?s arg:ARG_2000028 _:vcard . - _:vcard arg:ARG_2000029 ?s . - _:vcard a v:Organization . -} WHERE { - ?s a foaf:Organization - FILTER ( - EXISTS { ?s vivo:email ?email } || - EXISTS { ?s vivo:primaryEmail ?primaryEmail } || - EXISTS { ?s vivo:phoneNumber ?phoneNumber } || - EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || - EXISTS { ?s vivo:faxNumber ?faxNumber } || - EXISTS { ?s vivo:mailingAddress ?address } || - EXISTS { ?s vivo:webpage ?webpage } - ) -} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1d.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1d.sparql new file mode 100644 index 00000000..b7a4c933 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1d.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:email ?email . + ?s a foaf:Organization . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1e.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1e.sparql new file mode 100644 index 00000000..fad907f8 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1e.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:primaryEmail ?email . + ?s a foaf:Organization . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1f.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1f.sparql new file mode 100644 index 00000000..5baf40f5 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1f.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:phoneNumber ?phoneNumber . + ?s a foaf:Organization . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1g.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1g.sparql new file mode 100644 index 00000000..90c98507 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1g.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:primaryPhoneNumber ?primaryPhoneNumber . + ?s a foaf:Organization + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1h.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1h.sparql new file mode 100644 index 00000000..036b1c92 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1h.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:faxNumber ?faxNumber . + ?s a foaf:Organization + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1i.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1i.sparql new file mode 100644 index 00000000..071cf222 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1i.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:mailingAddress ?address . + ?s a foaf:Organization + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1j.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1j.sparql new file mode 100644 index 00000000..a7690455 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-1j.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Organization . +} WHERE { + ?s vivo:webpage ?webpage . + ?s a foaf:Organization + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2.sparql deleted file mode 100644 index b966a2a3..00000000 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2.sparql +++ /dev/null @@ -1,21 +0,0 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: - -CONSTRUCT { - ?s arg:ARG_2000028 _:vcard . - _:vcard arg:ARG_2000029 ?s . - _:vcard a v:Group . -} WHERE { - ?s a foaf:Group - FILTER ( - EXISTS { ?s vivo:email ?email } || - EXISTS { ?s vivo:primaryEmail ?primaryEmail } || - EXISTS { ?s vivo:phoneNumber ?phoneNumber } || - EXISTS { ?s vivo:primaryPhoneNumber ?primaryPhoneNumber } || - EXISTS { ?s vivo:faxNumber ?faxNumber } || - EXISTS { ?s vivo:mailingAddress ?address } || - EXISTS { ?s vivo:webpage ?webpage } - ) -} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2d.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2d.sparql new file mode 100644 index 00000000..37add2fa --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2d.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:email ?email . + ?s a foaf:Group . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2e.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2e.sparql new file mode 100644 index 00000000..27f965b6 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2e.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:primaryEmail ?email . + ?s a foaf:Group . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2f.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2f.sparql new file mode 100644 index 00000000..3018c379 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2f.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:phoneNumber ?phoneNumber . + ?s a foaf:Group . + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2g.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2g.sparql new file mode 100644 index 00000000..7b0de744 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2g.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:primaryPhoneNumber ?primaryPhoneNumber . + ?s a foaf:Group + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2h.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2h.sparql new file mode 100644 index 00000000..2ebffbbc --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2h.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:faxNumber ?faxNumber . + ?s a foaf:Group + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2i.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2i.sparql new file mode 100644 index 00000000..3e83b11e --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2i.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:mailingAddress ?address . + ?s a foaf:Group + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2j.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2j.sparql new file mode 100644 index 00000000..3ec0ab9e --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-2j.sparql @@ -0,0 +1,16 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: + +CONSTRUCT { + ?s arg:ARG_2000028 _:vcard . + _:vcard arg:ARG_2000029 ?s . + _:vcard a v:Group . +} WHERE { + ?s vivo:webpage ?webpage . + ?s a foaf:Group + FILTER NOT EXISTS { + ?s arg:ARG_2000028 ?vcard . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2.sparql deleted file mode 100644 index 499d0bbb..00000000 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2.sparql +++ /dev/null @@ -1,36 +0,0 @@ -PREFIX arg: -PREFIX foaf: -PREFIX v: -PREFIX vivo: -PREFIX bibo: - -CONSTRUCT { - ?vcard v:hasName _:name . - _:name a v:Name . - _:name v:givenName ?firstName . - _:name vivo:middleName ?middleName . - _:name v:familyName ?lastName . - _:name v:honorificPrefix ?prefix . - _:name v:honorificSuffix ?suffix . -} WHERE { - ?s arg:ARG_2000028 ?vcard . - OPTIONAL { - ?s foaf:firstName ?firstName . - BIND("yes" as ?test) - } - OPTIONAL { - ?s foaf:lastName ?lastName . - BIND("yes" as ?test) - } - OPTIONAL { - ?s vivo:middleName ?middleName - BIND("yes" as ?test) - } - OPTIONAL { - ?s bibo:prefixName ?prefix - } - OPTIONAL { - ?s bibo:suffixName ?suffix - } - FILTER(bound(?test)) -} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard22.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard22.sparql index 9107814a..db2f6276 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard22.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard22.sparql @@ -9,6 +9,9 @@ CONSTRUCT { _:title a v:Title . _:title v:title ?preferredTitle . } WHERE { - ?s arg:ARG_2000028 ?vcard . ?s ?preferredTitle . + ?s arg:ARG_2000028 ?vcard . + FILTER NOT EXISTS { + ?vcard v:hasTitle ?title + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2a.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2a.sparql new file mode 100644 index 00000000..ef2dc2ba --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2a.sparql @@ -0,0 +1,17 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?vcard v:hasName _:name . + _:name a v:Name . + _:name v:givenName ?firstName . +} WHERE { + ?s foaf:firstName ?firstName . + ?s arg:ARG_2000028 ?vcard . + FILTER NOT EXISTS { + ?vcard v:hasName ?name + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2b.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2b.sparql new file mode 100644 index 00000000..64634413 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2b.sparql @@ -0,0 +1,13 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?name v:givenName ?firstName . +} WHERE { + ?s foaf:firstName ?firstName . + ?s arg:ARG_2000028 ?vcard . + ?vcard v:hasName ?name +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2c.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2c.sparql new file mode 100644 index 00000000..dbcaf50a --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2c.sparql @@ -0,0 +1,17 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?vcard v:hasName _:name . + _:name a v:Name . + _:name vivo:middleName ?middleName . +} WHERE { + ?s vivo:middleName ?middleName . + ?s arg:ARG_2000028 ?vcard . + FILTER NOT EXISTS { + ?vcard v:hasName ?name + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql new file mode 100644 index 00000000..a065a9fe --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql @@ -0,0 +1,13 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?name vivo:middleName ?middleName . +} WHERE { + ?s vivo:middleName ?middleName . + ?s arg:ARG_2000028 ?vcard . + ?vcard v:hasName ?name +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2e.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2e.sparql new file mode 100644 index 00000000..cfa9ea92 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2e.sparql @@ -0,0 +1,17 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?vcard v:hasName _:name . + _:name a v:Name . + _:name v:familyName ?lastName . +} WHERE { + ?s foaf:lastName ?lastName . + ?s arg:ARG_2000028 ?vcard . + FILTER NOT EXISTS { + ?vcard v:hasName ?name + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2f.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2f.sparql new file mode 100644 index 00000000..4337be4d --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2f.sparql @@ -0,0 +1,13 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?name v:familyName ?lastName . +} WHERE { + ?s foaf:lastName ?lastName . + ?s arg:ARG_2000028 ?vcard . + ?vcard v:hasName ?name +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2g.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2g.sparql new file mode 100644 index 00000000..66231ddf --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2g.sparql @@ -0,0 +1,17 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?vcard v:hasName _:name . + _:name a v:Name . + _:name v:honorificPrefix ?prefixName . +} WHERE { + ?s bibo:prefixName ?prefixName . + ?s arg:ARG_2000028 ?vcard . + FILTER NOT EXISTS { + ?vcard v:hasName ?name + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2h.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2h.sparql new file mode 100644 index 00000000..1eb06b3b --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2h.sparql @@ -0,0 +1,13 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?name v:honorificPrefix ?prefixName . +} WHERE { + ?s bibo:prefixName ?prefixName . + ?s arg:ARG_2000028 ?vcard . + ?vcard v:hasName ?name +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2i.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2i.sparql new file mode 100644 index 00000000..5d873f15 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2i.sparql @@ -0,0 +1,17 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?vcard v:hasName _:name . + _:name a v:Name . + _:name v:honorificSuffix ?suffixName . +} WHERE { + ?s bibo:suffixName ?suffixName . + ?s arg:ARG_2000028 ?vcard . + FILTER NOT EXISTS { + ?vcard v:hasName ?name + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2j.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2j.sparql new file mode 100644 index 00000000..a3abaff9 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2j.sparql @@ -0,0 +1,13 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?name v:honorificSuffix ?suffixName . +} WHERE { + ?s bibo:suffixName ?suffixName . + ?s arg:ARG_2000028 ?vcard . + ?vcard v:hasName ?name +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard3.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard3.sparql index 91991c9e..2952d182 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard3.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard3.sparql @@ -8,6 +8,9 @@ CONSTRUCT { _:email a v:Email . _:email v:email ?email . } WHERE { + ?s vivo:email ?email . ?s arg:ARG_2000028 ?vcard . - ?s vivo:email ?email + FILTER NOT EXISTS { + ?vcard v:hasEmail ?emailnode + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard4.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard4.sparql index b6f9409f..8699c703 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard4.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard4.sparql @@ -9,6 +9,10 @@ CONSTRUCT { _:primaryEmail a v:Work . _:primaryEmail v:email ?primaryEmail . } WHERE { + ?s vivo:primaryEmail ?primaryEmail . ?s arg:ARG_2000028 ?vcard . - ?s vivo:primaryEmail ?primaryEmail + FILTER NOT EXISTS { + ?vcard v:hasEmail ?email . + ?email a v:Work . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard5.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard5.sparql index 6deedc83..26017bc1 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard5.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard5.sparql @@ -9,6 +9,9 @@ CONSTRUCT { _:telephone a v:Voice . _:telephone v:telephone ?phoneNumber . } WHERE { + ?s vivo:phoneNumber ?phoneNumber . ?s arg:ARG_2000028 ?vcard . - ?s vivo:phoneNumber ?phoneNumber + FILTER NOT EXISTS { + ?vcard v:hasTelephone ?telephoneNode . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard6.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard6.sparql index d5c0f26e..8bc690a0 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard6.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard6.sparql @@ -10,6 +10,10 @@ CONSTRUCT { _:primaryTelephone a v:Work . _:primaryTelephone v:telephone ?primaryPhoneNumber . } WHERE { + ?s vivo:primaryPhoneNumber ?primaryPhoneNumber . ?s arg:ARG_2000028 ?vcard . - ?s vivo:primaryPhoneNumber ?primaryPhoneNumber + FILTER NOT EXISTS { + ?vcard v:hasTelephone ?telephoneNode . + ?vcard a v:Work . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard7.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard7.sparql index 39982679..c94a7638 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard7.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard7.sparql @@ -9,6 +9,10 @@ CONSTRUCT { _:fax a v:Fax. _:fax v:telephone ?faxNumber . } WHERE { + ?s vivo:faxNumber ?faxNumber . ?s arg:ARG_2000028 ?vcard . - ?s vivo:faxNumber ?faxNumber + FILTER NOT EXISTS { + ?vcard v:hasTelephone ?faxNode . + ?faxNode a v:Fax . + } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql index eb88f650..1f1dddce 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql @@ -12,12 +12,12 @@ CONSTRUCT { _:address v:postalCode ?addressPostalCode . _:address v:country ?addressCountry . } WHERE { - ?s arg:ARG_2000028 ?vcard . ?s vivo:mailingAddress ?address . - ?address vivo:addressCity ?addressCity . - ?address vivo:addressState ?addressState . - ?address vivo:addressCountry ?addressCountry . - ?address vivo:addressPostalCode ?addressPostalCode . + OPTIONAL { ?address vivo:addressCity ?addressCity } + OPTIONAL { ?address vivo:addressState ?addressState } + OPTIONAL { ?address vivo:addressPostalCode ?addressPostalCode } + OPTIONAL { ?address vivo:addressCountry ?addressCountry } + ?s arg:ARG_2000028 ?vcard . OPTIONAL { ?address vivo:address1 ?address1 . ?address vivo:address2 ?address2 . @@ -33,5 +33,8 @@ CONSTRUCT { OPTIONAL { ?address vivo:address1 ?address1 BIND(?address1 as ?streetAddress) + } + FILTER NOT EXISTS { + ?vcard v:hasAddress ?addressNode } } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard9.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard9.sparql index d400de8f..62c04e1b 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard9.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard9.sparql @@ -10,10 +10,13 @@ CONSTRUCT { _:url v:url ?linkURI . _:url rdfs:label ?linkAnchorText } WHERE { - ?s arg:ARG_2000028 ?vcard . ?s vivo:webpage ?webpage . ?webpage vivo:linkURI ?linkURI . + ?s arg:ARG_2000028 ?vcard . OPTIONAL { ?webpage vivo:linkAnchorText ?linkAnchorText } + FILTER NOT EXISTS { + ?vcard v:hasURL ?URLNode + } } diff --git a/rdf/tbox/filegraph/data-properties.owl b/rdf/tbox/filegraph/data-properties.owl index 771b3128..5799c1e7 100644 --- a/rdf/tbox/filegraph/data-properties.owl +++ b/rdf/tbox/filegraph/data-properties.owl @@ -1833,16 +1833,13 @@ use one freetextKeyword assertion for each keyword or phrase. - - - From bb4145e5657f51ceef0e2af79b6cdb6c6c9bc5ec Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 10:45:57 -0500 Subject: [PATCH 17/40] VIVO-388 fixes vivo:middleName migration bug --- .../update/sparqlConstructs/deletions/vcardDel.sparql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql index 439b7599..d31781cf 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql @@ -27,7 +27,8 @@ CONSTRUCT { ?s foaf:lastName ?lastName . } UNION { - ?s vivo:middleName ?middleName + ?s vivo:middleName ?middleName . + ?s a foaf:Person . } UNION { ?s bibo:prefixName ?prefix From 2d05f1d814c15f9eb9e84adfa9f2186fb5a5fcf1 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 5 Nov 2013 11:05:02 -0500 Subject: [PATCH 18/40] VIVO-476 --- productMods/counter.jsp | 888 ++++++++++++++++++++-------------------- 1 file changed, 454 insertions(+), 434 deletions(-) diff --git a/productMods/counter.jsp b/productMods/counter.jsp index 0b8de8a7..51474cd0 100644 --- a/productMods/counter.jsp +++ b/productMods/counter.jsp @@ -1,434 +1,454 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://djpowell.net/tmp/sparql-tag/0.1/" prefix="sparql" %> -<%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.1" prefix="str" %> -<%@ page import="java.net.URLDecoder" %> - -
- -

Linkage Information

-
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(?author) as ?counts) WHERE { - ?author rdf:type core:Authorship . - ?author core:linkedInformationResource ?infor . - ?infor rdf:type core:InformationResource . - } - - -
  • 'Person'-'InformationResource' linkages (${inforauthorship.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX foaf: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?author) as ?counts) WHERE { - ?author core:authorInAuthorship ?obj . - ?author rdf:type foaf:Person . - ?obj core:linkedInformationResource ?infor . - ?infor rdf:type core:InformationResource . - } - - -
  • 'Person' entities which published 'InformationResource' entities (${inforauthor.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?infor) as ?counts) WHERE { - ?subj core:linkedInformationResource ?infor . - ?infor rdf:type core:InformationResource . - } - - -
  • 'InformationResource' entities (${infor.counts.string})
  • -
    -
    -
    -
- - -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(?author) as ?counts) WHERE { - ?author rdf:type core:Authorship . - ?author core:linkedInformationResource ?infor . - ?infor rdf:type core:ConferencePaper . - } - - -
  • 'Person'-'ConferencePaper' linkages (${confauthorship.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX foaf: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?author) as ?counts) WHERE { - ?author core:authorInAuthorship ?obj . - ?author rdf:type foaf:Person . - ?obj core:linkedInformationResource ?infor . - ?infor rdf:type core:ConferencePaper . - } - - -
  • 'Person' entities which published 'ConferencePaper' entities (${confauthor.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?infor) as ?counts) WHERE { - ?subj core:linkedInformationResource ?infor . - ?infor rdf:type core:ConferencePaper . - } - - -
  • 'ConferencePaper' entities (${conf.counts.string})
  • -
    -
    -
    -
- - -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(?author) as ?counts) WHERE { - ?author rdf:type core:Authorship . - ?author core:linkedInformationResource ?infor . - ?infor rdf:type bibo:AcademicArticle . - } - - -
  • 'Person'-'AcademicArticle' linkages (${acaauthorship.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX foaf: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?author) as ?counts) WHERE { - ?author core:authorInAuthorship ?obj . - ?author rdf:type foaf:Person . - ?obj core:linkedInformationResource ?infor . - ?infor rdf:type bibo:AcademicArticle . - } - - -
  • 'Person' entities which published 'AcademicArticle' entities (${acaauthor.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?infor) as ?counts) WHERE { - ?subj core:linkedInformationResource ?infor . - ?infor rdf:type bibo:AcademicArticle . - } - - -
  • 'AcademicArticle' entities (${aca.counts.string})
  • -
    -
    -
    -
- - -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(*) as ?counts) WHERE { - ?grant core:hasInvestigator ?pi . - } - - -
  • 'Person'-'Grant' linkages (${piship.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?pi) as ?counts) WHERE { - ?grant core:hasInvestigator ?pi . - ?grant rdf:type core:Grant . - } - - -
  • 'Person' entities which are (co-)investigators on 'Grant' entities (${pi.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?grant) as ?counts) WHERE { - ?grant rdf:type core:Grant . - } - - -
  • 'Grant' entities (${grant.counts.string})
  • -
    -
    -
    -
- - -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(*) as ?counts) WHERE { - ?teacher core:teaching ?obj . - } - - -
  • 'Person'-'CourseSection' linkages (${teaching.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(distinct ?teacher) as ?counts) WHERE { - ?teacher core:teaching ?obj . - } - - -
  • 'Person' entities which teach 'CourseSection' entities (${teacher.counts.string})
  • -
    -
    -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(?course) as ?counts) WHERE { - ?course rdf:type core:CourseSection . - } - - -
  • 'CourseSection' entities (${course.counts.string})
  • -
    -
    -
    -
- - -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(*) as ?counts) WHERE { - ?author1 rdf:type core:Authorship . - ?author2 rdf:type core:Authorship . - ?author1 core:linkedInformationResource ?infor . - ?author2 core:linkedInformationResource ?infor . - ?infor rdf:type core:InformationResource . - FILTER (str(?author1) < str(?author2)) - } - - -
  • Total co-author linkages (${coauthor.counts.string})
  • -
    -
    -
    - - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT DISTINCT ?author1 ?author2 WHERE { - ?author1 rdf:type core:Authorship . - ?author2 rdf:type core:Authorship . - ?author1 core:linkedInformationResource ?infor . - ?author2 core:linkedInformationResource ?infor . - ?infor rdf:type core:InformationResource . - FILTER (str(?author1) < str(?author2)) - } - -
  • Unique co-author linkages (${fn:length(discoauthors.rows)})
  • -
    -
    -
- - -
    - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT (count(*) as ?counts) WHERE { - ?grant core:hasInvestigator ?pi1 . - ?grant core:hasInvestigator ?pi2 . - FILTER (str(?pi1) < str(?pi2)) - } - - -
  • Total co-investigator linkages (${copi.counts.string})
  • -
    -
    -
    - - - - - - PREFIX rdfs: - PREFIX rdf: - PREFIX akt: - PREFIX bibo: - PREFIX core: - SELECT DISTINCT ?pi1 ?pi2 WHERE { - ?grant core:hasInvestigator ?pi1 . - ?grant core:hasInvestigator ?pi2 . - FILTER (str(?pi1) < str(?pi2)) - } - -
  • Unique co-investigator linkages (${fn:length(discopis.rows)})
  • -
    -
    - -
- -
+<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> + +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib uri="http://djpowell.net/tmp/sparql-tag/0.1/" prefix="sparql" %> +<%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.1" prefix="str" %> +<%@ page import="java.net.URLDecoder" %> + +
+ +

Linkage Information

+
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT (count(?author) as ?counts) WHERE { + ?author rdf:type core:Authorship . + ?author core:relates ?infor . + ?infor rdf:type obo:IAO_0000030 . + } + + +
  • 'Person'-'InformationResource' linkages (${inforauthorship.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX foaf: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT (count(distinct ?author) as ?counts) WHERE { + ?author core:relatedBy ?obj . + ?author rdf:type foaf:Person . + ?obj rdf:type core:Authorship . + ?obj core:relates ?infor . + ?infor rdf:type obo:IAO_0000030 . + } + + +
  • 'Person' entities which published 'InformationResource' entities (${inforauthor.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT (count(distinct ?infor) as ?counts) WHERE { + ?subj core:relates ?infor . + ?infor rdf:type obo:IAO_0000030 . + } + + +
  • 'InformationResource' entities (${infor.counts.string})
  • +
    +
    +
    +
+ + +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(?author) as ?counts) WHERE { + ?author rdf:type core:Authorship . + ?author core:relates ?infor . + ?infor rdf:type core:ConferencePaper . + } + + +
  • 'Person'-'ConferencePaper' linkages (${confauthorship.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX foaf: + PREFIX bibo: + PREFIX core: + SELECT (count(distinct ?author) as ?counts) WHERE { + ?author core:relatedBy ?obj . + ?author rdf:type foaf:Person . + ?obj rdf:type core:Authorship . + ?obj core:relates ?infor . + ?infor rdf:type core:ConferencePaper . + } + + +
  • 'Person' entities which published 'ConferencePaper' entities (${confauthor.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(distinct ?infor) as ?counts) WHERE { + ?subj core:relates ?infor . + ?infor rdf:type core:ConferencePaper . + } + + +
  • 'ConferencePaper' entities (${conf.counts.string})
  • +
    +
    +
    +
+ + +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(?author) as ?counts) WHERE { + ?author rdf:type core:Authorship . + ?author core:relates ?infor . + ?infor rdf:type bibo:AcademicArticle . + } + + +
  • 'Person'-'AcademicArticle' linkages (${acaauthorship.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX foaf: + PREFIX bibo: + PREFIX core: + SELECT (count(distinct ?author) as ?counts) WHERE { + ?author core:relatedBy ?obj . + ?author rdf:type foaf:Person . + ?obj rdf:type core:Authorship . + ?obj core:relates ?infor . + ?infor rdf:type bibo:AcademicArticle . + } + + +
  • 'Person' entities which published 'AcademicArticle' entities (${acaauthor.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(distinct ?infor) as ?counts) WHERE { + ?subj core:relates ?infor . + ?infor rdf:type bibo:AcademicArticle . + } + + +
  • 'AcademicArticle' entities (${aca.counts.string})
  • +
    +
    +
    +
+ + +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(*) as ?counts) WHERE { + ?grant core:relates ?pi . + ?grant rdf:type core:Grant . + ?pi rdf:type core:InvestigatorRole . + } + + +
  • 'Person'-'Grant' linkages (${piship.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(distinct ?pi) as ?counts) WHERE { + ?grant core:relates ?pi . + ?grant rdf:type core:Grant . + ?pi rdf:type core:InvestigatorRole . + } + + +
  • 'Person' entities which are (co-)investigators on 'Grant' entities (${pi.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(distinct ?grant) as ?counts) WHERE { + ?grant rdf:type core:Grant . + } + + +
  • 'Grant' entities (${grant.counts.string})
  • +
    +
    +
    +
+ + +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT (count(*) as ?counts) WHERE { + ?teacher obo:RO_0000053 ?obj . + ?obj rdf:type core:teacherRole . + } + + +
  • 'Person'-'CourseSection' linkages (${teaching.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT (count(distinct ?teacher) as ?counts) WHERE { + ?teacher core:teaching ?obj . + ?teacher obo:RO_0000053 ?obj . + ?obj rdf:type core:teacherRole . + } + + +
  • 'Person' entities which teach 'CourseSection' entities (${teacher.counts.string})
  • +
    +
    +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(?course) as ?counts) WHERE { + ?course rdf:type core:Course . + } + + +
  • 'Course' entities (${course.counts.string})
  • +
    +
    +
    +
+ + +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT (count(*) as ?counts) WHERE { + ?author1 rdf:type core:Authorship . + ?author2 rdf:type core:Authorship . + ?author1 core:relates ?infor . + ?author2 core:relates ?infor . + ?infor rdf:type obo:IAO_0000030 . + FILTER (str(?author1) < str(?author2)) + } + + +
  • Total co-author linkages (${coauthor.counts.string})
  • +
    +
    +
    + + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + PREFIX obo: + SELECT DISTINCT ?author1 ?author2 WHERE { + ?author1 rdf:type core:Authorship . + ?author2 rdf:type core:Authorship . + ?author1 core:relates ?infor . + ?author2 core:relates ?infor . + ?infor rdf:type obo:IAO_0000030 . + FILTER (str(?author1) < str(?author2)) + } + +
  • Unique co-author linkages (${fn:length(discoauthors.rows)})
  • +
    +
    +
+ + +
    + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT (count(*) as ?counts) WHERE { + ?grant core:relates ?pi1 . + ?pi1 rdf:type core:InvestigatorRole . + ?grant core:relates ?pi2 . + ?pi1 rdf:type core:InvestigatorRole . + FILTER (str(?pi1) < str(?pi2)) + } + + +
  • Total co-investigator linkages (${copi.counts.string})
  • +
    +
    +
    + + + + + + PREFIX rdfs: + PREFIX rdf: + PREFIX akt: + PREFIX bibo: + PREFIX core: + SELECT DISTINCT ?pi1 ?pi2 WHERE { + ?grant core:relates ?pi1 . + ?pi1 rdf:type core:InvestigatorRole . + ?grant core:relates ?pi2 . + ?pi1 rdf:type core:InvestigatorRole . + FILTER (str(?pi1) < str(?pi2)) + } + +
  • Unique co-investigator linkages (${fn:length(discopis.rows)})
  • +
    +
    + +
+ +
From d81ae170459da8e17b9c36a133e1791996ca516f Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 13:24:46 -0500 Subject: [PATCH 19/40] VIVO-493 hiding "has participant" / "participates in" --- rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index d1586c88..cef6df9c 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -2159,7 +2159,11 @@ vivo:supports "true"^^xsd:boolean . obo:RO_0000057 - rdfs:label "has participant"@en-US . + rdfs:label "has participant"@en-US ; + vitro:hiddenFromDisplayBelowRoleLevelAnnot + ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot + . vivo:patentNumber rdfs:label "patent number"@en-US ; @@ -2277,7 +2281,11 @@ obo:ARG_2000084 rdfs:label "American Board of Preventive Medicine"@en-US . obo:RO_0000056 - rdfs:label "participates in"@en-US . + rdfs:label "participates in"@en-US ; + vitro:hiddenFromDisplayBelowRoleLevelAnnot + ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot + . vcard:timeZone rdfs:label "timezone"@en-US . From 82f603a0f170c04b037fbe9d5842aed7b7e97107 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 5 Nov 2013 13:33:15 -0500 Subject: [PATCH 20/40] VIVO-490 thank you very much and please tip your waitress --- .../AddGrantRoleToPersonGenerator.java | 3 +- .../AddRoleToPersonTwoStageGenerator.java | 1797 +++++++++-------- 2 files changed, 902 insertions(+), 898 deletions(-) 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 1a94e2d8..09b02453 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 @@ -271,7 +271,8 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator urisInScope.put("roleType", Arrays.asList(new String[]{getRoleType(vreq)})); //Setting inverse role predicate - urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); + // with ISF changes this will always be the same + urisInScope.put("inverseRolePredicate", Arrays.asList(new String[]{"http://purl.obolibrary.org/obo/RO_0000052"})); editConfiguration.setUrisInScope(urisInScope); //Uris in scope include subject, predicate, and object var diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index 786ee6dc..c05f6c85 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java @@ -1,897 +1,900 @@ -/* $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.HashMap; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpSession; - -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.vivoweb.webapp.util.ModelUtils; - -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; -import com.hp.hpl.jena.vocabulary.XSD; - -import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; -import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; -import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; -import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.AutocompleteRequiredInputValidator; -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.EditConfigurationUtils; -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.ConstantFieldOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaClassGroupOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.RoleToActivityPredicatePreprocessor; -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; -/** - * Generates the edit configuration for adding a Role to a Person. - - Stage one is selecting the type of the non-person thing - associated with the Role with the intention of reducing the - number of Individuals that the user has to select from. - Stage two is selecting the non-person Individual to associate - with the Role. - - This is intended to create a set of statements like: - - ?person core:hasResearchActivityRole ?newRole. - ?newRole rdf:type core:ResearchActivityRole ; - roleToActivityPredicate ?someActivity . - ?someActivity rdf:type core:ResearchActivity . - ?someActivity rdfs:label "activity title" . - - - - Important: This form cannot be directly used as a custom form. It has parameters that must be set. - See addClinicalRoleToPerson.jsp for an example. - - roleToActivityPredicate and activityToRolePredicate are both dependent on the type of - the activity itself. For a new statement, the predicate type is not known. - For an existing statement, the predicate is known but may change based on the type of the activity newly selected. - - - bdc34: - TODO: figure out what needs to be customized per role form, document it here in comments - TODO: rewrite class as an abstract class with simple, documented, required methods to override - - AddRoleToPersonTwoStageGenerator is abstract, each subclass will need to configure: - From the old JSP version: - - showRoleLabelField boolean - roleType URI - roleToActivityPredicate URI - activityToRolePredicate URI - roleActivityType_optionsType - roleActivityType_objectClassURI - roleActivityType_literalOptions - - For the new generator version: - template - * - */ -public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { - - private Log log = LogFactory.getLog(AddRoleToPersonTwoStageGenerator.class); - - /* ***** Methods that are REQUIRED to be implemented in subclasses ***** */ - -// abstract String getStartDatePrecision(); - -// abstract String getEndDatePrecision(); - - /** Freemarker template to use */ - abstract String getTemplate(); - - /** URI of type for the role context node */ - abstract String getRoleType(); - - /** return the java object that generates the role activity field options for - * the subclass. - * @throws Exception */ - abstract FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception; - - /** In the case of literal options, subclass generator will set the options to be returned */ - //not needed any more since the FieldOption can be returned - //abstract HashMap getRoleActivityTypeLiteralOptions(); - - /** - * Each subclass generator will return its own type of option here: - * whether literal hardcoded, based on class group, or subclasses of a specific class - * The latter two will apparently lend some kind of uri to objectClassUri ? */ - //not needed any more since the FieldOption can be returned - //abstract RoleActivityOptionTypes getRoleActivityTypeOptionsType(); - - /** The URI of a Class to use with options if required. An option type like - * CHILD_VCLASSES would reqire a role activity object class URI. */ - //not needed any more since the FieldOption can be returned - //abstract String getRoleActivityTypeObjectClassUri(VitroRequest vreq); - - /** If true an input should be shown on the form for a - * label for the role context node - * TODO: move this to the FTL and have label optional. */ - abstract boolean isShowRoleLabelField(); - - /** URI of predicate between role context node and activity - * @throws Exception */ - //Bdc34: not used anywhere? that's odd - //abstract String getActivityToRolePredicate(); - - @Override - public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { - EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); - initProcessParameters(vreq, session, editConfiguration); - - editConfiguration.setVarNameForSubject("person"); - editConfiguration.setVarNameForPredicate("rolePredicate"); - editConfiguration.setVarNameForObject("role"); - - // Required N3 - editConfiguration.setN3Required(list( - N3_PREFIX + "\n" + - "?person ?rolePredicate ?role .\n" + - "?role a ?roleType .\n" + - "?role ?inverseRolePredicate ?person ." - )); - - // Optional N3 - //Note here we are placing the role to activity relationships as optional, since - //it's possible to delete this relationship from the activity - //On submission, if we kept these statements in n3required, the retractions would - //not have all variables substituted, leading to an error - //Note also we are including the relationship as a separate string in the array, to allow it to be - //independently evaluated and passed back with substitutions even if the other strings are not - //substituted correctly. - editConfiguration.setN3Optional( list( - getN3ForNewRoleActivity(), - getN3ForExistingRoleActivity(), -// getN3ForActivityType(), - getN3RoleLabelAssertion(), - getN3ForStart(), - getN3ForEnd() )); - - editConfiguration.setNewResources( newResources(vreq) ); - - //In scope - setUrisAndLiteralsInScope(editConfiguration, vreq); - - //on Form - setUrisAndLiteralsOnForm(editConfiguration, vreq); - - //Sparql queries - setSparqlQueries(editConfiguration, vreq); - - //set fields - setFields(editConfiguration, vreq, EditConfigurationUtils.getPredicateUri(vreq)); - - //Form title and submit label now moved to edit configuration template - //TODO: check if edit configuration template correct place to set those or whether - //additional methods here should be used and reference instead, e.g. edit configuration template could call - //default obj property form.populateTemplate or some such method - //Select from existing also set within template itself - editConfiguration.setTemplate(getTemplate()); - - //Add validator - editConfiguration.addValidator(new DateTimeIntervalValidationVTwo("startField","endField") ); - editConfiguration.addValidator(new AntiXssValidation()); - editConfiguration.addValidator(new AutocompleteRequiredInputValidator("existingRoleActivity", "activityLabel")); - - //Add preprocessors - addPreprocessors(editConfiguration, vreq.getWebappDaoFactory()); - //Adding additional data, specifically edit mode - addFormSpecificData(editConfiguration, vreq); - - //prepare - prepare(vreq, editConfiguration); - return editConfiguration; - } - - private void initProcessParameters(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { - editConfiguration.setFormUrl(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); - editConfiguration.setEntityToReturnTo(EditConfigurationUtils.getSubjectUri(vreq)); - } - - /* N3 Required and Optional Generators as well as supporting methods */ - - private List getN3ForNewRoleActivity() { - List n3ForNewRoleActivity = new ArrayList(); - n3ForNewRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?roleActivity .\n"+ - "?roleActivity " + getActivityToRolePlaceholder() + " ?role . \n" + - "?roleActivity <" + RDFS.label.getURI() + "> ?activityLabel . \n" + - "?roleActivity a ?roleActivityType ."); - return n3ForNewRoleActivity; - } - - private List getN3ForExistingRoleActivity() { - List n3ForExistingRoleActivity = new ArrayList(); - n3ForExistingRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?existingRoleActivity .\n"+ - "?existingRoleActivity " + getActivityToRolePlaceholder() + " ?role . \n" + - "?existingRoleActivity a ?roleActivityType ."); - return n3ForExistingRoleActivity; - } - - - private String getN3RoleLabelAssertion() { - return "?role <" + RDFS.label.getURI() + "> ?roleLabel ."; - } - - private List getN3ForStart() { - List n3ForStart = new ArrayList(); - n3ForStart.add("?role <" + RoleToIntervalURI + "> ?intervalNode ." + - "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + - "?intervalNode <" + IntervalToStartURI + "> ?startNode ." + - "?startNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + - "?startNode <" + DateTimeValueURI + "> ?startField-value ." + - "?startNode <" + DateTimePrecisionURI + "> ?startField-precision ."); - return n3ForStart; - } - - private List getN3ForEnd() { - List n3ForEnd = new ArrayList(); - n3ForEnd.add("?role <" + RoleToIntervalURI + "> ?intervalNode . " + - "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + - "?intervalNode <" + IntervalToEndURI + "> ?endNode ." + - "?endNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + - "?endNode <" + DateTimeValueURI + "> ?endField-value ." + - "?endNode <" + DateTimePrecisionURI+ "> ?endField-precision ."); - return n3ForEnd; - } - - /** Get new resources */ - private Map newResources(VitroRequest vreq) { - String DEFAULT_NS_TOKEN=null; //null forces the default NS - - HashMap newResources = new HashMap(); - newResources.put("role", DEFAULT_NS_TOKEN); - newResources.put("roleActivity", DEFAULT_NS_TOKEN); - newResources.put("intervalNode", DEFAULT_NS_TOKEN); - newResources.put("startNode", DEFAULT_NS_TOKEN); - newResources.put("endNode", DEFAULT_NS_TOKEN); - return newResources; - } - - /** Set URIS and Literals In Scope and on form and supporting methods */ - private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap> urisInScope = new HashMap>(); - - //Setting inverse role predicate - urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); - urisInScope.put("roleType", list( getRoleType() ) ); - - //Uris in scope include subject, predicate, and object var - editConfiguration.setUrisInScope(urisInScope); - - //literals in scope empty initially, usually populated by code in prepare for update - //with existing values for variables - } - - private List getInversePredicate(VitroRequest vreq) { - List inversePredicateArray = new ArrayList(); - ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); - if(op != null && op.getURIInverse() != null) { - inversePredicateArray.add(op.getURIInverse()); - } - return inversePredicateArray; - } - - private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - List urisOnForm = new ArrayList(); - //add role activity and roleActivityType to uris on form - urisOnForm.add("existingRoleActivity"); - urisOnForm.add("roleActivityType"); - //Also adding the predicates - //TODO: Check how to override this in case of default parameter? Just write hidden input to form? - urisOnForm.add("roleToActivityPredicate"); - urisOnForm.add("activityToRolePredicate"); - editConfiguration.setUrisOnform(urisOnForm); - - //activity label and role label are literals on form - List literalsOnForm = new ArrayList(); - literalsOnForm.add("activityLabel"); - literalsOnForm.add("activityLabelDisplay"); - literalsOnForm.add("roleLabel"); - editConfiguration.setLiteralsOnForm(literalsOnForm); - } - - /** Set SPARQL Queries and supporting methods. - * @throws Exception */ - private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) throws Exception { - //Queries for activity label, role label, start Field value, end Field value - HashMap map = new HashMap(); - map.put("activityLabel", getActivityLabelQuery(vreq)); - map.put("roleLabel", getRoleLabelQuery(vreq)); - map.put("startField-value", getExistingStartDateQuery(vreq)); - map.put("endField-value", getExistingEndDateQuery(vreq)); - - editConfiguration.setSparqlForExistingLiterals(map); - - //Queries for role activity, activity type query, interval node, - // start node, end node, start field precision, endfield precision - map = new HashMap(); - map.put("existingRoleActivity", getExistingRoleActivityQuery(vreq)); - map.put("roleActivityType", getActivityTypeQuery(vreq)); - map.put("intervalNode", getIntervalNodeQuery(vreq)); - map.put("startNode", getStartNodeQuery(vreq)); - map.put("endNode", getEndNodeQuery(vreq)); - map.put("startField-precision", getStartPrecisionQuery(vreq)); - map.put("endField-precision", getEndPrecisionQuery(vreq)); - //Also need sparql queries for roleToActivityPredicate and activityToRolePredicate - map.put("roleToActivityPredicate", getRoleToActivityPredicateQuery(vreq)); - map.put("activityToRolePredicate", getActivityToRolePredicateQuery(vreq)); - - editConfiguration.setSparqlForExistingUris(map); - } - - private String getActivityToRolePredicateQuery(VitroRequest vreq) { - String query = "SELECT ?existingActivityToRolePredicate \n " + - "WHERE { \n" + - "?roleActivity ?existingActivityToRolePredicate ?role .\n"; - //Get possible predicates - List addToQuery = new ArrayList(); - List predicates = getPossibleActivityToRolePredicates(); - for(String p:predicates) { - addToQuery.add("(?existingActivityToRolePredicate=<" + p + ">)"); - } - query += "FILTER (" + StringUtils.join(addToQuery, " || ") + ")\n"; - query += "}"; - return query; - } - - private String getRoleToActivityPredicateQuery(VitroRequest vreq) { - String query = "SELECT ?existingRoleToActivityPredicate \n " + - "WHERE { \n" + - "?role ?existingRoleToActivityPredicate ?roleActivity .\n"; - //Get possible predicates - query += getFilterRoleToActivityPredicate("existingRoleToActivityPredicate"); - query += "\n}"; - return query; - } - - private String getEndPrecisionQuery(VitroRequest vreq) { - String query = "SELECT ?existingEndPrecision WHERE {\n" + - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + - "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + - "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + - "?endNode <" + DateTimePrecisionURI + "> ?existingEndPrecision . }"; - return query; - } - - private String getStartPrecisionQuery(VitroRequest vreq) { - String query = "SELECT ?existingStartPrecision WHERE {\n" + - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + - "?intervalNode <" + IntervalToStartURI + "> ?startNode .\n" + - "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + - "?startNode <" + DateTimePrecisionURI + "> ?existingStartPrecision . }"; - return query; - } - - private String getEndNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingEndNode WHERE {\n"+ - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ - "?intervalNode <" + IntervalToEndURI + "> ?existingEndNode . \n"+ - "?existingEndNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}\n"; - return query; - } - - private String getStartNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingStartNode WHERE {\n"+ - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ - "?intervalNode <" + IntervalToStartURI + "> ?existingStartNode . \n"+ - "?existingStartNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}"; - return query; - } - - private String getIntervalNodeQuery(VitroRequest vreq) { - String query = "SELECT ?existingIntervalNode WHERE { \n" + - "?role <" + RoleToIntervalURI + "> ?existingIntervalNode . \n" + - " ?existingIntervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> . }\n"; - return query; - } - - /** - * Utility method for subclasses to make a query for type from a ConstantFieldOptions object. - * @throws Exception - */ - protected String getActivityTypeQueryForConstantOptions(VitroRequest vreq, ConstantFieldOptions fieldOptions ) - throws Exception{ - - //make list of type URIs from options, this can be called with null since - //ConstantFieldOptions doesn't use any of the arguments. - Map options = fieldOptions.getOptions(null, null, null) ; - - if (options != null && options.size() > 0) { - List typeUris = new ArrayList(); - for(String typeUri: options.keySet()) { - if(typeUri != null && !typeUri.isEmpty()) { - typeUris.add("(?existingActivityType = <" + typeUri + ">)"); - } - } - - String defaultActivityTypeQuery = getDefaultActivityTypeQuery(vreq); - String typeFilters = "FILTER (" + StringUtils.join(typeUris, "||") + ")"; - return defaultActivityTypeQuery.replaceAll("}$", "") + typeFilters + "}"; - } else { - return getDefaultActivityTypeQuery(vreq); - } - } - - /** - * Utility method for subclasses to make a query for type from a ChildVClassesOptions object. - * @throws Exception - */ - protected String getActivityTypeQueryForChildVClassOptions(VitroRequest vreq, ChildVClassesOptions opts){ - log.debug("objectClassUri = " + opts.getClassUri()); - return QueryUtils.subUriForQueryVar( - getSubclassActivityTypeQuery(vreq), - "objectClassUri", opts.getClassUri()); - } - - /** - * Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object. - * @throws Exception - */ - protected String getActivityTypeQueryForIndividualsViaClassGroupOptions(VitroRequest vreq, IndividualsViaClassGroupOptions opts){ - log.debug("ClassGroupUri = " + opts.getClassGroupUri()); - return QueryUtils.subUriForQueryVar( - getClassgroupActivityTypeQuery(vreq), - "classgroup", opts.getClassGroupUri()); - } - - /* - * The activity type query results must be limited to the values in the activity type select element. - * Sometimes the query returns a superclass such as owl:Thing instead. - * Make use of vitro:mostSpecificType so that, for example, an individual is both a - * core:InvitedTalk and a core:Presentation, core:InvitedTalk is selected. - * vitro:mostSpecificType alone may not suffice, since it does not guarantee that the value returned - * is in the select list. - * We could still have problems if the value from the select list is not a vitro:mostSpecificType, - * but that is unlikely. - * - */ - private String getActivityTypeQuery(VitroRequest vreq) throws Exception { - - String activityTypeQuery = null; - - FieldOptions fieldOpts = getRoleActivityFieldOptions(vreq); - try{ - if( fieldOpts == null ){ - activityTypeQuery = getDefaultActivityTypeQuery(vreq); - }if( fieldOpts instanceof ConstantFieldOptions ){ - activityTypeQuery = getActivityTypeQueryForConstantOptions(vreq, (ConstantFieldOptions)fieldOpts); // - }else if (fieldOpts instanceof ChildVClassesOptions ){ - activityTypeQuery = getActivityTypeQueryForChildVClassOptions(vreq, (ChildVClassesOptions)fieldOpts); - }else if( fieldOpts instanceof IndividualsViaClassGroupOptions){ - activityTypeQuery = getActivityTypeQueryForIndividualsViaClassGroupOptions(vreq, (IndividualsViaClassGroupOptions)fieldOpts); - } - }catch(Exception ex){ - log.debug("error while building activity type query",ex); - } - activityTypeQuery = getDefaultActivityTypeQuery(vreq); - - //The replacement of activity type query's predicate was only relevant when we actually - //know which predicate is definitely being used here - //Here we have multiple values possible for predicate so the original - //Replacement should only happen when we have an actual predicate - //String replaceRoleToActivityPredicate = getRoleToActivityPredicate(vreq); - activityTypeQuery = QueryUtils.replaceQueryVar(activityTypeQuery, "predicate", getRoleToActivityPlaceholderName()); - - log.debug("Activity type query: " + activityTypeQuery); - return activityTypeQuery; - } - - - private String getDefaultActivityTypeQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + VIVO_NS + ">\n" + - "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingActivityType WHERE { \n" + - " ?role ?predicate ?existingActivity . \n" + - " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n"; - query += getFilterRoleToActivityPredicate("predicate"); - query+= "}"; - return query; - } - - private String getSubclassActivityTypeQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + VIVO_NS + ">\n" + - "PREFIX rdfs: <" + VitroVocabulary.RDFS + ">\n" + - "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingActivityType WHERE {\n" + - " ?role ?predicate ?existingActivity . \n" + - " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n" + - " ?existingActivityType rdfs:subClassOf ?objectClassUri . \n"; - query += getFilterRoleToActivityPredicate("predicate"); - query+= "}"; - return query; - } - - private String getClassgroupActivityTypeQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + VIVO_NS + ">\n" + - "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + - "SELECT ?existingActivityType WHERE { \n" + - " ?role ?predicate ?existingActivity . \n" + - " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n" + - " ?existingActivityType vitro:inClassGroup ?classgroup . \n"; - query += getFilterRoleToActivityPredicate("predicate"); - query+= "}"; - return query; - } - - - private String getExistingRoleActivityQuery(VitroRequest vreq) { - //If role to activity predicate is the default query, then we need to replace with a union - //of both realizedIn and the other - String query = "PREFIX core: <" + VIVO_NS + ">"; - - query += "SELECT ?existingRoleActivity WHERE { \n" + - " ?role ?predicate ?existingRoleActivity . \n "; - query += getFilterRoleToActivityPredicate("predicate"); - query += "}"; - return query; - } - - private String getExistingEndDateQuery(VitroRequest vreq) { - String query = " SELECT ?existingEndDate WHERE {\n" + - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + - "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + - "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + - "?endNode <" + DateTimeValueURI + "> ?existingEndDate . }"; - return query; - } - - private String getExistingStartDateQuery(VitroRequest vreq) { - String query = "SELECT ?existingDateStart WHERE {\n" + - "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + - "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + - "?intervalNode <" + IntervalToStartURI+ "> ?startNode .\n" + - "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + - "?startNode <" + DateTimeValueURI + "> ?existingDateStart . }"; - - return query; - } - - private String getRoleLabelQuery(VitroRequest vreq) { - String query = "SELECT ?existingRoleLabel WHERE { \n" + - "?role <" + VitroVocabulary.LABEL + "> ?existingRoleLabel . }"; - return query; - } - - private String getActivityLabelQuery(VitroRequest vreq) { - String query = "PREFIX core: <" + VIVO_NS + ">" + - "PREFIX rdfs: <" + RDFS.getURI() + "> \n"; - - query += "SELECT ?existingTitle WHERE { \n" + - "?role ?predicate ?existingActivity . \n" + - "?existingActivity rdfs:label ?existingTitle . \n"; - query += getFilterRoleToActivityPredicate("predicate"); - query += "}"; - return query; - } - - /** - * - * Set Fields and supporting methods - * @throws Exception - */ - - private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) throws Exception { - Map fields = new HashMap(); - //Multiple fields - getActivityLabelField(editConfiguration, vreq, fields); - getActivityLabelDisplayField(editConfiguration, vreq, fields); - getRoleActivityTypeField(editConfiguration, vreq, fields); - getExistingRoleActivityField(editConfiguration, vreq, fields); - getRoleLabelField(editConfiguration, vreq, fields); - getStartField(editConfiguration, vreq, fields); - getEndField(editConfiguration, vreq, fields); - //These fields are for the predicates that will be set later - //TODO: Do these only if not using a parameter for the predicate? - getRoleToActivityPredicateField(editConfiguration, vreq, fields); - getActivityToRolePredicateField(editConfiguration, vreq, fields); - editConfiguration.setFields(fields); - } - - //This is a literal technically? - private void getActivityToRolePredicateField( - EditConfigurationVTwo editConfiguration, VitroRequest vreq, - Map fields) { - - FieldVTwo field = new FieldVTwo(); - - String fieldName = "activityToRolePredicate"; - field.setName(fieldName); - - //get range data type uri and range language - String stringDatatypeUri = XSD.xstring.toString(); - field.setRangeDatatypeUri( stringDatatypeUri ); - - fields.put(field.getName(), field); - } - - private void getRoleToActivityPredicateField( - EditConfigurationVTwo editConfiguration, VitroRequest vreq, - Map fields) { - - FieldVTwo field = new FieldVTwo(); - - String fieldName = "roleToActivityPredicate"; - field.setName(fieldName); - - //get range data type uri and range language - String stringDatatypeUri = XSD.xstring.toString(); - field.setRangeDatatypeUri(stringDatatypeUri); - - fields.put(field.getName(), field); - } - - //Label of "right side" of role, i.e. label for role roleIn Activity - private void getActivityLabelField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { - - FieldVTwo field = new FieldVTwo(); - String fieldName = "activityLabel"; - field.setName(fieldName); - - //get range data type uri and range language - String stringDatatypeUri = XSD.xstring.toString(); - field.setRangeDatatypeUri(stringDatatypeUri); - - List validators = new ArrayList(); - validators.add("datatype:" + stringDatatypeUri); - field.setValidators(validators); - - fields.put(field.getName(), field); - } - - private void getActivityLabelDisplayField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { - FieldVTwo field = new FieldVTwo(); - - String fieldName = "activityLabelDisplay"; - field.setName(fieldName); - - //get range data type uri and range language - String stringDatatypeUri = XSD.xstring.toString(); - field.setRangeDatatypeUri(stringDatatypeUri); - - fields.put(field.getName(), field); - } - - //type of "right side" of role, i.e. type of activity from role roleIn activity - private void getRoleActivityTypeField( - EditConfigurationVTwo editConfiguration, VitroRequest vreq, - Map fields) throws Exception { - String fieldName = "roleActivityType"; - //get range data type uri and range language - - FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - - List validators = new ArrayList(); - if(isAddMode(vreq) || isRepairMode(vreq)) { - validators.add("nonempty"); - } - field.setValidators(validators); - - field.setOptions( getRoleActivityFieldOptions(vreq) ); - -// field.setOptionsType(getRoleActivityTypeOptionsType().toString()); -// field.setObjectClassUri(getRoleActivityTypeObjectClassUri(vreq)); -// -// HashMap literalOptionsMap = getRoleActivityTypeLiteralOptions(); -// List> fieldLiteralOptions = new ArrayList>(); -// Set optionUris = literalOptionsMap.keySet(); -// for(String optionUri: optionUris) { -// List uriLabelArray = new ArrayList(); -// uriLabelArray.add(optionUri); -// uriLabelArray.add(literalOptionsMap.get(optionUri)); -// fieldLiteralOptions.add(uriLabelArray); -// } -// field.setLiteralOptions(fieldLiteralOptions); - - fields.put(field.getName(), field); - - } - - - - //Assuming URI for activity for role? - private void getExistingRoleActivityField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { - String fieldName = "existingRoleActivity"; - - FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - - fields.put(field.getName(), field); - } - - private void getRoleLabelField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { - String fieldName = "roleLabel"; - - FieldVTwo field = new FieldVTwo(); - field.setName(fieldName); - - String stringDatatypeUri = XSD.xstring.toString(); - field.setRangeDatatypeUri(stringDatatypeUri); - - List validators = new ArrayList(); - validators.add("datatype:" + stringDatatypeUri); - if(isShowRoleLabelField()) { - validators.add("nonempty"); - } - field.setValidators(validators); - - fields.put(field.getName(), field); - } - - private void getStartField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { - FieldVTwo field = new FieldVTwo(); - - String fieldName = "startField"; - field.setName(fieldName); - - field.setEditElement( - new DateTimeWithPrecisionVTwo(field, - getStartDatePrecision(), - VitroVocabulary.Precision.NONE.uri())); - - fields.put(field.getName(), field); - } - - private void getEndField(EditConfigurationVTwo editConfiguration, - VitroRequest vreq, Map fields) { - FieldVTwo field = new FieldVTwo(); - - String fieldName = "endField"; - field.setName(fieldName); - - field.setEditElement( - new DateTimeWithPrecisionVTwo(field, - getEndDatePrecision(), - VitroVocabulary.Precision.NONE.uri())); - - fields.put(field.getName(), field); - } - - private void addPreprocessors(EditConfigurationVTwo editConfiguration, WebappDaoFactory wadf) { - //Add preprocessor that will replace the role to activity predicate and inverse - //with correct properties based on the activity type - editConfiguration.addEditSubmissionPreprocessor( - new RoleToActivityPredicatePreprocessor(editConfiguration, wadf)); - - } - - //This has a default value, but note that even that will not be used - //in the update with realized in or contributes to - //Overridden when need be in subclassed generator - //Also note that for now we're going to actually going to return a - //placeholder value by default - public String getRoleToActivityPredicate(VitroRequest vreq) { - //TODO: and ?placeholder are incompatible - return getRoleToActivityPlaceholder(); - } - //Ensure when overwritten that this includes the <> b/c otherwise the query won't work - - //Some values will have a default value - - public List getPossibleRoleToActivityPredicates() { - return ModelUtils.getPossiblePropertiesForRole(); - } - - public List getPossibleActivityToRolePredicates() { - return ModelUtils.getPossibleInversePropertiesForRole(); - } - - /* Methods that check edit mode */ - public EditMode getEditMode(VitroRequest vreq) { - List roleToGrantPredicates = getPossibleRoleToActivityPredicates(); - return EditModeUtils.getEditMode(vreq, roleToGrantPredicates); - } - - private boolean isAddMode(VitroRequest vreq) { - return EditModeUtils.isAddMode(getEditMode(vreq)); - } - - private boolean isEditMode(VitroRequest vreq) { - return EditModeUtils.isEditMode(getEditMode(vreq)); - } - - private boolean isRepairMode(VitroRequest vreq) { - return EditModeUtils.isRepairMode(getEditMode(vreq)); - } - - /* URIS for various predicates */ - private final String VIVO_NS="http://vivoweb.org/ontology/core#"; - - private final String RoleToIntervalURI = VIVO_NS + "dateTimeInterval"; - private final String IntervalTypeURI = VIVO_NS + "DateTimeInterval"; - private final String IntervalToStartURI = VIVO_NS + "start"; - private final String IntervalToEndURI = VIVO_NS + "end"; - private final String StartYearPredURI = VIVO_NS + "startYear"; - private final String EndYearPredURI = VIVO_NS + "endYear"; - private final String DateTimeValueTypeURI=VIVO_NS + "DateTimeValue"; - private final String DateTimePrecisionURI=VIVO_NS + "dateTimePrecision"; - private final String DateTimeValueURI = VIVO_NS + "dateTime"; - - //Form specific data - public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { - HashMap formSpecificData = new HashMap(); - formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); - //Fields that will need select lists generated - //Store field names - List objectSelect = new ArrayList(); - objectSelect.add("roleActivityType"); - //TODO: Check if this is the proper way to do this? - formSpecificData.put("objectSelect", objectSelect); - //Also put in show role label field - formSpecificData.put("showRoleLabelField", isShowRoleLabelField()); - //Put in the fact that we require field - editConfiguration.setFormSpecificData(formSpecificData); - } - - public String getFilterRoleToActivityPredicate(String predicateVar) { - String addFilter = "FILTER ("; - List predicates = getPossibleRoleToActivityPredicates(); - List filterPortions = new ArrayList(); - for(String p: predicates) { - filterPortions.add("(?" + predicateVar + "=<" + p + ">)"); - } - addFilter += StringUtils.join(filterPortions, " || "); - addFilter += ")"; - return addFilter; - } - - private String getRoleToActivityPlaceholder() { - return "?" + getRoleToActivityPlaceholderName(); - } - - private String getRoleToActivityPlaceholderName() { - return "roleToActivityPredicate"; - } - - - private String getActivityToRolePlaceholder() { - return "?activityToRolePredicate"; - } - - //Types of options to populate drop-down for types for the "right side" of the role - public static enum RoleActivityOptionTypes { - VCLASSGROUP, - CHILD_VCLASSES, - HARDCODED_LITERALS - }; - - private final String N3_PREFIX = "@prefix core: ."; - - protected String getStartDatePrecision() { - String precision = VitroVocabulary.Precision.YEAR.uri(); - return precision; - } - - protected String getEndDatePrecision() { - String precision = VitroVocabulary.Precision.YEAR.uri(); - return precision; - } - - -} +/* $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 java.util.Map; + +import javax.servlet.http.HttpSession; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.vivoweb.webapp.util.ModelUtils; + +import com.hp.hpl.jena.vocabulary.RDF; +import com.hp.hpl.jena.vocabulary.RDFS; +import com.hp.hpl.jena.vocabulary.XSD; + +import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.dao.jena.QueryUtils; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.AutocompleteRequiredInputValidator; +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.EditConfigurationUtils; +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.ConstantFieldOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaClassGroupOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.RoleToActivityPredicatePreprocessor; +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; +/** + * Generates the edit configuration for adding a Role to a Person. + + Stage one is selecting the type of the non-person thing + associated with the Role with the intention of reducing the + number of Individuals that the user has to select from. + Stage two is selecting the non-person Individual to associate + with the Role. + + This is intended to create a set of statements like: + + ?person core:hasResearchActivityRole ?newRole. + ?newRole rdf:type core:ResearchActivityRole ; + roleToActivityPredicate ?someActivity . + ?someActivity rdf:type core:ResearchActivity . + ?someActivity rdfs:label "activity title" . + + + + Important: This form cannot be directly used as a custom form. It has parameters that must be set. + See addClinicalRoleToPerson.jsp for an example. + + roleToActivityPredicate and activityToRolePredicate are both dependent on the type of + the activity itself. For a new statement, the predicate type is not known. + For an existing statement, the predicate is known but may change based on the type of the activity newly selected. + + + bdc34: + TODO: figure out what needs to be customized per role form, document it here in comments + TODO: rewrite class as an abstract class with simple, documented, required methods to override + + AddRoleToPersonTwoStageGenerator is abstract, each subclass will need to configure: + From the old JSP version: + + showRoleLabelField boolean + roleType URI + roleToActivityPredicate URI + activityToRolePredicate URI + roleActivityType_optionsType + roleActivityType_objectClassURI + roleActivityType_literalOptions + + For the new generator version: + template + * + */ +public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigurationGenerator implements EditConfigurationGenerator { + + private Log log = LogFactory.getLog(AddRoleToPersonTwoStageGenerator.class); + + /* ***** Methods that are REQUIRED to be implemented in subclasses ***** */ + +// abstract String getStartDatePrecision(); + +// abstract String getEndDatePrecision(); + + /** Freemarker template to use */ + abstract String getTemplate(); + + /** URI of type for the role context node */ + abstract String getRoleType(); + + /** return the java object that generates the role activity field options for + * the subclass. + * @throws Exception */ + abstract FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception; + + /** In the case of literal options, subclass generator will set the options to be returned */ + //not needed any more since the FieldOption can be returned + //abstract HashMap getRoleActivityTypeLiteralOptions(); + + /** + * Each subclass generator will return its own type of option here: + * whether literal hardcoded, based on class group, or subclasses of a specific class + * The latter two will apparently lend some kind of uri to objectClassUri ? */ + //not needed any more since the FieldOption can be returned + //abstract RoleActivityOptionTypes getRoleActivityTypeOptionsType(); + + /** The URI of a Class to use with options if required. An option type like + * CHILD_VCLASSES would reqire a role activity object class URI. */ + //not needed any more since the FieldOption can be returned + //abstract String getRoleActivityTypeObjectClassUri(VitroRequest vreq); + + /** If true an input should be shown on the form for a + * label for the role context node + * TODO: move this to the FTL and have label optional. */ + abstract boolean isShowRoleLabelField(); + + /** URI of predicate between role context node and activity + * @throws Exception */ + //Bdc34: not used anywhere? that's odd + //abstract String getActivityToRolePredicate(); + + @Override + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, HttpSession session) throws Exception { + EditConfigurationVTwo editConfiguration = new EditConfigurationVTwo(); + initProcessParameters(vreq, session, editConfiguration); + + editConfiguration.setVarNameForSubject("person"); + editConfiguration.setVarNameForPredicate("rolePredicate"); + editConfiguration.setVarNameForObject("role"); + + // Required N3 + editConfiguration.setN3Required(list( + N3_PREFIX + "\n" + + "?person ?rolePredicate ?role .\n" + + "?role a ?roleType .\n" + + "?role ?inverseRolePredicate ?person ." + )); + + // Optional N3 + //Note here we are placing the role to activity relationships as optional, since + //it's possible to delete this relationship from the activity + //On submission, if we kept these statements in n3required, the retractions would + //not have all variables substituted, leading to an error + //Note also we are including the relationship as a separate string in the array, to allow it to be + //independently evaluated and passed back with substitutions even if the other strings are not + //substituted correctly. + editConfiguration.setN3Optional( list( + getN3ForNewRoleActivity(), + getN3ForExistingRoleActivity(), +// getN3ForActivityType(), + getN3RoleLabelAssertion(), + getN3ForStart(), + getN3ForEnd() )); + + editConfiguration.setNewResources( newResources(vreq) ); + + //In scope + setUrisAndLiteralsInScope(editConfiguration, vreq); + + //on Form + setUrisAndLiteralsOnForm(editConfiguration, vreq); + + //Sparql queries + setSparqlQueries(editConfiguration, vreq); + + //set fields + setFields(editConfiguration, vreq, EditConfigurationUtils.getPredicateUri(vreq)); + + //Form title and submit label now moved to edit configuration template + //TODO: check if edit configuration template correct place to set those or whether + //additional methods here should be used and reference instead, e.g. edit configuration template could call + //default obj property form.populateTemplate or some such method + //Select from existing also set within template itself + editConfiguration.setTemplate(getTemplate()); + + //Add validator + editConfiguration.addValidator(new DateTimeIntervalValidationVTwo("startField","endField") ); + editConfiguration.addValidator(new AntiXssValidation()); + editConfiguration.addValidator(new AutocompleteRequiredInputValidator("existingRoleActivity", "activityLabel")); + + //Add preprocessors + addPreprocessors(editConfiguration, vreq.getWebappDaoFactory()); + //Adding additional data, specifically edit mode + addFormSpecificData(editConfiguration, vreq); + + //prepare + prepare(vreq, editConfiguration); + return editConfiguration; + } + + private void initProcessParameters(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { + editConfiguration.setFormUrl(EditConfigurationUtils.getFormUrlWithoutContext(vreq)); + editConfiguration.setEntityToReturnTo(EditConfigurationUtils.getSubjectUri(vreq)); + } + + /* N3 Required and Optional Generators as well as supporting methods */ + + private List getN3ForNewRoleActivity() { + List n3ForNewRoleActivity = new ArrayList(); + n3ForNewRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?roleActivity .\n"+ + "?roleActivity " + getActivityToRolePlaceholder() + " ?role . \n" + + "?roleActivity <" + RDFS.label.getURI() + "> ?activityLabel . \n" + + "?roleActivity a ?roleActivityType ."); + return n3ForNewRoleActivity; + } + + private List getN3ForExistingRoleActivity() { + List n3ForExistingRoleActivity = new ArrayList(); + n3ForExistingRoleActivity.add("?role " + getRoleToActivityPlaceholder() + " ?existingRoleActivity .\n"+ + "?existingRoleActivity " + getActivityToRolePlaceholder() + " ?role . \n" + + "?existingRoleActivity a ?roleActivityType ."); + return n3ForExistingRoleActivity; + } + + + private String getN3RoleLabelAssertion() { + return "?role <" + RDFS.label.getURI() + "> ?roleLabel ."; + } + + private List getN3ForStart() { + List n3ForStart = new ArrayList(); + n3ForStart.add("?role <" + RoleToIntervalURI + "> ?intervalNode ." + + "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + + "?intervalNode <" + IntervalToStartURI + "> ?startNode ." + + "?startNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + + "?startNode <" + DateTimeValueURI + "> ?startField-value ." + + "?startNode <" + DateTimePrecisionURI + "> ?startField-precision ."); + return n3ForStart; + } + + private List getN3ForEnd() { + List n3ForEnd = new ArrayList(); + n3ForEnd.add("?role <" + RoleToIntervalURI + "> ?intervalNode . " + + "?intervalNode <" + RDF.type.getURI() + "> <" + IntervalTypeURI + "> ." + + "?intervalNode <" + IntervalToEndURI + "> ?endNode ." + + "?endNode <" + RDF.type.getURI() + "> <" + DateTimeValueTypeURI + "> ." + + "?endNode <" + DateTimeValueURI + "> ?endField-value ." + + "?endNode <" + DateTimePrecisionURI+ "> ?endField-precision ."); + return n3ForEnd; + } + + /** Get new resources */ + private Map newResources(VitroRequest vreq) { + String DEFAULT_NS_TOKEN=null; //null forces the default NS + + HashMap newResources = new HashMap(); + newResources.put("role", DEFAULT_NS_TOKEN); + newResources.put("roleActivity", DEFAULT_NS_TOKEN); + newResources.put("intervalNode", DEFAULT_NS_TOKEN); + newResources.put("startNode", DEFAULT_NS_TOKEN); + newResources.put("endNode", DEFAULT_NS_TOKEN); + return newResources; + } + + /** Set URIS and Literals In Scope and on form and supporting methods */ + private void setUrisAndLiteralsInScope(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap> urisInScope = new HashMap>(); + + //Setting inverse role predicate + //With ISF changes this will always be the same + urisInScope.put("inverseRolePredicate", Arrays.asList(new String[]{"http://purl.obolibrary.org/obo/RO_0000052"})); + urisInScope.put("roleType", list( getRoleType() ) ); + + //Uris in scope include subject, predicate, and object var + editConfiguration.setUrisInScope(urisInScope); + + //literals in scope empty initially, usually populated by code in prepare for update + //with existing values for variables + } + + private List getInversePredicate(VitroRequest vreq) { + List inversePredicateArray = new ArrayList(); + ObjectProperty op = EditConfigurationUtils.getObjectProperty(vreq); + if(op != null && op.getURIInverse() != null) { + inversePredicateArray.add(op.getURIInverse()); + } + return inversePredicateArray; + } + + private void setUrisAndLiteralsOnForm(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + List urisOnForm = new ArrayList(); + //add role activity and roleActivityType to uris on form + urisOnForm.add("existingRoleActivity"); + urisOnForm.add("roleActivityType"); + //Also adding the predicates + //TODO: Check how to override this in case of default parameter? Just write hidden input to form? + urisOnForm.add("roleToActivityPredicate"); + urisOnForm.add("activityToRolePredicate"); + editConfiguration.setUrisOnform(urisOnForm); + + //activity label and role label are literals on form + List literalsOnForm = new ArrayList(); + literalsOnForm.add("activityLabel"); + literalsOnForm.add("activityLabelDisplay"); + literalsOnForm.add("roleLabel"); + editConfiguration.setLiteralsOnForm(literalsOnForm); + } + + /** Set SPARQL Queries and supporting methods. + * @throws Exception */ + private void setSparqlQueries(EditConfigurationVTwo editConfiguration, VitroRequest vreq) throws Exception { + //Queries for activity label, role label, start Field value, end Field value + HashMap map = new HashMap(); + map.put("activityLabel", getActivityLabelQuery(vreq)); + map.put("roleLabel", getRoleLabelQuery(vreq)); + map.put("startField-value", getExistingStartDateQuery(vreq)); + map.put("endField-value", getExistingEndDateQuery(vreq)); + + editConfiguration.setSparqlForExistingLiterals(map); + + //Queries for role activity, activity type query, interval node, + // start node, end node, start field precision, endfield precision + map = new HashMap(); + map.put("existingRoleActivity", getExistingRoleActivityQuery(vreq)); + map.put("roleActivityType", getActivityTypeQuery(vreq)); + map.put("intervalNode", getIntervalNodeQuery(vreq)); + map.put("startNode", getStartNodeQuery(vreq)); + map.put("endNode", getEndNodeQuery(vreq)); + map.put("startField-precision", getStartPrecisionQuery(vreq)); + map.put("endField-precision", getEndPrecisionQuery(vreq)); + //Also need sparql queries for roleToActivityPredicate and activityToRolePredicate + map.put("roleToActivityPredicate", getRoleToActivityPredicateQuery(vreq)); + map.put("activityToRolePredicate", getActivityToRolePredicateQuery(vreq)); + + editConfiguration.setSparqlForExistingUris(map); + } + + private String getActivityToRolePredicateQuery(VitroRequest vreq) { + String query = "SELECT ?existingActivityToRolePredicate \n " + + "WHERE { \n" + + "?roleActivity ?existingActivityToRolePredicate ?role .\n"; + //Get possible predicates + List addToQuery = new ArrayList(); + List predicates = getPossibleActivityToRolePredicates(); + for(String p:predicates) { + addToQuery.add("(?existingActivityToRolePredicate=<" + p + ">)"); + } + query += "FILTER (" + StringUtils.join(addToQuery, " || ") + ")\n"; + query += "}"; + return query; + } + + private String getRoleToActivityPredicateQuery(VitroRequest vreq) { + String query = "SELECT ?existingRoleToActivityPredicate \n " + + "WHERE { \n" + + "?role ?existingRoleToActivityPredicate ?roleActivity .\n"; + //Get possible predicates + query += getFilterRoleToActivityPredicate("existingRoleToActivityPredicate"); + query += "\n}"; + return query; + } + + private String getEndPrecisionQuery(VitroRequest vreq) { + String query = "SELECT ?existingEndPrecision WHERE {\n" + + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + + "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + + "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + + "?endNode <" + DateTimePrecisionURI + "> ?existingEndPrecision . }"; + return query; + } + + private String getStartPrecisionQuery(VitroRequest vreq) { + String query = "SELECT ?existingStartPrecision WHERE {\n" + + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + + "?intervalNode <" + IntervalToStartURI + "> ?startNode .\n" + + "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> . \n" + + "?startNode <" + DateTimePrecisionURI + "> ?existingStartPrecision . }"; + return query; + } + + private String getEndNodeQuery(VitroRequest vreq) { + String query = "SELECT ?existingEndNode WHERE {\n"+ + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ + "?intervalNode <" + IntervalToEndURI + "> ?existingEndNode . \n"+ + "?existingEndNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}\n"; + return query; + } + + private String getStartNodeQuery(VitroRequest vreq) { + String query = "SELECT ?existingStartNode WHERE {\n"+ + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n"+ + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n"+ + "?intervalNode <" + IntervalToStartURI + "> ?existingStartNode . \n"+ + "?existingStartNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .}"; + return query; + } + + private String getIntervalNodeQuery(VitroRequest vreq) { + String query = "SELECT ?existingIntervalNode WHERE { \n" + + "?role <" + RoleToIntervalURI + "> ?existingIntervalNode . \n" + + " ?existingIntervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> . }\n"; + return query; + } + + /** + * Utility method for subclasses to make a query for type from a ConstantFieldOptions object. + * @throws Exception + */ + protected String getActivityTypeQueryForConstantOptions(VitroRequest vreq, ConstantFieldOptions fieldOptions ) + throws Exception{ + + //make list of type URIs from options, this can be called with null since + //ConstantFieldOptions doesn't use any of the arguments. + Map options = fieldOptions.getOptions(null, null, null) ; + + if (options != null && options.size() > 0) { + List typeUris = new ArrayList(); + for(String typeUri: options.keySet()) { + if(typeUri != null && !typeUri.isEmpty()) { + typeUris.add("(?existingActivityType = <" + typeUri + ">)"); + } + } + + String defaultActivityTypeQuery = getDefaultActivityTypeQuery(vreq); + String typeFilters = "FILTER (" + StringUtils.join(typeUris, "||") + ")"; + return defaultActivityTypeQuery.replaceAll("}$", "") + typeFilters + "}"; + } else { + return getDefaultActivityTypeQuery(vreq); + } + } + + /** + * Utility method for subclasses to make a query for type from a ChildVClassesOptions object. + * @throws Exception + */ + protected String getActivityTypeQueryForChildVClassOptions(VitroRequest vreq, ChildVClassesOptions opts){ + log.debug("objectClassUri = " + opts.getClassUri()); + return QueryUtils.subUriForQueryVar( + getSubclassActivityTypeQuery(vreq), + "objectClassUri", opts.getClassUri()); + } + + /** + * Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object. + * @throws Exception + */ + protected String getActivityTypeQueryForIndividualsViaClassGroupOptions(VitroRequest vreq, IndividualsViaClassGroupOptions opts){ + log.debug("ClassGroupUri = " + opts.getClassGroupUri()); + return QueryUtils.subUriForQueryVar( + getClassgroupActivityTypeQuery(vreq), + "classgroup", opts.getClassGroupUri()); + } + + /* + * The activity type query results must be limited to the values in the activity type select element. + * Sometimes the query returns a superclass such as owl:Thing instead. + * Make use of vitro:mostSpecificType so that, for example, an individual is both a + * core:InvitedTalk and a core:Presentation, core:InvitedTalk is selected. + * vitro:mostSpecificType alone may not suffice, since it does not guarantee that the value returned + * is in the select list. + * We could still have problems if the value from the select list is not a vitro:mostSpecificType, + * but that is unlikely. + * + */ + private String getActivityTypeQuery(VitroRequest vreq) throws Exception { + + String activityTypeQuery = null; + + FieldOptions fieldOpts = getRoleActivityFieldOptions(vreq); + try{ + if( fieldOpts == null ){ + activityTypeQuery = getDefaultActivityTypeQuery(vreq); + }if( fieldOpts instanceof ConstantFieldOptions ){ + activityTypeQuery = getActivityTypeQueryForConstantOptions(vreq, (ConstantFieldOptions)fieldOpts); // + }else if (fieldOpts instanceof ChildVClassesOptions ){ + activityTypeQuery = getActivityTypeQueryForChildVClassOptions(vreq, (ChildVClassesOptions)fieldOpts); + }else if( fieldOpts instanceof IndividualsViaClassGroupOptions){ + activityTypeQuery = getActivityTypeQueryForIndividualsViaClassGroupOptions(vreq, (IndividualsViaClassGroupOptions)fieldOpts); + } + }catch(Exception ex){ + log.debug("error while building activity type query",ex); + } + activityTypeQuery = getDefaultActivityTypeQuery(vreq); + + //The replacement of activity type query's predicate was only relevant when we actually + //know which predicate is definitely being used here + //Here we have multiple values possible for predicate so the original + //Replacement should only happen when we have an actual predicate + //String replaceRoleToActivityPredicate = getRoleToActivityPredicate(vreq); + activityTypeQuery = QueryUtils.replaceQueryVar(activityTypeQuery, "predicate", getRoleToActivityPlaceholderName()); + + log.debug("Activity type query: " + activityTypeQuery); + return activityTypeQuery; + } + + + private String getDefaultActivityTypeQuery(VitroRequest vreq) { + String query = "PREFIX core: <" + VIVO_NS + ">\n" + + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + + "SELECT ?existingActivityType WHERE { \n" + + " ?role ?predicate ?existingActivity . \n" + + " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n"; + query += getFilterRoleToActivityPredicate("predicate"); + query+= "}"; + return query; + } + + private String getSubclassActivityTypeQuery(VitroRequest vreq) { + String query = "PREFIX core: <" + VIVO_NS + ">\n" + + "PREFIX rdfs: <" + VitroVocabulary.RDFS + ">\n" + + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + + "SELECT ?existingActivityType WHERE {\n" + + " ?role ?predicate ?existingActivity . \n" + + " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n" + + " ?existingActivityType rdfs:subClassOf ?objectClassUri . \n"; + query += getFilterRoleToActivityPredicate("predicate"); + query+= "}"; + return query; + } + + private String getClassgroupActivityTypeQuery(VitroRequest vreq) { + String query = "PREFIX core: <" + VIVO_NS + ">\n" + + "PREFIX vitro: <" + VitroVocabulary.vitroURI + "> \n" + + "SELECT ?existingActivityType WHERE { \n" + + " ?role ?predicate ?existingActivity . \n" + + " ?existingActivity vitro:mostSpecificType ?existingActivityType . \n" + + " ?existingActivityType vitro:inClassGroup ?classgroup . \n"; + query += getFilterRoleToActivityPredicate("predicate"); + query+= "}"; + return query; + } + + + private String getExistingRoleActivityQuery(VitroRequest vreq) { + //If role to activity predicate is the default query, then we need to replace with a union + //of both realizedIn and the other + String query = "PREFIX core: <" + VIVO_NS + ">"; + + query += "SELECT ?existingRoleActivity WHERE { \n" + + " ?role ?predicate ?existingRoleActivity . \n "; + query += getFilterRoleToActivityPredicate("predicate"); + query += "}"; + return query; + } + + private String getExistingEndDateQuery(VitroRequest vreq) { + String query = " SELECT ?existingEndDate WHERE {\n" + + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + + "?intervalNode <" + IntervalToEndURI + "> ?endNode .\n" + + "?endNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + + "?endNode <" + DateTimeValueURI + "> ?existingEndDate . }"; + return query; + } + + private String getExistingStartDateQuery(VitroRequest vreq) { + String query = "SELECT ?existingDateStart WHERE {\n" + + "?role <" + RoleToIntervalURI + "> ?intervalNode .\n" + + "?intervalNode <" + VitroVocabulary.RDF_TYPE + "> <" + IntervalTypeURI + "> .\n" + + "?intervalNode <" + IntervalToStartURI+ "> ?startNode .\n" + + "?startNode <" + VitroVocabulary.RDF_TYPE + "> <" + DateTimeValueTypeURI + "> .\n" + + "?startNode <" + DateTimeValueURI + "> ?existingDateStart . }"; + + return query; + } + + private String getRoleLabelQuery(VitroRequest vreq) { + String query = "SELECT ?existingRoleLabel WHERE { \n" + + "?role <" + VitroVocabulary.LABEL + "> ?existingRoleLabel . }"; + return query; + } + + private String getActivityLabelQuery(VitroRequest vreq) { + String query = "PREFIX core: <" + VIVO_NS + ">" + + "PREFIX rdfs: <" + RDFS.getURI() + "> \n"; + + query += "SELECT ?existingTitle WHERE { \n" + + "?role ?predicate ?existingActivity . \n" + + "?existingActivity rdfs:label ?existingTitle . \n"; + query += getFilterRoleToActivityPredicate("predicate"); + query += "}"; + return query; + } + + /** + * + * Set Fields and supporting methods + * @throws Exception + */ + + private void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri) throws Exception { + Map fields = new HashMap(); + //Multiple fields + getActivityLabelField(editConfiguration, vreq, fields); + getActivityLabelDisplayField(editConfiguration, vreq, fields); + getRoleActivityTypeField(editConfiguration, vreq, fields); + getExistingRoleActivityField(editConfiguration, vreq, fields); + getRoleLabelField(editConfiguration, vreq, fields); + getStartField(editConfiguration, vreq, fields); + getEndField(editConfiguration, vreq, fields); + //These fields are for the predicates that will be set later + //TODO: Do these only if not using a parameter for the predicate? + getRoleToActivityPredicateField(editConfiguration, vreq, fields); + getActivityToRolePredicateField(editConfiguration, vreq, fields); + editConfiguration.setFields(fields); + } + + //This is a literal technically? + private void getActivityToRolePredicateField( + EditConfigurationVTwo editConfiguration, VitroRequest vreq, + Map fields) { + + FieldVTwo field = new FieldVTwo(); + + String fieldName = "activityToRolePredicate"; + field.setName(fieldName); + + //get range data type uri and range language + String stringDatatypeUri = XSD.xstring.toString(); + field.setRangeDatatypeUri( stringDatatypeUri ); + + fields.put(field.getName(), field); + } + + private void getRoleToActivityPredicateField( + EditConfigurationVTwo editConfiguration, VitroRequest vreq, + Map fields) { + + FieldVTwo field = new FieldVTwo(); + + String fieldName = "roleToActivityPredicate"; + field.setName(fieldName); + + //get range data type uri and range language + String stringDatatypeUri = XSD.xstring.toString(); + field.setRangeDatatypeUri(stringDatatypeUri); + + fields.put(field.getName(), field); + } + + //Label of "right side" of role, i.e. label for role roleIn Activity + private void getActivityLabelField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq, Map fields) { + + FieldVTwo field = new FieldVTwo(); + String fieldName = "activityLabel"; + field.setName(fieldName); + + //get range data type uri and range language + String stringDatatypeUri = XSD.xstring.toString(); + field.setRangeDatatypeUri(stringDatatypeUri); + + List validators = new ArrayList(); + validators.add("datatype:" + stringDatatypeUri); + field.setValidators(validators); + + fields.put(field.getName(), field); + } + + private void getActivityLabelDisplayField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq, Map fields) { + FieldVTwo field = new FieldVTwo(); + + String fieldName = "activityLabelDisplay"; + field.setName(fieldName); + + //get range data type uri and range language + String stringDatatypeUri = XSD.xstring.toString(); + field.setRangeDatatypeUri(stringDatatypeUri); + + fields.put(field.getName(), field); + } + + //type of "right side" of role, i.e. type of activity from role roleIn activity + private void getRoleActivityTypeField( + EditConfigurationVTwo editConfiguration, VitroRequest vreq, + Map fields) throws Exception { + String fieldName = "roleActivityType"; + //get range data type uri and range language + + FieldVTwo field = new FieldVTwo(); + field.setName(fieldName); + + List validators = new ArrayList(); + if(isAddMode(vreq) || isRepairMode(vreq)) { + validators.add("nonempty"); + } + field.setValidators(validators); + + field.setOptions( getRoleActivityFieldOptions(vreq) ); + +// field.setOptionsType(getRoleActivityTypeOptionsType().toString()); +// field.setObjectClassUri(getRoleActivityTypeObjectClassUri(vreq)); +// +// HashMap literalOptionsMap = getRoleActivityTypeLiteralOptions(); +// List> fieldLiteralOptions = new ArrayList>(); +// Set optionUris = literalOptionsMap.keySet(); +// for(String optionUri: optionUris) { +// List uriLabelArray = new ArrayList(); +// uriLabelArray.add(optionUri); +// uriLabelArray.add(literalOptionsMap.get(optionUri)); +// fieldLiteralOptions.add(uriLabelArray); +// } +// field.setLiteralOptions(fieldLiteralOptions); + + fields.put(field.getName(), field); + + } + + + + //Assuming URI for activity for role? + private void getExistingRoleActivityField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq, Map fields) { + String fieldName = "existingRoleActivity"; + + FieldVTwo field = new FieldVTwo(); + field.setName(fieldName); + + fields.put(field.getName(), field); + } + + private void getRoleLabelField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq, Map fields) { + String fieldName = "roleLabel"; + + FieldVTwo field = new FieldVTwo(); + field.setName(fieldName); + + String stringDatatypeUri = XSD.xstring.toString(); + field.setRangeDatatypeUri(stringDatatypeUri); + + List validators = new ArrayList(); + validators.add("datatype:" + stringDatatypeUri); + if(isShowRoleLabelField()) { + validators.add("nonempty"); + } + field.setValidators(validators); + + fields.put(field.getName(), field); + } + + private void getStartField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq, Map fields) { + FieldVTwo field = new FieldVTwo(); + + String fieldName = "startField"; + field.setName(fieldName); + + field.setEditElement( + new DateTimeWithPrecisionVTwo(field, + getStartDatePrecision(), + VitroVocabulary.Precision.NONE.uri())); + + fields.put(field.getName(), field); + } + + private void getEndField(EditConfigurationVTwo editConfiguration, + VitroRequest vreq, Map fields) { + FieldVTwo field = new FieldVTwo(); + + String fieldName = "endField"; + field.setName(fieldName); + + field.setEditElement( + new DateTimeWithPrecisionVTwo(field, + getEndDatePrecision(), + VitroVocabulary.Precision.NONE.uri())); + + fields.put(field.getName(), field); + } + + private void addPreprocessors(EditConfigurationVTwo editConfiguration, WebappDaoFactory wadf) { + //Add preprocessor that will replace the role to activity predicate and inverse + //with correct properties based on the activity type + editConfiguration.addEditSubmissionPreprocessor( + new RoleToActivityPredicatePreprocessor(editConfiguration, wadf)); + + } + + //This has a default value, but note that even that will not be used + //in the update with realized in or contributes to + //Overridden when need be in subclassed generator + //Also note that for now we're going to actually going to return a + //placeholder value by default + public String getRoleToActivityPredicate(VitroRequest vreq) { + //TODO: and ?placeholder are incompatible + return getRoleToActivityPlaceholder(); + } + //Ensure when overwritten that this includes the <> b/c otherwise the query won't work + + //Some values will have a default value + + public List getPossibleRoleToActivityPredicates() { + return ModelUtils.getPossiblePropertiesForRole(); + } + + public List getPossibleActivityToRolePredicates() { + return ModelUtils.getPossibleInversePropertiesForRole(); + } + + /* Methods that check edit mode */ + public EditMode getEditMode(VitroRequest vreq) { + List roleToGrantPredicates = getPossibleRoleToActivityPredicates(); + return EditModeUtils.getEditMode(vreq, roleToGrantPredicates); + } + + private boolean isAddMode(VitroRequest vreq) { + return EditModeUtils.isAddMode(getEditMode(vreq)); + } + + private boolean isEditMode(VitroRequest vreq) { + return EditModeUtils.isEditMode(getEditMode(vreq)); + } + + private boolean isRepairMode(VitroRequest vreq) { + return EditModeUtils.isRepairMode(getEditMode(vreq)); + } + + /* URIS for various predicates */ + private final String VIVO_NS="http://vivoweb.org/ontology/core#"; + + private final String RoleToIntervalURI = VIVO_NS + "dateTimeInterval"; + private final String IntervalTypeURI = VIVO_NS + "DateTimeInterval"; + private final String IntervalToStartURI = VIVO_NS + "start"; + private final String IntervalToEndURI = VIVO_NS + "end"; + private final String StartYearPredURI = VIVO_NS + "startYear"; + private final String EndYearPredURI = VIVO_NS + "endYear"; + private final String DateTimeValueTypeURI=VIVO_NS + "DateTimeValue"; + private final String DateTimePrecisionURI=VIVO_NS + "dateTimePrecision"; + private final String DateTimeValueURI = VIVO_NS + "dateTime"; + + //Form specific data + public void addFormSpecificData(EditConfigurationVTwo editConfiguration, VitroRequest vreq) { + HashMap formSpecificData = new HashMap(); + formSpecificData.put("editMode", getEditMode(vreq).name().toLowerCase()); + //Fields that will need select lists generated + //Store field names + List objectSelect = new ArrayList(); + objectSelect.add("roleActivityType"); + //TODO: Check if this is the proper way to do this? + formSpecificData.put("objectSelect", objectSelect); + //Also put in show role label field + formSpecificData.put("showRoleLabelField", isShowRoleLabelField()); + //Put in the fact that we require field + editConfiguration.setFormSpecificData(formSpecificData); + } + + public String getFilterRoleToActivityPredicate(String predicateVar) { + String addFilter = "FILTER ("; + List predicates = getPossibleRoleToActivityPredicates(); + List filterPortions = new ArrayList(); + for(String p: predicates) { + filterPortions.add("(?" + predicateVar + "=<" + p + ">)"); + } + addFilter += StringUtils.join(filterPortions, " || "); + addFilter += ")"; + return addFilter; + } + + private String getRoleToActivityPlaceholder() { + return "?" + getRoleToActivityPlaceholderName(); + } + + private String getRoleToActivityPlaceholderName() { + return "roleToActivityPredicate"; + } + + + private String getActivityToRolePlaceholder() { + return "?activityToRolePredicate"; + } + + //Types of options to populate drop-down for types for the "right side" of the role + public static enum RoleActivityOptionTypes { + VCLASSGROUP, + CHILD_VCLASSES, + HARDCODED_LITERALS + }; + + private final String N3_PREFIX = "@prefix core: ."; + + protected String getStartDatePrecision() { + String precision = VitroVocabulary.Precision.YEAR.uri(); + return precision; + } + + protected String getEndDatePrecision() { + String precision = VitroVocabulary.Precision.YEAR.uri(); + return precision; + } + + +} From da690ebf9d0bd63e799eceee54e4d9f0b09d8aac Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 15:25:27 -0500 Subject: [PATCH 21/40] VIVO-434 restoring "documentation for" --- rdf/tbox/filegraph/object-properties.owl | 62 +++++++++----------- rdf/tbox/filegraph/research-resource.owl | 13 ++++ rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 5 ++ 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/rdf/tbox/filegraph/object-properties.owl b/rdf/tbox/filegraph/object-properties.owl index 4c95312e..1f06a387 100644 --- a/rdf/tbox/filegraph/object-properties.owl +++ b/rdf/tbox/filegraph/object-properties.owl @@ -201,7 +201,6 @@ - @@ -317,7 +316,6 @@ - @@ -497,7 +495,6 @@ - @@ -575,7 +572,6 @@ - @@ -593,8 +589,6 @@ PERSON: Melissa Haendel PERSON: Melissa Haendel used to study - - @@ -914,14 +908,7 @@ there is a measurement process p that has specified output m, a measurement datu http://www.affymetrix.com/products/arrays/specific/hgu133.affx is_manufactered_by http://www.affymetrix.com/ (if we decide to use these URIs for the actual entities) is_manufactured_by - - - - - - - - + @@ -1671,7 +1658,8 @@ there is a measurement process p that has specified output m, a measurement datu - + + @@ -1679,7 +1667,21 @@ there is a measurement process p that has specified output m, a measurement datu - + + + + + + + + + + + + + + + @@ -1687,7 +1689,16 @@ there is a measurement process p that has specified output m, a measurement datu - + + + + + + + + + + @@ -1704,7 +1715,6 @@ there is a measurement process p that has specified output m, a measurement datu - @@ -1717,22 +1727,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - - - - - - - - - - - - diff --git a/rdf/tbox/filegraph/research-resource.owl b/rdf/tbox/filegraph/research-resource.owl index dccf8f43..795cdeb9 100644 --- a/rdf/tbox/filegraph/research-resource.owl +++ b/rdf/tbox/filegraph/research-resource.owl @@ -507,5 +507,18 @@ + + + + + OBI branch derived + wikipedia (http://en.wikipedia.org/wiki/Protocol_%28natural_sciences%29) + PMID: 18388943.Nat Protoc. 2008;3(4):612-8.Protocol for the induction of arthritis in C57BL/6 mice. + PlanAndPlannedProcess Branch + Protocol + a protocol is a plan specification which has sufficient level of detail and quantitative information to communicate it between domain experts, so that different domain experts will reliably be able to independently reproduce the process. + protocol + + + diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index cef6df9c..44a3d725 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -407,6 +407,9 @@ foaf:Person obo:OBI_0000643 rdfs:label "has grain"@en-US . +obo:OBI_0000272 + rdfs:label "protocol"@en-US . + vcard:Identification rdfs:label "Identification"@en-US . @@ -6173,6 +6176,8 @@ obo:ERO_0001716 vitro:prohibitedFromUpdateBelowRoleLevelAnnot ; vitro:selectFromExistingAnnot + "true"^^xsd:boolean ; + vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean . vcard:hasRelated From 8d8df54219a76f8da3222ac91de6999c10beee4e Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 15:26:07 -0500 Subject: [PATCH 22/40] fixes a vcard bug --- .../update/sparqlConstructs/additions/vcard1-0c.sparql | 3 ++- .../update/sparqlConstructs/additions/vcard2d.sparql | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql index 03405d95..7443d28a 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.sparql @@ -8,7 +8,8 @@ CONSTRUCT { _:vcard arg:ARG_2000029 ?s . _:vcard a v:Individual . } WHERE { - ?s vivo:middleName ?middleName + ?s vivo:middleName ?middleName . + ?s a foaf:Person FILTER NOT EXISTS { ?s arg:ARG_2000028 ?vcard } diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql index a065a9fe..cb32f1b9 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql @@ -8,6 +8,7 @@ CONSTRUCT { ?name vivo:middleName ?middleName . } WHERE { ?s vivo:middleName ?middleName . + ?s a foaf:Person . ?s arg:ARG_2000028 ?vcard . ?vcard v:hasName ?name } From 5adf4a587f6c7079a7013db34438fdf7d475c600 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 15:50:11 -0500 Subject: [PATCH 23/40] object property cleanup --- rdf/tbox/filegraph/object-properties.owl | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/rdf/tbox/filegraph/object-properties.owl b/rdf/tbox/filegraph/object-properties.owl index 1f06a387..f61d226f 100644 --- a/rdf/tbox/filegraph/object-properties.owl +++ b/rdf/tbox/filegraph/object-properties.owl @@ -558,24 +558,6 @@ related technique - - - - - - - - - - - - - - - - - - From ef3ac5008d150351a503498fe70c881b9a5ca4bb Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Tue, 5 Nov 2013 16:08:22 -0500 Subject: [PATCH 24/40] VIVO-494 hiding "realizes" --- rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index 44a3d725..672d3388 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -5983,7 +5983,11 @@ vcard:Name rdfs:label "Name"@en-US . obo:BFO_0000055 - rdfs:label "realizes"@en-US . + rdfs:label "realizes"@en-US ; + vitro:hiddenFromDisplayBelowRoleLevelAnnot + ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot + . geo:nationalityAR rdfs:label "nationalityAR"@en-US ; From 30c8b89436ec4f399dbf4b04c96798a8aa366574 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 5 Nov 2013 16:24:34 -0500 Subject: [PATCH 25/40] VIVO-492 --- rdf/display/everytime/PropertyConfig.n3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 47f25725..fbf5e0af 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -220,8 +220,8 @@ local:hasResearcherRoleContext a :ConfigContext ; local:hasResearcherRoleConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-researchActivities.xml"^^xsd:string ; - :displayName "research activities" ; - vitro:displayRankAnnot 15; + :displayName "other research activities" ; + vitro:displayRankAnnot 35; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddResearcherRoleToPersonGenerator"^^ ; From 6940771720a08f2532c066a20ac37234ac188824 Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 5 Nov 2013 17:51:09 -0500 Subject: [PATCH 26/40] VIVO-448 Correct the installation instructions for ORNG. The change from deploy.properties to build/runtime.properties wasn't handled correctly. --- doc/install.html | 39 +++++++++++++++++++-------------------- doc/setting_up_orng.html | 16 ++++++++-------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/doc/install.html b/doc/install.html index 00c033cd..c30b768e 100644 --- a/doc/install.html +++ b/doc/install.html @@ -339,6 +339,25 @@ issuing SPARQL queries that read data, and its URI for issuing SPARQL UPDATE com es_MX + + + These values are used when deploying VIVO as an OpenSocial container + and integrating with OpenSocial gadgets + (see Step 13, below). If you are creating + a VIVO installation that does not use OpenSocial gadgets, these values are omitted. + + + + + OpenSocial.shindigURL
+ OpenSocial.tokenService
+ OpenSocial.tokenKeyFile
+ OpenSocial.sandbox + + +   + + @@ -938,26 +957,6 @@ issuing SPARQL queries that read data, and its URI for issuing SPARQL UPDATE com - - - These values are used when deploying VIVO as an OpenSocial container - and integrating with OpenSocial gadgets - (see Step 13, below). If you are creating - a VIVO installation that does not use OpenSocial gadgets, these values are omitted. - - - - - OpenSocial.shindigURL
- OpenSocial.tokenService
- OpenSocial.tokenKeyFile
- OpenSocial.sandbox - - -   - - - diff --git a/doc/setting_up_orng.html b/doc/setting_up_orng.html index 9f7e59a6..9eb99459 100644 --- a/doc/setting_up_orng.html +++ b/doc/setting_up_orng.html @@ -188,7 +188,7 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle

I.iv Configure VIVO

- In the VIVO home directory, the file called runtime.properties + In the VIVO distribution directory, the file called build.properties contains configuration options for the VIVO application. You must set some additional parameters so VIVO will be able to communicate with Shindig-ORNG.

@@ -333,7 +333,7 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle
  • VIVO was not re-deployed with ant deploy after the OpenSocial - values were set in runtime.properties + values were set in build.properties
@@ -405,7 +405,7 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle
  • - OpenSocial.tokenKeyFile is not set in runtime.properties, + OpenSocial.tokenKeyFile is not set in build.properties, or the file does not exist at the specified location.
@@ -449,7 +449,7 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle
  • - In runtime.properties, OpenSocial.tokenService is not set correctly. + In build.properties, OpenSocial.tokenService is not set correctly.
@@ -692,11 +692,11 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle

III.i. Re-running the deployment script

- The OpenSocial framework relies on several of the settings in the runtime.properties file, + The OpenSocial framework relies on several of the settings in the build.properties and runtime.properties files, in addition to the ones that are explicitly linked to it.

- Each time you change the settings in runtime.properties, you should re-deploy + Each time you change the settings in build.properties or runtime.properties, you should re-deploy the framework with

          ant orng

@@ -750,12 +750,12 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle Disabling the gadgets, as above, will remove essentially all of the OpenSocial processing within VIVO. To remove the remainder of it, you can disable the connection between VIVO and the OpenSocial service. Do this by removing or commenting - the OpenSocial properties in runtime.properties + the OpenSocial properties in build.properties (see section I.iv. Configure VIVO).

- Restart Tomcat to make this change take effect. + To make this change take effect, re-deploy VIVO and restart Tomcat.

Remove the OpenSocial webapp from Tomcat

From badab0b5ae51bb4d3200270d4494f177f6754632 Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 5 Nov 2013 18:25:06 -0500 Subject: [PATCH 27/40] Modify counter.jsp to use ModelAccess --- productMods/counter.jsp | 78 +++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/productMods/counter.jsp b/productMods/counter.jsp index 51474cd0..59be7457 100644 --- a/productMods/counter.jsp +++ b/productMods/counter.jsp @@ -5,6 +5,8 @@ <%@ taglib uri="http://djpowell.net/tmp/sparql-tag/0.1/" prefix="sparql" %> <%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.1" prefix="str" %> <%@ page import="java.net.URLDecoder" %> +<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%> +<% request.setAttribute("jenaOntModel", ModelAccess.on(getServletContext()).getJenaOntModel()); %>
@@ -13,9 +15,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -34,9 +36,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -58,9 +60,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -84,9 +86,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -104,9 +106,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -127,9 +129,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -152,9 +154,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -172,9 +174,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -195,9 +197,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -220,9 +222,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -240,9 +242,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -260,9 +262,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -284,9 +286,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -304,9 +306,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -325,9 +327,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -349,9 +351,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -376,9 +378,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -404,9 +406,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: @@ -429,9 +431,9 @@ - + - + PREFIX rdfs: PREFIX rdf: PREFIX akt: From 77b408e699159fbddb612a6fcf53d17593690569 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 6 Nov 2013 09:11:03 -0500 Subject: [PATCH 28/40] VIVO-496 and VIVO-497 hiding inheres in and cleaning up has expertise --- rdf/tbox/filegraph/research-resource.owl | 30 -------------------- rdf/tbox/firsttime/initialTBoxAnnotations.n3 | 18 ++++++------ 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/rdf/tbox/filegraph/research-resource.owl b/rdf/tbox/filegraph/research-resource.owl index 795cdeb9..5d90bd3a 100644 --- a/rdf/tbox/filegraph/research-resource.owl +++ b/rdf/tbox/filegraph/research-resource.owl @@ -296,36 +296,6 @@ - - - - - - - - - A technique used for identification, assessment, and prioritization of risks followed by coordinated and economical application of resources to minimize, monitor, and control the probability and/or impact of unfortunate events or to maximize the realization of opportunities. - PERSON: Nicole Vasilevsky - http://en.wikipedia.org/wiki/Risk_management - - - - - - - - - - - - - A technique designed for the collection of clinical data in electronic format for use mainly in human clinical trials. - Electronic health records. - PERSON: Nicole Vasilevsky - clinical database development - http://en.wikipedia.org/wiki/Electronic_data_capture - - diff --git a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 index 672d3388..32f22456 100644 --- a/rdf/tbox/firsttime/initialTBoxAnnotations.n3 +++ b/rdf/tbox/firsttime/initialTBoxAnnotations.n3 @@ -1774,9 +1774,6 @@ vivo:hasGoverningAuthority vitro:selectFromExistingAnnot "true"^^xsd:boolean . -obo:ERO_0000715 - rdfs:label "Risk Management"@en-US . - vcard:additionalName rdfs:label "additional name"@en-US . @@ -2798,7 +2795,11 @@ vivo:GraduateAdvisingRelationship . obo:RO_0000052 - rdfs:label "inheres in"@en-US . + rdfs:label "inheres in"@en-US ; + vitro:hiddenFromDisplayBelowRoleLevelAnnot + ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot + . obo:OBI_0000299 rdfs:label "has specified output"@en-US . @@ -5568,9 +5569,6 @@ geo:countryAreaUnit vitro:prohibitedFromUpdateBelowRoleLevelAnnot . -obo:ERO_0000742 - rdfs:label "Research Electronic Datacapture"@en-US . - vcard:geo rdfs:label "geo"@en-US . @@ -6053,7 +6051,11 @@ obo:RO_0001018 rdfs:label "contained in"@en-US . obo:ERO_0000033 - rdfs:label "has expertise"@en-US . + rdfs:label "has expertise in technique"@en-US ; + vitro:selectFromExistingAnnot + "true"^^xsd:boolean ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean . bibo:peerReviewed rdfs:label "peer reviewed"@en-US . From 5b5bc34d1a9209803a32ab3f79ad88d07d6b49c9 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 6 Nov 2013 11:31:17 -0500 Subject: [PATCH 29/40] VIVO-491 migrating hasGeographicLocation on Addresses --- .../update/sparqlConstructs/additions/vcard8.sparql | 3 +++ .../update/sparqlConstructs/deletions/vcardDel.sparql | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql index 1f1dddce..a1a53389 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql @@ -11,12 +11,15 @@ CONSTRUCT { _:address v:region ?addressState . _:address v:postalCode ?addressPostalCode . _:address v:country ?addressCountry . + _:address ?location . + ?location _:address . } WHERE { ?s vivo:mailingAddress ?address . OPTIONAL { ?address vivo:addressCity ?addressCity } OPTIONAL { ?address vivo:addressState ?addressState } OPTIONAL { ?address vivo:addressPostalCode ?addressPostalCode } OPTIONAL { ?address vivo:addressCountry ?addressCountry } + OPTIONAL { ?address vivo:hasGeographicLocation ?location } ?s arg:ARG_2000028 ?vcard . OPTIONAL { ?address vivo:address1 ?address1 . diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql index d31781cf..1eb00279 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql @@ -17,6 +17,7 @@ CONSTRUCT { ?s vivo:faxNumber ?faxNumber . ?s vivo:mailingAddress ?address . ?address ?addressP ?addressO . + ?addressS ?addressQ ?address . ?s vivo:webpage ?webpage . ?webpage ?webpageP ?webpageO . } WHERE { @@ -58,6 +59,10 @@ CONSTRUCT { ?s vivo:mailingAddress ?address . ?address ?addressP ?addressO } + UNION { + ?s vivo:mailingAddress ?address . + ?addressS ?addressQ ?address + } UNION { ?s vivo:webpage ?webpage } From b83807a6cb923003658261fc85d26d6a19823dc0 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 6 Nov 2013 11:36:32 -0500 Subject: [PATCH 30/40] VIVO-420 change VivoInformationResourceContextNodeFields.java to use foaf:Agent in getting related authors/editors instead of foaf:Person --- .../search/solr/VivoInformationResourceContextNodeFields.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java index 31334700..2fcf6798 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java @@ -48,7 +48,7 @@ public class VivoInformationResourceContextNodeFields extends ContextNodeFields{ + "?uri core:relatedBy ?a . " + "?a rdf:type core:Authorship ." + "?a core:relates ?b ." - + "?b rdf:type foaf:Person ." + + "?b rdf:type foaf:Agent ." + "?b rdfs:label ?ContextNodeProperty .}"); /* features */ @@ -69,7 +69,7 @@ public class VivoInformationResourceContextNodeFields extends ContextNodeFields{ + "?uri core:relatedBy ?e . " + "?e rdf:type core:Editorship ." + "?e core:relates ?i ." - + "?i rdf:type foaf:Person ." + + "?i rdf:type foaf:Agent ." + "?i rdfs:label ?ContextNodeProperty ." + "}"); From 741ea08f980e09031172531db226872db6f90bd1 Mon Sep 17 00:00:00 2001 From: j2blake Date: Wed, 6 Nov 2013 12:24:56 -0500 Subject: [PATCH 31/40] A quick script to check the deployed language properties files. --- utilities/languageSupport/i18nChecker/check | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 utilities/languageSupport/i18nChecker/check diff --git a/utilities/languageSupport/i18nChecker/check b/utilities/languageSupport/i18nChecker/check new file mode 100755 index 00000000..5d133e93 --- /dev/null +++ b/utilities/languageSupport/i18nChecker/check @@ -0,0 +1,2 @@ +ruby i18nChecker.rb '/Library/Tomcat/webapps/vivo/i18n/*.properties' complete +ruby i18nChecker.rb '/Library/Tomcat/webapps/vivo/themes/wilma/i18n/*.properties' complete From 4a3937e78c0b82acabb8a0bb9acd5b135bceaab5 Mon Sep 17 00:00:00 2001 From: j2blake Date: Wed, 6 Nov 2013 12:26:46 -0500 Subject: [PATCH 32/40] VIVO-483 Adjust indexing code for the ISF This class should not have been in Vitro, since it uses VIVO URIs and is never referenced in Vitro. Also, it needed updating to match the ISF. --- .../search/solr/CalculateParameters.java | 298 ++++++++++++++++++ .../search/solr/VivoDocumentModifiers.java | 1 - 2 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java b/src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java new file mode 100644 index 00000000..432c3573 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java @@ -0,0 +1,298 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.search.solr; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.solr.common.SolrInputDocument; + +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.Query; +import com.hp.hpl.jena.query.QueryExecution; +import com.hp.hpl.jena.query.QueryExecutionFactory; +import com.hp.hpl.jena.query.QueryFactory; +import com.hp.hpl.jena.query.QuerySolution; +import com.hp.hpl.jena.query.QuerySolutionMap; +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.query.Syntax; +import com.hp.hpl.jena.rdf.model.RDFNode; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.ResourceFactory; +import com.hp.hpl.jena.shared.Lock; + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames; +import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.DocumentModifier; + + +public class CalculateParameters implements DocumentModifier { + + private boolean shutdown = false; + private Dataset dataset; + // public static int totalInd=1; + + private static final String prefix = "prefix owl: " + + " prefix vitroDisplay: " + + " prefix rdf: " + + " prefix core: " + + " prefix foaf: " + + " prefix rdfs: " + + " prefix localNav: " + + " prefix obo: " + + " prefix bibo: "; + + private static final String betaQuery = prefix + " SELECT count(distinct ?inLinks) " + + " WHERE { " + + " ?uri rdf:type owl:Thing . " + + " ?inLinks ?prop ?uri . " + + " } "; + + private static final String totalCountQuery = prefix + " SELECT count(distinct ?ind) " + + " WHERE { " + + " ?ind rdf:type owl:Thing . " + + " } "; + + private static Log log = LogFactory.getLog(CalculateParameters.class); + + public CalculateParameters(Dataset dataset){ + this.dataset =dataset; + // new Thread(new TotalInd(this.dataset,totalCountQuery)).start(); + } + + public CalculateParameters(){ + super(); + } + + public float calculateBeta(String uri){ + float beta=0; + int Conn=0; + Query query; + QuerySolutionMap initialBinding = new QuerySolutionMap(); + QuerySolution soln = null; + Resource uriResource = ResourceFactory.createResource(uri); + initialBinding.add("uri", uriResource); + dataset.getLock().enterCriticalSection(Lock.READ); + QueryExecution qexec=null; + try{ + query = QueryFactory.create(betaQuery,Syntax.syntaxARQ); + qexec = QueryExecutionFactory.create(query,dataset,initialBinding); + ResultSet results = qexec.execSelect(); + List resultVars = results.getResultVars(); + if(resultVars!=null && resultVars.size()!=0){ + soln = results.next(); + Conn = Integer.parseInt(soln.getLiteral(resultVars.get(0)).getLexicalForm()); + } + }catch(Throwable t){ + if( ! shutdown ) + log.error(t,t); + }finally{ + if( qexec != null ) + qexec.close(); + dataset.getLock().leaveCriticalSection(); + } + + beta = (float)Conn; + //beta *= 100; + beta += 1; + + // sigmoid function to keep beta between 0 to 1; + + beta = (float) (1 / ( 1 + Math.pow(Math.E,(-beta)))); + + if(beta > 1) + log.info("Beta higher than 1 : " + beta); + else if(beta <= 0) + log.info("Beta lower < = 0 : " + beta); + return beta; + } + + + public String[] getAdjacentNodes(String uri){ + + List queryList = new ArrayList(); + Set adjacentNodes = new HashSet(); + Set coauthorNames = new HashSet(); + String[] info = new String[]{"",""}; + StringBuffer adjacentNodesConcat = new StringBuffer(); + StringBuffer coauthorBuff = new StringBuffer(); + adjacentNodesConcat.append(""); + coauthorBuff.append(""); + + queryList.add(prefix + + " SELECT ?adjobj (str(?adjobjLabel) as ?coauthor) " + + " WHERE { " + + " ?uri rdf:type . " + + " ?uri ?prop ?obj . " + + " ?obj rdf:type . " + + " ?obj ?prop2 ?obj2 . " + + " ?obj2 rdf:type obo:IAO_0000030 . " + + " ?obj2 ?prop3 ?obj3 . " + + " ?obj3 rdf:type . " + + " ?obj3 ?prop4 ?adjobj . " + + " ?adjobj rdfs:label ?adjobjLabel . " + + " ?adjobj rdf:type . " + + + " FILTER (?prop !=rdf:type) . " + + " FILTER (?prop2!=rdf:type) . " + + " FILTER (?prop3!=rdf:type) . " + + " FILTER (?prop4!=rdf:type) . " + + " FILTER (?adjobj != ?uri) . " + + "}"); + + queryList.add(prefix + + " SELECT ?adjobj " + + " WHERE{ " + + + " ?uri rdf:type foaf:Agent . " + + " ?uri ?prop ?obj . " + + " ?obj ?prop2 ?adjobj . " + + + + " FILTER (?prop !=rdf:type) . " + + " FILTER isURI(?obj) . " + + + " FILTER (?prop2!=rdf:type) . " + + " FILTER (?adjobj != ?uri) . " + + " FILTER isURI(?adjobj) . " + + + " { ?adjobj rdf:type . } " + + " UNION " + + " { ?adjobj rdf:type . } " + + " UNION " + + " { ?adjobj rdf:type obo:IAO_0000030 . } " + + " UNION " + + " { ?adjobj rdf:type . } ." + + "}"); + + Query query; + + QuerySolution soln; + QuerySolutionMap initialBinding = new QuerySolutionMap(); + Resource uriResource = ResourceFactory.createResource(uri); + + initialBinding.add("uri", uriResource); + + Iterator queryItr = queryList.iterator(); + + dataset.getLock().enterCriticalSection(Lock.READ); + Resource adjacentIndividual = null; + RDFNode coauthor = null; + try{ + while(queryItr.hasNext()){ + /*if(!isPerson){ + queryItr.next(); // we don't want first query to execute if the ind is not a person. + }*/ + query = QueryFactory.create(queryItr.next(),Syntax.syntaxARQ); + QueryExecution qexec = QueryExecutionFactory.create(query,dataset,initialBinding); + try{ + ResultSet results = qexec.execSelect(); + while(results.hasNext()){ + soln = results.nextSolution(); + + adjacentIndividual = (Resource)soln.get("adjobj"); + if(adjacentIndividual!=null){ + adjacentNodes.add(adjacentIndividual.getURI()); + } + + coauthor = soln.get("coauthor"); + if(coauthor!=null){ + coauthorNames.add(" co-authors " + coauthor.toString() + " co-authors "); + } + } + }catch(Exception e){ + if( ! shutdown ) + log.error("Error found in getAdjacentNodes method of SearchQueryHandler"); + }finally{ + qexec.close(); + } + } + queryList = null; + Iterator itr = adjacentNodes.iterator(); + while(itr.hasNext()){ + adjacentNodesConcat.append(itr.next() + " "); + } + + info[0] = adjacentNodesConcat.toString(); + + itr = coauthorNames.iterator(); + while(itr.hasNext()){ + coauthorBuff.append(itr.next()); + } + + info[1] = coauthorBuff.toString(); + + } + catch(Throwable t){ + if( ! shutdown ) + log.error(t,t); + }finally{ + dataset.getLock().leaveCriticalSection(); + adjacentNodes = null; + adjacentNodesConcat = null; + coauthorBuff = null; + } + return info; + } + + @Override + public void modifyDocument(Individual individual, SolrInputDocument doc, StringBuffer addUri) { + // TODO Auto-generated method stub + // calculate beta value. + log.debug("Parameter calculation starts.."); + float beta = calculateBeta(individual.getURI()); + doc.addField(VitroSearchTermNames.BETA, beta); + doc.setDocumentBoost(beta + doc.getDocumentBoost() ); + log.debug("Parameter calculation is done"); + } + + + public void shutdown(){ + shutdown=true; + } +} + +class TotalInd implements Runnable{ + private Dataset dataset; + private String totalCountQuery; + private static Log log = LogFactory.getLog(TotalInd.class); + + public TotalInd(Dataset dataset,String totalCountQuery){ + this.dataset = dataset; + this.totalCountQuery = totalCountQuery; + + } + public void run(){ + int totalInd=0; + Query query; + QuerySolution soln = null; + dataset.getLock().enterCriticalSection(Lock.READ); + QueryExecution qexec = null; + + try{ + query = QueryFactory.create(totalCountQuery,Syntax.syntaxARQ); + qexec = QueryExecutionFactory.create(query,dataset); + ResultSet results = qexec.execSelect(); + List resultVars = results.getResultVars(); + + if(resultVars!=null && resultVars.size()!=0){ + soln = results.next(); + totalInd = Integer.parseInt(soln.getLiteral(resultVars.get(0)).getLexicalForm()); + } + //CalculateParameters.totalInd = totalInd; + //log.info("Total number of individuals in the system are : " + CalculateParameters.totalInd); + }catch(Throwable t){ + log.error(t,t); + }finally{ + if( qexec != null ) + qexec.close(); + dataset.getLock().leaveCriticalSection(); + } + + } +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java b/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java index 927ae69d..b27bfbad 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java @@ -13,7 +13,6 @@ import com.hp.hpl.jena.query.DatasetFactory; import edu.cornell.mannlib.vitro.webapp.dao.ModelAccess; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.CalculateParameters; import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.DocumentModifier; import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ExcludeBasedOnNamespace; import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.SearchIndexExcluder; From 95ce8a58286cb63498f06193436252d13319c67f Mon Sep 17 00:00:00 2001 From: j2blake Date: Wed, 6 Nov 2013 13:07:25 -0500 Subject: [PATCH 33/40] VIVO-483 Obsolete VIVO URIs in Vitro search code. Break out the mechanism for building a list of Additional URI Finder instances. Override that in VIVO. Move AdditionalURIsForContextNodes to VIVO. References to obsolete URIs are in comments. --- .../AdditionalURIsForContextNodes.java | 789 ++++++++++++++++++ .../search/indexing/AdditionalUriFinders.java | 30 + .../AdditionalURIsForContextNodesTest.java | 670 +++++++++++++++ 3 files changed, 1489 insertions(+) create mode 100644 src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java create mode 100644 src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalUriFinders.java create mode 100644 test/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodesTest.java diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java b/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java new file mode 100644 index 00000000..90bbc95e --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodes.java @@ -0,0 +1,789 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.search.indexing; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.ontology.OntModel; +import com.hp.hpl.jena.query.Query; +import com.hp.hpl.jena.query.QueryExecution; +import com.hp.hpl.jena.query.QueryExecutionFactory; +import com.hp.hpl.jena.query.QueryFactory; +import com.hp.hpl.jena.query.QuerySolution; +import com.hp.hpl.jena.query.QuerySolutionMap; +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.query.Syntax; +import com.hp.hpl.jena.rdf.model.RDFNode; +import com.hp.hpl.jena.rdf.model.Resource; +import com.hp.hpl.jena.rdf.model.ResourceFactory; +import com.hp.hpl.jena.rdf.model.Statement; +import com.hp.hpl.jena.shared.Lock; + +import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate; + +public class AdditionalURIsForContextNodes implements StatementToURIsToUpdate { + + private OntModel model; + private Set alreadyChecked; + private long accumulatedTime = 0; + + private static final List multiValuedQueriesForAgent = new ArrayList(); + private static final String multiValuedQueryForInformationContentEntity; + private static final List multiValuedQueriesForRole = new ArrayList(); + private static final ListqueryList; + + private Log log = LogFactory.getLog(AdditionalURIsForContextNodes.class); + + + public AdditionalURIsForContextNodes( OntModel jenaOntModel){ + this.model = jenaOntModel; + } + + @Override + public List findAdditionalURIsToIndex(Statement stmt) { + + if( stmt != null ){ + long start = System.currentTimeMillis(); + + ListurisToIndex = new ArrayList(); + if(stmt.getSubject() != null && stmt.getSubject().isURIResource() ){ + String subjUri = stmt.getSubject().getURI(); + if( subjUri != null && ! alreadyChecked.contains( subjUri )){ + urisToIndex.addAll( findAdditionalURIsToIndex(subjUri)); + alreadyChecked.add(subjUri); + } + } + + if( stmt.getObject() != null && stmt.getObject().isURIResource() ){ + String objUri = stmt.getSubject().getURI(); + if( objUri != null && ! alreadyChecked.contains(objUri)){ + urisToIndex.addAll( findAdditionalURIsToIndex(objUri)); + alreadyChecked.add(objUri); + } + } + + accumulatedTime += (System.currentTimeMillis() - start ) ; + return urisToIndex; + }else{ + return Collections.emptyList(); + } + } + + @Override + public void startIndexing() { + alreadyChecked = new HashSet(); + accumulatedTime = 0L; + } + + @Override + public void endIndxing() { + log.debug( "Accumulated time for this run of the index: " + accumulatedTime + " msec"); + alreadyChecked = null; + } + + protected List findAdditionalURIsToIndex(String uri) { + + List uriList = new ArrayList(); + + for(String query : queryList){ + + //log.info("Executing query: "+ query); + + QuerySolutionMap initialBinding = new QuerySolutionMap(); + Resource uriResource = ResourceFactory.createResource(uri); + initialBinding.add("uri", uriResource); + + Query sparqlQuery = QueryFactory.create( query, Syntax.syntaxARQ); + model.getLock().enterCriticalSection(Lock.READ); + try{ + QueryExecution qExec = QueryExecutionFactory.create(sparqlQuery, model, initialBinding); + try{ + ResultSet results = qExec.execSelect(); + while(results.hasNext()){ + QuerySolution soln = results.nextSolution(); + Iterator iter = soln.varNames() ; + while( iter.hasNext()){ + String name = iter.next(); + RDFNode node = soln.get( name ); + if( node != null ){ + uriList.add("" + node.toString()); + }else{ + log.debug(name + " is null"); + } + } + } + }catch(Throwable t){ + log.error(t,t); + } finally{ + qExec.close(); + } + }finally{ + model.getLock().leaveCriticalSection(); + } + } + + if( log.isDebugEnabled() ) + log.debug( "additional uris for " + uri + " are " + uriList); + + return uriList; + } + + + private static final String prefix = "prefix owl: \n" + + " prefix vitroDisplay: \n" + + " prefix rdf: \n" + + " prefix core: \n" + + " prefix foaf: \n" + + " prefix obo: \n" + + " prefix vcard: \n" + + " prefix event: \n" + + " prefix rdfs: \n" + + " prefix localNav: \n" + + " prefix bibo: \n"; + + static{ + + // If a person changes then update + // organizations for positions + multiValuedQueriesForAgent.add(prefix + + "SELECT DISTINCT \n" + + " (str(?i) as ?positionInOrganization) \n" + + " WHERE {\n" + + + "?uri rdf:type foaf:Agent ; core:relatedBy ?c . \n" + + " ?c rdf:type core:Position . \n" + + + " OPTIONAL { ?c core:relates ?i . ?i rdf:type foaf:Organization } . \n" + + " }"); + + // If a person changes then update + // advisee, linkedAuthor and informationResource + multiValuedQueriesForAgent.add(prefix + + "SELECT (str(?d) as ?advisee) \n" + + " (str(?f) as ?linkedAuthor) (str(?h) as ?linkedInformationResource) WHERE { {\n" + + + "?uri rdf:type foaf:Agent . \n" + + "?uri core:relatedBy ?c . \n" + + "?c rdf:type core:AdvisingRelationship . \n" + + "?c core:relates ?d . \n" + + "?d rdf:type core:AdviseeRole . \n" + + "?d obo:RO_0000052 ?e . \n" + + "?e rdf:type foaf:Person . \n" + + "} \n" + + "UNION { \n" + + " ?uri rdf:type foaf:Agent . \n" + + " ?uri core:relatedBy ?c . \n" + + " ?c rdf:type core:Authorship . \n" + + " OPTIONAL {?c core:relates ?f . \n" + + " ?f rdf:type foaf:Person . } \n" + + " OPTIONAL { ?c core:relates ?h . \n" + + " ?h rdf:type obo:IAO_0000030 . } \n" + + " } } "); + + // If a person changes then update + // award giver + multiValuedQueriesForAgent.add(prefix + + "SELECT (str(?d) as ?awardConferredBy) \n" + + "WHERE {\n" + + + "?uri rdf:type foaf:Agent ; ?b ?c . \n" + + " ?c rdf:type core:AwardReceipt . \n" + + + " OPTIONAL { ?c core:assignedBy ?d . } . \n" + + " }"); + + // If a person changes then update + // organization for role + multiValuedQueriesForAgent.add(prefix + + "SELECT (str(?Organization) as ?organization) \n" + + "WHERE {\n" + + + "?uri rdf:type foaf:Agent ; ?b ?c . \n" + + " ?c rdf:type obo:BFO_0000023 ; obo:BFO_0000054 ?Organization .\n" + + " }"); + + // If a person changes then update + // organization in educational training + multiValuedQueriesForAgent.add(prefix + + "SELECT \n" + + "(str(?e) as ?trainingAtOrganization) WHERE {\n" + + + " ?uri rdf:type foaf:Agent ; ?b ?c . \n" + + " ?c rdf:type core:EducationalProcess . \n" + + + " OPTIONAL { ?c obo:RO_0000057 ?e . \n" + + " ?e rdf:type foaf:Organization . } . " + +"}"); + + // If an organization changes then update + // people in head of relations + multiValuedQueriesForAgent.add( + " # for organization, get leader \n" + + prefix + + "SELECT \n" + + "(str(?e) as ?LeaderPerson ) WHERE {\n" + + + " ?uri rdf:type foaf:Agent . \n" + + " ?uri core:contributingRole ?c . \n" + + " ?c rdf:type core:LeaderRole . \n" + + + " OPTIONAL { ?c obo:RO_0000052 ?e . \n" + + " ?e rdf:type foaf:Person . } . " + +"}"); + + } + + //multivalued query for obo:IAO_0000030 (Information Content Entity) + static { + + multiValuedQueryForInformationContentEntity = prefix + + "SELECT (str(?b) as ?linkedAuthor) (str(?d) as ?linkedInformationResource) \n" + + "(str(?f) as ?editor) \n" + + "(str(?i) as ?features) WHERE {\n" + + + " ?uri rdf:type obo:IAO_0000030 . \n" + + + " OPTIONAL { ?uri core:relatedBy ?a . \n" + + " ?a rdf:type core:Authorship . \n" + + " ?a core:relates ?b . ?b rdf:type foaf:Person .\n" + + " ?a core:relates ?d . ?d rdf:type obo:IAO_0000030 .\n" + + "} . " + + + " OPTIONAL { ?uri core:relatedBy ?e . \n" + + " ?e rdf:type core:Editorship . \n" + + " ?e core:relates ?f . ?f rdf:type foaf:Person .\n" + + "} . " + + " OPTIONAL { ?uri core:features ?i . } . \n" + + +"}" ; + + } + + protected static List queriesForAuthorship(){ + List queries = new ArrayList(); + + //get additional URIs of information resources from author side + queries.add( + prefix + + "SELECT (str(?a) as ?infoResource) WHERE {\n" + + + " ?uri rdf:type foaf:Person . \n" + + " ?uri core:relatedBy ?aship .\n" + + " ?aship rdf:type core:Authorship .\n" + + "OPTIONAL { ?aship core:relates ?a . ?a rdf:type obo:IAO_0000030 } .\n" + +"}" ); + + //get additional URIs of authors from information resource side + queries.add( + prefix + + "SELECT (str(?a) as ?author ) WHERE {\n" + + + " ?uri rdf:type obo:IAO_0000030 . \n" + + " ?uri core:relatedBy ?aship . ?aship rdf:type core:Authorship . \n" + + "OPTIONAL { ?aship core:relates ?a . ?a rdf:type foaf:Person } .\n" + +"}" ); + return queries; + } + + protected static List queriesForURLLink(){ + List queries = new ArrayList(); + + //get additional URIs when URLLink is changed + queries.add( + prefix + + "SELECT (str(?x) as ?individual) WHERE {\n" + + + " ?i rdf:type vcard:Individual . \n" + + " ?i vcard:hasURL ?uri . \n" + + " ?i obo:ARG_2000029 ?x . \n" + +"}" ); + + return queries; + } + + protected static List queriesForEducationalTraining(){ + List queries = new ArrayList(); + + //if person changes, no additional URIs need to be + //changed because the person is not displayed on the + //degree individual or on the degree granting organization + + //if the degree changes, the person needs to be updated + //since the degree name is shown on the person page. + queries.add( + prefix + + " SELECT (str(?person) as ?personUri) WHERE {\n" + + + " ?uri rdf:type core:AcademicDegree . \n" + + " ?uri core:relatedBy ?awardedDegree .\n" + + " ?awardedDegree rdf:type core:AwardedDegree .\n" + + " ?awardedDegree core:relates ?person .\n" + + " ?person rdf:type foaf:Person .\n" + +"}" ); + + //if the organization changes the person needs to be updated + //since the organization name is shown on the person page. + queries.add( + prefix + + " SELECT (str(?person) as ?personUri) WHERE {\n" + + + " ?uri rdf:type foaf:Organization . \n" + + " ?uri obo:RO_0000056 ?edTrainingNode .\n" + + " ?edTrainingNode rdf:type core:EducationalProcess . \n" + + " ?edTrainingNode obo:RO_0000057 ?person . \n" + + " ?person rdf:type foaf:Person ." + +"}" ); + return queries; + } + + protected static List queriesForPosition(){ + List queries = new ArrayList(); + + //If an organization changes, update people + queries.add( + prefix + + " SELECT (str(?person) as ?personUri) WHERE {\n" + + + " ?uri rdf:type foaf:Organization . \n" + + " ?uri core:relatedBy ?positionNode .\n" + + " ?positionNode rdf:type core:Position .\n" + + " ?positionNode core:relates ?person . \n" + + " ?person rdf:type foaf:Person .\n" + +"}" ); + + + //if people change, update organizations + queries.add( + prefix + + " SELECT (str(?org) as ?orgUri) WHERE {\n" + + + " ?uri rdf:type foaf:Person . \n" + + " ?uri core:relatedBy ?positionNode .\n" + + " ?positionNode rdf:type core:Position .\n" + + " ?positionNode core:relates ?org . \n" + + " ?org rdf:type foaf:Organization .\n" + +"}" ); + return queries; + } + + static{ + // core:AttendeeRole + // If the person changes, update the attendee role in organization + // core:AttendeeRole applies to events, not organizations; updating accordingly - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?event) \n " + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:AttendeeRole . \n" + + "?c obo:BFO_0000054 ?d . \n" + + "?d rdf:type event:Event .\n" + + " }"); + + // If the organization changes, update the attendee role of person + // core:AttendeeRole applies to events, not organizations; updating accordingly - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + + "?uri rdf:type event:Event . \n" + + "?uri obo:BFO_0000055 ?c . \n" + + "?c rdf:type core:AttendeeRole . \n" + + "?c obo:RO_0000052 ?d . \n" + + "?d rdf:type foaf:Person .\n" + + " }"); + + // core:ClinicalRole -- core:clinicalRoleOf + + // If the person changes, update the clinical role in project + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?project) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:ClinicalRole . \n" + + "?c obo:BFO_0000054 ?d .\n" + + "?d rdf:type core:Project .\n" + + " }"); + + + // If the person changes, update the clinical role in service + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?service) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:ClinicalRole . \n" + + "?c core:roleContributesTo ?d .\n" + + "?d rdf:type obo:ERO_0000005 .\n" + + " }"); + + // If the project changes, update the clinical role of person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Project . \n" + + "?uri obo:BFO_0000055 ?c . \n" + + "?c rdf:type core:ClinicalRole . \n" + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // If the service changes, update the clinical role of person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type obo:ERO_0000005 . \n" + + "?uri core:contributingRole ?c . \n" + + "?c rdf:type core:ClinicalRole . \n" + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // If the person changes, update the leader role in organization + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?organization) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:LeaderRole . \n" + + "?c core:roleContributesTo ?d .\n" + + "?d rdf:type foaf:Organization .\n " + + " }"); + + // If the organization changes, update the leader role of person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Organization . \n" + + "?uri core:contributingRole ?c . \n" + + "?c rdf:type core:LeaderRole . \n" + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // core:MemberRole -- core:memberRoleOf + + // If the person changes, update the member role in organization + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?organization) \n" + + "WHERE \n{" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:MemberRole . \n" + + "?c core:roleContributesTo ?d .\n" + + "?d rdf:type foaf:Organization .\n " + + " }"); + + // If the organization changes, update the member role of person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {" + + "?uri rdf:type foaf:Organization . \n" + + "?uri core:contributingRole ?c . \n" + + "?c rdf:type core:MemberRole . \n" + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // core:OrganizerRole -- core:organizerRoleOf + + // If the person changes, update the organizer role in organization + // organizerRole appplies to events not organizations; updating accordingly - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?event) \n" + + "WHERE {" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:OrganizerRole .\n" + + "?c obo:BFO_0000054 ?d .\n" + + "?d rdf:type event:Event .\n " + + " }"); + + // If the organization changes, update the organizer role of person + // organizerRole appplies to events not organizations; updating accordingly - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type event:Event . \n" + + "?uri obo:BFO_0000055 ?c . \n" + + "?c rdf:type core:OrganizerRole . \n" + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // core:OutreachProviderRole -- core:outreachProviderRoleOf + + // If the person changes, update the outreach provider role in organization + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?organization) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + "?c rdf:type core:OutreachProviderRole .\n" + + "?c core:roleContributesTo ?d .\n" + + "?d rdf:type foaf:Organization .\n " + + " }"); + + // If the organization changes, update the outreach provider role of person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Organization . \n" + + "?uri core:contributingRole ?c . \n" + + "?c rdf:type core:OutreachProviderRole . \n" + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // core:PresenterRole -- core:presenterRoleOf + + // If the person changes, update the presentation + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?presentation) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type core:PresenterRole . \n" + + " ?c obo:BFO_0000054 ?d .\n" + + " ?d rdf:type core:Presentation . \n" + + " }"); + + // If the presentation changes, update the person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Presentation . \n" + + "?uri obo:BFO_0000055 ?c . \n" + + " ?c rdf:type core:PresenterRole . \n " + + "?c obo:RO_0000052 ?d .\n " + + "?d rdf:type foaf:Person .\n " + + " }"); + + // core:ResearcherRole -- core:researcherRoleOf + + // If the person changes, update the grant + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?grant) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type core:ResearcherRole . \n " + + " ?c core:relatedBy ?d .\n" + + " ?d rdf:type core:Grant . \n" + + " }"); + + // If the grant changes, update the researcher + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Grant . \n" + + "?uri core:relates ?c . \n" + + " ?c rdf:type core:ResearcherRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + // If the grant changes, update the principal investigator + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Grant . \n" + + " ?uri core:relates ?c . \n" + + " ?c rdf:type core:PrincipalInvestigatorRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + // If the grant changes, update the co-principal investigator + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Grant . \n" + + " ?uri core:relates ?c . \n" + + " ?c rdf:type core:CoPrincipalInvestigatorRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + + // If the grant changes, update the investigator + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Grant . \n" + + " ?uri core:relates ?c . \n" + + " ?c rdf:type core:InvestigatorRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + // If the person changes, update the project + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?project) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type core:ResearcherRole . \n " + + " ?c obo:BFO_0000054 ?d .\n" + + " ?d rdf:type core:Project . \n" + + " }"); + + // If the project changes, update the researcher + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type core:Project . \n" + + " ?uri obo:BFO_0000055 ?c .\n" + + " ?c rdf:type core:ResearcherRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + // core:EditorRole -- core:editorRoleOf, core:forInformationResource (person, informationresource) + + // If the person changes, update the editor role of the info resource + // changing foaf:Organization to info content entity. Org no longer applies here - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?informationResource) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type core:EditorRole . \n " + + " ?c core:roleContributesTo ?d .\n" + + "?d rdf:type obo:IAO_0000030 .\n " + + " }"); + + + // If the info respource changes, update the editor role of person + // changing foaf:Organization to info content entity. Org no longer applies here - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type obo:IAO_0000030 . \n" + + "?uri core:contributingRole ?c . \n" + + " ?c rdf:type core:EditorRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + // Next two queries are covered by the previous two. Commenting them out - tlw72 + // If the person changes, update the information resource associated with editor role +/* multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?informationResource) \n" + + "WHERE {\n" + + + "?uri rdf:type foaf:Person ; ?b ?c . \n" + + " ?c rdf:type core:EditorRole ; core:forInformationResource ?d .\n" + + " }"); + + // If the organization changes, update the information resource associated with editor role + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?informationResource) \n" + + "WHERE {\n" + + + "?uri rdf:type foaf:Organization ; ?b ?c . \n" + + " ?c rdf:type core:EditorRole ; core:forInformationResource ?d .\n" + + " }"); +*/ + // core:ServiceProviderRole -- core:serviceProviderRoleOf + + // If the person changes, update the service provider role in organization + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?organization) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type obo:ERO_0000012 . \n" + + " ?c core:roleContributesTo ?d .\n" + + " ?d rdf:type foaf:Organization .\n " + + " }"); + + // If the organization changes, update the service provider role of person + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Organization . \n" + + "?uri core:contributingRole ?c . \n" + + " ?c rdf:type obo:ERO_0000012 . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + + // core:TeacherRole -- core:teacherRoleOf + + // If the person changes, update the teacher role in organization + // updated to make this an Event (e.g., a course) not an organization - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?event) \n" + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type core:TeacherRole . \n" + + " ?c obo:BFO_0000054 ?d .\n" + + " ?d rdf:type event:Event .\n " + + " }"); + + // If the organization changes, update the teacher role of person + // updated to make this an Event (e.g., a course) not an organization - tlw72 + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?person) \n" + + "WHERE {\n" + + "?uri rdf:type event:Event . \n" + + "?uri obo:BFO_0000055 ?c . \n" + + " ?c rdf:type core:TeacherRole . \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + + // core:ReviewerRole -- core:forInformationResource, core:reviewerRoleOf +// core:PeerReviewerRole -- core:forInformationResource, core:reviewerRoleOf + + // If the person changes, update the information resource associated with reviewer role + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?informationResource) \n " + + "WHERE {\n" + + "?uri rdf:type foaf:Person . \n" + + "?uri obo:RO_0000053 ?c . \n" + + " ?c rdf:type core:ReviewerRole . \n" + + " ?c core:roleContributesTo ?d .\n" + + " ?d rdf:type obo:IAO_0000030 .\n " + + " }"); + + // If the organization changes, update the information resource associated with reviewer role + multiValuedQueriesForRole.add(prefix + + "SELECT (str(?d) as ?informationResource) \n" + + "WHERE {\n" + + "?uri rdf:type obo:IAO_0000030 . \n" + + "?uri core:contributingRole ?c . \n" + + " ?c rdf:type core:ReviewerRole. \n " + + " ?c obo:RO_0000052 ?d .\n" + + "?d rdf:type foaf:Person .\n " + + " }"); + + } + + static{ + List tmpList = new ArrayList(); + tmpList.add(multiValuedQueryForInformationContentEntity); + tmpList.addAll(multiValuedQueriesForAgent); + tmpList.addAll(multiValuedQueriesForRole); + tmpList.addAll( queriesForAuthorship()); + tmpList.addAll(queriesForURLLink()); + tmpList.addAll(queriesForEducationalTraining()); + tmpList.addAll(queriesForPosition()); + + queryList = Collections.unmodifiableList(tmpList); + } + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalUriFinders.java b/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalUriFinders.java new file mode 100644 index 00000000..6c48cded --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalUriFinders.java @@ -0,0 +1,30 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.search.indexing; + +import java.util.ArrayList; +import java.util.List; + +import com.hp.hpl.jena.ontology.OntModel; + +import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; +import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate; + +/** + * Make a list of StatementToURIsToUpdate objects for use by the + * IndexBuidler. + */ +public class AdditionalUriFinders { + + public static List getList(OntModel jenaOntModel, + IndividualDao indDao) { + List uriFinders = new ArrayList<>(); + uriFinders.add(new AdditionalURIsForDataProperties()); + uriFinders.add(new AdditionalURIsForObjectProperties(jenaOntModel)); + uriFinders.add(new AdditionalURIsForContextNodes(jenaOntModel)); + uriFinders.add(new AdditionalURIsForTypeStatements()); + uriFinders.add(new URIsForClassGroupChange(indDao)); + return uriFinders; + } + +} diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodesTest.java b/test/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodesTest.java new file mode 100644 index 00000000..f73674d8 --- /dev/null +++ b/test/edu/cornell/mannlib/vitro/webapp/search/indexing/AdditionalURIsForContextNodesTest.java @@ -0,0 +1,670 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.search.indexing; + +import static org.junit.Assert.assertTrue; + +import java.io.StringReader; +import java.util.List; + +import org.junit.Test; + +import com.hp.hpl.jena.ontology.OntModel; +import com.hp.hpl.jena.rdf.model.ModelFactory; + +import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalURIsForContextNodes; + + +public class AdditionalURIsForContextNodesTest { + + @Test + public void testPositionChanges(){ + String n3 = + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + //make a test model with an person, an authorship context node and a book + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the org needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932"); + assertTrue("did not find org for context node", uris.contains("http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423" )); + + //if the org changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n5423"); + assertTrue("did not find person for context node", uris.contains("http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n932" )); + } + + @Test + public void testPersonOnOrgChange() { + + String n3 ="@prefix dc: . \n" + + "@prefix rdfs: . \n" + + "@prefix swrl: . \n" + + "@prefix vitro: . \n" + + "@prefix xsd: . \n" + + "@prefix swrlb: . \n" + + "@prefix owl: . \n" + + "@prefix rdf: . \n" + + "@prefix core: . \n" + + "@prefix vivo: . \n" + + "@prefix obo: . \n" + + " " + + " \n" + + " a owl:Thing , core:Role , core:LeaderRole ; \n" + + " rdfs:label \"head\"^^xsd:string ; \n" + + " vitro:mostSpecificType \n" + + " core:LeaderRole ; \n" + + " core:dateTimeInterval \n" + + " ; \n" + + " obo:RO_0000052 ; \n" + + " core:roleContributesTo . \n" + + " \n" + + " a , owl:Thing , , core:ClinicalOrganization ; \n" + + " rdfs:label \"Organization XYZ\"^^xsd:string ; \n" + + " vitro:mostSpecificType \n" + + " core:ClinicalOrganization ; \n" + + " core:contributingRole . \n" + + " a , owl:Thing , . \n"; + + + //make a test model with an person, an authorship context node and a book + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //get additional uris for org + List uris = uriFinder.findAdditionalURIsToIndex( "http://caruso-laptop.mannlib.cornell.edu:8090/vivo/individual/n2592"); + + assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n14979" )); + + } + + @Test + public void testLeaderRoleChanges(){ + String n3= + + " \"1, Test\" . \n " + +// " \"1\"^^ . \n " + +// " \"Test\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + + " \"Leader Role\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + " \"University1\"^^ . \n " + + " . \n " + + " .\n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " ; + + + //make a test model with an person, a leader role node and a university + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the university needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2027"); + assertTrue("did not find org for context node", uris.contains("http://vivo.scripps.edu/individual/n7080" )); + + //if the university changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n7080"); + assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n2027" )); + + + } + + + @Test + public void testMemberRoleChanges(){ + String n3 = + + " . \n " + + " \"2, Test\" . \n " + +// " \"2\"^^ . \n " + +// " \"Test\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + " \"Member Role\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + + " \"University2\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " ; + + + + //make a test model with an person, a member role node and a university + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the university needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4519"); + assertTrue("did not find org for context node", uris.contains("http://vivo.scripps.edu/individual/n6004" )); + + //if the university changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n6004"); + assertTrue("did not find person for context node", uris.contains("http://vivo.scripps.edu/individual/n4519" )); + + + } + + + @Test + public void testClinicalRoleChangesForProject(){ + + String n3 = + + " \"3, Test\" . \n" + +// " \"3\"^^ .\n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " \"Clinical Role\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Project1\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + + + //make a test model with an person, a clinical role node and a project + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the project needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4858"); + assertTrue("did not find project for clinical role", uris.contains("http://vivo.scripps.edu/individual/n5177" )); + + //if the project changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5177"); + assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4858" )); + + } + + @Test + public void testClinicalRoleChangesForService(){ + + String n3 = + + " \"4, Test\" . \n" + +// " \"4\"^^ . \n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " \"Clinical Role 2\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Service1\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + //make a test model with an person, a clinical role node and a service + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the service needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5651"); + assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4442" )); + + //if the service changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4442"); + assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n5651" )); + + + } + + + @Test + public void testPresenterRoleChangesForPresentation(){ + String n3 = + " . \n" + + " \"5, Test\" . \n" + +// " \"5\"^^ . \n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " \"Presenter Role\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Presentation 1\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + + //make a test model with an person, a presenter role node and a presentation + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the presentation needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5596"); + assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n1305" )); + + //if the presentation changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1305"); + assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n5596" )); + + } + + + @Test + public void testPresenterRoleChangesForInvitedTalk(){ + String n3 = + + " . \n " + + " \"6, Test\" . \n " + +// " \"6\"^^ . \n " + +// " \"Test\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + " . \n " + + " \"Presenter Role 2\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + " \"Invited Talk 1\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " ; + + //make a test model with an person, a presenter role node and an invited talk + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the invited talk needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4112"); + assertTrue("did not find invited talk for person", uris.contains("http://vivo.scripps.edu/individual/n4107" )); + + //if the invited talk changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4107"); + assertTrue("did not find person for invited talk", uris.contains("http://vivo.scripps.edu/individual/n4112" )); + + } + + + @Test + public void testResearcherRoleForGrant(){ + + String n3 = + + " \"7, Test\" . \n" + +// " \"7\"^^ . \n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Researcher Role\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Grant1\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + + //make a test model with an person, a researcher role node and a grant + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the grant needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4957"); + assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4252" )); + + //if the grant changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4252"); + assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n4957" )); + + + } + + @Test + public void testResearcherRoleForProject(){ + + String n3 = + + " \"8, Test\" . \n " + +// " \"8\"^^ . \n " + +// " \"Test\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + " \"Researcher Role 2\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + + + " \"Project2\"^^ . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " + + " . \n " ; + + + + //make a test model with an person, a researcher role node and a project + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the project needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2029"); + assertTrue("did not find service for clinical role", uris.contains("http://vivo.scripps.edu/individual/n564" )); + + //if the project changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n564"); + assertTrue("did not find person for clinical role", uris.contains("http://vivo.scripps.edu/individual/n2029" )); + + + } + + @Test + public void testPrincipalInvestigatorRoleChanges(){ + + String n3 = + + " . \n" + + " \"8, Test\" . \n" + +// " \"8\"^^ . \n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Grant 2\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + + //make a test model with an person, a principal investigator role node and a grant + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the person changes then the grant needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n2368"); + assertTrue("did not find grant for pi", uris.contains("http://vivo.scripps.edu/individual/n1742" )); + + //if the grant changes then the person needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1742"); + assertTrue("did not find pi for grant", uris.contains("http://vivo.scripps.edu/individual/n2368" )); + + + } + + @Test + public void testCoPrincipalInvestigatorRoleChanges(){ + + String n3 = + + " \"9, Test\" . \n" + +// " \"9\"^^ . \n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Grant 3\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + //make a test model with an person, a co-principal investigator role node and a grant + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the copi changes then the grant needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n1373"); + assertTrue("did not find grant for co-pi", uris.contains("http://vivo.scripps.edu/individual/n4931" )); + + //if the grant changes then the copi needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n4931"); + assertTrue("did not find co-pi for grant", uris.contains("http://vivo.scripps.edu/individual/n1373" )); + + } + + + @Test + public void testInvestigatorRoleChanges(){ + + String n3 = + + " \"10, Test\" . \n" + +// " \"10\"^^ . \n" + +// " \"Test\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + + " \"Grant 4\"^^ . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" + + " . \n" ; + + + //make a test model with an person, a investigator role node and a grant + OntModel model = ModelFactory.createOntologyModel(); + model.read( new StringReader(n3), null, "N3"); + + //make an AdditionalURIsForContextNodesTest object with that model + AdditionalURIsForContextNodes uriFinder = new AdditionalURIsForContextNodes( model ); + + //if the investigator changes then the grant needs to be updated + List uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n5282"); + assertTrue("did not find grant for investigator", uris.contains("http://vivo.scripps.edu/individual/n160" )); + + //if the grant changes then the investigator needs to be updated + uris = uriFinder.findAdditionalURIsToIndex( "http://vivo.scripps.edu/individual/n160"); + assertTrue("did not find investigator for grant", uris.contains("http://vivo.scripps.edu/individual/n5282" )); + + + + } + + +} From 4e7bfbf783962e29d8f682225d03a0fbe44d6efe Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 6 Nov 2013 14:02:51 -0500 Subject: [PATCH 34/40] PropertyConfig.n3 changes for context node deletion --- rdf/display/everytime/PropertyConfig.n3 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index fbf5e0af..5aff1c63 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -28,6 +28,7 @@ local:personInPositionConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 40; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasPositionHistoryGenerator"^^xsd:string . local:organizationForPositionContext a :ConfigContext ; @@ -74,6 +75,7 @@ local:hasServiceProviderRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 20; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddServiceProviderRoleToPersonGenerator"^^ ; :propertyGroup . @@ -89,6 +91,7 @@ local:hasClinicalRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 70; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddClinicalRoleToPersonGenerator"^^ ; :propertyGroup . @@ -104,6 +107,7 @@ local:hasLeaderRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 30; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddHeadOfRoleToPersonGenerator"^^ ; :propertyGroup . @@ -119,6 +123,7 @@ local:hasMemberRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 50; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddMemberRoleToPersonGenerator"^^ ; :propertyGroup . @@ -134,6 +139,7 @@ local:hasTeacherRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 20; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddTeacherRoleToPersonGenerator"^^ ; :propertyGroup . @@ -149,6 +155,7 @@ local:hasEditorRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 2; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddEditorRoleToPersonGenerator"^^ ; :propertyGroup . @@ -164,6 +171,7 @@ local:hasReviewerRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 3; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddReviewerRoleToPersonGenerator"^^ ; :propertyGroup . @@ -179,6 +187,7 @@ local:hasOrganizerRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 4; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddOrganizerRoleToPersonGenerator"^^ ; :propertyGroup . @@ -194,6 +203,7 @@ local:hasOutreachProviderRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 50; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddOutreachProviderRoleToPersonGenerator"^^ ; :propertyGroup . @@ -209,6 +219,7 @@ local:hasAttendeeRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 1; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAttendeeRoleToPersonGenerator"^^ ; :propertyGroup . @@ -224,6 +235,7 @@ local:hasResearcherRoleConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 35; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddResearcherRoleToPersonGenerator"^^ ; :propertyGroup . @@ -316,6 +328,7 @@ local:educationalTrainingConfig a :ObjectPropertyDisplayConfig ; vitro:displayRankAnnot 10; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:stubObjectPropertyAnnot "true"^^xsd:boolean ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasEducationalTraining"^^ ; :propertyGroup . From 23e0a4d390fbd9c1ca69c8b6d0ed188dbaf9b281 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 6 Nov 2013 15:51:33 -0500 Subject: [PATCH 35/40] VIVO-472 updated the rich-export sparql queries --- .../WEB-INF/rich-export/address/address.sparql | 6 +++++- .../address/locationOfAddress.sparql | 7 +++++-- .../rich-export/advising/advisee.sparql | 15 +++++++++++---- .../advising/adviseesDegreeAlt.sparql | 18 ++++++++++++++---- .../advising/adviseesEducationEndDate.sparql | 14 +++++++++++--- .../adviseesEducationalInsitituionAlt.sparql | 17 +++++++++++++---- .../advising/associatedDegree.sparql | 4 +++- .../associatedEducationalTraining.sparql | 3 ++- .../associatedEducationalTrainingAlt.sparql | 14 +++++++++++--- .../WEB-INF/rich-export/award/award.sparql | 6 ++++-- .../award/conferringOrganization.sparql | 7 +++++-- .../award/sponsoringOrganization.sparql | 7 +++++-- .../rich-export/credential/credential.sparql | 6 ++++-- .../credentialGoverningAuthority.sparql | 6 ++++-- .../credential/issuedCredential.sparql | 3 ++- .../issuedCredentialExpirationDate.sparql | 3 ++- .../issuedCredentialIssueDate.sparql | 3 ++- .../issuedCredentialSubjectArea.sparql | 3 ++- .../educationalTraining.sparql | 4 +++- .../educationalTrainingDegree.sparql | 9 +++++++-- .../educationalTrainingEndDate.sparql | 4 +++- .../educationalTrainingLocation.sparql | 11 ++++++++--- .../educationalTrainingOrganization.sparql | 8 ++++++-- .../educationalTrainingStartDate.sparql | 4 +++- .../rich-export/funding/grantAwardedBy.sparql | 17 ++++++++++------- .../WEB-INF/rich-export/funding/grants.sparql | 16 ++++++++++------ .../rich-export/membership/memberRoleIn.sparql | 12 ++++-------- .../rich-export/outreach/outreachRoleIn.sparql | 12 ++++-------- .../WEB-INF/rich-export/patent/assignee.sparql | 5 +++-- .../rich-export/patent/inventors.sparql | 9 ++++++--- .../WEB-INF/rich-export/patent/patent.sparql | 5 +++-- .../rich-export/patent/patentFiledDate.sparql | 5 +++-- .../rich-export/patent/patentIssuedDate.sparql | 5 +++-- .../position/locationForPosition.sparql | 10 +++++++--- .../position/organizationForPosition.sparql | 7 +++++-- .../position/subOrganizationForPosition.sparql | 10 +++++++--- .../superOrganizationForPosition.sparql | 8 +++++--- .../presentation/meetingLocation.sparql | 14 ++++++-------- .../presentation/meetingName.sparql | 11 ++++------- .../presentation/presenterRoleIn.sparql | 12 ++++-------- .../publication/associatedJournal.sparql | 7 +++++-- .../rich-export/publication/authors.sparql | 14 ++++++++++---- .../publication/presentedAtEvent.sparql | 8 ++++++-- .../publication/presentedAtEventEndDate.sparql | 9 ++++++--- .../presentedAtEventLocation.sparql | 9 ++++++--- .../presentedAtEventStartDate.sparql | 7 +++++-- .../rich-export/publication/publication.sparql | 7 +++++-- .../publication/publicationDate.sparql | 7 +++++-- .../publicationPartOfInfoResource.sparql | 9 ++++++--- .../publication/publicationReproducedIn.sparql | 7 +++++-- .../publication/publicationStatus.sparql | 7 +++++-- .../publication/publicationURL.sparql | 11 ++++++++--- .../publication/publisher_variant1.sparql | 7 +++++-- .../publication/publisher_variant2.sparql | 7 +++++-- .../rich-export/teaching/teacherRoleIn.sparql | 6 ++++-- 55 files changed, 305 insertions(+), 157 deletions(-) diff --git a/productMods/WEB-INF/rich-export/address/address.sparql b/productMods/WEB-INF/rich-export/address/address.sparql index 97fefb62..5fb4a5c6 100644 --- a/productMods/WEB-INF/rich-export/address/address.sparql +++ b/productMods/WEB-INF/rich-export/address/address.sparql @@ -1,8 +1,12 @@ PREFIX core: +PREFIX obo: +PREFIX vcard: + CONSTRUCT { ?address ?property ?object . } WHERE { - PERSON_URI core:mailingAddress ?address . + PERSON_URI obo:ARG_2000028 ?vcard . + ?vcard vcard:hasAddress ?address . ?address ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/address/locationOfAddress.sparql b/productMods/WEB-INF/rich-export/address/locationOfAddress.sparql index 47152369..5bfba019 100644 --- a/productMods/WEB-INF/rich-export/address/locationOfAddress.sparql +++ b/productMods/WEB-INF/rich-export/address/locationOfAddress.sparql @@ -1,9 +1,12 @@ PREFIX core: +PREFIX obo: +PREFIX vcard: CONSTRUCT { ?geographicLocation ?property ?object . } WHERE { - PERSON_URI core:mailingAddress ?address . - ?address core:hasGeographicLocation ?geographicLocation . + PERSON_URI obo:ARG_2000028 ?vcard . + ?vcard vcard:hasAddress ?address . + ?address obo:RO_0001025 ?geographicLocation . ?geographicLocation ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/advising/advisee.sparql b/productMods/WEB-INF/rich-export/advising/advisee.sparql index 449df609..ba5e8ab6 100644 --- a/productMods/WEB-INF/rich-export/advising/advisee.sparql +++ b/productMods/WEB-INF/rich-export/advising/advisee.sparql @@ -1,9 +1,16 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { - ?person ?property ?object . + ?advisee ?property ?object . } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . - ?advisingRelationship core:advisee ?person . - ?person ?property ?object . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . + ?advisingRelationship core:relates ?advisee . + ?advisee a foaf:Person . + ?advisee obo:RO_0000053 ?adviseeRole . + ?adviseeRole a core:AdviseeRole . + ?adviseeRole core:relatedBy ?advisingRelationship . + ?advisee ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql b/productMods/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql index aa9225e3..83117529 100644 --- a/productMods/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql +++ b/productMods/WEB-INF/rich-export/advising/adviseesDegreeAlt.sparql @@ -1,11 +1,21 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { ?degree ?property ?object } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . - ?advisingRelationship core:advisee ?advisee . - ?advisee core:educationalTraining ?educationalTraining . - ?educationalTraining core:degreeEarned ?degree . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . + ?advisingRelationship core:relates ?advisee . + ?advisee a foaf:Person . + ?advisee obo:RO_0000053 ?adviseeRole . + ?adviseeRole a core:AdviseeRole . + ?adviseeRole core:relatedBy ?advisingRelationship . + ?advisee core:relates ?educationalTraining . + ?educationalTraining a core:EducationalProcess . + ?educationalTraining obo:RO_0002234 ?awardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . ?degree ?property ?object } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql b/productMods/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql index 48b726d0..ccc4acd4 100644 --- a/productMods/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql +++ b/productMods/WEB-INF/rich-export/advising/adviseesEducationEndDate.sparql @@ -1,11 +1,19 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { ?dateTimeValue ?property ?object . } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . - ?advisingRelationship core:advisee ?advisee . - ?advisee core:educationalTraining ?educationalTraining . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . + ?advisingRelationship core:relates ?advisee . + ?advisee a foaf:Person . + ?advisee obo:RO_0000053 ?adviseeRole . + ?adviseeRole a core:AdviseeRole . + ?adviseeRole core:relatedBy ?advisingRelationship . + ?advisee core:relates ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:end ?dateTimeValue . ?dateTimeValue ?property ?object . diff --git a/productMods/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql b/productMods/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql index d715cc60..5332ca71 100644 --- a/productMods/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql +++ b/productMods/WEB-INF/rich-export/advising/adviseesEducationalInsitituionAlt.sparql @@ -1,12 +1,21 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: PREFIX rdfs: CONSTRUCT { ?educationalInstitution rdfs:label ?label } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . - ?advisingRelationship core:advisee ?advisee . - ?advisee core:educationalTraining ?educationalTraining . - ?educationalTraining core:trainingAtOrganization ?educationalInstitution . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . + ?advisingRelationship core:relates ?advisee . + ?advisee a foaf:Person . + ?advisee obo:RO_0000053 ?adviseeRole . + ?adviseeRole a core:AdviseeRole . + ?adviseeRole core:relatedBy ?advisingRelationship . + ?advisee core:relates ?educationalTraining . + ?educationalTraining a core:EducationalProcess . + ?educationalTraining obo:RO_0000057 ?educationalInstitution . + ?educationalInstitution a foaf:Organization . ?educationalInstitution rdfs:label ?label } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/advising/associatedDegree.sparql b/productMods/WEB-INF/rich-export/advising/associatedDegree.sparql index 4ee7fe12..e3ba5b83 100644 --- a/productMods/WEB-INF/rich-export/advising/associatedDegree.sparql +++ b/productMods/WEB-INF/rich-export/advising/associatedDegree.sparql @@ -1,9 +1,11 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?degree ?property ?object . } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . ?advisingRelationship core:degreeCandidacy ?degree . ?degree ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql b/productMods/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql index f9f59ed5..e417d74f 100644 --- a/productMods/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql +++ b/productMods/WEB-INF/rich-export/advising/associatedEducationalTraining.sparql @@ -3,7 +3,8 @@ PREFIX core: CONSTRUCT { ?educationalTraining ?property ?object . } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . ?advisingRelationship core:advisingContributionTo ?educationalTraining . ?educationalTraining ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql b/productMods/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql index 29a31bc9..a0a60c33 100644 --- a/productMods/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql +++ b/productMods/WEB-INF/rich-export/advising/associatedEducationalTrainingAlt.sparql @@ -1,10 +1,18 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { ?educationalTraining ?property ?object . } WHERE { - PERSON_URI core:advisorIn ?advisingRelationship . - ?advisingRelationship core:advisee ?advisee . - ?advisee core:educationalTraining ?educationalTraining . + PERSON_URI core:relatedBy ?advisingRelationship . + ?advisingRelationship a core:AdvisingRelationship . + ?advisingRelationship core:relates ?advisee . + ?advisee a foaf:Person . + ?advisee obo:RO_0000053 ?adviseeRole . + ?adviseeRole a core:AdviseeRole . + ?adviseeRole core:relatedBy ?advisingRelationship . + ?advisee core:relates ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/award/award.sparql b/productMods/WEB-INF/rich-export/award/award.sparql index db731058..353e143f 100644 --- a/productMods/WEB-INF/rich-export/award/award.sparql +++ b/productMods/WEB-INF/rich-export/award/award.sparql @@ -3,7 +3,9 @@ PREFIX core: CONSTRUCT { ?award ?property ?object . } WHERE { - PERSON_URI core:awardOrHonor ?awardReceipt . - ?awardReceipt core:receiptOf ?award . + PERSON_URI core:relatedBy ?awardReceipt . + ?awardReceipt a core:AwardReceipt . + ?awardReceipt core:relates ?award . + ?award a core:Award . ?award ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/award/conferringOrganization.sparql b/productMods/WEB-INF/rich-export/award/conferringOrganization.sparql index 43bc1361..2c735ba4 100644 --- a/productMods/WEB-INF/rich-export/award/conferringOrganization.sparql +++ b/productMods/WEB-INF/rich-export/award/conferringOrganization.sparql @@ -1,9 +1,12 @@ PREFIX core: +PREFIX foaf: CONSTRUCT { ?organization ?property ?object . } WHERE { - PERSON_URI core:awardOrHonor ?awardReceipt . - ?awardReceipt core:awardConferredBy ?organization . + PERSON_URI core:relatedBy ?awardReceipt . + ?awardReceipt a core:AwardReceipt . + ?awardReceipt core:assignedBy ?organization . + ?organization a foaf:Organization . ?organization ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/award/sponsoringOrganization.sparql b/productMods/WEB-INF/rich-export/award/sponsoringOrganization.sparql index 9de3f5a9..e686fa86 100644 --- a/productMods/WEB-INF/rich-export/award/sponsoringOrganization.sparql +++ b/productMods/WEB-INF/rich-export/award/sponsoringOrganization.sparql @@ -1,10 +1,13 @@ PREFIX core: +PREFIX foaf: CONSTRUCT { ?organization ?property ?object . } WHERE { - PERSON_URI core:awardOrHonor ?awardReceipt . - ?awardReceipt core:receiptOf ?award . + PERSON_URI core:relatedBy ?awardReceipt . + ?awardReceipt a core:AwardReceipt . + ?awardReceipt core:relates ?award . + ?award a core:Award . ?award core:sponsoredBy ?organization . ?organization ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/credential/credential.sparql b/productMods/WEB-INF/rich-export/credential/credential.sparql index dafb6f40..124317f0 100644 --- a/productMods/WEB-INF/rich-export/credential/credential.sparql +++ b/productMods/WEB-INF/rich-export/credential/credential.sparql @@ -3,7 +3,9 @@ PREFIX core: CONSTRUCT { ?credential ?property ?object . } WHERE { - PERSON_URI core:hasCredential ?issuedCredential . - ?issuedCredential core:issuanceOfCredential ?credential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . + ?issuedCredential core:relates ?credential . + ?credential a core:Credential . ?credential ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql b/productMods/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql index 4650bb53..79bb6cb2 100644 --- a/productMods/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql +++ b/productMods/WEB-INF/rich-export/credential/credentialGoverningAuthority.sparql @@ -3,8 +3,10 @@ PREFIX core: CONSTRUCT { ?organization ?property ?object . } WHERE { - PERSON_URI core:hasCredential ?issuedCredential . - ?issuedCredential core:issuanceOfCredential ?credential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . + ?issuedCredential core:relates ?credential . + ?credential a core:Credential . ?credential core:hasGoverningAuthority ?organization . ?organization ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/credential/issuedCredential.sparql b/productMods/WEB-INF/rich-export/credential/issuedCredential.sparql index 88b8f9ec..e055c153 100644 --- a/productMods/WEB-INF/rich-export/credential/issuedCredential.sparql +++ b/productMods/WEB-INF/rich-export/credential/issuedCredential.sparql @@ -3,6 +3,7 @@ PREFIX core: CONSTRUCT { ?issuedCredential ?property ?object . } WHERE { - PERSON_URI core:hasCredential ?issuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql b/productMods/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql index c9247cb9..d59f5119 100644 --- a/productMods/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql +++ b/productMods/WEB-INF/rich-export/credential/issuedCredentialExpirationDate.sparql @@ -4,7 +4,8 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:hasCredential ?issuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:expirationDate ?date . ?date ?property ?object . ?date core:dateTimePrecision ?precision . diff --git a/productMods/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql b/productMods/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql index f893aa3d..22a41b16 100644 --- a/productMods/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql +++ b/productMods/WEB-INF/rich-export/credential/issuedCredentialIssueDate.sparql @@ -4,7 +4,8 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:hasCredential ?issuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:dateIssued ?date . ?date ?property ?object . ?date core:dateTimePrecision ?precision . diff --git a/productMods/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql b/productMods/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql index c76b85b6..afc265c9 100644 --- a/productMods/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql +++ b/productMods/WEB-INF/rich-export/credential/issuedCredentialSubjectArea.sparql @@ -3,7 +3,8 @@ PREFIX core: CONSTRUCT { ?subjectArea ?property ?object . } WHERE { - PERSON_URI core:hasCredential ?issuedCredential . + PERSON_URI core:relatedBy ?issuedCredential . + ?issuedCredential a core:IssuedCredential . ?issuedCredential core:hasSubjectArea ?subjectArea . ?subjectArea ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql b/productMods/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql index 68c16cc1..2b43a303 100644 --- a/productMods/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql +++ b/productMods/WEB-INF/rich-export/educationalTraining/educationalTraining.sparql @@ -1,8 +1,10 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?educationalTraining ?property ?object . } WHERE { - PERSON_URI core:educationalTraining ?educationalTraining . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql index 07961267..27fb7508 100644 --- a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql +++ b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingDegree.sparql @@ -1,9 +1,14 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?degree ?property ?object . } WHERE { - PERSON_URI core:educationalTraining ?educationalTraining . - ?educationalTraining core:degreeEarned ?degree . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . + ?educationalTraining obo:RO_0002234 ?awardedDegree . + ?awardedDegree a core:AwardedDegree . + ?awardedDegree core:relates ?degree . + ?degree a core:AcademicDegree . ?degree ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql index 095f8c4a..1ccdd587 100644 --- a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql +++ b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingEndDate.sparql @@ -1,10 +1,12 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?dateTimeInterval core:end ?date . ?date ?property ?object . } WHERE { - PERSON_URI core:educationalTraining ?educationalTraining . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:end ?date . ?date ?property ?object . diff --git a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql index 89b4d14a..2edff7fe 100644 --- a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql +++ b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingLocation.sparql @@ -1,10 +1,15 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { ?geographicLocation ?property ?object . } WHERE { - PERSON_URI core:educationalTraining ?educationalTraining . - ?educationalTraining core:trainingAtOrganization ?organization . - ?organization core:hasGeographicLocation ?geographicLocation . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . + ?educationalTraining obo:RO_0000057 ?organization . + ?organization a foaf:Organization . + ?organization obo:RO_0001025 ?geographicLocation . + ?geographicLocation a core:GeographicLocation . ?geographicLocation ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql index 32221ff0..188ea661 100644 --- a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql +++ b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingOrganization.sparql @@ -1,9 +1,13 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { ?organization ?property ?object . } WHERE { - PERSON_URI core:educationalTraining ?educationalTraining . - ?educationalTraining core:trainingAtOrganization ?organization . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . + ?educationalTraining obo:RO_0000057 ?organization . + ?organization a foaf:Organization . ?organization ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql index 95023460..f7ed31f4 100644 --- a/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql +++ b/productMods/WEB-INF/rich-export/educationalTraining/educationalTrainingStartDate.sparql @@ -1,9 +1,11 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?date ?property ?object . } WHERE { - PERSON_URI core:educationalTraining ?educationalTraining . + PERSON_URI obo:RO_0000056 ?educationalTraining . + ?educationalTraining a core:EducationalProcess . ?educationalTraining core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:start ?date . ?date ?property ?object . diff --git a/productMods/WEB-INF/rich-export/funding/grantAwardedBy.sparql b/productMods/WEB-INF/rich-export/funding/grantAwardedBy.sparql index 52113cf4..8b03e590 100644 --- a/productMods/WEB-INF/rich-export/funding/grantAwardedBy.sparql +++ b/productMods/WEB-INF/rich-export/funding/grantAwardedBy.sparql @@ -1,20 +1,23 @@ PREFIX core: -PREFIX rdf: +PREFIX foaf: PREFIX rdfs: CONSTRUCT { - ?investigatorRole core:roleContributesTo ?grant . - ?grant core:grantAwardedBy ?awardingOrganization . ?awardingOrganization rdfs:label ?label } WHERE { { - {PERSON_URI core:hasPrincipalInvestigatorRole ?investigatorRole } + {PERSON_URI core:relatedBy ?investigatorRole . + ?investigatorRole a core:PrincipalInvestigatorRole + } union - {PERSON_URI core:hasCo-PrincipalInvestigatorRole ?investigatorRole } + {PERSON_URI core:relatedBy ?investigatorRole . + ?investigatorRole a core:CoPrincipalInvestigatorRole + } } - ?investigatorRole core:roleContributesTo ?grant . + ?investigatorRole core:relatedBy ?grant . ?grant a core:Grant . - ?grant core:grantAwardedBy ?awardingOrganization . + ?grant core:assignedBy ?awardingOrganization . + ?awardingOrganization a foaf:Organization . ?awardingOrganization rdfs:label ?label } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/funding/grants.sparql b/productMods/WEB-INF/rich-export/funding/grants.sparql index a7109ecc..3d0df166 100644 --- a/productMods/WEB-INF/rich-export/funding/grants.sparql +++ b/productMods/WEB-INF/rich-export/funding/grants.sparql @@ -3,15 +3,19 @@ PREFIX rdf: CONSTRUCT { ?grant ?property ?object . - ?investigatorRole core:roleContributesTo ?grant . + ?investigatorRole core:relatedBy ?grant . } WHERE { - { - {PERSON_URI core:hasPrincipalInvestigatorRole ?investigatorRole } - union - {PERSON_URI core:hasCo-PrincipalInvestigatorRole ?investigatorRole } + { + { PERSON_URI core:relatedBy ?investigatorRole . + ?investigatorRole a core:PrincipalInvestigatorRole + } + union + { PERSON_URI core:relatedBy ?investigatorRole . + ?investigatorRole a core:CoPrincipalInvestigatorRole + } } - ?investigatorRole core:roleContributesTo ?grant . + ?investigatorRole core:relatedBy ?grant . ?grant a core:Grant . ?grant ?property ?object } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/membership/memberRoleIn.sparql b/productMods/WEB-INF/rich-export/membership/memberRoleIn.sparql index 06815f0d..165c83c8 100644 --- a/productMods/WEB-INF/rich-export/membership/memberRoleIn.sparql +++ b/productMods/WEB-INF/rich-export/membership/memberRoleIn.sparql @@ -1,15 +1,11 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?endeavor ?property ?object . } WHERE { - PERSON_URI core:hasMemberRole ?memberRole . - - { - {?memberRole core:roleRealizedIn ?endeavor } - union - {?memberRole core:roleContributesTo ?endeavor } - } - + PERSON_URI obo:RO_0000053 ?memberRole . + ?memberRole a core:MemberRole . + ?memberRole core:roleContributesTo ?endeavor . ?endeavor ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/outreach/outreachRoleIn.sparql b/productMods/WEB-INF/rich-export/outreach/outreachRoleIn.sparql index fd103df0..c0c6e60a 100644 --- a/productMods/WEB-INF/rich-export/outreach/outreachRoleIn.sparql +++ b/productMods/WEB-INF/rich-export/outreach/outreachRoleIn.sparql @@ -1,15 +1,11 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?endeavor ?property ?object . } WHERE { - PERSON_URI core:hasOutreachProviderRole ?outreachRole . - - { - { ?memberRole core:roleRealizedIn ?endeavor } - union - { ?memberRole core:roleContributesTo ?endeavor } - } - + PERSON_URI obo:RO_0000053 ?outreachRole . + ?outreachRole a core:OutreachProviderRole . + ?outreachRole core:roleContributesTo ?endeavor . ?endeavor ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/patent/assignee.sparql b/productMods/WEB-INF/rich-export/patent/assignee.sparql index 13befc4c..48c11d30 100644 --- a/productMods/WEB-INF/rich-export/patent/assignee.sparql +++ b/productMods/WEB-INF/rich-export/patent/assignee.sparql @@ -5,8 +5,9 @@ PREFIX bibo: CONSTRUCT { ?assignee ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?patent . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?patent core:assignee ?assignee . ?assignee ?property ?object . diff --git a/productMods/WEB-INF/rich-export/patent/inventors.sparql b/productMods/WEB-INF/rich-export/patent/inventors.sparql index 3563b082..f14a7994 100644 --- a/productMods/WEB-INF/rich-export/patent/inventors.sparql +++ b/productMods/WEB-INF/rich-export/patent/inventors.sparql @@ -1,13 +1,16 @@ PREFIX core: PREFIX rdf: PREFIX bibo: +PREFIX foaf: CONSTRUCT { ?person ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?patent . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . - ?authorship core:linkedAuthor ?person . + ?authorship core:relates ?person . + ?person a foaf:Person . ?person ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/patent/patent.sparql b/productMods/WEB-INF/rich-export/patent/patent.sparql index 9c31f723..2cd24159 100644 --- a/productMods/WEB-INF/rich-export/patent/patent.sparql +++ b/productMods/WEB-INF/rich-export/patent/patent.sparql @@ -5,8 +5,9 @@ PREFIX bibo: CONSTRUCT { ?patent ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?patent . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?patent ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/patent/patentFiledDate.sparql b/productMods/WEB-INF/rich-export/patent/patentFiledDate.sparql index c6923acf..13dd7506 100644 --- a/productMods/WEB-INF/rich-export/patent/patentFiledDate.sparql +++ b/productMods/WEB-INF/rich-export/patent/patentFiledDate.sparql @@ -6,8 +6,9 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?patent . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?patent core:dateFiled ?date . ?date ?property ?object . diff --git a/productMods/WEB-INF/rich-export/patent/patentIssuedDate.sparql b/productMods/WEB-INF/rich-export/patent/patentIssuedDate.sparql index d8d32c00..16785dc4 100644 --- a/productMods/WEB-INF/rich-export/patent/patentIssuedDate.sparql +++ b/productMods/WEB-INF/rich-export/patent/patentIssuedDate.sparql @@ -6,8 +6,9 @@ CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?patent . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?patent . ?patent rdf:type bibo:Patent . ?patent core:dateIssued ?date . ?date ?property ?object . diff --git a/productMods/WEB-INF/rich-export/position/locationForPosition.sparql b/productMods/WEB-INF/rich-export/position/locationForPosition.sparql index 5ebd9242..e1ad43bc 100644 --- a/productMods/WEB-INF/rich-export/position/locationForPosition.sparql +++ b/productMods/WEB-INF/rich-export/position/locationForPosition.sparql @@ -1,12 +1,16 @@ PREFIX core: PREFIX rdfs: +PREFIX foaf: +PREFIX obo: CONSTRUCT { ?organization core:hasGeographicLocation ?geographicLocation . ?geographicLocation rdfs:label ?label . } WHERE { - PERSON_URI core:personInPosition ?position . - ?position core:positionInOrganization ?organization . - ?organization core:hasGeographicLocation ?geographicLocation . + PERSON_URI core:relatedBy ?position . + ?position a core:Position . + ?position core:relates ?organization . + ?organization a foaf:Organization . + ?organization obo:RO_0001025 ?geographicLocation . ?geographicLocation rdfs:label ?label . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/position/organizationForPosition.sparql b/productMods/WEB-INF/rich-export/position/organizationForPosition.sparql index 2c771c22..dd9d5e0d 100644 --- a/productMods/WEB-INF/rich-export/position/organizationForPosition.sparql +++ b/productMods/WEB-INF/rich-export/position/organizationForPosition.sparql @@ -1,11 +1,14 @@ PREFIX core: PREFIX rdfs: +PREFIX foaf: CONSTRUCT { ?position core:positionInOrganization ?organization . ?organization rdfs:label ?label . } WHERE { - PERSON_URI core:personInPosition ?position . - ?position core:positionInOrganization ?organization . + PERSON_URI core:relatedBy ?position . + ?position a core:Position . + ?position core:relates ?organization . + ?organization a foaf:Organization . ?organization rdfs:label ?label . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/position/subOrganizationForPosition.sparql b/productMods/WEB-INF/rich-export/position/subOrganizationForPosition.sparql index 58678586..6748f690 100644 --- a/productMods/WEB-INF/rich-export/position/subOrganizationForPosition.sparql +++ b/productMods/WEB-INF/rich-export/position/subOrganizationForPosition.sparql @@ -1,12 +1,16 @@ PREFIX core: PREFIX rdfs: +PREFIX foaf: +PREFIX obo: CONSTRUCT { ?organization core:hasSubOrganization ?subOrganization . ?subOrganization rdfs:label ?label . } WHERE { - PERSON_URI core:personInPosition ?position . - ?position core:positionInOrganization ?organization . - ?organization core:hasSubOrganization ?subOrganization . + PERSON_URI core:relatedBy ?position . + ?position a core:Position . + ?position core:relates ?organization . + ?organization a foaf:Organization . + ?organization obo:BFO_0000050 ?subOrganization . ?subOrganization rdfs:label ?label . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/position/superOrganizationForPosition.sparql b/productMods/WEB-INF/rich-export/position/superOrganizationForPosition.sparql index 74c0b9e1..93ef97c4 100644 --- a/productMods/WEB-INF/rich-export/position/superOrganizationForPosition.sparql +++ b/productMods/WEB-INF/rich-export/position/superOrganizationForPosition.sparql @@ -3,8 +3,10 @@ PREFIX core: CONSTRUCT { ?superOrganization ?property ?object . } WHERE { - PERSON_URI core:personInPosition ?position . - ?position core:positionInOrganization ?organization . - ?organization core:subOrganizationWithin ?superOrganization . + PERSON_URI core:relatedBy ?position . + ?position a core:Position . + ?position core:relates ?organization . + ?organization a foaf:Organization . + ?organization obo:BFO_0000051 ?superOrganization . ?superOrganization ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/presentation/meetingLocation.sparql b/productMods/WEB-INF/rich-export/presentation/meetingLocation.sparql index cb110302..fe2ed944 100644 --- a/productMods/WEB-INF/rich-export/presentation/meetingLocation.sparql +++ b/productMods/WEB-INF/rich-export/presentation/meetingLocation.sparql @@ -1,16 +1,14 @@ PREFIX vivo: PREFIX rdfs: +PREFIX obo: CONSTRUCT { ?location rdfs:label ?locationName . } WHERE { - PERSON_URI vivo:hasPresenterRole ?presenterRole . - - {?presenterRole vivo:roleRealizedIn ?presentation} - union - {?presenterRole vivo:roleIn ?presentation} - - ?presentation vivo:eventWithin ?containingEvent . - ?containingEvent vivo:hasGeographicLocation ?location . + PERSON_URI obo:RO_0000053 ?presenterRole . + ?presenterRole a core:PresenterRole . + ?presenterRole obo:BFO_0000054 ?presentation . + ?presentation obo:BFO_0000050 ?containingEvent . + ?containingEvent obo:RO_0001025 ?location . ?location rdfs:label ?locationName . } diff --git a/productMods/WEB-INF/rich-export/presentation/meetingName.sparql b/productMods/WEB-INF/rich-export/presentation/meetingName.sparql index 8ca7c752..ee70539a 100644 --- a/productMods/WEB-INF/rich-export/presentation/meetingName.sparql +++ b/productMods/WEB-INF/rich-export/presentation/meetingName.sparql @@ -4,12 +4,9 @@ PREFIX rdfs: CONSTRUCT { ?containingEvent rdfs:label ?containingEventName } WHERE { - PERSON_URI vivo:hasPresenterRole ?presenterRole . - - {?presenterRole vivo:roleRealizedIn ?presentation} - union - {?presenterRole vivo:roleIn ?presentation} - - ?presentation vivo:eventWithin ?containingEvent . + PERSON_URI obo:RO_0000053 ?presenterRole . + ?presenterRole a core:PresenterRole . + ?presenterRole obo:BFO_0000054 ?presentation . + ?presentation obo:BFO_0000050 ?containingEvent . ?containingEvent rdfs:label ?containingEventName } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/presentation/presenterRoleIn.sparql b/productMods/WEB-INF/rich-export/presentation/presenterRoleIn.sparql index c733e94c..c77c3a8a 100644 --- a/productMods/WEB-INF/rich-export/presentation/presenterRoleIn.sparql +++ b/productMods/WEB-INF/rich-export/presentation/presenterRoleIn.sparql @@ -5,13 +5,9 @@ CONSTRUCT { ?presentation rdfs:label ?presentationTitle . ?presenterRole rdfs:label ?roleLabel . } WHERE { - PERSON_URI vivo:hasPresenterRole ?presenterRole . - - optional {?presenterRole rdfs:label ?roleLabel} - - {?presenterRole vivo:roleRealizedIn ?presentation} - union - {?presenterRole vivo:roleIn ?presentation} - + PERSON_URI obo:RO_0000053 ?presenterRole . + ?presenterRole a core:PresenterRole . + ?presenterRole rdfs:label ?roleLAbel . + ?presenterRole obo:BFO_0000054 ?presentation . ?presentation rdfs:label ?presentationTitle . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/associatedJournal.sparql b/productMods/WEB-INF/rich-export/publication/associatedJournal.sparql index a8daaa63..bf2582cb 100644 --- a/productMods/WEB-INF/rich-export/publication/associatedJournal.sparql +++ b/productMods/WEB-INF/rich-export/publication/associatedJournal.sparql @@ -1,10 +1,13 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?publicationVenue ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication core:hasPublicationVenue ?publicationVenue . ?publicationVenue ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/authors.sparql b/productMods/WEB-INF/rich-export/publication/authors.sparql index bf4ac16a..bc1105b1 100644 --- a/productMods/WEB-INF/rich-export/publication/authors.sparql +++ b/productMods/WEB-INF/rich-export/publication/authors.sparql @@ -1,13 +1,19 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: CONSTRUCT { ?coAuthorship ?property1 ?object1 . ?person ?property2 ?object2 . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . - ?publication core:informationResourceInAuthorship ?coAuthorship . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . + ?publication core:relatedBy ?coAuthorship . + ?coAuthorship a core:Authorship . ?coAuthorship ?property1 ?object1 . - ?coAuthorship core:linkedAuthor ?person . + ?coAuthorship core:relates ?person . + ?person a foaf:Person . ?person ?property2 ?object2 . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/presentedAtEvent.sparql b/productMods/WEB-INF/rich-export/publication/presentedAtEvent.sparql index c366de39..a7e4bb34 100644 --- a/productMods/WEB-INF/rich-export/publication/presentedAtEvent.sparql +++ b/productMods/WEB-INF/rich-export/publication/presentedAtEvent.sparql @@ -1,11 +1,15 @@ PREFIX core: +PREFIX obo: +PREFIX foaf: PREFIX bibo: CONSTRUCT { ?event ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication bibo:presentedAt ?event . ?event ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql b/productMods/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql index c0fd3853..6e3cfd94 100644 --- a/productMods/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql +++ b/productMods/WEB-INF/rich-export/publication/presentedAtEventEndDate.sparql @@ -1,12 +1,15 @@ PREFIX core: -PREFIX bibo: +PREFIX obo: +PREFIX foaf: PREFIX bibo: CONSTRUCT { ?endDate ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication bibo:presentedAt ?event . ?event ?property ?object . ?event core:dateTimeInterval ?dateTimeInterval . diff --git a/productMods/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql b/productMods/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql index 80560c0f..ebddb52e 100644 --- a/productMods/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql +++ b/productMods/WEB-INF/rich-export/publication/presentedAtEventLocation.sparql @@ -1,13 +1,16 @@ PREFIX core: PREFIX bibo: PREFIX rdfs: +PREFIX obo: CONSTRUCT { ?location rdfs:label ?locationName . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication bibo:presentedAt ?event . - ?event core:hasGeographicLocation ?location . + ?event obo:RO_0001025 ?location . ?location rdfs:label ?locationName . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql b/productMods/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql index 3803a72f..3a85c078 100644 --- a/productMods/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql +++ b/productMods/WEB-INF/rich-export/publication/presentedAtEventStartDate.sparql @@ -1,12 +1,15 @@ PREFIX core: PREFIX bibo: +PREFIX obo: CONSTRUCT { ?startDate ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication bibo:presentedAt ?event . ?event ?property ?object . ?event core:dateTimeInterval ?dateTimeInterval . diff --git a/productMods/WEB-INF/rich-export/publication/publication.sparql b/productMods/WEB-INF/rich-export/publication/publication.sparql index 96e4344d..1ab4318a 100644 --- a/productMods/WEB-INF/rich-export/publication/publication.sparql +++ b/productMods/WEB-INF/rich-export/publication/publication.sparql @@ -1,9 +1,12 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?publication ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/publicationDate.sparql b/productMods/WEB-INF/rich-export/publication/publicationDate.sparql index 8661c16b..0f2fb63d 100644 --- a/productMods/WEB-INF/rich-export/publication/publicationDate.sparql +++ b/productMods/WEB-INF/rich-export/publication/publicationDate.sparql @@ -1,11 +1,14 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?date ?property ?object . ?precision ?property2 ?object2 . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication ?dateTimeValue ?date . ?date ?property ?object . ?date core:dateTimePrecision ?precision . diff --git a/productMods/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql b/productMods/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql index b92459a3..f37a43dc 100644 --- a/productMods/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql +++ b/productMods/WEB-INF/rich-export/publication/publicationPartOfInfoResource.sparql @@ -1,10 +1,13 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?informationResource ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . - ?publication core:partOf ?informationResource . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . + ?publication obo:BFO_0000050 ?informationResource . ?informationResource ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/publicationReproducedIn.sparql b/productMods/WEB-INF/rich-export/publication/publicationReproducedIn.sparql index 376e9f97..3b751a9e 100644 --- a/productMods/WEB-INF/rich-export/publication/publicationReproducedIn.sparql +++ b/productMods/WEB-INF/rich-export/publication/publicationReproducedIn.sparql @@ -1,11 +1,14 @@ PREFIX core: PREFIX bibo: +PREFIX obo: CONSTRUCT { ?informationResource ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication bibo:reproducedIn ?informationResource . ?informationResource ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/publicationStatus.sparql b/productMods/WEB-INF/rich-export/publication/publicationStatus.sparql index 7c8f4614..e1cb2f25 100644 --- a/productMods/WEB-INF/rich-export/publication/publicationStatus.sparql +++ b/productMods/WEB-INF/rich-export/publication/publicationStatus.sparql @@ -1,11 +1,14 @@ PREFIX core: PREFIX bibo: +PREFIX obo: CONSTRUCT { ?publicationStatus ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication bibo:status ?publicationStatus . ?publicationStatus ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/publicationURL.sparql b/productMods/WEB-INF/rich-export/publication/publicationURL.sparql index 940f6062..47f0de80 100644 --- a/productMods/WEB-INF/rich-export/publication/publicationURL.sparql +++ b/productMods/WEB-INF/rich-export/publication/publicationURL.sparql @@ -1,10 +1,15 @@ PREFIX core: +PREFIX obo: +PREFIX vcard: CONSTRUCT { ?urllink ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . - ?publication core:webpage ?urllink . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . + ?publication obo:ARG_2000028 ?vcard . + ?vcard vcard:hasURL ?urllink . ?urllink ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/publication/publisher_variant1.sparql b/productMods/WEB-INF/rich-export/publication/publisher_variant1.sparql index f41cc890..4ae35fd0 100644 --- a/productMods/WEB-INF/rich-export/publication/publisher_variant1.sparql +++ b/productMods/WEB-INF/rich-export/publication/publisher_variant1.sparql @@ -1,10 +1,13 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?publisher ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication core:hasPublicationVenue ?publicationVenue . ?publicationVenue core:publisher ?publisher . ?publisher ?property ?object . diff --git a/productMods/WEB-INF/rich-export/publication/publisher_variant2.sparql b/productMods/WEB-INF/rich-export/publication/publisher_variant2.sparql index 88d56bea..6d552625 100644 --- a/productMods/WEB-INF/rich-export/publication/publisher_variant2.sparql +++ b/productMods/WEB-INF/rich-export/publication/publisher_variant2.sparql @@ -1,10 +1,13 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?publisher ?property ?object . } WHERE { - PERSON_URI core:authorInAuthorship ?authorship . - ?authorship core:linkedInformationResource ?publication . + PERSON_URI core:relatedBy ?authorship . + ?authorship a core:Authorship . + ?authorship core:relates ?publication . + ?publication a obo:IAO_0000030 . ?publication core:publisher ?publisher . ?publisher ?property ?object . } \ No newline at end of file diff --git a/productMods/WEB-INF/rich-export/teaching/teacherRoleIn.sparql b/productMods/WEB-INF/rich-export/teaching/teacherRoleIn.sparql index a5b55771..76ec8cdd 100644 --- a/productMods/WEB-INF/rich-export/teaching/teacherRoleIn.sparql +++ b/productMods/WEB-INF/rich-export/teaching/teacherRoleIn.sparql @@ -1,9 +1,11 @@ PREFIX core: +PREFIX obo: CONSTRUCT { ?course ?property ?object . } WHERE { - PERSON_URI core:hasTeacherRole ?teacherRole . - ?teacherRole core:roleRealizedIn ?course . + PERSON_URI obo:RO_0000053 ?teacherRole . + ?teacherRole a core:TeacherRole . + ?teacherRole obo:BFO_0000054 ?course . ?course ?property ?object . } \ No newline at end of file From 14e83ecc6c78c27bf66fe09eb4f5d16e84a7ccad Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 6 Nov 2013 16:13:46 -0500 Subject: [PATCH 36/40] VIVO-491 cleaning up some minor address stuff --- .../edit/forms/js/mailingAddressUtils.js | 9 +++++++++ rdf/display/everytime/PropertyConfig.n3 | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js b/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js index d2104330..43648028 100644 --- a/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js +++ b/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js @@ -10,6 +10,8 @@ var mailingAddressUtils = { if ( editMode != "add" ) { this.setStreetAddressDisplayFields(); } + + this.setAddressFieldsIfErrors(); }, initObjectReferences: function() { @@ -18,9 +20,16 @@ var mailingAddressUtils = { this.street1 = $('#streetAddressOne'); this.street2 = $('#streetAddressTwo'); this.streetAddress = $('#streetAddress'); + this.errorSection = $('section#error-alert'); }, + setAddressFieldsIfErrors: function() { + if ( this.errorSection.length ) { + mailingAddressUtils.setStreetAddressDisplayFields(); + } + }, + bindEventListeners: function() { this.idCache = {}; diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 5aff1c63..aebf49ab 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -893,6 +893,20 @@ local:awardReceiptsAwardForConfig a :ObjectPropertyDisplayConfig ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; :propertyGroup . +local:addressLocationContext a :ConfigContext ; + :hasConfiguration local:addressLocationConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy vivo:GeographicLocation . + +local:addressLocationConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "has geographic location" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + ### roles using the BFO_0000055 property ### local:bfo_0000055Context a :ConfigContext ; From 390c05ab3f1d30f2d45496f99d465095e0436864 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 6 Nov 2013 16:51:09 -0500 Subject: [PATCH 37/40] inverse predicate method now working --- .../generators/AddGrantRoleToPersonGenerator.java | 4 +--- .../generators/AddRoleToPersonTwoStageGenerator.java | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) 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 09b02453..61e44257 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 @@ -271,9 +271,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator urisInScope.put("roleType", Arrays.asList(new String[]{getRoleType(vreq)})); //Setting inverse role predicate - // with ISF changes this will always be the same - urisInScope.put("inverseRolePredicate", Arrays.asList(new String[]{"http://purl.obolibrary.org/obo/RO_0000052"})); - + urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); editConfiguration.setUrisInScope(urisInScope); //Uris in scope include subject, predicate, and object var //literals in scope empty initially, usually populated by code in prepare for update diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index c05f6c85..ea76d04b 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java @@ -270,8 +270,7 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura HashMap> urisInScope = new HashMap>(); //Setting inverse role predicate - //With ISF changes this will always be the same - urisInScope.put("inverseRolePredicate", Arrays.asList(new String[]{"http://purl.obolibrary.org/obo/RO_0000052"})); + urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); urisInScope.put("roleType", list( getRoleType() ) ); //Uris in scope include subject, predicate, and object var From 6a7caf1cdd7db8ec9b451c9c505ee193f265ecc9 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Thu, 7 Nov 2013 11:47:48 -0500 Subject: [PATCH 38/40] sparql query reordering for performance --- .../sparqlConstructs/additions/post/contributingAdvising.sparql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/contributingAdvising.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/contributingAdvising.sparql index a80f3c79..af1e6871 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/contributingAdvising.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/contributingAdvising.sparql @@ -6,10 +6,10 @@ CONSTRUCT { ?educationalProcess ?role . ?role ?educationalProcess . } WHERE { + ?educationalProcess vivo:contributingAdvising ?advising . ?person ?educationalProcess . ?person a foaf:Person . ?educationalProcess a vivo:EducationalProcess . - ?educationalProcess vivo:contributingAdvising ?advising . ?advising vivo:relates ?role . ?role a . } From ac60d04bad37d676eba3b8a89404b2d7a974262c Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Thu, 7 Nov 2013 11:49:23 -0500 Subject: [PATCH 39/40] grant sparql bugfix --- .../update/sparqlConstructs/additions/post/Grant.sparql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/Grant.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/Grant.sparql index 64d32879..f778da76 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/Grant.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/post/Grant.sparql @@ -7,6 +7,7 @@ CONSTRUCT { ?grant vivo:relates ?agent } WHERE { ?agent ?role . - ?role vivo:relatedBy ?grant + ?role vivo:relatedBy ?grant . + ?grant a vivo:Grant . FILTER NOT EXISTS { ?grant vivo:relates ?agent } } From 86ccde7d39e52289aab2c942e5581401929276c4 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Thu, 7 Nov 2013 12:25:39 -0500 Subject: [PATCH 40/40] fix typo in PropertyConfig.n3 --- rdf/display/everytime/PropertyConfig.n3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf/display/everytime/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index aebf49ab..7d9d5363 100644 --- a/rdf/display/everytime/PropertyConfig.n3 +++ b/rdf/display/everytime/PropertyConfig.n3 @@ -305,7 +305,7 @@ local:awardOrHonorContext a :ConfigContext ; :hasConfiguration local:awardOrHonorConfig ; :configContextFor ; :qualifiedByDomain ; - :qualifiedBy . + :qualifiedBy . local:awardOrHonorConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-awardOrHonor.xml"^^xsd:string ;