From db124422af090b37db957af3a080b7c41829a6fd Mon Sep 17 00:00:00 2001 From: stellamit Date: Fri, 28 Oct 2011 21:42:25 +0000 Subject: [PATCH] NIHVIVO-3266 (list views for roles) NIHVIVO-3206 (data migration) --- .../loadedAtStartup/vivoListViewConfig.rdf | 6 +- .../WEB-INF/ontologies/update/diff.tab.txt | 2 +- .../additions/ExternalConcept.sparql | 2 +- .../WEB-INF/resources/startup_listeners.txt | 2 +- .../listViewConfig-hasEditReviewRole.xml | 13 +++- .../listViewConfig-hasInvestigatorRole.xml | 63 ++++++++++++++----- .../listViewConfig-hasPresenterRole.xml | 26 ++++---- productMods/config/listViewConfig-hasRole.xml | 49 ++++++++++++--- .../config/listViewConfig-relatedRole.xml | 4 +- src/org/vivoweb/webapp/util/ModelUtils.java | 4 +- 10 files changed, 122 insertions(+), 49 deletions(-) diff --git a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf index 85349946..36f0a7f8 100644 --- a/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf +++ b/productMods/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf @@ -131,7 +131,11 @@ ****************************************************************** --> - + + listViewConfig-relatedRole.xml + + + listViewConfig-relatedRole.xml diff --git a/productMods/WEB-INF/ontologies/update/diff.tab.txt b/productMods/WEB-INF/ontologies/update/diff.tab.txt index 62638a6e..515966a9 100644 --- a/productMods/WEB-INF/ontologies/update/diff.tab.txt +++ b/productMods/WEB-INF/ontologies/update/diff.tab.txt @@ -5,7 +5,7 @@ http://vivoweb.org/ontology/core#subjectAreaFor No Delete Delete http://vivoweb.org/ontology/core#researchAreaOf No Delete Delete http://vivoweb.org/ontology/core#roleIn No Delete Delete http://vivoweb.org/ontology/core#relatedRole No Delete Delete -http://vivoweb.org/ontology/core#URLLink No Delete Delete +http://vivoweb.org/ontology/core#VocabularySourceReference No Delete Delete http://vivoweb.org/ontology/core#sourceVocabularyReference No Delete Delete http://vivoweb.org/ontology/core#vocabularyReferenceFor No Delete Delete http://vivoweb.org/ontology/core#addressStreet http://vivoweb.org/ontology/core#address1 Yes Map Directly-changed diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/ExternalConcept.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/ExternalConcept.sparql index d12eb8a1..29e0626c 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/ExternalConcept.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/ExternalConcept.sparql @@ -22,6 +22,6 @@ Construct { {?something vivo:hasResearchArea ?concept} ?concept rdf:type vivo:SubjectArea . - ?concept vivo:vocabularySourceReference ?urllink . + ?concept vivo:sourceVocabularyReference ?urllink . ?urllink vivo:linkURI ?uri } \ No newline at end of file diff --git a/productMods/WEB-INF/resources/startup_listeners.txt b/productMods/WEB-INF/resources/startup_listeners.txt index 4c64bc9e..e4f75158 100644 --- a/productMods/WEB-INF/resources/startup_listeners.txt +++ b/productMods/WEB-INF/resources/startup_listeners.txt @@ -32,7 +32,7 @@ edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdateUserAccounts # Invokes process to perform updates to align with ontology changes if needed --> # Needs to run before submodels are attached and Pellet is set up --> -# edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdateKnowledgeBase +edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdateKnowledgeBase edu.cornell.mannlib.vitro.webapp.servlet.setup.FileGraphSetup diff --git a/productMods/config/listViewConfig-hasEditReviewRole.xml b/productMods/config/listViewConfig-hasEditReviewRole.xml index 078171b2..505d1e63 100644 --- a/productMods/config/listViewConfig-hasEditReviewRole.xml +++ b/productMods/config/listViewConfig-hasEditReviewRole.xml @@ -26,7 +26,12 @@ ?subject ?property ?role - OPTIONAL { ?role core:roleIn ?activity + OPTIONAL { ?role core:roleContributesTo ?activity + LET (?activityName := afn:localname(?activity)) + OPTIONAL { ?activity rdfs:label ?activityLabel } + } + + OPTIONAL { ?role core:roleRealizedIn ?activity LET (?activityName := afn:localname(?activity)) OPTIONAL { ?activity rdfs:label ?activityLabel } } @@ -101,7 +106,11 @@ ?role ?roleProperty ?roleValue } UNION { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role core:roleRealizedIn ?activity . ?activity rdfs:label ?activityName } } diff --git a/productMods/config/listViewConfig-hasInvestigatorRole.xml b/productMods/config/listViewConfig-hasInvestigatorRole.xml index 490b2601..57b741f3 100644 --- a/productMods/config/listViewConfig-hasInvestigatorRole.xml +++ b/productMods/config/listViewConfig-hasInvestigatorRole.xml @@ -22,7 +22,7 @@ ?subject ?property ?role - OPTIONAL { ?role core:roleIn ?activity + OPTIONAL { ?role core:roleRealizedIn ?activity LET (?activityName := afn:localname(?activity)) OPTIONAL { ?activity rdfs:label ?activityLabel } @@ -30,7 +30,16 @@ ?activity vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:hasInvestigatorRole - } + } + OPTIONAL { ?role core:roleContributesTo ?activity + LET (?activityName := afn:localname(?activity)) + OPTIONAL { ?activity rdfs:label ?activityLabel } + + + ?activity vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf core:hasInvestigatorRole + + } OPTIONAL { ?activity core:grantAwardedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel } @@ -60,12 +69,30 @@ CONSTRUCT { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleRealizedIn ?activity . ?activity vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:hasInvestigatorRole } WHERE { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleRealizedIn ?activity . + ?activity vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf core:hasInvestigatorRole + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?subject ?property ?role . + ?role core:roleContributesTo ?activity . + ?activity vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf core:hasInvestigatorRole + } WHERE { + ?subject ?property ?role . + ?role core:roleContributesTo ?activity . ?activity vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:hasInvestigatorRole } @@ -84,30 +111,34 @@ ?adminedBy rdfs:label ?adminedByLabel } WHERE { { - ?subject ?property ?role - } UNION { - ?subject ?property ?role . - ?role ?roleProperty ?roleValue - } UNION { - ?subject ?property ?role . - ?role core:roleIn ?activity . - ?activity rdfs:label ?activityName + ?subject ?property ?role } UNION { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role core:roleRealizedIn ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role core:roleContributesTo ?activity . ?activity core:grantAwardedBy ?awardedBy } UNION { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleContributesTo ?activity . ?activity core:grantAwardedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel } UNION { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleContributesTo ?activity . ?activity core:administeredBy ?adminedBy } UNION { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleContributesTo ?activity . ?activity core:administeredBy ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } diff --git a/productMods/config/listViewConfig-hasPresenterRole.xml b/productMods/config/listViewConfig-hasPresenterRole.xml index cf09b498..f3431cf1 100644 --- a/productMods/config/listViewConfig-hasPresenterRole.xml +++ b/productMods/config/listViewConfig-hasPresenterRole.xml @@ -28,7 +28,7 @@ OPTIONAL { ?role rdfs:label ?roleLabel } - OPTIONAL { ?role core:roleIn ?presentation + OPTIONAL { ?role core:roleRealizedIn ?presentation LET (?presentationName := afn:localname(?presentation)) OPTIONAL { ?presentation rdfs:label ?presentationLabel } @@ -86,19 +86,19 @@ CONSTRUCT { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?presentation vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:Presentation . ?subclass owl:equivalentClass core:Presentation . } WHERE { { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?presentation vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:Presentation } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?presentation vitro:mostSpecificType ?subclass . ?subclass owl:equivalentClass core:Presentation } @@ -120,7 +120,7 @@ ?role ?roleProperty ?roleValue } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?presentation rdfs:label ?presentationLabel } } @@ -141,23 +141,23 @@ { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?presentation core:eventWithin ?conference } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?presentation core:eventWithin ?conference . ?conference rdfs:label ?conferenceLabel } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?conference core:includesEvent ?presentation } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?conference core:includesEvent ?presentation . ?conference rdfs:label ?conferenceLabel @@ -181,26 +181,26 @@ } WHERE { { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?presentation core:eventWithin ?workshop . ?workshop core:eventWithin ?conference } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?presentation core:eventWithin ?workshop . ?workshop core:eventWithin ?conference . ?conference rdfs:label ?conferenceLabel } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?conference core:includesEvent ?workshop . ?workshop core:includesEvent ?presentation } UNION { ?subject ?property ?role . - ?role core:roleIn ?presentation . + ?role core:roleRealizedIn ?presentation . ?conference a bibo:Conference . ?conference core:includesEvent ?workshop . ?workshop core:includesEvent ?presentation . diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml index 2929068d..69879a08 100644 --- a/productMods/config/listViewConfig-hasRole.xml +++ b/productMods/config/listViewConfig-hasRole.xml @@ -21,7 +21,7 @@ ?subject ?property ?role - OPTIONAL { ?role core:roleIn ?activity + OPTIONAL { ?role core:roleRealizedIn ?activity LET (?activityName := afn:localname(?activity)) OPTIONAL { ?activity rdfs:label ?activityLabel } @@ -30,6 +30,15 @@ } + OPTIONAL { ?role core:roleContributesTo ?activity + LET (?activityName := afn:localname(?activity)) + OPTIONAL { ?activity rdfs:label ?activityLabel } + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role rdfs:label ?roleLabel } OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . @@ -52,11 +61,27 @@ CONSTRUCT { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleContributesTo ?activity . ?activity vitro:mostSpecificType ?subclass . } WHERE { ?subject ?property ?role . - ?role core:roleIn ?activity . + ?role core:roleContributesTo ?activity . + ?activity vitro:mostSpecificType ?subclass + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> + + CONSTRUCT { + ?subject ?property ?role . + ?role core:roleRealizedIn ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role core:roleRealizedIn ?activity . ?activity vitro:mostSpecificType ?subclass } @@ -70,18 +95,22 @@ ?activity rdfs:label ?activityName } WHERE { { - ?subject ?property ?role + ?subject ?property ?role } UNION { - ?subject ?property ?role . - ?role ?roleProperty ?roleValue + ?subject ?property ?role . + ?role ?roleProperty ?roleValue } UNION { - ?subject ?property ?role . - ?role core:roleIn ?activity . - ?activity rdfs:label ?activityName + ?subject ?property ?role . + ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role core:roleRealizedIn ?activity . + ?activity rdfs:label ?activityName } } - + PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index ceca4f6e..d36e03d0 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -3,8 +3,8 @@ - + diff --git a/src/org/vivoweb/webapp/util/ModelUtils.java b/src/org/vivoweb/webapp/util/ModelUtils.java index 97c988b0..80489d9f 100644 --- a/src/org/vivoweb/webapp/util/ModelUtils.java +++ b/src/org/vivoweb/webapp/util/ModelUtils.java @@ -26,9 +26,9 @@ public class ModelUtils { private static Set processClass = new HashSet(); static { - processClass.add("http://vivoweb.org/ontology/core#Process"); + processClass.add("http://vivoweb.org/ontology/core#Project"); processClass.add("http://purl.org/NET/c4dm/event.owl#Event"); - processClass.add("http://xmlns.com/foaf/0.1/Agent"); + processClass.add("http://vivoweb.org/ontology/core#EventSeries"); } /*