diff --git a/config/example.runtime.properties b/config/example.runtime.properties index a25e5922..6e61088d 100644 --- a/config/example.runtime.properties +++ b/config/example.runtime.properties @@ -143,7 +143,13 @@ visualization.temporal = enabled # The format for this property is id, name; id1, name1; id2, name2 etc. # See Service Metadata from this page http://code.google.com/p/google-refine/wiki/ReconciliationServiceApi # for more information. -Vitro.reconcile.defaultTypeList = http://vivoweb.org/ontology/core#Role, core:Role; http://vivoweb.org/ontology/core#AcademicDegree, core:Academic Degree; http://purl.org/NET/c4dm/event.owl#Event, event:Event; http://vivoweb.org/ontology/core#Agreement, core:Agreement; http://vivoweb.org/ontology/core#Location, core:Location; http://xmlns.com/foaf/0.1/Organization, foaf:Organization; http://xmlns.com/foaf/0.1/Person, foaf:Person; http://vivoweb.org/ontology/core#InformationResource, core:Information Resource +Vitro.reconcile.defaultTypeList = http://vivoweb.org/ontology/core#Role, core:Role; \ + http://vivoweb.org/ontology/core#AcademicDegree, core:Academic Degree; \ + http://purl.org/NET/c4dm/event.owl#Event, event:Event; \ + http://vivoweb.org/ontology/core#Location, core:Location; \ + http://xmlns.com/foaf/0.1/Organization, foaf:Organization; \ + http://xmlns.com/foaf/0.1/Person, foaf:Person; \ + http://purl.obolibrary.org/obo/IAO_0000030, obo:IAO_0000030 # # Types of individual for which we can create proxy editors. 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 @@ -405,7 +405,7 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle @@ -449,7 +449,7 @@ set CATALINA_OPTS=-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headle @@ -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

diff --git a/doc/upgrade-1.6.html b/doc/upgrade-1.6.html index 42bc64d5..0cb35e51 100644 --- a/doc/upgrade-1.6.html +++ b/doc/upgrade-1.6.html @@ -51,6 +51,7 @@
  • Auto-loaded RDF files move to the Home directory
  • Support for additional languages
  • More compact responses to Linked data requests
  • +
  • Changes to default types for Google Refine
  • Upgrade Instructions
  • @@ -143,7 +144,9 @@
  • webapp.name
  • + +
  • Solr is no longer secured

    In previous releases, Solr was deployed to Tomcat with a RemoteAddrValve @@ -163,7 +166,9 @@

    Sites that need to secure Solr are now left to their own devices.

    +
  • +
  • Log4J properties file renamed

    In previous releases, the properties file for the VIVO logging system @@ -175,7 +180,9 @@ Note that debug.log4j.properties, if present, will still override the default.

    +
  • +
  • Property groups now displayed in a tab format, including a "View All" tab

    With release 1.6, the property group menu bar that was used on profile pages has been replaced @@ -183,7 +190,9 @@ within that group while the contents of the previously displayed group will be hidden. The array of tabs also includes a "View All" tab that, when clicked, displays the contents of all the property groups.

    +
  • +
  • Class-specific SPARQL Query Data Getters

    The VIVO software now supports the development of SPARQL query data getters that can be associated @@ -195,7 +204,9 @@ data getters: https://wiki.duraspace.org/display/VIVO/Enriching+VIVO+Content+Using+SPARQL+Query+Data+Getters.

    +
  • +
  • The foaf:Person template has been re-located.

    The template individual--foaf-person.ftl has been moved to the "templates" subdirectory in the wilma @@ -204,7 +215,9 @@ theme directory or, if your installation does not have it's own theme directory, in the themes/wilma/templates subdirectory.

    +
  • +
  • Multiple foaf:Person Profile Pages

    VIVO now supports multiple profile pages for foaf:Persons. This feature, which is optional so installations @@ -218,7 +231,9 @@ Websnapr.) For more information on how to implement multiple profile page views, refer to this wiki page: https://wiki.duraspace.org/display/VIVO/Multiple+foaf%3APerson+Profile+Pages.

    +
  • +
  • Home Page Re-design

    For Release 1.6 the VIVO Home Page has been redesigned. The Search field beneath the "welcome" text now @@ -229,7 +244,9 @@ activities and organizations; and, optionally a global map showing researchers' areas of geographic focus.

    +
  • +
  • Auto-loaded RDF files move to the Home directory

    The RDF files that initialize the data model have moved, in both the distribution and @@ -243,97 +260,59 @@ the new locations accordingly.

    -
    Old locations of RDF files
    -
    /WEB-INF/ontologies/app/application.owl
    -/WEB-INF/ontologies/app/aboutPage.n3
    -/WEB-INF/ontologies/app/menu.n3
    -/WEB-INF/ontologies/app/profilePageType.n3
    -/WEB-INF/ontologies/app/loadedAtStartup/displayModelListViews.rdf
    -/WEB-INF/ontologies/app/loadedAtStartup/homePageDataGetters.n3
    -/WEB-INF/ontologies/app/loadedAtStartup/localeSelectionGUI.n3
    -/WEB-INF/ontologies/app/loadedAtStartup/vivoListViewConfig.rdf
    -/WEB-INF/ontologies/app/loadedAtStartup/vivoOrganizationDataGetters.n3
    -/WEB-INF/ontologies/app/loadedAtStartup/vivoSearchProhibited.n3
    -/WEB-INF/ontologies/app/menuload/displayTBOX.n3
    -/WEB-INF/ontologies/app/menuload/displayDisplay.n3
    -/WEB-INF/init-data/initialSiteConfig.rdf
    -/WEB-INF/ontologies/user/abox/geopolitical.ver1.1-11-18-11-individual-labels.rdf
    -/WEB-INF/ontologies/user/abox/vocabularySource-labels.n3
    -/WEB-INF/ontologies/user/tbox/vitro-0.7-annotations.rdf
    -/WEB-INF/ontologies/user/tbox/geopolitical-ver1.1-11-18-11-annotations.rdf
    -/WEB-INF/ontologies/user/tbox/scires-1.5-annotations.rdf
    -/WEB-INF/ontologies/user/tbox/vivo-core-1.5-annotations.rdf
    -/WEB-INF/ontologies/user/tbox/isDefinedBy-1.5-annotations.rdf
    -/WEB-INF/ontologies/user/applicationMetadata/propertygroups.rdf
    -/WEB-INF/ontologies/user/applicationMetadata/classgroups.rdf
    -/WEB-INF/filegraph/abox/us-states.rdf
    -/WEB-INF/filegraph/abox/geopolitical.abox.ver1.1-11-18-11.owl
    -/WEB-INF/filegraph/abox/academicDegree.rdf
    -/WEB-INF/filegraph/abox/documentStatus.owl
    -/WEB-INF/filegraph/abox/continents.n3
    -/WEB-INF/filegraph/abox/vocabularySource.n3
    -/WEB-INF/filegraph/abox/dateTimeValuePrecision.owl
    -/WEB-INF/filegraph/tbox/vitroPublic.owl
    -/WEB-INF/filegraph/tbox/vivo-dcterms-1.5.owl
    -/WEB-INF/filegraph/tbox/scires-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-core-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-c4o-1.5.owl
    -/WEB-INF/filegraph/tbox/geopolitical.tbox.ver1.1-11-18-11.owl
    -/WEB-INF/filegraph/tbox/vivo-fabio-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-skos-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-event-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-foaf-1.5.owl
    -/WEB-INF/filegraph/tbox/vitro-0.7.owl
    -/WEB-INF/filegraph/tbox/vivo-pws-1.5.owl
    -/WEB-INF/filegraph/tbox/isDefinedBy-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-dcelements-1.5.owl
    -/WEB-INF/filegraph/tbox/vivo-bibo-1.5.owl
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Old locations of RDF files
    under [Vitro]/webapp/web or [VIVO]/productMods
    New locations of RDF files
    under [Vitro]/webapp/rdf or [VIVO]/rdf
    Comments
    WEB-INF/ontologies/app/rdf/display/firsttime/
    WEB-INF/ontologies/app/loadedAtStartup/rdf/display/everytime/
    WEB-INF/ontologies/app/menuload/displayTBOX.n3rdf/displayTbox/everytime/Was one file, now a directory
    /WEB-INF/ontologies/app/menuload/displayDisplay.n3rdf/displayDisplay/everytime/Was one file, now a directory
    WEB-INF/ontologies/user/applicationMetadata/
    WEB-INF/init-data/
    rdf/applicationMetadata/firsttime/Merged directories
    WEB-INF/ontologies/user/abox/rdf/abox/firsttime/
    WEB-INF/filegraph/abox/rdf/abox/filegraph/
    WEB-INF/ontologies/user/tbox/rdf/tbox/firsttime/
    WEB-INF/filegraph/tbox/rdf/tbox/filegraph/
    -
    New locations of RDF files
    -
    rdf/display/firsttime/aboutPage.n3
    -rdf/display/firsttime/application.owl
    -rdf/display/firsttime/menu.n3
    -rdf/display/firsttime/profilePageType.n3
    -rdf/display/everytime/displayModelListViews.rdf
    -rdf/display/everytime/homePageDataGetters.n3
    -rdf/display/everytime/localeSelectionGUI.n3
    -rdf/display/everytime/vivoListViewConfig.rdf
    -rdf/display/everytime/vivoOrganizationDataGetters.n3
    -rdf/display/everytime/vivoSearchProhibited.n3
    -rdf/displayTbox/everytime/displayTBOX.n3
    -rdf/displayDisplay/everytime/displayDisplay.n3
    -rdf/applicationMetadata/firsttime/classgroups.rdf
    -rdf/applicationMetadata/firsttime/initialSiteConfig.rdf
    -rdf/applicationMetadata/firsttime/propertygroups.rdf
    -rdf/abox/firsttime/geopolitical.ver1.1-11-18-11-individual-labels.rdf
    -rdf/abox/firsttime/vocabularySource-labels.n3
    -rdf/abox/filegraph/abox/academicDegree.rdf
    -rdf/abox/filegraph/abox/continents.n3
    -rdf/abox/filegraph/abox/dateTimeValuePrecision.owl
    -rdf/abox/filegraph/abox/documentStatus.owl
    -rdf/abox/filegraph/abox/geopolitical.abox.ver1.1-11-18-11.owl
    -rdf/abox/filegraph/abox/us-states.rdf
    -rdf/abox/filegraph/abox/vocabularySource.n3
    -rdf/tbox/firsttime/geopolitical-ver1.1-11-18-11-annotations.rdf
    -rdf/tbox/firsttime/isDefinedBy-1.5-annotations.rdf
    -rdf/tbox/firsttime/scires-1.5-annotations.rdf
    -rdf/tbox/firsttime/vitro-0.7-annotations.rdf
    -rdf/tbox/firsttime/vivo-core-1.5-annotations.rdf
    -rdf/tbox/filegraph/tbox/geopolitical.tbox.ver1.1-11-18-11.owl
    -rdf/tbox/filegraph/tbox/isDefinedBy-1.5.owl
    -rdf/tbox/filegraph/tbox/scires-1.5.owl
    -rdf/tbox/filegraph/tbox/vitro-0.7.owl
    -rdf/tbox/filegraph/tbox/vitroPublic.owl
    -rdf/tbox/filegraph/tbox/vivo-bibo-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-c4o-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-core-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-dcelements-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-dcterms-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-event-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-fabio-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-foaf-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-pws-1.5.owl
    -rdf/tbox/filegraph/tbox/vivo-skos-1.5.owl

    If you are using a three-tier build process, you will need to add two lines to the build script to accomodate the RDF files, and the language support (see below) @@ -353,8 +332,8 @@ rdf/tbox/filegraph/tbox/vivo-skos-1.5.owl

    <patternset id="appbase.patterns">
     <include name="src/**/*" />
     <include name="lib/**/*" />
    -<include name="rdf/**/*" />
    -<include name="languages/**/*" />
    +<include name="rdf/**/*" />
    +<include name="languages/**/*" />
     <include name="test/**/*" />
     <include name="themes/**/*" />
     <include name="config/*.properties" />
    @@ -364,7 +343,9 @@ rdf/tbox/filegraph/tbox/vivo-skos-1.5.owl
    <include name="context.xml" /> </patternset>

    +
  • +
  • Support for additional languages

    VIVO 1.6 includes limited support for other languages, in addition to American English. @@ -388,7 +369,9 @@ rdf/tbox/filegraph/tbox/vivo-skos-1.5.owl Add a new language to VIVO.

    +
  • +
  • More compact responses to Linked data requests

    In VIVO 1.6, the response to requests for linked data is changed, to be smaller and faster. @@ -429,8 +412,17 @@ rdf/tbox/filegraph/tbox/vivo-skos-1.5.owl VIVO release 1.6 can be configured to produce extended linked data like previous releases. However, extended linked data will not be supported in future releases.

    -
  • + +
  • +

    Changes to default types for Google Refine

    +

    + The list of default types for Google Refine has changed, to accomodate changes in the + ontology. If you are using Google Refine, you may need to change your runtime properties + accordingly. The new defaults appear in example.runtime.properties. +

    +
  • +
  • Supported Browsers

    diff --git a/languages/example/themes/wilma/i18n/all_es.properties b/languages/example/themes/wilma/i18n/all_es.properties index 1dc13fa6..35ac2536 100644 --- a/languages/example/themes/wilma/i18n/all_es.properties +++ b/languages/example/themes/wilma/i18n/all_es.properties @@ -194,14 +194,7 @@ hyperlink = Hiperenlace # # accounts templates ( /templates/freemarker/body/accounts ) # -congratulations = ¡Enhorabuena! -we_have_created_your_account = Hemos creado el nuevo {0} cuenta asociada a {1}. -did_not_request_text = Si no has solicitado esta nueva cuenta puede ignorar este mensaje. Esta solicitud caducará si no se hubiere pronunciado sobre durante 30 días. -click_to_create_password = Haga clic en el enlace de abajo para crear la contraseña de su cuenta usando nuestro servidor seguro. password = contraseña -if_link_failed = Si el enlace no funciona, puedes copiar y pegar el enlace directamente en la barra de direcciones de su navegador. -thanks = ¡Gracias! -paste_the_link = Pega el siguiente enlace en la barra de direcciones de su navegador para crear la contraseña de su cuenta usando nuestro servidor seguro. # # harvester templates ( /templates/freemarker/body/harvester ) @@ -356,7 +349,7 @@ selected_conference = Conferencia Seleccionado years_participation_in = Años de participación en grant_entry_for = autorizará la entrada de -select_existing_pub_or_enter_new = Por favor seleccione una subvención actual en el campo de título o ingresar uno nuevo. +select_existing_pub_or_enter_new = Por favor seleccione una publicación actual en el campo de título o ingresar uno nuevo. unable_to_handle_grant_editing = Esta forma no es capaz de manejar la edición de esta subvención, ya que se asocia con múltiples individuos subvención. grant_type = concesión de la @@ -876,3 +869,7 @@ edit_year_awarded = Editar año concede publication_date_for = fecha de publicación de create_publication_date = Crear fecha de publicación edit_publication_date = Editar fecha de publicación +name_prefix = Prefijo de nombre +name_suffix = Sufijo de nombre +administering_organization_for = administración de la organización para +missing_credential = falta credencial \ No newline at end of file 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/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..c79d5687 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisingRelationship.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdviseeRole.sparql @@ -6,18 +6,14 @@ 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 . + 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 new file mode 100644 index 00000000..8a389c08 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/AdvisorRole.sparql @@ -0,0 +1,19 @@ +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 . + 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/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 } } 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/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 . } 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..7443d28a --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-0c.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:middleName ?middleName . + ?s a foaf:Person + 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/vcard1-3.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-3.sparql index 96076c4f..fb409425 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-3.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard1-3.sparql @@ -7,7 +7,7 @@ PREFIX owl: CONSTRUCT { ?s arg:ARG_2000028 _:vcard . _:vcard arg:ARG_2000029 ?s . - _:vcard a v:Individual . + _:vcard a v:Kind . } WHERE { ?s vivo:webpage ?webpage FILTER NOT EXISTS { ?s a foaf:Agent } 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..cb32f1b9 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard2d.sparql @@ -0,0 +1,14 @@ +PREFIX arg: +PREFIX foaf: +PREFIX v: +PREFIX vivo: +PREFIX bibo: + +CONSTRUCT { + ?name vivo:middleName ?middleName . +} WHERE { + ?s vivo:middleName ?middleName . + ?s a foaf:Person . + ?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..a1a53389 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/vcard8.sparql @@ -11,13 +11,16 @@ CONSTRUCT { _:address v:region ?addressState . _:address v:postalCode ?addressPostalCode . _:address v:country ?addressCountry . + _:address ?location . + ?location _:address . } 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 } + OPTIONAL { ?address vivo:hasGeographicLocation ?location } + ?s arg:ARG_2000028 ?vcard . OPTIONAL { ?address vivo:address1 ?address1 . ?address vivo:address2 ?address2 . @@ -33,5 +36,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/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 . + } +} diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/deletions/vcardDel.sparql index 439b7599..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 { @@ -27,7 +28,8 @@ CONSTRUCT { ?s foaf:lastName ?lastName . } UNION { - ?s vivo:middleName ?middleName + ?s vivo:middleName ?middleName . + ?s a foaf:Person . } UNION { ?s bibo:prefixName ?prefix @@ -57,6 +59,10 @@ CONSTRUCT { ?s vivo:mailingAddress ?address . ?address ?addressP ?addressO } + UNION { + ?s vivo:mailingAddress ?address . + ?addressS ?addressQ ?address + } UNION { ?s vivo:webpage ?webpage } diff --git a/productMods/WEB-INF/resources/startup_listeners.txt b/productMods/WEB-INF/resources/startup_listeners.txt index b0cb3e8d..72b4075e 100644 --- a/productMods/WEB-INF/resources/startup_listeners.txt +++ b/productMods/WEB-INF/resources/startup_listeners.txt @@ -34,12 +34,11 @@ edu.cornell.mannlib.vitro.webapp.servlet.setup.UpdatePermissionSetUris edu.cornell.mannlib.vitro.webapp.servlet.setup.FileGraphSetup -edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup - # 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.SimpleReasonerSetup + # Must run after JenaDataSourceSetup edu.cornell.mannlib.vitro.webapp.servlet.setup.ThemeInfoSetup 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 diff --git a/productMods/config/listViewConfig-adviseeIn.xml b/productMods/config/listViewConfig-adviseeIn.xml index 72b07c2c..3a38a1f1 100644 --- a/productMods/config/listViewConfig-adviseeIn.xml +++ b/productMods/config/listViewConfig-adviseeIn.xml @@ -32,26 +32,26 @@ OPTIONAL { ?advisingRel rdfs:label ?advisingRelLabel } OPTIONAL { ?advisingRel core:relates ?advisor . ?advisor a foaf:Person . - OPTIONAL { ?advisor rdfs:label ?advisorLabel } + ?advisor rdfs:label ?advisorLabel } OPTIONAL { ?advisingRel core:degreeCandidacy ?degree . ?degree rdfs:label ?degreeLabel . - OPTIONAL { ?degree core:abbreviation ?degreeAbbr } + } + OPTIONAL { ?advisingRel core:degreeCandidacy ?degree . + ?degree core:abbreviation ?degreeAbbr . } OPTIONAL { ?advisingRel vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:AdvisingRelationship } - OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } + OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } - OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } } ORDER BY ?subclass DESC(?dateTimeEnd) diff --git a/productMods/config/listViewConfig-advisorIn.xml b/productMods/config/listViewConfig-advisorIn.xml index 0182d6ea..25146b7a 100644 --- a/productMods/config/listViewConfig-advisorIn.xml +++ b/productMods/config/listViewConfig-advisorIn.xml @@ -32,26 +32,26 @@ OPTIONAL { ?advisingRel rdfs:label ?advisingRelLabel } OPTIONAL { ?advisingRel core:relates ?advisee . ?advisee a foaf:Person . - OPTIONAL { ?advisee rdfs:label ?adviseeLabel } + ?advisee rdfs:label ?adviseeLabel } OPTIONAL { ?advisingRel core:degreeCandidacy ?degree . ?degree rdfs:label ?degreeLabel . - OPTIONAL { ?degree core:abbreviation ?degreeAbbr } + } + OPTIONAL { ?advisingRel core:degreeCandidacy ?degree . + ?degree core:abbreviation ?degreeAbbr } OPTIONAL { ?advisingRel vitro:mostSpecificType ?subclass . ?subclass rdfs:subClassOf core:AdvisingRelationship } - OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } + OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } - OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?advisingRel core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } } ORDER BY ?subclass DESC(?dateTimeEnd) diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index 755ceff4..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 . @@ -199,13 +199,14 @@ ?infoResource core:relatedBy ?editorship . ?editorship a core:Editorship . ?editorship core:relates ?editorObj . + ?editorObj a foaf:Person . ?editorObj rdfs:label ?editor } UNION { ?subject ?property ?authorship . ?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-awardOrHonor.xml b/productMods/config/listViewConfig-awardOrHonor.xml index 149df272..4dbb907d 100644 --- a/productMods/config/listViewConfig-awardOrHonor.xml +++ b/productMods/config/listViewConfig-awardOrHonor.xml @@ -35,18 +35,16 @@ OPTIONAL { ?awardReceipt core:assignedBy ?assignedBy . ?assignedBy rdfs:label ?assignedByLabel } - OPTIONAL { ?awardReceipt core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } + OPTIONAL { ?awardReceipt core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } - OPTIONAL { ?awardReceipt core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?awardReceipt core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } - OPTIONAL { ?awardReceipt core:dateTimeValue ?dateTimeValue - OPTIONAL { ?dateTimeValue core:dateTime ?dateTime } + OPTIONAL { ?awardReceipt core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime } } ORDER BY DESC(?dateTime) DESC(?dateTimeEnd) diff --git a/productMods/config/listViewConfig-educationalTraining.xml b/productMods/config/listViewConfig-educationalTraining.xml index 863b44bc..97e70fca 100644 --- a/productMods/config/listViewConfig-educationalTraining.xml +++ b/productMods/config/listViewConfig-educationalTraining.xml @@ -23,10 +23,14 @@ OPTIONAL { ?edTraining vitro:mostSpecificType ?subclass . } OPTIONAL { ?edTraining <http://purl.obolibrary.org/obo/RO_0002234> ?awardedDegree . ?awardedDegree core:relates ?degree . - ?degree a core:AcademicDegree - OPTIONAL { ?degree rdfs:label ?degreeName } - OPTIONAL { ?degree core:abbreviation ?degreeAbbr } - } + ?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> ?org . ?org a foaf:Organization . ?org rdfs:label ?orgName @@ -34,13 +38,13 @@ OPTIONAL { ?edTraining core:majorField ?majorField } OPTIONAL { ?edTraining core:departmentOrSchool ?deptOrSchool } OPTIONAL { ?edTraining core:supplementalInformation ?info } - OPTIONAL { ?edTraining core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + 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) diff --git a/productMods/config/listViewConfig-grantAdministeredBy.xml b/productMods/config/listViewConfig-grantAdministeredBy.xml new file mode 100644 index 00000000..d9a6c58d --- /dev/null +++ b/productMods/config/listViewConfig-grantAdministeredBy.xml @@ -0,0 +1,57 @@ + + + + + + + + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX obo: <http://purl.obolibrary.org/obo/> + + SELECT DISTINCT ?administratorRole + ?organization + ?organizationLabel + + WHERE { + ?subject ?property ?administratorRole . + ?administratorRole a core:AdministratorRole . + OPTIONAL { ?administratorRole obo:RO_0000052 ?organization . + ?organization a foaf:Organization . + ?organization obo:RO_0000053 ?administratorRole . + ?organization rdfs:label ?organizationLabel . + } + } ORDER BY ?organizationLabel + + + + PREFIX foaf: <http://xmlns.com/foaf/0.1/> + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX obo: <http://purl.obolibrary.org/obo/> + + CONSTRUCT { + ?subject ?property ?administratorRole . + ?administratorRole a core:AdministratorRole . + ?administratorRole obo:RO_0000052 ?organization . + ?organization a foaf:Organization . + ?organization obo:RO_0000053 ?administratorRole . + ?organization rdfs:label ?organizationLabel . + } WHERE { + { + ?subject ?property ?administratorRole . + ?administratorRole a core:AdministratorRole . + } UNION { + ?subject ?property ?administratorRole . + ?administratorRole a core:AdministratorRole . + ?administratorRole obo:RO_0000052 ?organization . + ?organization a foaf:Organization . + ?organization obo:RO_0000053 ?administratorRole . + ?organization rdfs:label ?organizationLabel . + } + } + + + + diff --git a/productMods/config/listViewConfig-hasClinicalActivity.xml b/productMods/config/listViewConfig-hasClinicalActivity.xml new file mode 100644 index 00000000..4ae2e97a --- /dev/null +++ b/productMods/config/listViewConfig-hasClinicalActivity.xml @@ -0,0 +1,159 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + 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#> + + SELECT DISTINCT ?subclass + # send the property to the template, since this view supports multiple role properties + ?property + ?role + ?roleLabel + ?activity ?activityName + ?activityLabel + ?dateTimeStart ?dateTimeEnd + ?hideThis + ?objectType + WHERE { + ?subject ?property ?role . + ?role a core:ClinicalRole . + + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityLabel + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityLabel + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName + + + + 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 a core:ClinicalRole . + ?role core:roleContributesTo ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?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 a core:ClinicalRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity vitro:mostSpecificType ?subclass + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityName + } WHERE { + { + ?subject ?property ?role . + ?role a core:ClinicalRole . + } UNION { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role core:relates ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role a core:ClinicalRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + diff --git a/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml b/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml new file mode 100644 index 00000000..04b433fd --- /dev/null +++ b/productMods/config/listViewConfig-hasCoPrincipalInvestigatorRole.xml @@ -0,0 +1,195 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + 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#> + + SELECT DISTINCT + ?role + ?activity ?activityName + ?activityLabel + ?awardedBy + ?adminedBy + ?awardedByLabel + ?adminedByLabel + ?dateTimeStartRole ?dateTimeEndRole + ?dateTimeStartGrant ?dateTimeEndGrant + ?hideThis + WHERE { + + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity rdfs:label ?activityLabel . + LET (?activityName := afn:localname(?activity)) + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:assignedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } + OPTIONAL { ?role core:hideFromDisplay ?hideThis } + } ORDER BY DESC(?dateTimeEndRole) DESC(?dateTimeStartRole) DESC(?dateTimeEndGrant) DESC(?dateTimeStartGrant) ?activityLabel ?activityName + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + 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 . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityLabel . + ?activity core:assignedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } WHERE { + { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + } UNION { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity rdfs:label ?activityLabel + } UNION { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?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:relates ?adminedByRole . + ?adminedByRole a core:AdminsitratorRole. + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy a foaf:Organization . + ?adminedBy rdfs:label ?adminedByLabel + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } WHERE { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } WHERE { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } WHERE { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } WHERE { + ?subject ?property ?role . + ?role a core:CoPrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } + + + + diff --git a/productMods/config/listViewConfig-hasEditorRole.xml b/productMods/config/listViewConfig-hasEditorRole.xml index 0d2b7854..4e868cf7 100644 --- a/productMods/config/listViewConfig-hasEditorRole.xml +++ b/productMods/config/listViewConfig-hasEditorRole.xml @@ -22,18 +22,19 @@ ?subject ?property ?role OPTIONAL { ?role core:roleContributesTo ?activity . - ?activity vitro:mostSpecificType ?subclass - OPTIONAL { ?activity rdfs:label ?activityName } - OPTIONAL { ?subclass rdfs:label ?subclassLabel } - } - - OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + ?activity vitro:mostSpecificType ?subclass . + ?subclass rdfs:label ?subclassLabel + } + OPTIONAL { ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityName diff --git a/productMods/config/listViewConfig-hasInvestigatorRole.xml b/productMods/config/listViewConfig-hasInvestigatorRole.xml index 98344214..baecbdc1 100644 --- a/productMods/config/listViewConfig-hasInvestigatorRole.xml +++ b/productMods/config/listViewConfig-hasInvestigatorRole.xml @@ -24,145 +24,95 @@ WHERE { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role vitro:mostSpecificType ?subclass - OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity rdfs:label ?activityLabel . LET (?activityName := afn:localname(?activity)) - OPTIONAL { ?activity rdfs:label ?activityLabel } - } - OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity - LET (?activityName := afn:localname(?activity)) - OPTIONAL { ?activity rdfs:label ?activityLabel } } - OPTIONAL { ?activity core:grantAwardedBy ?awardedBy . + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:assignedBy ?awardedBy . ?awardedBy rdfs:label ?awardedByLabel } - OPTIONAL { ?activity core:administeredBy ?adminedBy . + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . ?adminedBy rdfs:label ?adminedByLabel } - OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole - OPTIONAL { ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . - ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole - } - OPTIONAL { ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . - ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole - } - } - OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?grant . - ?grant core:dateTimeInterval ?dateTimeIntervalGrant - OPTIONAL { ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . - ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant - } - OPTIONAL { ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . - ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant - } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant } OPTIONAL { ?role core:hideFromDisplay ?hideThis } - FILTER ( bound(?activity) && ?subclass = ?objectType) + FILTER ( ?subclass = core:InvestigatorRole) } ORDER BY DESC(?dateTimeEndRole) DESC(?dateTimeStartRole) DESC(?dateTimeEndGrant) DESC(?dateTimeStartGrant) ?activityLabel ?activityName - - - 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 a ?objectType . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . - ?activity rdfs:label ?activityLabel - } WHERE { - { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity - } UNION - { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . - ?activity rdfs:label ?activityLabel - } - } - - - - 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 a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity rdfs:label ?activityLabel - } WHERE { - { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity - } UNION - { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity rdfs:label ?activityLabel - } - } - - + 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 ?objectType . + ?role a core:InvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . ?role ?roleProperty ?roleValue . - ?activity rdfs:label ?activityName . - ?activity core:grantAwardedBy ?awardedBy . + ?activity rdfs:label ?activityLabel . + ?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 { { - ?subject ?property ?role + ?subject ?property ?role . + ?role a core:InvestigatorRole . } UNION { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role ?roleProperty ?roleValue } UNION { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity rdfs:label ?activityName + ?activity a core:Grant . + ?activity rdfs:label ?activityLabel } UNION { ?subject ?property ?role . - ?role a ?objectType . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . - ?activity rdfs:label ?activityName - } UNION { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity core:grantAwardedBy ?awardedBy - } UNION { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity core:grantAwardedBy ?awardedBy . + ?role a core:InvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:assignedBy ?awardedBy . + ?awardedBy a foaf:Organization . ?awardedBy rdfs:label ?awardedByLabel } UNION { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity core:administeredBy ?adminedBy - } UNION { - ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . - ?activity core:administeredBy ?adminedBy . + ?activity a core:Grant . + ?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 } } @@ -172,13 +122,13 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role core:dateTimeInterval ?dateTimeIntervalRole . ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole } WHERE { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role core:dateTimeInterval ?dateTimeIntervalRole . ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole @@ -189,13 +139,13 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role core:dateTimeInterval ?dateTimeIntervalRole . ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole } WHERE { ?subject ?property ?role . - ?role a ?objectType . + ?role a core:InvestigatorRole . ?role core:dateTimeInterval ?dateTimeIntervalRole . ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole @@ -205,16 +155,18 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?grant . - ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?role a core:InvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant } WHERE { ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?grant . - ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?role a core:InvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant } @@ -224,16 +176,18 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?grant . - ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?role a core:InvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant } WHERE { ?subject ?property ?role . - ?role a ?objectType . - ?role <http://vivoweb.org/ontology/core#relatedBy> ?grant . - ?grant core:dateTimeInterval ?dateTimeIntervalGrant . + ?role a core:InvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant } diff --git a/productMods/config/listViewConfig-hasPresenterRole.xml b/productMods/config/listViewConfig-hasPresenterRole.xml index a6c58288..88be9a91 100644 --- a/productMods/config/listViewConfig-hasPresenterRole.xml +++ b/productMods/config/listViewConfig-hasPresenterRole.xml @@ -30,68 +30,50 @@ OPTIONAL { ?role rdfs:label ?roleLabel } - OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . + ?presentation rdfs:label ?presentationLabel . LET (?presentationName := afn:localname(?presentation)) - - OPTIONAL { ?presentation rdfs:label ?presentationLabel } - - OPTIONAL { ?conference a bibo:Conference . - OPTIONAL { ?conference rdfs:label ?conferenceLabel } - - { - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?conference - } UNION { - ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation - } - } - OPTIONAL { - { - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?conference - } UNION { - ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . - ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop - } - OPTIONAL { ?conference rdfs:label ?conferenceLabel } - } - - - OPTIONAL { ?series a vivo:EventSeries . - OPTIONAL { ?series rdfs:label ?seriesLabel } - - { - ?presentation vivo:inEventWithin ?series - } UNION { - ?series vivo:seriesForEvent ?presentation - } - } - OPTIONAL { - { - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop vivo:inEventSeries ?series - } UNION { - ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . - ?series vivo:seriesForEvent ?workshop - } - OPTIONAL { ?series rdfs:label ?seriesLabel } - } - - - ?presentation vitro:mostSpecificType ?subclass . - - { - ?subclass rdfs:subClassOf vivo:Presentation - } UNION { - ?subclass owl:equivalentClass vivo:Presentation - } - - - } - - OPTIONAL { ?role vivo:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval vivo:start ?dateTimeStartValue . - ?dateTimeStartValue vivo:dateTime ?dateTime - } + } + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . + ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . + ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . + ?conference a bibo:Conference . + ?conference rdfs:label ?conferenceLabel + } + 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 <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . + ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . + ?conference rdfs:label ?conferenceLabel + } + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo: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 <http://purl.obolibrary.org/obo/BFO_0000050> ?series . + ?series <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . + ?series rdfs:label ?seriesLabel + } + + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . + ?presentation vitro:mostSpecificType ?subclass . + } + + + OPTIONAL { ?role vivo:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval vivo:start ?dateTimeStartValue . + ?dateTimeStartValue vivo:dateTime ?dateTime } @@ -101,44 +83,18 @@ } ORDER BY ?subclass DESC(?dateTime) ?presentationLabel ?presentationName - - PREFIX vivo: <http://vivoweb.org/ontology/core#> - PREFIX owl: <http://www.w3.org/2002/07/owl#> - 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 a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?presentation vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf vivo:Presentation . - ?subclass owl:equivalentClass vivo:Presentation . - } WHERE { - { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?presentation vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf vivo:Presentation - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?presentation vitro:mostSpecificType ?subclass . - ?subclass owl:equivalentClass vivo:Presentation - } - } - - PREFIX vivo: <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 vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> CONSTRUCT { ?subject ?property ?role . ?role a vivo:PresenterRole . - ?role ?roleProperty ?roleValue . - ?presentation rdfs:label ?presentationLabel + ?role rdfs:label ?roleLabel . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . + ?presentation rdfs:label ?presentationLabel . + ?presentation vitro:mostSpecificType ?subclass . } WHERE { { ?subject ?property ?role . @@ -146,12 +102,19 @@ } UNION { ?subject ?property ?role . ?role a vivo:PresenterRole . - ?role ?roleProperty ?roleValue + ?role rdfs:label ?roleLabel . } UNION { ?subject ?property ?role . ?role a vivo:PresenterRole . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . ?presentation rdfs:label ?presentationLabel + } UNION { + ?subject ?property ?role . + ?role a vivo:PresenterRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . + ?presentation vitro:mostSpecificType ?subclass . } } @@ -164,37 +127,25 @@ CONSTRUCT { ?subject ?property ?role . ?role a vivo:PresenterRole . - ?conference a bibo:Conference . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . + ?conference a bibo:Conference . ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?conference rdfs:label ?conferenceLabel } WHERE { { ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?conference + ?role a vivo:PresenterRole . } UNION { ?subject ?property ?role . ?role a vivo:PresenterRole . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . + ?presentation a vivo:Presentation . ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . - ?conference rdfs:label ?conferenceLabel - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . - ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . + ?conference a bibo:Conference . ?conference rdfs:label ?conferenceLabel } } @@ -208,43 +159,32 @@ CONSTRUCT { ?subject ?property ?role . ?role a vivo:PresenterRole . + ?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 a bibo:Workshop . ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . ?conference a bibo:Conference . - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . ?conference rdfs:label ?conferenceLabel } WHERE { { ?subject ?property ?role . ?role a vivo:PresenterRole . + } UNION { + ?subject ?property ?role . + ?role a vivo:PresenterRole . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . + ?presentation a vivo:Presentation . ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?conference - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . ?conference a bibo:Conference . - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . - ?conference rdfs:label ?conferenceLabel - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . - ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . - ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?conference a bibo:Conference . - ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . - ?conference rdfs:label ?conferenceLabel + ?workshop a bibo:Workshop . + ?workshop <http://purl.obolibrary.org/obo/BFO_0000050> ?conference . + ?conference <http://purl.obolibrary.org/obo/BFO_0000051> ?workshop . + ?conference a bibo:Conference . + ?conference rdfs:label ?conferenceLabel } } @@ -257,37 +197,25 @@ CONSTRUCT { ?subject ?property ?role . ?role a vivo:PresenterRole . + ?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 { { ?subject ?property ?role . ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . - ?presentation vivo:inEventSeries ?series } UNION { ?subject ?property ?role . ?role a vivo:PresenterRole . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . + ?presentation a vivo:Presentation . ?series a vivo:EventSeries . - ?presentation vivo:inEventSeries ?series . - ?series rdfs:label ?seriesLabel - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . - ?series vivo:seriesForEvent ?presentation - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . - ?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 } } @@ -301,42 +229,30 @@ CONSTRUCT { ?subject ?property ?role . ?role a vivo:PresenterRole . - ?workshop vivo:inEventSeries ?series . - ?series vivo:seriesForEvent ?workshop . - ?series a vivo:EventSeries . + ?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 a bibo: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 { { ?subject ?property ?role . ?role a vivo:PresenterRole . + } UNION { + ?subject ?property ?role . + ?role a vivo:PresenterRole . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . + ?presentation a vivo:Presentation . ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop vivo:inEventSeries ?series - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . - ?presentation <http://purl.obolibrary.org/obo/BFO_0000050> ?workshop . - ?workshop vivo:inEventSeries ?series . - ?series rdfs:label ?seriesLabel - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . - ?series vivo:seriesForEvent ?workshop . - ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation - } UNION { - ?subject ?property ?role . - ?role a vivo:PresenterRole . - ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?presentation . - ?series a vivo:EventSeries . - ?series vivo:seriesForEvent ?workshop . ?workshop <http://purl.obolibrary.org/obo/BFO_0000051> ?presentation . + ?workshop a bibo: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 new file mode 100644 index 00000000..71a0c8f9 --- /dev/null +++ b/productMods/config/listViewConfig-hasPrincipalInvestigatorRole.xml @@ -0,0 +1,195 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + 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#> + + SELECT DISTINCT + ?role + ?activity ?activityName + ?activityLabel + ?awardedBy + ?adminedBy + ?awardedByLabel + ?adminedByLabel + ?dateTimeStartRole ?dateTimeEndRole + ?dateTimeStartGrant ?dateTimeEndGrant + ?hideThis + WHERE { + + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity rdfs:label ?activityLabel . + LET (?activityName := afn:localname(?activity)) + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:assignedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + OPTIONAL { ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } + OPTIONAL { ?role core:hideFromDisplay ?hideThis } + } ORDER BY DESC(?dateTimeEndRole) DESC(?dateTimeStartRole) DESC(?dateTimeEndGrant) DESC(?dateTimeStartGrant) ?activityLabel ?activityName + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + 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 . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityLabel . + ?activity core:assignedBy ?awardedBy . + ?awardedBy rdfs:label ?awardedByLabel . + ?activity core:relates ?adminedByRole . + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy rdfs:label ?adminedByLabel + } WHERE { + { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + } UNION { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity rdfs:label ?activityLabel + } UNION { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?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:relates ?adminedByRole . + ?adminedByRole a core:AdminsitratorRole. + ?adminedByRole <http://purl.obolibrary.org/obo/RO_0000052> ?adminedBy . + ?adminedBy a foaf:Organization . + ?adminedBy rdfs:label ?adminedByLabel + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } WHERE { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:start ?dateTimeStartValueRole . + ?dateTimeStartValueRole core:dateTime ?dateTimeStartRole + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } WHERE { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role core:dateTimeInterval ?dateTimeIntervalRole . + ?dateTimeIntervalRole core:end ?dateTimeEndValueRole . + ?dateTimeEndValueRole core:dateTime ?dateTimeEndRole + } + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } WHERE { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:start ?dateTimeStartValueGrant . + ?dateTimeStartValueGrant core:dateTime ?dateTimeStartGrant + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } WHERE { + ?subject ?property ?role . + ?role a core:PrincipalInvestigatorRole . + ?role <http://vivoweb.org/ontology/core#relatedBy> ?activity . + ?activity a core:Grant . + ?activity core:dateTimeInterval ?dateTimeIntervalGrant . + ?dateTimeIntervalGrant core:end ?dateTimeEndValueGrant . + ?dateTimeEndValueGrant core:dateTime ?dateTimeEndGrant + } + + + + diff --git a/productMods/config/listViewConfig-hasReviewerRole.xml b/productMods/config/listViewConfig-hasReviewerRole.xml index e65fcada..b812a5b2 100644 --- a/productMods/config/listViewConfig-hasReviewerRole.xml +++ b/productMods/config/listViewConfig-hasReviewerRole.xml @@ -22,18 +22,20 @@ ?subject ?property ?role OPTIONAL { ?role core:roleContributesTo ?activity . - ?activity vitro:mostSpecificType ?subclass - OPTIONAL { ?activity rdfs:label ?activityName } - OPTIONAL { ?subclass rdfs:label ?subclassLabel } - } + ?activity rdfs:label ?activityName . + } - OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?role core:roleContributesTo ?activity . + ?activity vitro:mostSpecificType ?subclass . + ?subclass rdfs:label ?subclassLabel + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityName @@ -60,20 +62,11 @@ ?subject ?property ?role . ?role a core:ReviewerRole . ?role vitro:mostSpecificType ?roleSubclass - } UNION { - ?subject ?property ?role . - ?role a core:ReviewerRole . - ?role core:roleContributesTo ?activity } UNION { ?subject ?property ?role . ?role a core:ReviewerRole . ?role core:roleContributesTo ?activity . ?activity rdfs:label ?activityName . - } UNION { - ?subject ?property ?role . - ?role a core:ReviewerRole . - ?role core:roleContributesTo ?activity . - ?activity vitro:mostSpecificType ?subclass } UNION { ?subject ?property ?role . ?role a core:ReviewerRole . diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml index 5e4a4e1b..46a53d9f 100644 --- a/productMods/config/listViewConfig-hasRole.xml +++ b/productMods/config/listViewConfig-hasRole.xml @@ -23,7 +23,6 @@ WHERE { ?subject ?property ?role . ?role a ?objectType . - ?role vitro:mostSpecificType ?roleSubclass OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . ?activity rdfs:label ?activityLabel @@ -46,25 +45,15 @@ ?activity vitro:mostSpecificType ?subclass } - - OPTIONAL { ?role core:relatedBy ?activity . - ?activity rdfs:label ?activityLabel - - - ?activity vitro:mostSpecificType ?subclass - - } OPTIONAL { ?role rdfs:label ?roleLabel } - OPTIONAL { ?role core:hideFromDisplay ?hideThis } - OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } - FILTER ( ?objectType = ?roleSubclass ) } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName @@ -84,22 +73,6 @@ } - - 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:relatedBy ?activity . - ?activity vitro:mostSpecificType ?subclass . - } WHERE { - ?subject ?property ?role . - ?role core:relatedBy ?activity . - ?activity vitro:mostSpecificType ?subclass - } - - PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -141,26 +114,27 @@ ?activity rdfs:label ?activityName } WHERE { { - ?subject ?property ?role + ?subject ?property ?role . + ?role a ?objectType . } UNION { ?subject ?property ?role . + ?role a ?objectType . ?role ?roleProperty ?roleValue } UNION { ?subject ?property ?role . + ?role a ?objectType . ?role core:relates ?activity . ?activity rdfs:label ?activityName } UNION { ?subject ?property ?role . + ?role a ?objectType . ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . ?activity rdfs:label ?activityName } UNION { ?subject ?property ?role . + ?role a ?objectType . ?role core:roleContributesTo ?activity . ?activity rdfs:label ?activityName - } UNION { - ?subject ?property ?role . - ?role core:relatedBy ?activity . - ?activity rdfs:label ?activityName } } diff --git a/productMods/config/listViewConfig-informationResourceInAuthorship.xml b/productMods/config/listViewConfig-informationResourceInAuthorship.xml index 343609b0..d02b328a 100644 --- a/productMods/config/listViewConfig-informationResourceInAuthorship.xml +++ b/productMods/config/listViewConfig-informationResourceInAuthorship.xml @@ -18,30 +18,22 @@ ?subject ?property ?authorship . OPTIONAL { ?authorship core:rank ?rank } OPTIONAL { ?authorship core:relates ?person . - ?person a foaf:Person . - ?person rdfs:label ?personName - - OPTIONAL { ?person vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf foaf:Person - } - + ?person a foaf:Person . + ?person rdfs:label ?personName + + OPTIONAL { ?authorship core:relates ?person . + ?person a foaf:Person . + ?person vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf foaf:Person + } + } FILTER ( bound(?person) ) } ORDER BY ?subclass ?rank ?personName - - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX foaf: <http://xmlns.com/foaf/0.1/> - CONSTRUCT { - ?subclass rdfs:subClassOf foaf:Person - } WHERE { - ?subclass rdfs:subClassOf foaf:Person - } - - + PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -54,7 +46,8 @@ ?authorship core:relates ?person . ?person a foaf:Person . ?person rdfs:label ?personName . - ?person vitro:mostSpecificType ?subclass + ?person vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf foaf:Person } WHERE { { ?subject ?property ?authorship . @@ -75,7 +68,8 @@ ?authorship core:relates ?person . ?person a foaf:Person . ?person rdfs:label ?personName . - ?person vitro:mostSpecificType ?subclass + ?person vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf foaf:Person } } diff --git a/productMods/config/listViewConfig-informationResourceInEditorship.xml b/productMods/config/listViewConfig-informationResourceInEditorship.xml index 7bd6b34f..e5fc3a01 100644 --- a/productMods/config/listViewConfig-informationResourceInEditorship.xml +++ b/productMods/config/listViewConfig-informationResourceInEditorship.xml @@ -18,30 +18,22 @@ ?subject ?property ?editorship . OPTIONAL { ?editorship core:rank ?rank } OPTIONAL { ?editorship core:relates ?person . - ?person a foaf:Person . - ?person rdfs:label ?personName - - OPTIONAL { ?person vitro:mostSpecificType ?subclass . - ?subclass rdfs:subClassOf foaf:Person - } - - } + ?person a foaf:Person . + ?person rdfs:label ?personName + } + + OPTIONAL { ?editorship core:relates ?person . + ?person a foaf:Person . + ?person vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf foaf:Person + } + FILTER ( bound(?person) ) } ORDER BY ?subclass ?rank ?personName - - PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> - PREFIX foaf: <http://xmlns.com/foaf/0.1/> - CONSTRUCT { - ?subclass rdfs:subClassOf foaf:Person - } WHERE { - ?subclass rdfs:subClassOf foaf:Person - } - - PREFIX core: <http://vivoweb.org/ontology/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> @@ -54,7 +46,8 @@ ?editorship core:relates ?person . ?person a foaf:Person . ?person rdfs:label ?personName . - ?person vitro:mostSpecificType ?subclass + ?person vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf foaf:Person } WHERE { { ?subject ?property ?editorship . @@ -75,7 +68,8 @@ ?editorship core:relates ?person . ?person a foaf:Person . ?person rdfs:label ?personName . - ?person vitro:mostSpecificType ?subclass + ?person vitro:mostSpecificType ?subclass . + ?subclass rdfs:subClassOf foaf:Person } } diff --git a/productMods/config/listViewConfig-issuedCredential.xml b/productMods/config/listViewConfig-issuedCredential.xml index 349187ad..c5a5d54f 100644 --- a/productMods/config/listViewConfig-issuedCredential.xml +++ b/productMods/config/listViewConfig-issuedCredential.xml @@ -27,27 +27,25 @@ ?subject ?property ?issuedCredential . ?issuedCredential a core:IssuedCredential . LET (?issuedCredentialLocal := afn:localname(?issuedCredential)) - OPTIONAL { ?issuedCredential rdfs:label ?issuedCredentialLabel } + OPTIONAL {?issuedCredential rdfs:label ?issuedCredentialLabel } OPTIONAL { ?issuedCredential core:relates ?credential . ?credential a core:Credential . + ?credential core:relatedBy ?issuedCredential . + ?credential rdfs:label ?credentialLabel . LET (?credentialLocal := afn:localname(?credential)) - ?credential core:relatedBy ?issuedCredential - OPTIONAL { ?credential rdfs:label ?credentialLabel } - } - OPTIONAL { ?issuedCredential core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - } - OPTIONAL { ?issuedCredential core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } - } - OPTIONAL { ?issuedCredential core:dateIssued ?dateTimeValue - OPTIONAL { ?dateTimeValue core:dateTime ?dateTime } - } - } ORDER BY DESC(?dateTime) DESC(?dateTimeEnd) + } + OPTIONAL { ?issuedCredential core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?issuedCredential core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + OPTIONAL { ?issuedCredential core:dateIssued ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } + } ORDER BY DESC(?dateTime) DESC(?dateTimeEnd) diff --git a/productMods/config/listViewConfig-organizationForPosition.xml b/productMods/config/listViewConfig-organizationForPosition.xml index a49f0889..d76b0976 100644 --- a/productMods/config/listViewConfig-organizationForPosition.xml +++ b/productMods/config/listViewConfig-organizationForPosition.xml @@ -29,16 +29,15 @@ OPTIONAL { ?position rdfs:label ?positionTitle } OPTIONAL { ?position core:hideFromDisplay ?hideThis } - OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } # Get current positions only: end date is either null or not in the past - } - # NOT EXISTS { ?position core:hideFromDisplay ?hideThis } FILTER ( !bound(?dateTimeEnd) || afn:substring(str(?dateTimeEnd), 0, 4) >= afn:substring(str(afn:now()), 0, 4) ) 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-personInPosition.xml b/productMods/config/listViewConfig-personInPosition.xml index 6922110b..6438f459 100644 --- a/productMods/config/listViewConfig-personInPosition.xml +++ b/productMods/config/listViewConfig-personInPosition.xml @@ -19,27 +19,33 @@ ?org ?orgName ?middleOrg ?middleOrgName ?outerOrg ?outerOrgName - ?dateTimeStart ?dateTimeEnd WHERE { - ?subject ?property ?position + ?dateTimeStart ?dateTimeEnd + WHERE { + ?subject ?property ?position . OPTIONAL { ?position core:relates ?org . ?org rdfs:label ?orgName - OPTIONAL { ?org obo:BFO_0000050 ?middleOrg . - ?middleOrg rdfs:label ?middleOrgName - OPTIONAL { ?middleOrg obo:BFO_0000050 ?outerOrg . - ?outerOrg rdfs:label ?outerOrgName - } - } + } + OPTIONAL { ?position core:relates ?org . + ?org rdfs:label ?orgName . + ?org obo:BFO_0000050 ?middleOrg . + ?middleOrg rdfs:label ?middleOrgName + } + OPTIONAL { ?position core:relates ?org . + ?org rdfs:label ?orgName . + ?org obo:BFO_0000050 ?middleOrg . + ?middleOrg obo:BFO_0000050 ?outerOrg . + ?outerOrg rdfs:label ?outerOrgName } OPTIONAL { ?position rdfs:label ?positionTitle } OPTIONAL { ?position core:hrJobTitle ?hrJobTitle } OPTIONAL { ?position core:rank ?rank } - OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } OPTIONAL { ?position vitro:mostSpecificType ?subclass . @@ -75,7 +81,6 @@ PREFIX obo: <http://purl.obolibrary.org/obo/> CONSTRUCT { ?subject ?property ?position . - ?position a core:Position . ?position ?positionProperty ?positionValue . ?org rdfs:label ?orgName . ?org obo:BFO_0000050 ?middleOrg . @@ -86,14 +91,7 @@ { ?subject ?property ?position . ?position a core:Position . - } UNION { - ?subject ?property ?position . - ?position a core:Position . ?position ?positionProperty ?positionValue - } UNION { - ?subject ?property ?position . - ?position a core:Position . - ?position core:rank ?rank } UNION { ?subject ?property ?position . ?position a core:Position . @@ -105,12 +103,6 @@ ?position a core:Position . ?position core:relates ?org . ?org a foaf:Organization . - ?org obo:BFO_0000050 ?middleOrg - } UNION { - ?subject ?property ?position . - ?position a core:Position . - ?position core:relates ?org . - ?org a foaf:Organization . ?org obo:BFO_0000050 ?middleOrg . ?middleOrg rdfs:label ?middleOrgName } UNION { @@ -119,13 +111,6 @@ ?position core:relates ?org . ?org a foaf:Organization . ?org obo:BFO_0000050 ?middleOrg . - ?middleOrg obo:BFO_0000050 ?outerOrg - } UNION { - ?subject ?property ?position . - ?position a core:Position . - ?position core:positionInOrganization ?org . - ?org a foaf:Organization . - ?org obo:BFO_0000050 ?middleOrg . ?middleOrg obo:BFO_0000050 ?outerOrg . ?outerOrg rdfs:label ?outerOrgName } @@ -136,28 +121,22 @@ PREFIX core: <http://vivoweb.org/ontology/core#> CONSTRUCT { ?subject ?property ?position . - ?position a core:Position . ?position core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeStartValue core:dateTime ?dateTimeStart . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } WHERE { ?subject ?property ?position . ?position a core:Position . ?position core:dateTimeInterval ?dateTimeInterval . ?dateTimeInterval core:start ?dateTimeStartValue . ?dateTimeStartValue core:dateTime ?dateTimeStart . - ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } - + diff --git a/productMods/config/listViewConfig-preferredTitle.xml b/productMods/config/listViewConfig-preferredTitle.xml index c592fbb9..fc26114c 100644 --- a/productMods/config/listViewConfig-preferredTitle.xml +++ b/productMods/config/listViewConfig-preferredTitle.xml @@ -12,8 +12,8 @@ ?preferredTitle WHERE { ?subject ?property ?vcard . - ?vcard vcard:hasTitle ?title - OPTIONAL { ?title vcard:title ?preferredTitle } + ?vcard vcard:hasTitle ?title . + ?title vcard:title ?preferredTitle } diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index 86460c02..fa9f6b17 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -3,8 +3,6 @@ - @@ -30,23 +28,27 @@ http://vivoweb.org/ontology/core#realizedRole and http://vivoweb.org/ontology/co # We need ?subclass in the uncollated query to get the roleTypeLabel # for roles that have no label. - OPTIONAL { ?role vitro:mostSpecificType ?subclass . - OPTIONAL { ?subclass rdfs:label ?roleTypeLabel } - OPTIONAL { ?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole - OPTIONAL { ?indivInRole rdfs:label ?indivLabel } - } - OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000055> ?indivInRole - OPTIONAL { ?indivInRole rdfs:label ?indivLabel } - } + OPTIONAL { ?role vitro:mostSpecificType ?subclass . } + OPTIONAL { ?role vitro:mostSpecificType ?subclass . + ?subclass rdfs:label ?roleTypeLabel + } + OPTIONAL { ?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole } + OPTIONAL { ?role <http://purl.obolibrary.org/obo/RO_0000052> ?indivInRole . + ?indivInRole rdfs:label ?indivLabel + } + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000055> ?indivInRole . + } + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000055> ?indivInRole . + ?indivInRole rdfs:label ?indivLabel } - OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval - OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart - } - OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd - } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } FILTER ( bound(?indivInRole) ) diff --git a/productMods/config/listViewConfig-researchActivities.xml b/productMods/config/listViewConfig-researchActivities.xml new file mode 100644 index 00000000..1e401b95 --- /dev/null +++ b/productMods/config/listViewConfig-researchActivities.xml @@ -0,0 +1,157 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + 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#> + + SELECT DISTINCT ?subclass + # send the property to the template, since this view supports multiple role properties + ?property + ?role + ?roleLabel + ?activity ?activityName + ?activityLabel + ?dateTimeStart ?dateTimeEnd + ?hideThis + ?objectType + WHERE { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role vitro:mostSpecificType ?roleSubclass + + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityLabel + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role core:relatedBy ?activity . + ?activity rdfs:label ?activityLabel + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:hideFromDisplay ?hideThis } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + FILTER ( ?roleSubclass = core:ResearcherRole) + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName + + + + 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 a core:ResearcherRole . + ?role core:relatedBy ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role core:relatedBy ?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 a core:ResearcherRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity vitro:mostSpecificType ?subclass + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityName + } WHERE { + { + ?subject ?property ?role . + ?role a core:ResearcherRole . + } UNION { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role core:relatedBy ?activity . + ?activity rdfs:label ?activityName + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role a core:ResearcherRole . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + diff --git a/productMods/config/listViewConfig-researchAreaOf.xml b/productMods/config/listViewConfig-researchAreaOf.xml index 3a161ec8..b40b84d7 100644 --- a/productMods/config/listViewConfig-researchAreaOf.xml +++ b/productMods/config/listViewConfig-researchAreaOf.xml @@ -26,14 +26,19 @@ ?subject ?property ?person . OPTIONAL { ?person core:relatedBy ?position . ?position a core:Position - OPTIONAL { ?position rdfs:label ?posnLabel } + } + OPTIONAL { ?person core:relatedBy ?position . + ?position a core:Position . + ?position rdfs:label ?posnLabel } OPTIONAL { ?person rdfs:label ?personName } OPTIONAL { ?person obo:ARG_2000028 ?vcard . ?vcard vcard:hasTitle ?titleObj . ?titleObj vcard:title ?title } - OPTIONAL { ?position core:relates ?org . + OPTIONAL { ?person core:relatedBy ?position . + ?position a core:Position . + ?position core:relates ?org . ?org a foaf:Organization . ?org rdfs:label ?orgLabel } diff --git a/productMods/config/listViewConfig-roleContributesTo.xml b/productMods/config/listViewConfig-roleContributesTo.xml new file mode 100644 index 00000000..6cc74045 --- /dev/null +++ b/productMods/config/listViewConfig-roleContributesTo.xml @@ -0,0 +1,133 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + 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#> + + SELECT DISTINCT ?subclass + # send the property to the template, since this view supports multiple role properties + ?property + ?role + ?roleLabel + ?activity ?activityName + ?activityLabel + ?dateTimeStart ?dateTimeEnd + ?hideThis + ?objectType + WHERE { + ?subject ?property ?role . + ?role a ?objectType . + + OPTIONAL { ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityLabel + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName + + + + 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 a ?objectType . + ?role core:roleContributesTo ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role a ?objectType . + ?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#> + CONSTRUCT { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityName + } WHERE { + { + ?subject ?property ?role . + ?role a ?objectType . + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:relates ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + diff --git a/productMods/config/listViewConfig-roleRealizedIn.xml b/productMods/config/listViewConfig-roleRealizedIn.xml new file mode 100644 index 00000000..a57e828a --- /dev/null +++ b/productMods/config/listViewConfig-roleRealizedIn.xml @@ -0,0 +1,133 @@ + + + + + + + + PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> + 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#> + + SELECT DISTINCT ?subclass + # send the property to the template, since this view supports multiple role properties + ?property + ?role + ?roleLabel + ?activity ?activityName + ?activityLabel + ?dateTimeStart ?dateTimeEnd + ?hideThis + ?objectType + WHERE { + ?subject ?property ?role . + ?role a ?objectType . + + OPTIONAL { ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityLabel + + + ?activity vitro:mostSpecificType ?subclass + + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?activityLabel ?activityName + + + + 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 a ?objectType . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity vitro:mostSpecificType ?subclass . + } WHERE { + ?subject ?property ?role . + ?role a ?objectType . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity vitro:mostSpecificType ?subclass + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue . + ?activity rdfs:label ?activityName + } WHERE { + { + ?subject ?property ?role . + ?role a ?objectType . + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:relates ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role <http://purl.obolibrary.org/obo/BFO_0000054> ?activity . + ?activity rdfs:label ?activityName + } UNION { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:roleContributesTo ?activity . + ?activity rdfs:label ?activityName + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role a ?objectType . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + + 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/counter.jsp b/productMods/counter.jsp index 0b8de8a7..59be7457 100644 --- a/productMods/counter.jsp +++ b/productMods/counter.jsp @@ -1,434 +1,456 @@ -<%-- $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

    - - - - - - - - - - - - - - - - - - - - -
    +<%-- $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" %> +<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.ModelAccess"%> +<% request.setAttribute("jenaOntModel", ModelAccess.on(getServletContext()).getJenaOntModel()); %> + +
    + +

    Linkage Information

    + + + + + + + + + + + + + + + + + + + + +
    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/body/accounts/userAccounts-acctCreatedEmail.ftl b/productMods/templates/freemarker/body/accounts/userAccounts-acctCreatedEmail.ftl deleted file mode 100644 index 25226e78..00000000 --- a/productMods/templates/freemarker/body/accounts/userAccounts-acctCreatedEmail.ftl +++ /dev/null @@ -1,64 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#-- Confirmation that an account has been created. --> - -<#assign subject = "${i18n().account_created_subject(siteName)}" /> - -<#assign html> - - - ${subject} - - -

    - ${userAccount.firstName} ${userAccount.lastName} -

    - -

    - ${i18n().congratulations} -

    - -

    - ${i18n().we_have_created_your_account(siteName,userAccount.emailAddress)} -

    - -

    - ${i18n().did_not_request_text} -

    - -

    - ${i18n().click_to_create_password} -

    - -

    - ${passwordLink} -

    - -

    - ${i18n().if_link_failed} -

    - -

    - ${i18n().thanks} -

    - - - - -<#assign text> -${userAccount.firstName} ${userAccount.lastName} - -${i18n().congratulations} - -${i18n().we_have_created_your_account(siteName,userAccount.emailAddress)} - -${i18n().did_not_request_text} - -${i18n().paste_the_link} - -${passwordLink} - -${i18n().thanks} - - -<@email subject=subject html=html text=text /> \ No newline at end of file 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 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-grantAdministeredBy.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-grantAdministeredBy.ftl new file mode 100644 index 00000000..08cd3d98 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-grantAdministeredBy.ftl @@ -0,0 +1,26 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- + + 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. + --> +<#import "lib-sequence.ftl" as s> +<#import "lib-datetime.ftl" as dt> +<@showAdministrator statement /> + +<#-- Use a macro to keep variable assignments local; otherwise the values carry over to the + next statement --> +<#macro showAdministrator statement> + + <#local linkedIndividual> + <#if statement.organization??> + ${statement.organizationLabel!""} + <#else> + ${i18n().missing_organization} + + + + ${linkedIndividual!} + + 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 0c19e9b4..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. @@ -16,7 +16,7 @@ <#macro showRole statement> <#local linkedIndividual> <#if statement.presentation??> - ${statement.presentationLabel!statement.presentationName} + ${statement.presentationLabel!statement.presentationName!""} <#else> <#-- This shouldn't happen, but we must provide for it --> ${i18n().missing_presentation} 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-issuedCredential.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-issuedCredential.ftl index 1b12358a..0f3c9398 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-issuedCredential.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-issuedCredential.ftl @@ -17,7 +17,7 @@ <#if statement.credential??> ${statement.credentialLabel!statement.issuedCredentialLabel!statement.credentialLocal!} <#else> - ${statement.issuedCredentialLabel!"missing credential"} + ${statement.issuedCredentialLabel!"${i18n().missing_credential}"} diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-mailingAddress.ftl index f5a45eec..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. @@ -13,9 +13,17 @@ <#macro showAddress statement> <#if statement.street?has_content> -

    - ${statement.street} -

    + <#if statement.street?contains(";") > + <#list statement.street?split("; ") as lines> +

    + ${lines} +

    + + <#else> +

    + ${statement.street} +

    + <#if ( statement.country?has_content && (statement.country == "US" || statement.country?contains("United States") || statement.country?contains("U.S.") || statement.country?contains("U.S.A.") || statement.country?contains("USA")))> @@ -23,7 +31,7 @@ <#local cityStateZip><@s.join [ cityState!, statement.postalCode!], " " /> <#if cityStateZip?has_content>

    ${cityStateZip}

    -

    ${statement.country!}

    +

    ${statement.country!}

    <#else> <#if statement.locality?has_content> @@ -42,7 +50,7 @@

    <#if statement.country?has_content> -

    +

    ${statement.country}

    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..711d2ee7 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. @@ -19,18 +19,20 @@ ${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> <#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/addAssociatedConcept.ftl b/productMods/templates/freemarker/edit/forms/addAssociatedConcept.ftl index ee613943..fe1f81c6 100644 --- a/productMods/templates/freemarker/edit/forms/addAssociatedConcept.ftl +++ b/productMods/templates/freemarker/edit/forms/addAssociatedConcept.ftl @@ -66,6 +66,9 @@
    <#if existingConcept.vocabURI?has_content && existingConcept.vocabLabel?has_content> ${existingConcept.vocabLabel} + <#else> +   + <#--We still want the column to be there even if no vocabulary source is present-->
    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/addConceptThroughObjectPropertyAutoComplete.ftl b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyAutoComplete.ftl new file mode 100644 index 00000000..9d92cefa --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyAutoComplete.ftl @@ -0,0 +1,145 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#--Assign variables from editConfig--> +<#assign rangeOptions = editConfiguration.pageData.objectVar /> +<#-- +<#assign rangeOptionsExist = false /> +<#if (rangeOptions?keys?size > 0)> + <#assign rangeOptionsExist = true/> + + --> + +<#assign rangeOptionsExist = true /> + +<#assign objectTypes = editConfiguration.pageData.objectTypes /> +<#assign objectTypesSize = objectTypes?length /> +<#assign objectTypesExist = false /> +<#assign multipleTypes = false /> +<#if (objectTypesSize > 1)> + <#assign objectTypesExist = true /> + +<#if objectTypes?contains(",")> + <#assign multipleTypes = true/> + +<#assign sparqlForAcFilter = editConfiguration.pageData.sparqlForAcFilter /> +<#assign editMode = editConfiguration.pageData.editMode /> +<#assign propertyNameForDisplay = "" /> +<#if editConfiguration.objectPropertyNameForDisplay?has_content> + <#assign propertyNameForDisplay = editConfiguration.objectPropertyNameForDisplay /> + +<#if editMode = "edit" > + <#assign titleVerb = "${i18n().edit_capitalized}" /> + <#assign objectLabel = editConfiguration.pageData.objectLabel /> + <#assign selectedObjectUri = editConfiguration.objectUri /> + <#assign submitButtonText = "${i18n().save_button}" /> +<#else> + <#assign titleVerb = "${i18n().add_capitalized}" > + <#assign objectLabel = "" /> + <#assign selectedObjectUri = ""/> + <#assign submitButtonText = "${i18n().create_entry}" /> + + +<#if editConfiguration.formTitle?contains("collaborator") > + <#assign formTitle = "${i18n().select_existing_collaborator(editConfiguration.subjectName)}" /> +<#else> + <#assign formTitle = editConfiguration.formTitle /> + +<#--In order to fill out the subject--> +<#assign acFilterForIndividuals = "['" + editConfiguration.subjectUri + "']" /> + +

    ${formTitle}

    + +<#if editConfiguration.propertySelectFromExisting = true> + <#if rangeOptionsExist = true > +
    + + <#if editConfiguration.propertyPublicDescription?has_content> +

    ${editConfiguration.propertyPublicDescription}

    + + + <#---This section should become autocomplete instead--> +

    + + +

    + +
    +

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

    + +
    + + <#--The above section should be autocomplete--> + +

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

    +
    + <#else> +

    ${i18n().there_are_no_entries_for_selection}

    + + +

     

    +<#if editConfiguration.propertyOfferCreateNewOption = true> +<#include "addConceptThroughObjectPropertyCreateNew.ftl"> + + + +<#if editConfiguration.propertySelectFromExisting = false && editConfiguration.propertyOfferCreateNewOption = false> +

    ${i18n().editing_prohibited}

    + + + +<#if editConfiguration.includeDeletionForm = true> +<#include "defaultDeletePropertyForm.ftl"> + + + +<#assign sparqlQueryUrl = "${urls.base}/ajax/sparqlQuery" > +<#--Passing in object types only if there are any types returned, otherwise +the parameter should not be passed at all to the solr search. +Also multiple types parameter set to true only if more than one type returned--> + +<#-- + edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AutocompleteObjectPropertyFormGenerator + edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddAttendeeRoleToPersonGenerator +--> + +${stylesheets.add('')} + ${stylesheets.add('')} + ${stylesheets.add('')} + + + ${scripts.add('', + '', + '', + '')} diff --git a/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyCreateNew.ftl b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyCreateNew.ftl new file mode 100644 index 00000000..9efc361b --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyCreateNew.ftl @@ -0,0 +1,35 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#--Overriding default form here to allow just concepts to show in the list--> + + <#if rangeOptionsExist = true > +

    ${i18n().no_appropriate_entry}:

    + <#else> +

    ${i18n().create_new_entry}

    + + + <#if editConfiguration.objectUri?has_content> + <#assign objectUri = editConfiguration.objectUri> + <#else> + <#assign objectUri = ""/> + + + <#assign typesList = editConfiguration.pageData.createNewTypes/> +
    + + + + + + + + + <#if rangeOptionsExist = false > + ${i18n().or} + ${i18n().cancel_link} + +
    \ No newline at end of file diff --git a/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyForm.ftl b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyForm.ftl new file mode 100644 index 00000000..89b5ddc4 --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyForm.ftl @@ -0,0 +1,49 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#--Assign variables from editConfig--> +<#assign rangeOptions = editConfiguration.pageData.objectVar /> +<#assign rangeOptionsExist = false /> +<#if (rangeOptions?keys?size > 0)> + <#assign rangeOptionsExist = true/> + + +

    ${editConfiguration.formTitle}

    + +<#if editConfiguration.propertySelectFromExisting = true> + <#if rangeOptionsExist = true > + <#assign rangeOptionKeys = rangeOptions?keys /> +
    + + <#if editConfiguration.propertyPublicDescription?has_content> +

    ${editConfiguration.propertyPublicDescription}

    + + + +

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

    +
    + <#else> +

    ${i18n().there_are_no_entries_for_selection}

    + + + +<#if editConfiguration.propertyOfferCreateNewOption = true> +<#include "addConceptThroughObjectPropertyCreateNew.ftl"> + + +<#if editConfiguration.propertySelectFromExisting = false && editConfiguration.propertyOfferCreateNewOption = false> +

    ${i18n().editing_prohibited}

    + + + +<#if editConfiguration.includeDeletionForm = true> +<#include "defaultDeletePropertyForm.ftl"> + + diff --git a/productMods/templates/freemarker/edit/forms/addFullNameToPerson.ftl b/productMods/templates/freemarker/edit/forms/addFullNameToPerson.ftl index 3956993c..23a3f0ea 100644 --- a/productMods/templates/freemarker/edit/forms/addFullNameToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addFullNameToPerson.ftl @@ -65,13 +65,13 @@

    - +

    - +

    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/addOrcidIdToPerson.ftl b/productMods/templates/freemarker/edit/forms/addOrcidIdToPerson.ftl index eca559a1..b52c52fd 100644 --- a/productMods/templates/freemarker/edit/forms/addOrcidIdToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addOrcidIdToPerson.ftl @@ -58,7 +58,8 @@

    - + +

    diff --git a/productMods/templates/freemarker/edit/forms/grantAdministeredBy.ftl b/productMods/templates/freemarker/edit/forms/grantAdministeredBy.ftl new file mode 100644 index 00000000..dfba927f --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/grantAdministeredBy.ftl @@ -0,0 +1,136 @@ +<#-- $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> + +<#--Retrieve certain edit configuration information--> +<#if editConfiguration.objectUri?has_content> + <#assign editMode = "edit"> +<#else> + <#assign editMode = "add"> + + +<#--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" /> + +<#assign htmlForElements = editConfiguration.pageData.htmlForElements /> + +<#--Retrieve variables needed--> +<#assign existingOrgValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "existingOrganization") /> +<#assign orgLabelValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabel") /> +<#assign orgLabelDisplayValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "orgLabelDisplay") /> + +<#--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"> + <#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 = " *" /> + +

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

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

    + + + +

    + +
    +

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

    + +
    + <#assign htmlForElements = editConfiguration.pageData.htmlForElements /> + + + +

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

    + +

    * ${i18n().required_fields}

    + + + + + + + + +${stylesheets.add('')} +${stylesheets.add('')} +${stylesheets.add('')} + +${scripts.add('', + '', + '', + '', + '', + '')} + + + diff --git a/productMods/templates/freemarker/edit/forms/js/addOrcidIdToPersonUtils.js b/productMods/templates/freemarker/edit/forms/js/addOrcidIdToPersonUtils.js index 5a9cffad..b979c348 100644 --- a/productMods/templates/freemarker/edit/forms/js/addOrcidIdToPersonUtils.js +++ b/productMods/templates/freemarker/edit/forms/js/addOrcidIdToPersonUtils.js @@ -12,6 +12,7 @@ var addOrcidIdToPersonUtils = { this.form = $('#personHasOrcidId'); this.orcidId = $('#orcidId'); + this.orcidIdDisplay = $('#orcidIdDisplay'); }, @@ -25,10 +26,10 @@ var addOrcidIdToPersonUtils = { buildOrcidIdURL: function() { - var orcidBase = "http://www.orcid.org/"; + var orcidBase = "http://orcid.org/"; var orcidIdVal = ""; - if ( this.orcidId.val().length > 0 ) { - orcidIdVal = orcidBase + this.orcidId.val(); + if ( this.orcidIdDisplay.val().length > 0 ) { + orcidIdVal = orcidBase + this.orcidIdDisplay.val(); this.orcidId.val(orcidIdVal); } }, diff --git a/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js b/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js new file mode 100644 index 00000000..43648028 --- /dev/null +++ b/productMods/templates/freemarker/edit/forms/js/mailingAddressUtils.js @@ -0,0 +1,60 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + + +var mailingAddressUtils = { + + onLoad: function(editMode) { + this.initObjectReferences(); + this.bindEventListeners(); + + if ( editMode != "add" ) { + this.setStreetAddressDisplayFields(); + } + + this.setAddressFieldsIfErrors(); + }, + + initObjectReferences: function() { + + this.form = $('#personHasMailingAddress'); + 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 = {}; + + this.form.submit(function() { + mailingAddressUtils.setStreetAddressField(); + }); + + }, + + // the vcard only has one address field, so combine the two + // displayed addresses into the hidden field which gets asserted in the N3 + setStreetAddressField: function() { + var tempString = this.street1.val() + "; " + this.street2.val(); + this.streetAddress.val(tempString); + }, + + // in edit mode, take the asserted streetAddress value and parse it into + // the two displayed address fields + setStreetAddressDisplayFields: function() { + var tempString = this.streetAddress.val(); + var lineOne = tempString.substring(0,tempString.lastIndexOf(";")); + var lineTwo = tempString.substring(tempString.lastIndexOf(";") + 2); + + this.street1.val(lineOne); + this.street2.val(lineTwo); + } + +} \ 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/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/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/productMods/templates/freemarker/edit/forms/personHasIssuedCredential.ftl b/productMods/templates/freemarker/edit/forms/personHasIssuedCredential.ftl index d542fd2d..b921ebcf 100644 --- a/productMods/templates/freemarker/edit/forms/personHasIssuedCredential.ftl +++ b/productMods/templates/freemarker/edit/forms/personHasIssuedCredential.ftl @@ -53,7 +53,7 @@ Set this flag on the input acUriReceiver where you would like this behavior to o <#assign requiredHint = " *" /> <#assign yearHint = "(${i18n().year_hint_format})" /> -

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

    +

    ${titleVerb} ${i18n().credentials} ${i18n().for} ${editConfiguration.subjectName}

    <#--Display error messages if any--> <#if submissionErrors?has_content> diff --git a/productMods/templates/freemarker/edit/forms/subjectHasMailingAddress.ftl b/productMods/templates/freemarker/edit/forms/subjectHasMailingAddress.ftl index 99236069..e44041ea 100644 --- a/productMods/templates/freemarker/edit/forms/subjectHasMailingAddress.ftl +++ b/productMods/templates/freemarker/edit/forms/subjectHasMailingAddress.ftl @@ -68,13 +68,19 @@
    -
    +

    - - + +

    +

    + + + +

    +

    @@ -107,6 +113,12 @@

    + + ${stylesheets.add('')} ${stylesheets.add('')} @@ -114,6 +126,7 @@ ${stylesheets.add('', '', + '', '', '')} 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/PropertyConfig.n3 b/rdf/display/everytime/PropertyConfig.n3 index 0ae8434d..77869e28 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 ; @@ -40,7 +41,7 @@ local:organizationForPositionConfig a :ObjectPropertyDisplayConfig ; :displayName "people" ; :listViewConfigFile "listViewConfig-organizationForPosition.xml"^^xsd:string ; :propertyGroup ; - vitro:displayRankAnnot 15; + vitro:displayRankAnnot 10; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.OrganizationHasPositionHistoryGenerator"^^xsd:string . @@ -69,11 +70,12 @@ local:hasServiceProviderRoleContext a :ConfigContext ; :qualifiedBy . local:hasServiceProviderRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ; :displayName "service to the profession" ; 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 . @@ -84,11 +86,12 @@ local:hasClinicalRoleContext a :ConfigContext ; :qualifiedBy . local:hasClinicalRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-hasClinicalActivity.xml"^^xsd:string ; :displayName "clinical activities" ; 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 . @@ -99,11 +102,12 @@ local:hasLeaderRoleContext a :ConfigContext ; :qualifiedBy . local:hasLeaderRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ; :displayName "head of" ; 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 . @@ -114,11 +118,12 @@ local:hasMemberRoleContext a :ConfigContext ; :qualifiedBy . local:hasMemberRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ; :displayName "member of" ; 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 . @@ -129,11 +134,12 @@ local:hasTeacherRoleContext a :ConfigContext ; :qualifiedBy . local:hasTeacherRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ; :displayName "teaching activities" ; 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 . @@ -174,11 +182,12 @@ local:hasOrganizerRoleContext a :ConfigContext ; :qualifiedBy . local:hasOrganizerRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-roleRealizedIn.xml"^^xsd:string ; :displayName "organizer of" ; 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 . @@ -189,11 +198,12 @@ local:hasOutreachProviderRoleContext a :ConfigContext ; :qualifiedBy . local:hasOutreachProviderRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-roleContributesTo.xml"^^xsd:string ; :displayName "outreach and community service" ; 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 . @@ -219,11 +230,12 @@ local:hasResearcherRoleContext a :ConfigContext ; :qualifiedBy . local:hasResearcherRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasRole.xml"^^xsd:string ; - :displayName "research activities" ; - vitro:displayRankAnnot 15; + :listViewConfigFile "listViewConfig-researchActivities.xml"^^xsd:string ; + :displayName "other research activities" ; + 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 . @@ -249,7 +261,7 @@ local:hasPrincipalInvestigatorRoleContext a :ConfigContext ; :qualifiedBy . local:hasPrincipalInvestigatorRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasInvestigatorRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-hasPrincipalInvestigatorRole.xml"^^xsd:string ; :displayName "principal investigator on" ; vitro:displayRankAnnot 20; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; @@ -264,7 +276,7 @@ local:hasCo-PrincipalInvestigatorRoleContext a :ConfigContext ; :qualifiedBy . local:hasCo-PrincipalInvestigatorRoleConfig a :ObjectPropertyDisplayConfig ; - :listViewConfigFile "listViewConfig-hasInvestigatorRole.xml"^^xsd:string ; + :listViewConfigFile "listViewConfig-hasCoPrincipalInvestigatorRole.xml"^^xsd:string ; :displayName "co-principal investigator on" ; vitro:displayRankAnnot 25; vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; @@ -293,7 +305,7 @@ local:awardOrHonorContext a :ConfigContext ; :hasConfiguration local:awardOrHonorConfig ; :configContextFor ; :qualifiedByDomain ; - :qualifiedBy . + :qualifiedBy . local:awardOrHonorConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-awardOrHonor.xml"^^xsd:string ; @@ -316,9 +328,25 @@ 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 . +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 ; @@ -411,13 +439,29 @@ local:issuedCredentialConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.PersonHasIssuedCredentialGenerator"^^ ; :propertyGroup . +local:grantAdministeredByContext a :ConfigContext ; + :hasConfiguration local:grantAdministeredByConfig ; + :configContextFor vivo:relates ; + :qualifiedByDomain vivo:Grant ; + :qualifiedBy vivo:AdministratorRole . + +local:grantAdministeredByConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-grantAdministeredBy.xml"^^xsd:string ; + :displayName "grant administered by" ; + vitro:displayRankAnnot 1; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.GrantAdministeredByGenerator"^^ ; + :propertyGroup . + ### vcard properties ### local:mailingAddressContext a :ConfigContext ; :hasConfiguration local:mailingAddressConfig ; :configContextFor ; :qualifiedByDomain ; - :qualifiedBy . + :qualifiedBy ; + :qualifiedByRoot . local:mailingAddressConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-mailingAddress.xml"^^xsd:string ; @@ -428,13 +472,14 @@ local:mailingAddressConfig a :ObjectPropertyDisplayConfig ; vitro:customEntryFormAnnot "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.SubjectHasMailingAddressGenerator"^^ ; :propertyGroup . -local:mailingAddressContext a :ConfigContext ; - :hasConfiguration local:mailingAddressConfig ; +local:mailingAddressOrgContext a :ConfigContext ; + :hasConfiguration local:mailingAddressOrgConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . -local:mailingAddressConfig a :ObjectPropertyDisplayConfig ; +local:mailingAddressOrgConfig a :ObjectPropertyDisplayConfig ; :listViewConfigFile "listViewConfig-mailingAddress.xml"^^xsd:string ; :displayName "mailing address" ; vitro:displayRankAnnot 80; @@ -447,6 +492,7 @@ local:personTelephoneContext a :ConfigContext ; :hasConfiguration local:personTelephoneConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:personTelephoneConfig a :ObjectPropertyDisplayConfig ; @@ -462,6 +508,7 @@ local:orgTelephoneContext a :ConfigContext ; :hasConfiguration local:orgTelephoneConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:orgTelephoneConfig a :ObjectPropertyDisplayConfig ; @@ -477,6 +524,7 @@ local:personFaxContext a :ConfigContext ; :hasConfiguration local:personFaxConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:personFaxConfig a :ObjectPropertyDisplayConfig ; @@ -492,6 +540,7 @@ local:orgFaxContext a :ConfigContext ; :hasConfiguration local:orgFaxConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:orgFaxConfig a :ObjectPropertyDisplayConfig ; @@ -507,6 +556,7 @@ local:additionalEmailContext a :ConfigContext ; :hasConfiguration local:additionalEmailConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:additionalEmailConfig a :ObjectPropertyDisplayConfig ; @@ -522,6 +572,7 @@ local:primaryEmailContext a :ConfigContext ; :hasConfiguration local:primaryEmailConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:primaryEmailConfig a :ObjectPropertyDisplayConfig ; @@ -533,13 +584,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; @@ -548,13 +600,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; @@ -567,6 +652,7 @@ local:fullNameContext a :ConfigContext ; :hasConfiguration local:fullNameConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:fullNameConfig a :ObjectPropertyDisplayConfig ; @@ -582,6 +668,7 @@ local:preferredTitleContext a :ConfigContext ; :hasConfiguration local:preferredTitleConfig ; :configContextFor ; :qualifiedByDomain ; + :qualifiedByRoot ; :qualifiedBy . local:preferredTitleConfig a :ObjectPropertyDisplayConfig ; @@ -595,6 +682,34 @@ local:preferredTitleConfig a :ObjectPropertyDisplayConfig ; ### properties using default editing form ## +local:hasSubOrganizationContext a :ConfigContext ; + :hasConfiguration local:hasSubOrganizationConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:hasSubOrganizationConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ; + :displayName "has sub-organization" ; + vitro:displayRankAnnot 15; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + +local:subOrganizationWithinContext a :ConfigContext ; + :hasConfiguration local:subOrganizationWithinConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy . + +local:subOrganizationWithinConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-webpage.xml"^^xsd:string ; + :displayName "organization within" ; + vitro:displayRankAnnot 20; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + local:eventWithinContext a :ConfigContext ; :hasConfiguration local:eventWithinConfig ; :configContextFor ; @@ -603,7 +718,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 ; @@ -637,6 +752,133 @@ local:inEventSeriesConfig a :ObjectPropertyDisplayConfig ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; :propertyGroup . +local:eventLocationContext a :ConfigContext ; + :hasConfiguration local:eventLocationConfig ; + :configContextFor ; + :qualifiedByDomain ; + :qualifiedBy vivo:GeographicLocation . + +local:eventLocationConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "has geographic location" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + 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 ; + :qualifiedByDomain vivo:Course ; + :qualifiedBy . + +local:courseOfferedByConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "offered by" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + +local:orgOffersCourseContext a :ConfigContext ; + :hasConfiguration local:orgOffersCourseConfig ; + :configContextFor vivo:offers ; + :qualifiedByDomain ; + :qualifiedBy vivo:Course . + +local:orgOffersCourseConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "offers course" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + +local:collegeOffersDegreeContext a :ConfigContext ; + :hasConfiguration local:collegeOffersDegreeConfig ; + :configContextFor vivo:offers ; + :qualifiedByDomain vivo:College ; + :qualifiedBy vivo:AcademicDegree . + +local:collegeOffersDegreeConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "offers degree" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + +local:deptOffersDegreeContext a :ConfigContext ; + :hasConfiguration local:deptOffersDegreeConfig ; + :configContextFor vivo:offers ; + :qualifiedByDomain vivo:AcademicDepartment ; + :qualifiedBy vivo:AcademicDegree . + +local:deptOffersDegreeConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "offers degree" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + +local:uniOffersDegreeContext a :ConfigContext ; + :hasConfiguration local:uniOffersDegreeConfig ; + :configContextFor vivo:offers ; + :qualifiedByDomain vivo:University ; + :qualifiedBy vivo:AcademicDegree . + +local:uniOffersDegreeConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "offers degree" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + 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 ; + :qualifiedByDomain vivo:Grant ; + :qualifiedBy . + +local:grantAwardedByConfig a :ObjectPropertyDisplayConfig ; + :listViewConfigFile "listViewConfig-default.xml"^^xsd:string ; + :displayName "grant awarded by" ; + vitro:displayRankAnnot 2; + vitro:hiddenFromDisplayBelowRoleLevelAnnot role:public ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot role:public ; + :propertyGroup . + local:awardOrHonorReceiptsContext a :ConfigContext ; :hasConfiguration local:awardOrHonorReceiptsConfig ; :configContextFor ; @@ -679,6 +921,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 ; 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/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/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 ; diff --git a/rdf/tbox/filegraph/classes-additional.owl b/rdf/tbox/filegraph/classes-additional.owl index 70b15bee..8bc74eed 100644 --- a/rdf/tbox/filegraph/classes-additional.owl +++ b/rdf/tbox/filegraph/classes-additional.owl @@ -194,12 +194,6 @@ - - - - - - @@ -313,6 +307,12 @@ + + + + + + @@ -559,27 +559,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -687,23 +666,6 @@ - - - - - - - - - - - - - - - - - @@ -773,7 +735,7 @@ - + @@ -947,21 +909,6 @@ - - - - - - - - - - - - - - - @@ -1040,19 +987,6 @@ - - - - - - - - - - - - - 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. - - - diff --git a/rdf/tbox/filegraph/object-properties.owl b/rdf/tbox/filegraph/object-properties.owl index 176c40e7..f61d226f 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 @@ - @@ -561,25 +558,6 @@ related technique - - - - - - - - - - - - - - - - - - - @@ -593,8 +571,6 @@ PERSON: Melissa Haendel PERSON: Melissa Haendel used to study - - @@ -698,7 +674,6 @@ - @@ -915,14 +890,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 - - - - - - - - + @@ -1145,22 +1113,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - - - - - - - - - - - - @@ -1508,14 +1460,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - - - - @@ -1534,15 +1478,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - Currently being used by a restriction on organization. - - - - @@ -1705,7 +1640,8 @@ there is a measurement process p that has specified output m, a measurement datu - + + @@ -1713,7 +1649,21 @@ there is a measurement process p that has specified output m, a measurement datu - + + + + + + + + + + + + + + + @@ -1721,7 +1671,16 @@ there is a measurement process p that has specified output m, a measurement datu - + + + + + + + + + + @@ -1738,7 +1697,6 @@ there is a measurement process p that has specified output m, a measurement datu - @@ -1751,22 +1709,6 @@ there is a measurement process p that has specified output m, a measurement datu - - - - - - - - - - - - - - - - diff --git a/rdf/tbox/filegraph/object-properties3.owl b/rdf/tbox/filegraph/object-properties3.owl index c763feae..f4ea1be4 100644 --- a/rdf/tbox/filegraph/object-properties3.owl +++ b/rdf/tbox/filegraph/object-properties3.owl @@ -213,7 +213,8 @@ - + + @@ -447,9 +448,19 @@ + + + + + + + + + + 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/filegraph/research-resource.owl b/rdf/tbox/filegraph/research-resource.owl index dccf8f43..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 - - @@ -507,5 +477,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 36af8a0a..32f22456 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 . @@ -329,6 +329,8 @@ vivo:GovernmentAgency skos:narrower rdfs:label "narrower term"@en-US ; + vitro:customEntryFormAnnot + "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddConceptThroughObjectPropertyGenerator"^^xsd:string ; vitro:displayLimitAnnot "5"^^xsd:int ; vitro:displayRankAnnot @@ -405,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 . @@ -581,6 +586,23 @@ vivo:researchAreaOf vitro:selectFromExistingAnnot "true"^^xsd:boolean . +vivo:subjectAreaOf + rdfs:label "subject area of"@en-US ; + vitro:displayLimitAnnot + "5"^^xsd:int ; + vitro:displayRankAnnot + "10"^^xsd:int ; + vitro:hiddenFromDisplayBelowRoleLevelAnnot + ; + vitro:inPropertyGroupAnnot + ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean ; + vitro:prohibitedFromUpdateBelowRoleLevelAnnot + ; + vitro:selectFromExistingAnnot + "true"^^xsd:boolean . + geo:populationTotal rdfs:label "total population"@en-US ; vitro:hiddenFromDisplayBelowRoleLevelAnnot @@ -641,6 +663,8 @@ vivo:reproduces ; vitro:prohibitedFromUpdateBelowRoleLevelAnnot ; + vitro:offerCreateNewOptionAnnot + "true"^^xsd:boolean ; vitro:selectFromExistingAnnot "true"^^xsd:boolean . @@ -808,23 +832,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 . @@ -1767,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 . @@ -2052,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 ; @@ -2153,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 ; @@ -2271,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 . @@ -2781,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 . @@ -3612,25 +3630,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 . @@ -4744,6 +4743,8 @@ obo:ERO_0001245 skos:broader rdfs:label "broader term"@en-US ; + vitro:customEntryFormAnnot + "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.AddConceptThroughObjectPropertyGenerator"^^xsd:string ; vitro:displayLimitAnnot "5"^^xsd:int ; vitro:displayRankAnnot @@ -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 . @@ -5983,7 +5981,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 ; @@ -6049,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 . @@ -6076,23 +6082,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 @@ -6193,6 +6182,8 @@ obo:ERO_0001716 vitro:prohibitedFromUpdateBelowRoleLevelAnnot ; vitro:selectFromExistingAnnot + "true"^^xsd:boolean ; + vitro:offerCreateNewOptionAnnot "true"^^xsd:boolean . vcard:hasRelated @@ -6208,7 +6199,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 ; @@ -6296,7 +6289,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 . @@ -6726,28 +6721,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 . 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/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java new file mode 100644 index 00000000..41f4c1e2 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java @@ -0,0 +1,140 @@ +/* $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.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.beans.VClass; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +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.ConstantFieldOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaObjectPropetyOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaSolrQueryOptions; + +/** + * This generator is for the case where a new concept is being added for an object property other than research/subject areas where the + * default object property form generator would work instead of the generator for managing concepts. + * In this case, we don't want the dropdown list for types for "add a new item of this type" to show concept subclasses, so we are overriding + * the fields to just include the Concept class. + */ +public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPropertyFormGenerator implements EditConfigurationGenerator { + + private Log log = LogFactory.getLog(AddConceptThroughObjectPropertyGenerator.class); + + @Override + public EditConfigurationVTwo getEditConfiguration(VitroRequest vreq, + HttpSession session) throws Exception { + EditConfigurationVTwo editConfig = super.getEditConfiguration(vreq, session); + //If this isn't adding a new individual, then override template/types + if(!DefaultAddMissingIndividualFormGenerator.isCreateNewIndividual(vreq, session)) { + //return rangetypes in form specific data + editConfig.addFormSpecificData("createNewTypes", getCreateNewTypesOptions(vreq)); + //override templates with ones that will override create new types portion + editConfig.setTemplate(getTemplate(vreq)); + } + return editConfig; + } + + private HashMap getCreateNewTypesOptions(VitroRequest vreq) { + HashMap options = new HashMap(); + List rangeTypes = getRangeTypes(vreq); + for(VClass v: rangeTypes) { + options.put(v.getURI(), v.getName()); + } + return options; + } + + //We will override range types as well so that autocomplete and other fields dependent on range + //will only consider the main concept type to be the range type + @Override + protected List getRangeTypes(VitroRequest vreq) { + // This first part needs a WebappDaoFactory with no filtering/RDFService + // funny business because it needs to be able to retrieve anonymous union + // classes by their "pseudo-bnode URIs". + // Someday we'll need to figure out a different way of doing this. + //WebappDaoFactory ctxDaoFact = ModelAccess.on( + // vreq.getSession().getServletContext()).getWebappDaoFactory(); + WebappDaoFactory ctxDaoFact = vreq.getLanguageNeutralWebappDaoFactory(); + + List types = new ArrayList(); + Individual subject = EditConfigurationUtils.getSubjectIndividual(vreq); + String predicateUri = EditConfigurationUtils.getPredicateUri(vreq); + String rangeUri = EditConfigurationUtils.getRangeUri(vreq); + if (rangeUri != null) { + VClass rangeVClass = ctxDaoFact.getVClassDao().getVClassByURI(rangeUri); + if (!rangeVClass.isUnion()) { + types.add(rangeVClass); + } else { + for (VClass unionComponent : rangeVClass.getUnionComponents()) { + types.add(unionComponent); + } + } + return types; + } else { + //This should never happen + log.warn("Range not found for this property so employing SKOS concept class"); + String vclassURI = "http://www.w3.org/2004/02/skos/core#Concept"; + VClass rangeVClass = ctxDaoFact.getVClassDao().getVClassByURI(vclassURI); + types.add(rangeVClass); + } + + return types; + } + + //Should override the method in default object property + private String getTemplate( + VitroRequest vreq) { + + String acObjectPropertyTemplate = "addConceptThroughObjectPropertyAutoComplete.ftl"; + String objectPropertyTemplate = "addConceptThroughObjectPropertyForm.ftl"; + String template = objectPropertyTemplate; + if( doAutoComplete ) + template = acObjectPropertyTemplate; + return template; + + } + + @Override + protected void setFields(EditConfigurationVTwo editConfiguration, VitroRequest vreq, String predicateUri, List rangeTypes) throws Exception { + FieldVTwo field = new FieldVTwo(); + field.setName("objectVar"); + + List validators = new ArrayList(); + validators.add("nonempty"); + field.setValidators(validators); + + if( ! doAutoComplete ){ + List types = new ArrayList(); + for(VClass v: rangeTypes) { + types.add(v.getURI()); + } + String[] typesArray = types.toArray(new String[types.size()]); + field.setOptions( new IndividualsViaSolrQueryOptions( + vreq.getSession().getServletContext(), + getSubjectUri(), + predicateUri, + getObjectUri(), + typesArray)); + }else{ + field.setOptions(null); + } + + Map fields = new HashMap(); + fields.put(field.getName(), field); + + editConfiguration.setFields(fields); + } + +} 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..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; @@ -31,17 +34,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 { @@ -55,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 @@ -69,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"); @@ -84,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")); @@ -140,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 ."; 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..d7170973 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 { @@ -208,6 +202,8 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator String editString = getPrefixesString(); editString += "?role <" + getRoleToGrantPredicate(vreq) + "> ?grant ."; editString += "?grant a core:Grant . "; + editString += "?person core:relatedBy ?grant . "; + editString += "?grant core:relates ?person . "; editString += "?grant <" + getGrantToRolePredicate(vreq) + "> ?role ."; editString += "?grant <" + RDFS.label.getURI() + "> ?grantLabel ."; return editString; @@ -215,6 +211,8 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator public String getN3ForExistingGrant(VitroRequest vreq) { String editString = getPrefixesString(); + editString += "?person core:relatedBy ?existingGrant . "; + editString += "?existingGrant core:relates ?person . "; editString += "?role <" + getRoleToGrantPredicate(vreq) + "> ?existingGrant . "; editString += "?existingGrant <" + getGrantToRolePredicate(vreq) + "> ?role ."; return editString; @@ -277,8 +275,7 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator urisInScope.put("roleType", Arrays.asList(new String[]{getRoleType(vreq)})); //Setting inverse role predicate - urisInScope.put("inverseRolePredicate", getInversePredicate(vreq)); - + 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 @@ -664,12 +661,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/AddRoleToPersonTwoStageGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index 786ee6dc..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 @@ -1,897 +1,899 @@ -/* $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 + 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; + } + + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java new file mode 100644 index 00000000..8fea8fd4 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/GrantAdministeredByGenerator.java @@ -0,0 +1,123 @@ +/* $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.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.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.EditConfigurationVTwo; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesWithParent; +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.IndividualsViaVClassOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.validators.AntiXssValidation; + +public class GrantAdministeredByGenerator extends VivoBaseGenerator implements + EditConfigurationGenerator { + + public GrantAdministeredByGenerator() {} + + @Override + 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("grantAdministeredBy.ftl"); + + conf.setVarNameForSubject("grant"); + conf.setVarNameForPredicate("predicate"); + conf.setVarNameForObject("adminRole"); + + conf.setN3Required( Arrays.asList( n3ForNewAdminRole) ); + conf.setN3Optional( Arrays.asList( n3ForNewAdminOrganization, + n3ForExistingAdminOrganization ) ); + + conf.addNewResource("newOrganization", DEFAULT_NS_FOR_NEW_RESOURCE); + conf.addNewResource("adminRole", DEFAULT_NS_FOR_NEW_RESOURCE); + + conf.setUrisOnform(Arrays.asList("existingOrganization")); + conf.setLiteralsOnForm(Arrays.asList("orgLabel", "orgLabelDisplay" )); + + conf.addSparqlForExistingLiteral("orgLabel", orgLabelQuery); + conf.addSparqlForExistingUris("existingOrganization", existingOrganizationQuery); + + + conf.addField( new FieldVTwo(). // options will be added in browser by auto complete JS + setName("existingOrganization") + ); + + conf.addField( new FieldVTwo(). + setName("orgLabel"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString()) ) + ); + + conf.addField( new FieldVTwo(). + setName("orgLabelDisplay"). + setRangeDatatypeUri(XSD.xstring.toString() ). + setValidators( list("datatype:" + XSD.xstring.toString())) + ); + + conf.addValidator(new AntiXssValidation()); + conf.addValidator(new AutocompleteRequiredInputValidator("existingOrganization", "orgLabel")); + +// addFormSpecificData(conf, vreq); + prepare(vreq, conf); + return conf; + } + + /* N3 assertions */ + + final static String n3ForNewAdminRole = + "@prefix vivo: <" + vivoCore + "> . \n\n" + + "?grant vivo:relates ?adminRole . \n" + + "?adminRole a vivo:AdministratorRole . \n" + + "?adminRole vivo:relatedBy ?grant . " ; + + final static String n3ForNewAdminOrganization = + "@prefix vivo: <" + vivoCore + "> . \n\n" + + "?adminRole ?newOrganization . \n" + + "?newOrganization a . \n" + + "?newOrganization ?adminRole . \n" + + "?newOrganization <"+ label + "> ?orgLabel ."; + + final static String n3ForExistingAdminOrganization = + "@prefix vivo: <" + vivoCore + "> . \n\n" + + "?adminRole ?existingOrganization . \n" + + "?existingOrganization a . \n" + + "?existingOrganization ?adminRole . " ; + + /* Queries for editing an existing entry */ + + final static String existingOrganizationQuery = + "PREFIX vivo: \n" + + "SELECT ?existingOrganization WHERE { \n" + + " ?adminRole ?existingOrganization . \n" + + " ?existingOrganization a . \n" + + "}"; + + final static String orgLabelQuery = + "PREFIX vivo: \n" + + "SELECT ?existingOrganizationLabel WHERE { \n" + + " ?adminRole ?existingOrganization . \n" + + " ?existingOrganization a . \n" + + " ?existingOrganization <" + label + "> ?existingOrganizationLabel . \n" + + "}"; + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/NewIndividualFormGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/NewIndividualFormGenerator.java index 4ebe249a..bef4eeda 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/NewIndividualFormGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/NewIndividualFormGenerator.java @@ -172,7 +172,10 @@ public class NewIndividualFormGenerator extends BaseEditConfigurationGenerator i WebappDaoFactory wdf = vreq.getWebappDaoFactory(); Boolean isPersonType = Boolean.FALSE; String foafPersonType = getFOAFPersonClassURI(); - List superTypes = wdf.getVClassDao().getAllSuperClassURIs(getTypeOfNew(vreq)); + String typeOfNew = getTypeOfNew(vreq); + List superTypes = wdf.getVClassDao().getAllSuperClassURIs(typeOfNew); + //add the actual type as well so we can add that for the list to be checked + superTypes.add(typeOfNew); if( superTypes != null ){ for( String typeUri : superTypes){ if( foafPersonType.equals(typeUri)) { 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..c7070d8b --- /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, n3ForNewPerson, n3ForExistingPerson, + n3ForNewPersonAwardedDegree, n3ForExistingPersonAwardedDegree, deptAssertion, infoAssertion, n3ForStart, + n3ForEnd, firstNameAssertion, lastNameAssertion )); + + 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", "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("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 n3ForNewPerson = + "?edTraining ?newPerson . \n" + + "?newPerson ?edTraining . \n" + + "?newPerson a . \n" + + "?newPerson <"+ label +"> ?personLabel . "; + + final static String n3ForExistingPerson = + "?edTraining ?existingPerson . \n" + + "?existingPerson ?edTraining . \n" + + " "; + + 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.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); 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/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java index 760b04c3..7cc69d63 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/PersonHasIssuedCredentialGenerator.java @@ -117,12 +117,6 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem setValidators( list("datatype:" + XSD.xstring.toString())) ); - conf.addField( new FieldVTwo(). - setName("orgLabelDisplay"). - setRangeDatatypeUri(XSD.xstring.toString() ). - setValidators( list("datatype:" + XSD.xstring.toString())) - ); - conf.addField( new FieldVTwo(). setName("credentialLabelDisplay"). setRangeDatatypeUri(XSD.xstring.toString() ). @@ -184,8 +178,8 @@ public class PersonHasIssuedCredentialGenerator extends VivoBaseGenerator implem final static String n3ForExistingCredentialAssertion = "@prefix vivo: <" + vivoCore + "> . \n\n" + "?issuedCredential vivo:relates ?existingCredential . \n" + - "?existingCredential a <" + credentialTypeClass + "> . \n" + - "?credential a ?credentialType . \n" + +/* "?existingCredential a <" + credentialTypeClass + "> . \n" + + "?existingCredential a ?credentialType . \n" + */ "?existingCredential vivo:relatedBy ?issuedCredential . " ; final static String n3ForYearCredentialed = 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/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; 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 ." + "}"); 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 = 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" )); + + + + } + + +} diff --git a/themes/wilma/i18n/all.properties b/themes/wilma/i18n/all.properties index f2a2052c..158f250a 100644 --- a/themes/wilma/i18n/all.properties +++ b/themes/wilma/i18n/all.properties @@ -194,15 +194,7 @@ hyperlink = Hyperlink # # accounts templates ( /templates/freemarker/body/accounts ) # -congratulations = Congratulations! -we_have_created_your_account = We have created your new {0} account associated with {1}. -did_not_request_text = If you did not request this new account you can safely ignore this email. \ - This request will expire if not acted upon for 30 days. -click_to_create_password = Click the link below to create your password for your new account using our secure server. password = password -if_link_failed = If the link above doesn't work, you can copy and paste the link directly into your browser's address bar. -thanks = Thanks! -paste_the_link = Paste the link below into your browser's address bar to create your password for your new account using our secure server. # # harvester templates ( /templates/freemarker/body/harvester ) @@ -363,7 +355,7 @@ selected_conference = Selected Conference years_participation_in = Years of Participation in grant_entry_for = grant entry for -select_existing_pub_or_enter_new = Please select an existing grant in the Title field or enter a new one. +select_existing_pub_or_enter_new = Please select an existing publication in the Title field or enter a new one. unable_to_handle_grant_editing = This form is unable to handle the editing of this grant because it is associated with multiple grant individuals. grant_type = grant Type @@ -883,4 +875,7 @@ edit_year_awarded = Edit year awarded publication_date_for = publication date for create_publication_date = Create publication date edit_publication_date = Edit publication date - +name_prefix = Name Prefix +name_suffix = Name Suffix +administering_organization_for = administering organization for +missing_credential = missing credential \ No newline at end of file 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 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 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/doit b/utilities/ISF-transition/obsoleteUris/doit new file mode 100755 index 00000000..157ddc6d --- /dev/null +++ b/utilities/ISF-transition/obsoleteUris/doit @@ -0,0 +1,7 @@ +ruby obsoleteUriChecker.rb /Users/jeb228/git/VIVO \ + ../../../productMods/WEB-INF/ontologies/update/diff.tab.txt \ + 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.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/event.rb b/utilities/ISF-transition/obsoleteUris/event.rb index 00f1a598..b35de06c 100644 --- a/utilities/ISF-transition/obsoleteUris/event.rb +++ b/utilities/ISF-transition/obsoleteUris/event.rb @@ -5,9 +5,15 @@ class Event attr_reader :string attr_reader :is_localname + require 'pathname' + # ------------------------------------------------------------------------------------ private # ------------------------------------------------------------------------------------ + + def relativize(root, path) + Pathname.new(path).relative_path_from(Pathname.new(root)).to_s + end # ------------------------------------------------------------------------------------ public @@ -21,7 +27,11 @@ class Event @is_localname = string[0] == ?: end - def to_s() - "#{@path} \n #{@line_number} #{@line} \n #{@string} #{@is_localname ? "Localname" : "URI"}" + def to_s(directory_root = nil) + if directory_root + "#{relativize(directory_root, @path)} \n #{@line_number} #{@line} \n #{@string} #{@is_localname ? "Localname" : "URI"}" + else + "#{@path} \n #{@line_number} #{@line} \n #{@string} #{@is_localname ? "Localname" : "URI"}" + end end end diff --git a/utilities/ISF-transition/obsoleteUris/known_exceptions.rb b/utilities/ISF-transition/obsoleteUris/known_exceptions.rb index 871782ee..745b0a1e 100644 --- a/utilities/ISF-transition/obsoleteUris/known_exceptions.rb +++ b/utilities/ISF-transition/obsoleteUris/known_exceptions.rb @@ -1,5 +1,22 @@ +require 'pathname' + class KnownExceptionsError < StandardError; end +class GlobSkipper + def initialize(root_path, glob) + @root_path = root_path + @glob = glob + end + + def relativize(path) + Pathname.new(path).relative_path_from(Pathname.new(@root_path)).to_s + end + + def skip?(path, line, uri) + return File.fnmatch(@glob, relativize(path)) + end +end + class ExtensionSkipper def initialize(extension) @extension = extension @@ -44,10 +61,11 @@ class KnownExceptions line.strip! next if line.length == 0 || line[0..0] == '#' || line[0] == ?! - if line =~ /^\.[^\/]*$/ - skippers << ExtensionSkipper.new(line) - elsif line =~ /^(\S+)\s*$/ - skippers << PathSkipper.new(@root_path, $1) +# if line =~ /^\.[^\/]*$/ +# skippers << ExtensionSkipper.new(line) + if line =~ /^(\S+)\s*$/ +# skippers << PathSkipper.new(@root_path, $1) + skippers << GlobSkipper.new(@root_path, $1) elsif line =~ /^(\S+)\s*(\d+)\s*$/ skippers << LineSkipper.new(@root_path, $1, $2.to_i) else @@ -71,7 +89,7 @@ class KnownExceptions if line_number == -1 next if skipper.is_a?(LineSkipper) else - next if skipper.is_a?(ExtensionSkipper) || skipper.is_a?(PathSkipper) + next if skipper.is_a?(ExtensionSkipper) || skipper.is_a?(PathSkipper) || skipper.is_a?(GlobSkipper) end if skipper.skip?(file, line_number, string) diff --git a/utilities/ISF-transition/obsoleteUris/obsoleteUriChecker.rb b/utilities/ISF-transition/obsoleteUris/obsoleteUriChecker.rb index 27463d8b..70a87211 100644 --- a/utilities/ISF-transition/obsoleteUris/obsoleteUriChecker.rb +++ b/utilities/ISF-transition/obsoleteUris/obsoleteUriChecker.rb @@ -80,8 +80,8 @@ class ObsoleteUriChecker # ------------------------------------------------------------------------------------ def initialize(args) - @report = Report.new(args) @directory_root, @obsolete_uris, @known_exceptions, @complete = parse_arguments(args) + @report = Report.new(args, @directory_root) rescue UsageError => e puts "\n----------------\nUsage error\n----------------\n\n#{e}\n\n----------------\n\n" exit diff --git a/utilities/ISF-transition/obsoleteUris/report.rb b/utilities/ISF-transition/obsoleteUris/report.rb index 0bdef5eb..a964422e 100644 --- a/utilities/ISF-transition/obsoleteUris/report.rb +++ b/utilities/ISF-transition/obsoleteUris/report.rb @@ -3,6 +3,10 @@ class Report private # ------------------------------------------------------------------------------------ + def relativize(path) + Pathname.new(path).relative_path_from(Pathname.new(@directory_root)).to_s + end + def state_arguments() puts puts "-----------------------------------------------------------------" @@ -29,9 +33,8 @@ class Report hash[event.path] = hash[event.path] << event end -# puts "FLAT: #{hash.to_a.flatten}" hash.sort.each do |path, events| - puts "#{path}" + puts "#{relativize(path)}" events.sort{|a, b| a.line_number <=> b.line_number }.each do |e| trimmed = if e.line.size <= 100 @@ -46,18 +49,13 @@ class Report end end - def list_events() - @events.each do |event| - puts "Event: #{event}" - end - end - # ------------------------------------------------------------------------------------ public # ------------------------------------------------------------------------------------ - def initialize(args) + def initialize(args, directory_root) @args = args; + @directory_root = directory_root @file_count = 0 @extensions_count = Hash.new(0) @events = [] @@ -75,7 +73,6 @@ class Report def report() state_arguments() file_summary() -# list_events() collate_and_list_events() end end 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_old.txt b/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_old.txt new file mode 100644 index 00000000..3409da4c --- /dev/null +++ b/utilities/ISF-transition/obsoleteUris/vivo_known_exceptions_old.txt @@ -0,0 +1,41 @@ +.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 +# probably in the .build directory also. Ran against the repository, so VIVO +# only. +# +# 7498 89730 2277668 first_pass.output +# + +test/edu/cornell/mannlib/vitro/webapp/search/solr/NIHVIVO3853_DataSet1.rdf +productMods/WEB-INF/ontologies/update/oldVersion/vivo-event-1.5.owl +productMods/WEB-INF/ontologies/update/oldAnnotations/vivo-core-1.5-annotations.rdf +productMods/WEB-INF/ontologies/update/diff.tab.txt + +# +# second_pass: excluded these nasty files. Ran against a clean distro, with VIVO and +# Vitro, but no .bin or .build +# +# 1798 5159 170092 second_pass.output +# + +productMods/WEB-INF/ontologies/update/oldVersion/vivo-foaf-1.5.owl +productMods/WEB-INF/ontologies/update/oldVersion/vivo-core-1.5.owl +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 diff --git a/utilities/LoadTesting/scripts/_captureTomcatLogs b/utilities/LoadTesting/scripts/_captureTomcatLogs index e64b7028..55bcd656 100755 --- a/utilities/LoadTesting/scripts/_captureTomcatLogs +++ b/utilities/LoadTesting/scripts/_captureTomcatLogs @@ -12,11 +12,22 @@ directory, for possible inspection later. require File.expand_path('subscripts/common', File.dirname(__FILE__)) require 'date' +require "#{File.dirname(__FILE__)}/subscripts/loadParms" def figure_time_stamp() return DateTime.now.strftime("%Y-%m-%d_%H-%M-%S") end +def add_read_me() + puts "Add a comment for the README.txt file" + comment = STDIN.gets.strip + return if comment.empty? + + File.open('README.txt', "w") do |file| + file.puts comment + end +end + @tomcat_logs_dir = version_file('tomcatLogs') if (! File.directory?(@tomcat_logs_dir)) Dir.mkdir(@tomcat_logs_dir) @@ -29,5 +40,5 @@ end Dir.chdir(@this_logs_dir) do |path| system("cp #{@home}/tomcat/logs/* .") + add_read_me() end - 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 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