diff --git a/config/licenser/known_exceptions.txt b/config/licenser/known_exceptions.txt index a847a835..522a2dc8 100644 --- a/config/licenser/known_exceptions.txt +++ b/config/licenser/known_exceptions.txt @@ -33,4 +33,6 @@ utilities/load-testing/jmeter-results-detail-report.xsl productMods/css/jquery_plugins/* productMods/js/jquery_plugins/* productMods/js/visualization/entitycomparison/jquery_plugins/* -themes/wilma/js/jquery_plugins/raphael/* + +# PROBLEM: Can't find any info on licensing. +productMods/js/jquery_plugins/jquery.truncator.js \ No newline at end of file diff --git a/doc/3rd-party-licenses.txt b/doc/3rd-party-licenses.txt index f70d5c98..b132e036 100644 --- a/doc/3rd-party-licenses.txt +++ b/doc/3rd-party-licenses.txt @@ -115,6 +115,7 @@ GNU GPL 2 licenses/gpl2.LICENSE.txt jaxrpc +jsontofmmodel mysql-connector-java rowset rsslib4j @@ -156,6 +157,7 @@ icu4j (licenses/icu.LICENSE.txt) jquery (licenses/mit.LICENSE.txt) jquery-plugins (licenses/mit.LICENSE.txt) prototype (licenses/mit.LICENSE.txt) +raphael (licenses/mit.LICENSE.txt) selectivizr (licenses/mit.LICENSE.txt) slf4j-api (licenses/mit.LICENSE.txt) slf4j-log4j12 (licenses/mit.LICENSE.txt) @@ -184,7 +186,6 @@ jdom (licenses/jdom.LICENSE.txt) json (licenses/json.LICENSE.txt) jtidy (licenses/jtidy.LICENSE.txt) ojdbc (licenses/oracle.LICENSE.txt) -pictos (licenses/pictos.LICENSE.txt) Unknown diff --git a/doc/css/doc.css b/doc/css/doc.css index 37c82cb8..75b9ee01 100644 --- a/doc/css/doc.css +++ b/doc/css/doc.css @@ -54,7 +54,7 @@ h2 a:hover, h2 a:active{ h3{ padding: 8px 0 6px 0; margin: 0; - font-size: 1.2m; + font-size: 1.2em; color: #2485ae; } h4{ @@ -162,7 +162,7 @@ td { } /* FOOTER------> */ -footer { +div#footer { clear: both; width: 970px; height: 88px; @@ -171,16 +171,16 @@ footer { color: #4e5051; background-color: #fff; } -footer p.copyright { +div#footer p.copyright { float: left; - padding-top: 55px; + padding-top: 50px; padding-left: 30px; width: 500px; } ul#footer-nav { float: right; list-style: none; - width: 200px; + width: 300px; height: 20px; margin: 0; padding: 0; diff --git a/doc/install.html b/doc/install.html index e7d8e083..53de5176 100644 --- a/doc/install.html +++ b/doc/install.html @@ -2,30 +2,20 @@ - VIVO - + VIVO Release 1 V1.2 Installation Guide + + - +
-

VIVO Release 1 V1.2 Installation Guide

+

VIVO Release 1 V1.2 Installation Guide

- January 28, 2011 + January 28, 2011 -
- Missing pieces and fixes - -
- +
-

VIVO Release 1 v1.2 Upgrade Guide

- - January 28, 2011 - Upgrading from Release 1 v1.1 to Release 1 v1.2 - -
- Missing pieces and fixes -
    -
  • - Link to install pdf online at SF -
  • -
  • - Add config table from install d/t so many new vars. -
  • -
  • -
  • -
-
- - - -

- This document provides a short description of the steps involved in upgrading your - installation of VIVO from Release 1, Version 1.1 to Version 1.2. This and other - documentation can be found on the support page - at VIVOweb.org -

-

- If you need to do a fresh install, please consult VIVO Release 1 v1.2 Installation Guide - or the install.html file located in the doc - directoy of the VIVO source code distribution. -

-

Release anouncement for V1.2

-

- Text from the wiki page -

-

Upgrade process for V1.2

-

- -
    -
  1. - Before Performing the Upgrade -
  2. -
  3. - The Upgrade Process -
  4. -
  5. - Ontology Upgrade -
  6. -
      +

      VIVO Release 1 v1.2 Upgrade Guide

      + + January 28, 2011 - Upgrading from Release 1 v1.1 to Release 1 + v1.2 + + + + +

      + This document provides a short description of the steps involved in + upgrading your installation of VIVO from Release 1, Version 1.1 to + Version 1.2. This and other documentation can be found on the support page + at VIVOweb.org +

      +

      + If you need to do a fresh install, please consult the VIVO Release 1 v1.2 + Installation Guide found on vivoweb.org + or the install.html file located in the doc + directory of the VIVO source code distribution. The installation + document also has a list of the required software and versions. +

      +

      Release anouncement for V1.2

      +

      + The VIVO 1.2 release incorporates major changes throughout the + application - notably a new templating system to support more flexible + display and navigation, plus improvements to address scalability. The + release also features two new visualization options: temporal graphing + for organizations, and personal visualizations extended to cover grants + as well as publications. The VIVO Harvester library has also been + significantly improved and expanded in scope for its 1.0 release + through the VIVO SourceForge project at http://sourceforge.net/projects/vivo. +

      +

      Templating system for page generation, navigation, and theming

      +

      + A new installation of VIVO 1.2 looks strikingly different, with a + new navigation and browse interface as well as a more modular page + design that is easier to customize and brand for your local + institution. Page displays now support inline navigation to streamline + viewing of expanded personal and organizational profiles, as well as + improved graphic layout and organization. New browsing controls on the + home page and each menu page include interactive visual controls to + provide an immediate overview of the size and range of content and + quick access down to the individual person, organization, research + feature, or event. VIVO's navigation has also been completely + overhauled. +

      +

      Storage model

      +

      + While server memory capacity has increased significantly in recent + years, VIVO's reliance on in-memory caching of RDF data had put limits + on the ultimate scalability of VIVO instances and potentially increased + the cost of servers required to support VIVO.  +
      +

      +

      + With version 1.2, VIVO has been converted to optionally use Jena's + SPARQL database (SDB) subsystem. SDB significantly reduces the baseline + memory footprint, allowing VIVO installations to scale well beyond what + has previously been possible. +

      +

      New visualizations

      +

      + VIVO continues to expand visualization options including all-new + user-configurable temporal comparisons of publications and grants, + grouped by organization or by affiliated person. Visualizations of + networks of co-authors are now complemented by visualizations of + co-investigators on grants, with a similar interactivity and options + for export as images or data. +

      +

      Ontology

      +

      + VIVO 1.2 includes a new ontology module representing research + resources including biological specimens, human studies, instruments, + organisms, protocols, reagents, and research opportunities. This module + is aligned with the top-level ontology classes and properties from the + NIH-funded eagle-i Project. +

      +

      Associated VIVO releases

      +

      VIVO Harvester

      +

      + The Harvester development team is releasing version 1.0 of the VIVO + Harvester library, an extensible data ingest and updating framework + with sample configurations for loading PubMed publication, grants, and + human resources data. The Harvester is available at http://sourceforge.net/projects/vivo. +

      +

      Upgrade process for V1.2

      + +
        +
      1. + Before Performing the Upgrade +
      2. +
      3. + Chose Triple Store +
      4. +
      5. + The Upgrade Process +
      6. +
      7. + Ontology Changes +
          +
        1. + Verify Ontology upgrade + process +
        2. +
        3. + Ontology knowledge base + manual review +
        4. +
        +
      8. +
      9. + File Storage System Upgrade +
          +
        1. + Changes to the File + Storage System +
        2. +
        3. + Verify File Storage + System upgrade process +
        4. +
        +
      10. +
      11. + Theme Changes +
      12. +
      13. + Set Up SDB Store in the Background (Optional)
      +
      +

      I. Before Performing the Upgrade

      +

      + Please ensure that backups are created of the: +

      +
    - -

    I. Before Performing the Upgrade

    -

    - Please ensure that backups are created of the: -

    -
      -
    • - Tomcat webapps directory -
    • -
    • - Original source directory -
    • -
    • - MySQL database (mysqldump) -
    • -
    -

    - The upgrade process is similar to the original install process with the following - EXCEPTIONS: -

    -
      -
    • - DO NOT reinstall MySQL or recreate the MySQL database. Please ensure that - you back-up the MySQL database. -
    • -
    • - It is not necessary to add RDF data. -
    • -
    • - First-time login of the administrator account after the upgrade - process is complete will use the password previously set, NOT the - default password used on the first login after the initial installation. -
    • -
    • - The first time Apache Tomcat starts up after the upgrade, it will - initiate a process that modifies the knowledge base to align the data - with the revised ontology. See the section on the Ontology Upgrade - below for more information. -
    • -
    -

    The Upgrade Process

    -

    - 1. Download the new distribution file and unpack it into a new source - directory. -

    -

    - 2. Create deploy.properties, using the same values as in your previous - installation and set values for the new variables. The following table - shows the default properties for deploy.properties with new V1.2 properties in - blue. - +

  7. + Original source directory +
  8. +
  9. + MySQL database (mysqldump) +
  10. + +

    + The upgrade process is similar to the original install process with + the following EXCEPTIONS: +

    +
      +
    • + DO NOT reinstall MySQL or recreate the MySQL database. Please + ensure that you back-up the MySQL database. Also note that VIVO 1.2 will + not run on older versions of MySQL that may have worked with 1.1.1. + Be sure to run VIVO 1.2 with MySQL 5.1 or higher. Using unsupported + versions may result in strange error messages related to table formatting or + other unexpected problems. +
    • +
    • + It is not necessary to add RDF data. +
    • +
    • + First-time login of the administrator account after the upgrade + process is complete will use the password previously set, NOT the + default password used on the first login after the initial + installation. +
    • +
    • + The first time Apache Tomcat starts up after the upgrade, it + will initiate a process that modifies the knowledge base to align the + data with the revised ontology. See the section on the Ontology Upgrade + below for more information. +
    • +
    +

    II. Choose Triple Store

    +

    + VIVO 1.2 offers a choice of two triple store technologies: in-memory models backed by + Jena's legacy relational database store (RDB), and Jena's SPARQL database (SDB). RDB was + used by VIVO 1.1.1 and earlier. This mode offers fast response, but only by caching the + entire RDF model in the server's main memory. The memory available to VIVO limits the + number of RDF statements that may be stored. +

    +

    + SDB mode caches only a fraction of the RDF data in memory. Most queries are issued directly + against the underlying database. This allows VIVO installations to display data from large + RDF models while requiring only a small amount of server memory to run the application. + There is a tradeoff in response time: pages make take slightly longer to load in SDB mode, + and performance will depend on the configuration parameters of the database server. + Additionally, advanced OWL reasoning (not enabled by default in either mode) is not possible + in SDB mode. With SDB, only the default set of inferences (inferred rdf:type statements) are + generated, though they are generated as soon as data is edited rather than in a background process. +

    +

    + Though a VIVO installation may be switched back and forth between RDB and SDB mode by changing + a configuration property and redeploying the application, it is important to note that data + added in one mode will not typically appear in the other. The exception is when a system is + first switched from RDB mode to SDB mode. In this case, the data from the RDB store will be + automatically migrated to SDB. +

    +

    + A VIVO 1.2 system that is upgraded from VIVO 1.1.1 must initially be run in RDB mode in order + to receive required ontology updates. Attempting to run an upgraded system initially in SDB will + result in a logged error message, and the application will not start. After the system starts + up successfully the first time in RDB mode, it may then be switched to SDB, redeployed, and restarted. + Upon restart, the data in the RDB store will be copied to the SDB store. +

    +

    + This copying process can take a number of hours to complete if the installation contains a large + amount of RDF data (roughly a million triples or more). See section Set Up SDB Store in the Background (Optional) + for instructions on how + to run this lengthy conversion process in the background while an RDB system is operating. + Doing this will reduce the time necessary to start VIVO the first time it is run in SDB mode. +

    +

    III. The Upgrade Process

    +

    + 1. Download the new distribution file and unpack it into a new + source directory. +

    +

    + 2. Create deploy.properties, using the same values as in your + previous installation and set values for the new variables. The + following table shows the default properties for deploy.properties with + new V1.2 properties in blue. +

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - Property Name - - Example Value -
    - Default namespace: VIVO installations make their RDF resources available - for harvest using linked data. Requests for RDF resource URIs redirect to HTML - or RDF representations as specified by the client. To make this possible, - VIVO's default namespace must have certain structure and begin with the public - web address of the VIVO installation. For example, if the web address of a VIVO - installation is "http://vivo.example.edu/" the default namespace must be set to - "http://vivo.example.edu/individual/" in order to support linked data. Similarly, - if VIVO is installed at "http://www.example.edu/vivo" the default namespace must be - set to "http://www.example.edu/vivo/individual/" -

    * The namespace must end with "individual/" (including the trailing slash).

    -
    - Vitro.defaultNamespace - - http://vivo.mydomain.edu/individual/ -
    - Directory where Vitro code is located. In most deployments, this is set to - ./vitro-core, but it commonly points elsewhere during development. -
    - vitro.core.dir - - ./vitro-core -
    - Directory where tomcat is installed. -
    - tomcat.home - - /usr/local/tomcat -
    - Name of your VIVO application. -
    - webapp.name - - vivo -
    - Directory where uploaded files will be stored. You must create this directory ahead of time. -
    - upload.directory - - /usr/local/vivo/data/uploads -
    - Directory where the Lucene search index will be built. Depending on your - permissions and who Tomcat is running as, you may need to create this directory - ahead of time. -
    - LuceneSetup.indexDir - - /usr/local/vivo/data/luceneIndex -
    - Specify an SMTP host that the form will use for sending e-mail (Optional). If - this is left blank, the contact form will be hidden and disabled. -
    - Vitro.smtpHost - - smtp.servername.edu -
    - Specify the JDBC URL of your database. Change the end of theURL to reflect - your database name (if it is not "vivo"). -
    - VitroConnection.DataSource.url - - jdbc:mysql://localhost/vivo -
    - Change the username to match the authorized user you created in MySQL. -
    - VitroConnection.DataSource.username - - username -
    - Change the password to match the password you created in MySQL. -
    - VitroConnection.DataSource.password - - password -
    - Specify the Jena triple store technology to use. SDB is Jena's - SPARQL database; this setting allows RDF data to scale beyond the - limits of the JVM heap. Set to RDB to use the older Jena RDB - store with in-memory caching. -
    - VitroConnection.DataSource.tripleStoreType - - SDB -
    - Specify the maximum number of active connections in the database - connection pool to support the anticipated number of concurrent - page requests. It is not necessary to adjust this value when - using the RDB configuration. -
    - VitroConnection.DataSource.pool.maxActive - - 40 -
    - Specify the maximum number of database connections that will be - allowed to remain idle in the connection pool. Default is - 25% of the maximum number of active connections. -
    - VitroConnection.DataSource.pool.maxIdle - - 10 -
    - Change the dbtype setting to use a database other than MySQL. - Otherwise, leave this value unchanged. - Possible values are DB2, derby, HSQLDB, H2, MySQL, Oracle, - PostgreSQL, and SQLServer. - Refer to http://openjena.org/wiki/SDB/Databases_Supported - for additional information. -
    - VitroConnection.DataSource.dbtype - - MySQL -
    - Specify a driver class name to use a database other than MySQL. - Otherwise, leave this value unchanged. - This JAR file for this driver must be added to the the webapp/lib - directory within the vitro.core.dir specified above. -
    - VitroConnection.DataSource.driver - - com.mysql.jdbc.Driver -
    - Change the validation query used to test database connections - only if necessary to use a database other than MySQL. - Otherwise, leave this value unchanged. -
    - VitroConnection.DataSource.validationQuery - - SELECT 1 -
    - Specify the name of your first admin user for the VIVO application. - This user will have an initial temporary password of 'defaultAdmin'. - You will be prompted to create a new password on first login. -
    - initialAdminUser - - defaultAdmin -
    - The name of a property that can be used to associate an Individual - with a user account. When a user logs in with a name that matches - the value of this property, the user will be authorized to editthat Individual. -
    - selfEditing.idMatchingProperty - - http://vivo.mydomain.edu/ns#networkId -
    - Temporal Graph Visualization is used to compare different - organizations/people within an organization on different parameters like - number of publications, grants. This parameter will be used as a default - in case a URI is not provided. It will be also used whenever this - visualization is to be rendered for top level organization. - In absence of this parameter a SPARQL query will be fired which will - attempt to provide a top level organization. The name of a property that - can be used to associate an Individual with a user account. When a user - logs in with a name that matches the value of this property, the user - will be authorized to edit that Individual. -
    - visualization.topLevelOrg - - http://vivo-trunk.indiana.edu/individual/topLevelOrgURI -
    + Property Name + + Example Value +
    + Default namespace: VIVO installations make their + RDF resources available for harvest using linked data. Requests for RDF + resource URIs redirect to HTML or RDF representations as specified by + the client. To make this possible, VIVO's default namespace must have + a certain structure and begin with the public web address of the VIVO + installation. For example, if the web address of a VIVO installation is + "http://vivo.example.edu/" the default namespace must be set to + "http://vivo.example.edu/individual/" in order to support linked data. + Similarly, if VIVO is installed at "http://www.example.edu/vivo" the + default namespace must be set to + "http://www.example.edu/vivo/individual/"

    * The namespace must end with "individual/" (including the + trailing slash).

    +
    + Vitro.defaultNamespace + + http://vivo.mydomain.edu/individual/ +
    + Directory where Vitro code is located. In most + deployments, this is set to ./vitro-core (It is not uncommon for this + setting to point elsewhere in development environments). +
    + vitro.core.dir + + ./vitro-core +
    + Directory where tomcat is installed. +
    + tomcat.home + + /usr/local/tomcat +
    + Name of your VIVO application. +
    + webapp.name + + vivo +
    + Directory where uploaded files will be stored. + Be sure this directory exists and is writable by the user who + the Tomcat service is running as. +
    + upload.directory + + /usr/local/vivo/data/uploads +
    + Directory where the Lucene search index will be + built. Be sure this directory exists and is writable by the user who + the Tomcat service is running as. +
    + LuceneSetup.indexDir + + /usr/local/vivo/data/luceneIndex +
    + Specify an SMTP host that the form will use for + sending e-mail (Optional). If this is left blank, the contact form will + be hidden and disabled. +
    + Vitro.smtpHost + + smtp.servername.edu +
    + Specify the JDBC URL of your database. Change + the end of the URL to reflect your database name (if it is not "vivo"). +
    + VitroConnection.DataSource.url + + jdbc:mysql://localhost/vivo +
    + Change the username to match the authorized user + you created in MySQL. +
    + VitroConnection.DataSource.username + + username +
    + Change the password to match the password you + created in MySQL. +
    + VitroConnection.DataSource.password + + password +
    + Specify the Jena triple store technology to use. + SDB is Jena's SPARQL database; this setting allows RDF data to scale + beyond the limits of the JVM heap. Set to RDB to use the older Jena RDB + store with in-memory caching. +
    + VitroConnection.DataSource.tripleStoreType + + SDB +
    + Specify the maximum number of active connections + in the database connection pool to support the anticipated number of + concurrent page requests. It is not necessary to adjust this value when + using the RDB configuration. +
    + VitroConnection.DataSource.pool.maxActive + + 40 +
    + Specify the maximum number of database + connections that will be allowed to remain idle in the connection pool. + Default is 25% of the maximum number of active connections. +
    + VitroConnection.DataSource.pool.maxIdle + + 10 +
    + Change the dbtype setting to use a database + other than MySQL. Otherwise, leave this value unchanged. Possible + values are DB2, derby, HSQLDB, H2, MySQL, Oracle, PostgreSQL, and + SQLServer. Refer to http://openjena.org/wiki/SDB/Databases_Supported + for additional information. +
    + VitroConnection.DataSource.dbtype + + MySQL +
    + Specify a driver class name to use a database + other than MySQL. Otherwise, leave this value unchanged. This JAR file + for this driver must be added to the the webapp/lib + directory within the vitro.core.dir specified above. +
    + VitroConnection.DataSource.driver + + com.mysql.jdbc.Driver +
    + Change the validation query used to test + database connections only if necessary to use a database other than + MySQL. Otherwise, leave this value unchanged. +
    + VitroConnection.DataSource.validationQuery + + SELECT 1 +
    + Specify the name of your first admin user for + the VIVO application. This user will have an initial temporary password + of 'defaultAdmin'. You will be prompted to create a new password on + first login. +
    + initialAdminUser + + defaultAdmin +
    + The URI of a property that can be used to + associate an Individual with a user account. When a user logs in with a + name that matches the value of this property, the user will be + authorized to edit that Individual.  For example, to use the netID + at Cornell University as the property: +
    + seflEditing.idMatchingProperty + = + http://vivo.cornell.edu/ns/hr/0.9/hr.owl#netId +
    + selfEditing.idMatchingProperty + + http://vivo.mydomain.edu/ns#networkId +
    + The temporal graph visualization can require extensive machine resources. + This can have a particularly noticable impact on memory usage if +
      +
    • + VIVO is configured to use Jena SDB, +
    • +
    • + The organization tree is deep, +
    • +
    • + The number of grants and publications is large. +
    • +
    + The VIVO developers are working to make this visualization more efficient. + In the meantime, VIVO release 1.2 allows you to guard against this impact + by setting the "visualization.temporal" flag to "disabled". +
    + visualization.temporal + + enabled +
    + The temporal graph visualization is used to + compare different + organizations/people within an organization on parameters like number + of publications or grants. By default, the app will attempt to make its + best guess at the top level organization in your instance. If you're + unhappy with this selection, uncomment out the property below and set + it to the URI of the organization individual you want to identify as + the top level organization. It will be used as the default whenever the + temporal graph visualization is rendered without being passed an + explicit org. For example, to use "Ponce School of Medicine" as the top + organization: +
    + visualization.topLevelOrg = + http://vivo.psm.edu/individual/n2862 +
    + visualization.topLevelOrg + + http://vivo-trunk.indiana.edu/individual/topLevelOrgURI +
    -

    -

    - 3. Apply any previous changes you have made to the new source directory. +

    + 3. Apply any previous changes you have made to the new source + directory. +

    Special notes regarding source files
    • - This process assumes any changes made to the application were made in - the source directory and deployed, and were not made directly within - the Tomcat webapps directory. + This process assumes any changes made to the application were + made in the source directory and deployed, and were not made directly + within the Tomcat webapps directory.
    • - In many cases, simply copying the modified files from your original - source directory will not work since the files on which they are based - have changed. It will be necessary to inspect the new source files and - add any changes to them at that time. + In many cases, simply copying the modified files from your + original source directory will not work since the files on which they + are based have changed. It will be necessary to inspect the new source + files and add any changes to them at that time.
    • - NIH-funded VIVO Implmentations will need to apply the Google Analytics Tracking - Code (GATC) to googleAnalytics.ftl - in the theme:
      [new_source_directory]/themes/[theme_dir]/templates/googleAnalytics.ftl
      + NIH-funded VIVO implementations will need to apply the Google + Analytics Tracking Code (GATC) to googleAnalytics.ftl + in the theme:
      [new_source_directory]/themes/[theme_dir]/templates/googleAnalytics.ftl
      A sample googleAnalytics.ftl - is included in the built-in theme. This file - serves only as an example, and you must replace the tracking code shown - with your institution's own tracking code. - For additional information about the GATC for the NIH-funded VIVO - implementation sites and a copy your institution's tracking code, see the VIVO Google Analytics wiki page. + is included in the built-in theme. This file serves only as an example, + and you must replace the tracking code shown with your institution's own + tracking code. For additional information about the GATC for the NIH-funded + VIVO implementation sites and a copy of your institution's tracking code, see + the VIVO Google Analytics wiki page.
    • If you had used the vivo/contrib/FLShibboleth - code in your previous release, - you should stop using it. Consult install.html - or VIVO Release 1 v1.2 Installation Guide - on "Using an External Authentication System with VIVO". + code in your previous release, you should stop using it. Consult install.html + or VIVO Release 1 + v1.2 Installation Guide + on "Using an External Authentication System + with VIVO".
    -

    -

    - 4. If you had modified web.xml - to configure the Pellet Reasoner (as described - in the installation instructions), repeat that modification. -

    -

    - 5. Stop Apache Tomcat and run ant by typing: ant all -

    -

    - 6. Start Apache Tomcat and log in to VIVO. -

    -

    III. Ontology Changes

    -

    A. Verify Ontology upgrade process

    -

    - After Apache Tomcat is started, these files should be reviewed to - verify that the automated upgrade process was executed - successfully.  The ontology alignment process will create the - following files in the Tomcat webapps/vivo/WEB-INF directory: -

    -
    -
    - ontologies/update/logs/knowledgeBaseUpdate.log -
    -
    - A log of a summary of updates that were made to the knowledge base and - notes about some recommended manual reviews. This file should end with - "Successfully finished processing ontology changes". -
    -
    -
    -
    - ontologies/update/logs/knowledgeBaseUpdate.error.log -
    -
    - A log of errors that were encountered during the upgrade process. This - file should be empty if the upgrade was successful. -
    -
    -
    -
    - ontologies/update/changedData/removedData.n3 -
    -
    - An N3 file containing all the statements that were removed from the - knowledge base. -
    -
    -
    -
    - ontologies/update/changedData/addedData.n3 -
    -
    - An N3 file containing all the statements that were added to the - knowledge base. -
    -
    -

    B. Ontology knowledge base manual review

    -

    - Changes to the VIVO core ontology may require corresponding - modifications of the knowledge base instance data and local ontology - extensions. -

    -

    - When Apache Tomcat starts up following the upgrade, it will initiate a - process to examine the knowledge base and apply necessary changes. Not - all of the modifications that may be required can be automated, so - manual review of the knowledge base is recommended after the automated - upgrade process. The automated process will make only the following - types of changes: -

    -
    -
    - Class or Property renaming -
    -
    - All references to the class (in the subject or object position) will be - updated to the new name. References to the property will be updated to - the new name. -
    -
    -
    -
    - Class or Property deletion -
    -
    - All individuals in a deleted class will be removed. -
    - All statements using a deleted property will be changed to use the - nearest available superproperty. If there is no available superproperty - then the statement will be deleted from the knowledge base. Note that - all removed and added data is recorded in the files in the changedData - directory. -
    -
    -
    -
    - Property addition -
    -
    - If a newly added property is the inverse of a previously existing - property, the inverse of any statements using the pre-existing property - will be asserted. -
    -
    -
    -
    - Annotation property default values -
    -
    - If a site has modified the value of a vitro annotation (such as - displayRankAnnot or displayLimitAnnot) so that it is no longer using - the default, then that setting will be left unchanged. -
    - If a site is using the default value of a vitro annotation, and the - default has been changed in the new version of the ontology, then the - new default value will be propagated to the knowledge base. -
    -
    -

    IV. Theme Changes

    -

    - VIVO 1.2 comes with a new theme called "wilma" that uses the FreeMarker template - engine for generating web pages. The theme is located in /vivo/themes/wilma and - the FreeMarker files have an ftl (for FreeMarker Template Language) extension. -

    -

    - Follow step A or B below, whichever is applicable to your site: -

    -

    - A. If you did not create a customized theme for your site in V1.0 or V1.1, but used - the vivo-basic theme in its original directory, you need not take any - action in order to convert your site to the VIVO 1.1 theme. -

    -

    I THINK THIS SECTION NEEDS MAJOR CHANGING AND I NEED HELP WITH IT, Por Favor

    -

    - B. If you created your own theme directory in VIVO 1.1, follow the steps below - under sections "Templates," "Stylesheets," and "Site Icons" to upgrade your - theme to VIVO 1.2. -

    -
    -
    - 1. Templates -
    -
    -
    -
    - a. Copy the directory /vivo/themes/vivo-basic/templates - into your theme directory /vivo/themes/[your-theme-name]. -
    -
    -
    -
    - b. Follow step i or ii below, whichever is applicable to your theme. -
    -
    -
      -
    1. - If you did not apply any customizations to the JSPs in your VIVO - 1.0 theme, then you do not need to apply any additional changes - to the VIVO 1.1 theme templates during the upgrade process. -
    2. -
    3. -

      - If you did apply customizations to the JSPs in your VIVO 1.0 - theme,you will need to hand-replicate those modifications in the - new theme template files. -

      -

      - The theme template content that was previously contained in - three JSP files is now contained in five FTL files. The - correspondence between the 1.0 JSPs and the 1.1 FTLs is as - follows: -

      -
      -            identity.jsp => identity.ftl
      -            menu.jsp => menu.ftl and search.ftl
      -            footer.jsp => footer.ftl and googleAnalytics.ftl
      -								    
      -

      - googleAnalytics.ftl - is the file to which you add your site's Google Analytics Tracking - Code (see section II). -

      -

      - Because the FreeMarker Template Language uses many syntactic - conventions that will be familiar to template authors from JSP - or other common templating systems, the translation of your JSP - changes into the new FTLs should be relatively straightforward. -

      -

      - Consult the FreeMarker Template Author's Guide at http://freemarker.org/docs/dgui.html - and the Reference at http://freemarker.org/docs/ref.html - for complete documentation of the syntax and available built-in constructs. Template - authors need not be concerned with the Programmer's Guide or Java API documentation. -

      -
    4. -
    -
    -
    - c. Remove the jsp directory from your themes directory. -
    -
    -
    -
    -
    -
    - 2. Stylesheets -
    -
    - VIVO 1.1 includes changes to vivo-basic stylesheets. If you modified - styles in your VIVO 1.0 theme, you will not be able to simply copy the - 1.0 stylesheets into your 1.1 theme, because you will then lose 1.1 - style upgrades that your theme should pick up. Instead, you should - use the vivo-basic 1.1 stylesheets as a starting point, and manually - merge your 1.0 style modifications in as needed. -
    -
    - 3. Site Icons -
    -
    - Copy the site icons from your 1.1 theme into the site_icons folder in - your 1.2 theme. -
    -
    -
- - +

+ 4. If you had modified web.xml + to configure the Pellet Reasoner (as described + in the installation instructions), repeat that modification. +

+

+ 5. Stop Apache Tomcat and run ant by typing: ant all +

+

+ 6. Start Apache Tomcat and log in to VIVO. +

+

IV. Ontology Changes

+

i. Verify Ontology upgrade process

+

+ After Apache Tomcat is started, these files should be reviewed to + verify that the automated upgrade process was executed + successfully.  The ontology alignment process will create the + following files in the Tomcat webapps/vivo/WEB-INF directory: +

+
+
+ ontologies/update/logs/knowledgeBaseUpdate.log +
+
+ A log of a summary of updates that were made to the knowledge base and + notes about some recommended manual reviews. This file should end with + "Finished knowledge base migration". + If this file contains any warnings they should be reviewed with + your implementation team representative to see whether any + corrective action needs to be taken. +
+
+
+
+ ontologies/update/logs/knowledgeBaseUpdate.error.log +
+
+ A log of errors that were encountered during the upgrade process. This + file should be empty if the upgrade was successful. +
+
+
+
+ ontologies/update/changedData/removedData.n3 +
+
+ An N3 file containing all the statements that were removed from the + knowledge base. +
+
+
+
+ ontologies/update/changedData/addedData.n3 +
+
+ An N3 file containing all the statements that were added to the + knowledge base. +
+
+

ii. Ontology knowledge base manual review

+

+ Changes to the VIVO core ontology may require corresponding + modifications of the knowledge base instance data and local ontology + extensions. +

+

+ When Apache Tomcat starts up following the upgrade, it will initiate a + process to examine the knowledge base and apply necessary changes. Not + all of the modifications that may be required can be automated, so + manual review of the knowledge base is recommended after the automated + upgrade process. The automated process will make only the following + types of changes: +

+
+
+ Class or Property renaming +
+
+ All references to the class (in the subject or object position) will be + updated to the new name. References to the property will be updated to + the new name. +
+
+
+
+ Class or Property deletion +
+
+ All individuals in a deleted class will be removed. +
+ All statements using a deleted property will be changed to use the + nearest available superproperty. If there is no available superproperty + then the statement will be deleted from the knowledge base. Note that + all removed and added data is recorded in the files in the changedData + directory. +
+
+
+
+ Property addition +
+
+ If a newly added property is the inverse of a previously existing + property, the inverse of any statements using the pre-existing property + will be asserted. +
+
+
+
+ Annotation property default values +
+
+ If a site has modified the value of a vitro annotation (such as + displayRankAnnot or displayLimitAnnot) so that it is no longer using + the default, then that setting will be left unchanged. +
+ If a site is using the default value of a vitro annotation, and the + default has been changed in the new version of the ontology, then the + new default value will be propagated to the knowledge base. +
+
+

V. File Storage System Upgrade

+

i. Changes to the File Storage System

+

+ Each uploaded file exists as an individual in VIVO. When the browser + requests an uploaded file from VIVO, the data model is queried to find + out where the file is actually stored, so it can be downloaded to the + browser. +

+

+ In VIVO 1.2 this storage location, known as the "Alias URL" for + the uploaded file, is stored in the file individual. That way, pages that + contain many files can be displayed much more quickly. +

+

+ When Apache Tomcat starts up after the upgrade, + it will initiate a process to calculate the "Alias URL" + for each existing file and store it in the data model for fast access. +

+

ii. Verify File Storage System upgrade process

+

+ The File Storage upgrade process will create a log file in the + VIVO upload directory. You should review this file to ensure that + this upgrade worked properly. +

+
+
+ upgrade/FileStorageAliasAdder-log.2011-00-00T00-00-00.txt +
+
+ A log of the upgrade process. The actual filename includes a timestamp + that tells when the upgrade executed. + This file should end withFinished adding alias URLs to FileByteStreams. + If this file contains any warnings they should be reviewed with + your implementation team representative to see whether any + corrective action needs to be taken. +
+
+

VI. Theme Changes

+

Introducing a New Default Theme

+

+ VIVO 1.2 includes a new default theme called wilma + (located in + /vivo/themes/wilma) which fully supports all 1.2 features. For details on how to + create your own theme using wilma as a starting point, please review the Site Administrator's Guide. +

+
+

The vivo-basic theme has been deprecated with the 1.2 release and is not + recommended for production instances.

+

+ Since vivo-basic was the default theme for all previous releases, it is + included as part of VIVO 1.2 to help with the transition of upgrading + existing installations to the latest code, but all vivo-basic development + has ceased and it will not be distributed in future releases. +

+

+ Please note that vivo-basic does not support all of the new 1.2 features. + Most notably, in choosing to use vivo-basic you will be missing out on the + following: +

+ +
+

Templates

+

+ The 1.2 release continues the transition from JavaServer Pages (.jsp) to + Freemarker templates (.ftl) for generating web pages. While there are still + JSP files in action behind the scenes, as of 1.2 all theme templates + are of the Freemarker variety and are located in the "templates" directory + within a theme. +

+

+ If you did not create a custom theme for your site previously, but used + the vivo-basic theme in its original directory, you need not take any + action in order to remain using the vivo-basic theme in 1.2. +

+

+ If you did make changes to the vivo-basic theme, you will need to reapply those changes. + We recommend you apply these changes to the wilma theme. +

+
+ Please note: + The vivo-basic theme has been deprecated and is not recommended for production instances. +
+

+ For details on the new structure of themes in 1.2 and further information + regarding the development of your own custom theme, please review the Site Administrator's Guide. This document will focus on updating an existing + pre 1.2 theme. +

+

VII. Set Up SDB Store in the Background (Optional)

+

+ If your VIVO installation is running in RDB mode, and you'd like to convert + to SDB, you can start the conversion process in the background while the RDB + system is running. This will reduce the delay in initial startup after the + application is redeployed with deploy.properties set for SDB. Note that it + is important not to edit any data anywhere in the application while this + background conversion is running. +

+

+ To start the SDB conversion, log in as a system + administrator and request /sdbsetup (For example, if your VIVO is installed + at http://vivo.myuniversity.edu/ you would type + http://vivo.myuniversity.edu/sdbsetup into your browser). +

+

+ Click the button that appears on this page. +

+

+ During the course of the SDB setup, which may take several hours on a + large database, subsequent requests to /sdbsetup will display a + message that the operation is still in progress. When a request for this + page shows a message that the SDB setup has completed successfully, shut down + Tomcat, set deploy.properties to SDB mode, redeploy, and restart Tomcat. + VIVO will now be running from the SDB store. +

+ + + diff --git a/example.deploy.properties b/example.deploy.properties index d8787897..f4732b34 100644 --- a/example.deploy.properties +++ b/example.deploy.properties @@ -20,8 +20,8 @@ Vitro.defaultNamespace = http://vivo.mydomain.edu/individual/ # # Where is the Vitro core directory? -# In most deployments, this is set to ./vitro-core, but internal developers may -# prefer to set it to ../vitro +# In most deployments, this is set to ./vitro-core (It is not uncommon for this +# setting to point elsewhere in development environments). # Examples: # vitro.core.dir = ./vitro-core # vitro.core.dir = ../vitro @@ -43,14 +43,16 @@ webapp.name = vivo # # The location where the VIVO application will store uploaded files -# (usually images). You should arrange for these files to be backed up in some -# way. +# (usually images). Be sure this directory exists and is writable by the +# user that the Tomcat service is running as. You should arrange for these +# files to be backed up in some way. # upload.directory = /usr/local/vivo/data/uploads # # The location where the VIVO application will create its Lucene search -# index. +# index. Be sure this directory exists and is writable by the +# user that the Tomcat service is running as. # LuceneSetup.indexDir = /usr/local/vivo/data/luceneIndex @@ -76,7 +78,7 @@ VitroConnection.DataSource.password = vitrodbPassword # this setting allows RDF data to scale beyond the limits of the JVM heap. # Set to RDB to use the older Jena RDB store with in-memory caching. # -VitroConnection.DataSource.tripleStoreType = SDB +VitroConnection.DataSource.tripleStoreType = RDB # # The maximum number of active connections in the database connection pool. @@ -111,7 +113,7 @@ initialAdminUser = defaultAdmin # # How is a logged-in user associated with a particular Individual? One way is # for the Individual to have a property whose value is the username of the user. -# This is the name of that property. +# This value should be the URI for that property. # selfEditing.idMatchingProperty = http://vivo.mydomain.edu/ns#networkId @@ -119,18 +121,32 @@ selfEditing.idMatchingProperty = http://vivo.mydomain.edu/ns#networkId # If an external authentication system like Shibboleth or CUWebAuth is to be # used, these properties say how the login button should be labeled, and which # HTTP header will contain the user ID from the authentication system. If such -# as system is not to be used, leave these commented out. Consult the +# a system is not to be used, leave these commented out. Consult the # installation instructions for more details. # #externalAuth.buttonText = Log in using BearCat Shibboleth #externalAuth.netIdHeaderName = remote_userID # -# The temporal graph visualization is used to compare different organizations/people -# within an organization on different parameters like number of publications, grants. -# This parameter will be used as a default in case a URI is not provided. It will also -# be used whenever this visualization is to be rendered for the top level organization. -# In the absence of this parameter, a SPARQL query will be fired which will attempt to -# provide a top level organization. +# The temporal graph visualization can require extensive machine resources. +# This can have a particularly noticable impact on memory usage if +# - VIVO is configured to use Jena SDB, +# - The organization tree is deep, +# - The number of grants and publications is large. +# VIVO release 1.2 allows you to guard against this impact by setting +# the "visualization.temporal" flag to "disabled". +# +visualization.temporal = enabled -# visualization.topLevelOrg = http://vivo-trunk.indiana.edu/individual/topLevelOrgURI +# +# The temporal graph visualization is used to compare different organizations/people +# within an organization on parameters like number of publications or grants. +# By default, the app will attempt to make its best guess at the top level +# organization in your instance. If you're unhappy with this selection, uncomment out +# the property below and set it to the URI of the organization individual you want to +# identify as the top level organization. It will be used as the default whenever the +# temporal graph visualization is rendered without being passed an explicit org. +# For example, to use "Ponce School of Medicine" as the top organization: +# visualization.topLevelOrg = http://vivo.psm.edu/individual/n2862 +# +# visualization.topLevelOrg = http://vivo.mydomain.edu/individual/topLevelOrgURI diff --git a/productMods/WEB-INF/filegraph/tbox/scires-1.2.owl b/productMods/WEB-INF/filegraph/tbox/scires-1.2.owl index f0889199..5fcdbca2 100644 --- a/productMods/WEB-INF/filegraph/tbox/scires-1.2.owl +++ b/productMods/WEB-INF/filegraph/tbox/scires-1.2.owl @@ -13,153 +13,156 @@ xmlns:j.5="http://purl.org/dc/terms/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > - - - + + - + + eagle-i: Material entity that is a portion or quantity of a biological material for use in testing, examination, or study. A biological specimen can be an individual animal, part of or derived an animal, plant, part of a plant, or microorganism. When a taxon is described, it is typically based on a single specimen and is referred to as the holotype. - + An individual animal, part of or derived an animal, plant, part of a plant, or microorganism. + A portion or quantity of a biological material for use in testing, examination, or study. - - number of human participants in the study (trial). + + - - - - An implement used to facilitate work, especially precision work. - An implement used to facilitate work, especially precision work. - - - - A plan specification that allows different domain experts to reliably and independently reproduce a process. - 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. + - - - - - - + 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. + A plan specification that allows different domain experts to reliably and independently reproduce a process. - + Phase 4 Clinical Trial In Phase 4 trials, post marketing studies delineate additional information including the drug's or treatment's risks, benefits, and optimal use. - + - - + + - - - - + + + eagle-i: Research project that uses or collects measurements or assessments about humans. + Research project that uses or collects measurements or assessments about humans. + Phase 2 Clinical Trial - + In Phase 2 trials, an experimental study drug or treatment is given to a larger group of people (100-300) to see if it is effective and to further evaluate its safety. - - An organism is a material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. - OBI: An organism is material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. An organism may be unicellular or made up, like humans, of many billions of cells divided into specialized tissues and organs. -NOTE that we are not addressing for now the issue of whether a foaf:Person is a subclass of obi:Organism - - - - A service that produces a physical object or data. - A service that produces a physical object or data, such as a custom micro-array chip, a made to order antibody, or a behavioral dataset + + ClinicalTrials.gov is an ICMJE-acceptable public registry, offering up-to-date information for locating clinical trials for a wide range of diseases and conditions. The U.S. National Institutes of Health (NIH), through its National Library of Medicine (NLM), developed this site in collaboration with the Food and Drug Administration (FDA), as a result of the FDA Modernization Act, which was passed into law in November 1997. - NCT00000419 - + + + + + + + A service that produces a physical object or data, such as a custom micro-array chip, a made to order antibody, or a behavioral dataset + A service that produces a physical object or data. - - - - In Phase I trials, researchers test an experimental drug or treatment in a small group of people (20-80) for the first time to evaluate its safety, determine a safe dosage range, and identify side effects - Phase 1 Clinical Trial + + + + + - - - Research project that uses or collects measurements or assessments about humans. - - eagle-i: Research project that uses or collects measurements or assessments about humans. - - - - - Every clinical trial in the United States must be approved and monitored by an Institutional Review Board (IRB). An IRB is an independent committee of physicians, statisticians, community advocates and others whose objective is to ensure that a clinical trial is ethical and the rights of study participants are protected. - - - - A portion or quantity of a biological material for use in testing, examination, or study. - eagle-i: Material entity that is a portion or quantity of a biological material for use in testing, examination, or study. A biological specimen can be an individual animal, part of or derived an animal, plant, part of a plant, or microorganism. When a taxon is described, it is typically based on a single specimen and is referred to as the holotype. - An individual animal, part of or derived an animal, plant, part of a plant, or microorganism. - - - In Phase 3 trials, an experimental study drug or treatment is given to large groups of people (1,000-3,000) to confirm its effectiveness, monitor side effects, compare it to commonly used treatments, and collect information that will allow the experimental drug or treatment to be used safely. - - - - Phase 3 Clinical Trial - - + eagle-i: Material entity that is used in a chemical reaction or other experimental process to detect, measure, examine, or produce other substances. NOTE: For now we are not addressing whether this is a subclass of foaf:Agent Material entity that is used in a chemical reaction or other experimental process to detect, measure, examine, or produce other substances. - - + + + In Phase I trials, researchers test an experimental drug or treatment in a small group of people (20-80) for the first time to evaluate its safety, determine a safe dosage range, and identify side effects + Phase 1 Clinical Trial + + + + An organism is a material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. + OBI: An organism is material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. An organism may be unicellular or made up, like humans, of many billions of cells divided into specialized tissues and organs. +NOTE that we are not addressing for now the issue of whether a foaf:Person is a subclass of obi:Organism + + + + A research study using human volunteers to answer specifc health-related questions. A clinical trial is a research study using human volunteers to answer questions about treatments for diseases and conditions. Clinical trials are conducted in phases. The trials at each phase have a different purpose and help scientists answer different questions. - A research study using human volunteers to answer specifc health-related questions. + - + + + Every clinical trial in the United States must be approved and monitored by an Institutional Review Board (IRB). An IRB is an independent committee of physicians, statisticians, community advocates and others whose objective is to ensure that a clinical trial is ethical and the rights of study participants are protected. + + + + + In Phase 3 trials, an experimental study drug or treatment is given to large groups of people (1,000-3,000) to confirm its effectiveness, monitor side effects, compare it to commonly used treatments, and collect information that will allow the experimental drug or treatment to be used safely. + - - Phase 0 is a recent designation for exploratory, first-in-human trials conducted in accordance with the United States Food and Drug Administration's (FDA) 2006 Guidance on Exploratory Investigational New Drug (IND) Studies. Phase 0 trials are also known as human microdosing studies and are designed to speed up the development of promising drugs or imaging agents by establishing very early on whether the drug or agent behaves in human subjects as was expected from preclinical studies. - Phase 0 Clinical Trial + Phase 3 Clinical Trial + + + + + An implement used to facilitate work, especially precision work. + + An implement used to facilitate work, especially precision work. + + + + + - + - - - - + + + + Phase 0 is a recent designation for exploratory, first-in-human trials conducted in accordance with the United States Food and Drug Administration's (FDA) 2006 Guidance on Exploratory Investigational New Drug (IND) Studies. Phase 0 trials are also known as human microdosing studies and are designed to speed up the development of promising drugs or imaging agents by establishing very early on whether the drug or agent behaves in human subjects as was expected from preclinical studies. + Phase 0 Clinical Trial + + + + - - - + + + + + + + diff --git a/productMods/WEB-INF/filegraph/tbox/vitro-0.7.owl b/productMods/WEB-INF/filegraph/tbox/vitro-0.7.owl index 1050aee6..79ce94f0 100644 --- a/productMods/WEB-INF/filegraph/tbox/vitro-0.7.owl +++ b/productMods/WEB-INF/filegraph/tbox/vitro-0.7.owl @@ -278,5 +278,8 @@ xmlns:vitro="&vitro;" + + + diff --git a/productMods/WEB-INF/filegraph/tbox/vivo-core-1.2.owl b/productMods/WEB-INF/filegraph/tbox/vivo-core-1.2.owl index d92acb40..168e4474 100644 --- a/productMods/WEB-INF/filegraph/tbox/vivo-core-1.2.owl +++ b/productMods/WEB-INF/filegraph/tbox/vivo-core-1.2.owl @@ -27,13 +27,8 @@ - 1 - - - - - - + 1 + http://purl.org/ontology/bibo/ @@ -75,10 +70,20 @@ + + + + + - - + + + + + + 1 + @@ -101,14 +106,19 @@ A person who is enrolled in an educational institution. Use only if no specific subclasses of core:Student describe the person. + + + + + - + UN Cartographic Section UN Cartographic Section - + - + @@ -116,28 +126,18 @@ - - - - - - - - 1 - - - Accounting & Research Services Assistant; Director of Information Technology Staff, support, and other non-academic positions. - A position classified as professional, staff, support, or any other non-academic role + + A position classified as professional, staff, support, or any other non-academic role @@ -152,20 +152,25 @@ Serial Item and Contribution Identifier + + + + + - - - - - + + + + + Definition take from: http://en.wikipedia.org/wiki/Government_agency. United States Library of Congress @@ -180,14 +185,14 @@ Public description modified from the information on this page: http://www.w3.org/TR/2005/WD-swbp-skos-core-guide-20050510/#sechierarchy . - - - - - + + + + + @@ -219,11 +224,6 @@ Definition take from: http://xmlns.com/foaf/spec/#term_based_near . foaf indicates that the status of this term is "unstable". "The based_near relationship relates two "spatial things" (anything that can be somewhere), the latter typically described using the geo:lat / geo:long geo-positioning vocabulary (http://www.w3.org/2003/01/geo/wgs84_pos#). This allows us to say describe the typical latitute and longitude of, say, a Person (people are spatial things - they can be places) without implying that a precise location has been given." Used to link an agent, related to bibliographic things, to a place where it is based near: can be a city, a monument, a building, etc. - - - - - Note that the administering department is not the central research administration office (such as University of Florida DSP or Cornell OSP) -- we didn't see a need to record a relationship to that office because it implicitly manages all grants. @@ -231,18 +231,28 @@ + The most general classification of a person - - The most general classification of a person - + + + + + + + + + + + + http://purl.org/ontology/bibo/ @@ -251,11 +261,6 @@ Starting page number within a continuous page range. stable - - - 1 - - @@ -267,6 +272,11 @@ + + + 1 + + @@ -275,10 +285,10 @@ http://www.fao.org/figis/servlet/RefServlet Fisheries Global Information System http://www.fao.org/figis/servlet/RefServlet - - + - + + @@ -299,20 +309,15 @@ - - - 1 - - - + + - @@ -323,13 +328,12 @@ Short definition was partially taken from http://en.wikipedia.org/wiki/Subnational_entity. - + - - + + - @@ -340,7 +344,6 @@ - @@ -351,6 +354,7 @@ + @@ -358,18 +362,29 @@ - - + - + + + + + + + + + + + + + @@ -378,6 +393,11 @@ + + + 1 + + @@ -401,6 +421,16 @@ http://www.fao.org/termportal/contr/fr/ FAO terminology + + + + + + + + + + 2010-06-24 @@ -414,16 +444,6 @@ http://www.fao.org/termportal/contr/es/ http://www.fao.org/termportal/contr/ar/ - - - - - - - - - - @@ -431,6 +451,11 @@ + + + + + @@ -438,23 +463,18 @@ - + - - - - - - - + 1 + Audiovisual recording in video format - - + + @@ -475,16 +495,6 @@ An explicit individual period considered by an academic institution to be its primary academic cycle. - - - - - - - - 1 - - @@ -514,15 +524,10 @@ UN Statistics Division - + 1 - - - - - - + http://faostat.fao.org @@ -534,30 +539,30 @@ http://faostat.fao.org/default.aspx?lang=es FAOSTAT http://faostat.fao.org - + - - + 1 + + + + + + - - - - - Currently being used by a restriction on organization. - + + - 1 - + @@ -577,11 +582,6 @@ - - - 1 - - http://www.fao.org/termportal/en/ http://www.fao.org/termportal/en/ @@ -598,20 +598,15 @@ http://www.iso.org/iso/fr/country_codes/iso_3166_code_lists.htm - Authorship of journal articles, books and other original works is a means by which academics communicate the results of their scholarly work, establish priority for their discoveries, and build their reputation among their peers. This class allows for linking an author to a publication while indicating information about that author's authorship. Contains the authors name, their rank in the publication, and whether or not they are a corresponding author on the publication. + Currently any abstract name is given to members of this class. This could change in the future. - - - 1 - - A seminar, discussion group, or the like, that emphasizes zxchange of ideas and the demonstration and application of techniques, skills, etc. stable @@ -620,10 +615,20 @@ This class allows for linking an author to a publication while indicating inform Bibo Definition: A seminar, discussion group, or the like, that emphasizes exchange of ideas and the demonstration and application of techniques, skills, etc. - + - - + 1 + + + + + + + + + + 1 + @@ -643,11 +648,11 @@ This class allows for linking an author to a publication while indicating inform stable - + Committee on Institutional Cooperation (CIC); The Five Colleges of Ohio Independent organizations formally working together toward a common goal, under an expressed agreement - + @@ -657,15 +662,15 @@ This class allows for linking an author to a publication while indicating inform - + - + A group of related documents issued at regular intervals. http://purl.org/ontology/bibo/ stable + - - + @@ -676,11 +681,6 @@ This class allows for linking an author to a publication while indicating inform - - - - - http://www.fao.org/termportal/contr/ar/ @@ -707,15 +707,10 @@ This class allows for linking an author to a publication while indicating inform Short Definition take from http://en.wiktionary.org/wiki/continent. - - + - - - - - - + + @@ -725,7 +720,7 @@ This class allows for linking an author to a publication while indicating inform 1 - + http://www.fao.org/termportal/contr/zh/ @@ -740,11 +735,6 @@ This class allows for linking an author to a publication while indicating inform http://www.fao.org/termportal/contr/ar/ 2010-06-24 - - - 1 - - @@ -826,32 +816,22 @@ This class allows for linking an author to a publication while indicating inform 2009-04-30 FAOSTAT - - - 1 - - A unit devoted primarily to extension activities, whether for outreach or research. Alachua County Extension Office + + + 1 + + Public Description for bibo:distributor taken from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . - - - - - - - - 1 - - FAO terminology @@ -867,14 +847,14 @@ This class allows for linking an author to a publication while indicating inform - - - + + + - - + + + - @@ -885,11 +865,6 @@ This class allows for linking an author to a publication while indicating inform A legal decision that affirms a ruling. - - - - - @@ -903,30 +878,25 @@ This class allows for linking an author to a publication while indicating inform Use subclasses of core:Facility subclasses instead of this class if possible - - - - - A gathering of people for a defined purpose, not necessarily public or announced - + 1 - + - + - - + 1 + - + - + @@ -975,11 +945,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - @@ -990,11 +955,6 @@ This class allows for linking an author to a publication while indicating inform Either city or town - a thickly populated area having fixed boundaries and certain local powers of government. - - - - - @@ -1005,25 +965,25 @@ This class allows for linking an author to a publication while indicating inform That is a position held by an academic faculty member who works for administration. + + Associate Dean - - An academic administrative position (associate dean, etc.) as distinct from a professional administrative position (non-academic) - - - - 2 - - server; Bruker Vector-33 FT-IR - + A network server is one example. Medical schools and research laboratories can list professional equipment, such as microscopes. - + A physical object provided for specific purpose, task or occupation. + + + + + + @@ -1033,26 +993,31 @@ This class allows for linking an author to a publication while indicating inform http://purl.org/ontology/bibo/ + + + 1 + + - http://purl.org/ontology/bibo/ A specific journal article - + A written composition in prose, usually nonfiction, on a specific topic, forming an independent part of a periodical or book - + Short Definition modified from the bibo ontology. A written composition in prose, usually nonfiction, on a specific topic, forming an independent part of a book or other publication, as a newspaper or magazine. + stable + + Director of Admissions and Placement; Associate University Librarian Particular position in an organization, commonly identified by job title, and normally associated with a job description that details the tasks and responsibilities that go with the position. - An employment activity, whether compensated or not. Short definition comes from http://en.wikipedia.org/wiki/Position, and has been modified. - @@ -1065,16 +1030,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - - - - - - The thesis degree. @@ -1086,9 +1041,9 @@ This class allows for linking an author to a publication while indicating inform The source of the public description and this info is found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html. Bibo considers this term "unstable". The bibo editorial note is: "We are not defining, using an enumeration, the range of the bibo:degree to the defined list of bibo:ThesisDegree. We won't do it because we want people to be able to define new degress if needed by some special usecases. Creating such an enumeration would restrict this to happen." - + An organizational unit (as opposed to the physical facility) that performs research, provides services, or processes materials @@ -1103,20 +1058,10 @@ This class allows for linking an author to a publication while indicating inform - - - - - - - - 1 - - Relates a document to an event; for example, a paper to a conference. @@ -1128,6 +1073,11 @@ This class allows for linking an author to a publication while indicating inform unstable + + + + + Agricultural area, this category is the sum of areas under a) arable land - land under temporary agricultural crops (multiple-cropped areas are counted only once), temporary meadows for mowing or pasture, land under market and kitchen gardens and land temporarily fallow (less than five years). The abandoned land resulting from shifting cultivation is not included in this category. Data for “Arable land†are not meant to indicate the amount of land that is potentially cultivable; (b) permanent crops - land cultivated with long-term crops which do not have to be replanted for several years (such as cocoa and coffee); land under trees and shrubs producing flowers, such as roses and jasmine; and nurseries (except those for forest trees, which should be classified under "forest"); and (c) permanent meadows and pastures - land used permanently (five years or more) to grow herbaceous forage crops, either cultivated or growing wild (wild prairie or grazing land). Data are expressed in 1000 hectares. http://faostat.fao.org/site/375/default.aspx @@ -1140,6 +1090,11 @@ This class allows for linking an author to a publication while indicating inform 2009-04-30 http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=es#ancor + + + + + Public Definition source (http://www.answers.com/topic/publisher). @@ -1151,28 +1106,33 @@ This class allows for linking an author to a publication while indicating inform + + + + + + + + + + + + + 1 + + Use for teaching roles other than specific for-credit courses within a person's home institution. Use for teaching experiences other than specific for-credit courses within a person's home institution. - - - - - - - - 1 - - http://faostat.fao.org/DesktopDefault.aspx?PageID=550&lang=fr#ancor @@ -1184,33 +1144,38 @@ This class allows for linking an author to a publication while indicating inform http://faostat.fao.org/DesktopDefault.aspx?PageID=550&lang=es#ancor 2009-09-21 - - - - - US Patent Data; US Job Data A named collection of data, usually containing only one type of data - - - - - - + Computer program and its related documentation; directs the operation of a computer + + + + + An agreement involving specific deliverables and payment + + + + + + + + + + stable @@ -1220,6 +1185,11 @@ This class allows for linking an author to a publication while indicating inform Definiton from Bibo here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html + + + + + http://purl.org/ontology/bibo/ @@ -1232,6 +1202,11 @@ This class allows for linking an author to a publication while indicating inform A date and/or time + + + 1 + + @@ -1239,11 +1214,6 @@ This class allows for linking an author to a publication while indicating inform - - - - - http://www.fao.org/termportal/contr/es/ @@ -1284,11 +1254,6 @@ This class allows for linking an author to a publication while indicating inform 020530902X - - - 1 - - Member of the International Conference on Complex Systems Organizing Committee @@ -1300,21 +1265,21 @@ This class allows for linking an author to a publication while indicating inform Note that the administering department is not the central research administration office (such as University of Florida DSP or Cornell OSP) -- we didn't see a need to record a relationship to that office because it implicitly manages all grants. - + - 1 - - - - - - + 1 + A person working in a position of librarian or information professional, or academic or technical expert in support of providing information services or materials. + + + + + http://www.fao.org/termportal/contr/zh/ @@ -1329,16 +1294,26 @@ This class allows for linking an author to a publication while indicating inform FAO terminology + stable A scholarly academic article, typically published in a journal. - + http://purl.org/ontology/bibo/ Written by scholars for other scholars, typically published in an academic journal with an abstract and bibliography - A specific academic journal article + + + + + + + + 1 + + @@ -1350,10 +1325,10 @@ This class allows for linking an author to a publication while indicating inform - + - - + + @@ -1361,11 +1336,6 @@ This class allows for linking an author to a publication while indicating inform http://purl.org/ontology/bibo/ Digital Object Identifier - - - 1 - - A short description of the resource. @@ -1385,10 +1355,10 @@ This class allows for linking an author to a publication while indicating inform http://www.un.org/Depts/Cartographic/french/htmain.htm UN Cartographic Section - + - 1 - + + @@ -1429,10 +1399,10 @@ This class allows for linking an author to a publication while indicating inform http://www.fao.org/termportal/en/ - + - - + + http://www.fao.org/termportal/contr/ar/ @@ -1447,6 +1417,11 @@ This class allows for linking an author to a publication while indicating inform http://www.fao.org/termportal/contr/es/ + + + + + @@ -1458,6 +1433,16 @@ This class allows for linking an author to a publication while indicating inform + + + + + + + + + + @@ -1469,17 +1454,12 @@ This class allows for linking an author to a publication while indicating inform - - - - - - Definition taken from: http://en.wikipedia.org/wiki/University University of Florida; Washington University in St. Louis + An institution of higher education and research, which grants academic degrees in a variety of subjects, and provides both undergraduate education and postgraduate education. @@ -1488,43 +1468,49 @@ This class allows for linking an author to a publication while indicating inform Definition from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html + + + + 2 + Top level of all location classes. It's anticipated that the subclasses will be used when classifying items. And, all locations can be viewable via this class. Use subclasses of core:Location when classsifying items. - + - 1 - + + A document created as a basis for discussion or a very early draft of a formal paper - + - - - - - - + - + + + - 1 - + + + + + + Used for a single narrative summary of teaching, typically covering a wide range of courses including for credit and non-credit teaching over multiple semesters; the "teaches" property links a person directly with an instance of a Semester Class, typically from an institutional database of record; then use Teacher Role for information about a person's role in non-credit teaching or their specific contribution to individual courses @@ -1553,11 +1539,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - http://purl.org/ontology/bibo/ @@ -1567,7 +1548,7 @@ This class allows for linking an author to a publication while indicating inform A periodical of scholarly journal Articles. Contains original scholarly research or review articles by experts in the field Journal of Information Science; IEEE Intelligent System; Scientometrics - + http://purl.org/ontology/bibo/ @@ -1578,15 +1559,20 @@ This class allows for linking an author to a publication while indicating inform Contains news articles, opinions, features, advertising, and is usually issued daily or weekly - - + + + + + + + http://www.fao.org/termportal/contr/es/ http://www.fao.org/termportal/contr/zh/ @@ -1606,14 +1592,14 @@ This class allows for linking an author to a publication while indicating inform - - - - - + + + - - + + + + @@ -1627,19 +1613,9 @@ This class allows for linking an author to a publication while indicating inform - - - - - - - - 1 - - - + Wiley Prize in Biomedical Sciences An Award or Honor An Award or Honor @@ -1657,10 +1633,26 @@ This class allows for linking an author to a publication while indicating inform - + + - 1 - + + + + + + + + + + + + + + + + + @@ -1671,21 +1663,21 @@ This class allows for linking an author to a publication while indicating inform An agent that receives a communication document. - - - - - + + + + Only use if no specific subclasses of core:EventSeries desribe the activity. - - - + + A generic class which may include a conference series, a course section, a seminar series, or a workshop series. When possible, use one of these more specific classes. - - + + + Two or more events that follow on one after the other or are connected one after the other. + + - Enter building name. If the building's name is a number (as in many governmental organizations such as national laboratories and military bases), then enter it. Do not confuse with the number that appears in a postal address. @@ -1699,20 +1691,15 @@ This class allows for linking an author to a publication while indicating inform - + + - - + - - - + - - - - - + + @@ -1720,11 +1707,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - @@ -1744,25 +1726,10 @@ use one freetextKeyword assertion for each keyword or phrase. We would like the range of core:outcome to be the union of Event and Process; and that same union to be the range for core:outcomeOf, but we cannot currently express this with the editor. - - - - - - - - - - - - - - - @@ -1770,33 +1737,23 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - - - + + + - Represents educational training that has been received. This connects person to their academic degree through this educational training, but can also be used when the training does not result in a degree. Currently any abstract name is given to individuals of this class. This could change in the future. + - - - - - - + - - + A paper presented at a conference; optionally collected into a Proceedings or a special Journal issue + @@ -1807,13 +1764,13 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ + Facebook; VIVOweb.org; Flickr A group of Webpages accessible on the Web. A group of webpages available within a specific parent address or URL on the World Wide Web unstable - FAO terminology @@ -1828,22 +1785,12 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/ar/ http://www.fao.org/termportal/contr/zh/ - - - - - - - - 1 - - + Work consisting of collections of previously published works Short Definition is the Medical Subject Heading (MeSH) definition - A document that simultaneously contains other documents. http://purl.org/ontology/bibo/ stable @@ -1853,31 +1800,21 @@ We would like the range of core:outcome to be the union of Event and Process; an a reified relationship - - - 1 - - - - - 1 - - + An area of corporate activity organized as an administrative or functional unit. Definition modified from http://www.thefreedictionary.com/division. It is difficult to tell the difference between a division and a department. Cardiovascular Medicine (division within medicine) - - - + - + + The Ornithological Newsletter @@ -1885,22 +1822,27 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + The bibo:reviewOf public description was found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . As of 26 May 2010, bibo:reviewOf is used with the class Review, but core:reviewIn doesn't seem to be being used. - + + + - - VIVO Outreach Team; VIVO Ontology Team - An informal organization brought together for the purposes of a project or event. + @@ -1918,11 +1860,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - 1 - - Definition take from: http://dictionary.reference.com/browse/hospital. Shands at the University of Florida @@ -1940,34 +1877,14 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ The academic degree of a Thesis - - - 1 - - - - - - - - - - - - - Alchohol Education Center; Center for Arts and Public Policy; Hearing Research Center + A place where a particular activity or service is concentrated. Short Definition take from http://www.thefreedictionary.com/center. - - - - - Country area, area of the country including area under inland water bodies, but excluding offshore territorial waters. Possible variations in the data may be due to updating and revisions of the country data and not necessarily to any change of area. Data are expressed in 1000 hectares. http://faostat.fao.org/site/375/default.aspx FAOSTAT @@ -1983,11 +1900,6 @@ We would like the range of core:outcome to be the union of Event and Process; an Indicates the precision of the value of a DateTimeValue instance. - - - - - For example an HR job title for a person might be - Assistant University Librarian, and the preferred job title for that same person could be - Physical Sciences Librarian. @@ -1996,12 +1908,12 @@ We would like the range of core:outcome to be the union of Event and Process; an - + Short Definition from OCLC Input Standards, EntW A document created to summarize research findings associated with the completion of an academic degree. stable - + http://purl.org/ontology/bibo/ Works created to satisfy the requirements for an academic certification or degree; also called dissertation @@ -2013,21 +1925,16 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - + - - + + UN Statistics Division @@ -2042,11 +1949,16 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + Only use if no specific subclasses of core:Role describe the role. - + + - A person's or organization's type of contribution to an endeavor Only use this broad role class if no subclasses of role describe the item being classified. @@ -2055,11 +1967,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - @@ -2073,29 +1980,9 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - - - 1 - - - - - - - - - - - - @@ -2115,7 +2002,7 @@ We would like the range of core:outcome to be the union of Event and Process; an A structured file of information or a set of logically related data stored and retrieved using computer-based means Short Definition is the Medical Subject Heading (MeSH) definition - + PubMed @@ -2134,7 +2021,7 @@ We would like the range of core:outcome to be the union of Event and Process; an A meeting for consultation or discussion. - + @@ -2143,33 +2030,33 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - + A distinct, usually ongoing and specialized unit within a large organization. Definition modified from the definition here: http://dictionary.reference.com/browse/department. It is difficult to tell the difference between and department and a division. Legal (department within a company); Use for any non-academic department - - - 1 - - - + 1 - + + + + + 1 + + + + + + - An online article or commentary appearing on a blog + A specific blog posting @@ -2181,8 +2068,8 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ Hill Ornithology Collection; Wiley Interscience Online Books Biochemisty Collection A collection of Documents or Collections + - submitted; accepted; in-press; published; invited; refereed. @@ -2205,13 +2092,18 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + - + B.A. Bachelor of Arts This list may have multiple abbreviations for some degrees. + An academic degree at any level, both as reported by individuals for employment and as offered by academic degree programs. - @@ -2229,11 +2121,6 @@ We would like the range of core:outcome to be the union of Event and Process; an A legal document proposing or enacting a law or a group of laws. - - - 1 - - Minnesota; Michigan; Indiana; New York; Quebec; Manitoba; Ontario Source of the Short Definition: http://www.thefreedictionary.com/state. @@ -2256,11 +2143,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - @@ -2270,13 +2152,18 @@ We would like the range of core:outcome to be the union of Event and Process; an - phonograph record; tape; CD; DVD; DAT An audio document; aka record. + http://purl.org/ontology/bibo/ stable Recorded audio in any format + + + + + http://unstats.un.org/unsd/methods/m49/m49alpha.htm http://unstats.un.org/unsd/methods/m49/m49chgef.htm @@ -2298,15 +2185,15 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ - + 1 - + - + + + - - FAO terminology @@ -2321,17 +2208,12 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/zh/ 2010-06-24 - - - 1 - - http://purl.org/ontology/bibo/ film; video; Blu-ray Audiovisual recording in any format - + stable An audio-visual document; film, video, and so forth. @@ -2371,6 +2253,11 @@ We would like the range of core:outcome to be the union of Event and Process; an http://xmlns.com/foaf/spec/#term_lastName. Note from foaf: "The lastName property is provided (alongside firstName) as a mechanism to support legacy data that cannot be easily interpreted in terms of the (otherwise preferred) familyName and givenName properties. The concepts of 'first' and 'last' names do not work well across cultural and linguistic boundaries; however they are widely used in addressbooks and databases." + + + + + @@ -2399,20 +2286,10 @@ We would like the range of core:outcome to be the union of Event and Process; an stable - - - - - - + - - - - - - - + + @@ -2422,16 +2299,16 @@ We would like the range of core:outcome to be the union of Event and Process; an - A defined class of organizations that fund Grants. + National Institute of Health (NIH) - + 1 - + @@ -2442,17 +2319,22 @@ We would like the range of core:outcome to be the union of Event and Process; an A person or company whose business is the publishing of books, periodicals, engravings, computer software, etc. Elsevier; Harper & Row; Indiana University Press - + + + + + + - + + + - 1 - A student organization is an organization, operated by students at a university, whose membership normally consists only of students. @@ -2466,6 +2348,11 @@ We would like the range of core:outcome to be the union of Event and Process; an Afghanistan; Antigua and Barbuda; Cameroon; Iceland; Jamaica; Nigeria; United States of America + + + 1 + + @@ -2474,16 +2361,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - - - - - 2010-06-24 @@ -2497,6 +2374,16 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/zh/ http://www.fao.org/termportal/contr/fr/ + + + 1 + + + + + + + @@ -2508,8 +2395,13 @@ We would like the range of core:outcome to be the union of Event and Process; an The full URL. Uniform Resource Locator (URL) specifies where an identified resource is available and the mechanism for retrieving it. - http://info.slis.indiana.edu/~katy/ + + + + + 1 + @@ -2537,6 +2429,16 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ stable + + + + + + + + 1 + + http://www.fao.org/termportal/contr/ar/ @@ -2557,16 +2459,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - 1 - - - - - 1 - - Short Definition copied from bibo ontology @@ -2589,17 +2481,18 @@ We would like the range of core:outcome to be the union of Event and Process; an Institute for Fundamental Theory + This class will display all the instances in the subclasses below it, as well as any organizations that were added as part of this generic class because there wasn't a specific class available. - + Only use if no specific subclasses of foaf:organization desribe the organization. + A generic class encompassing several types of organizations. - - - - + - + + + Ued to describe an organization related to bibliographic items such as a publishing company, etc. @@ -2615,16 +2508,21 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/zh/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ + + + + + - + + + - - @@ -2639,57 +2537,47 @@ We would like the range of core:outcome to be the union of Event and Process; an definition modified from: source (http://en.wikipedia.org/wiki/Seating_capacity). 55 - - - - - - + 1 - + The digital file (or physical equivalent), if available after the conference, vs. the act of attending/presenting: use ConferencePresentation for information about date/time/location/name of the event where the poster was presented - - - - - - - - - - An organized series of workshop events, whether repetitions of the same workshop or multiple different workshops. Use workshop for individual events. - - - - - + + + + + + + + + + - + - 1 - + + @@ -2697,24 +2585,34 @@ We would like the range of core:outcome to be the union of Event and Process; an - Only use if no specific subclasses of event:Event are appropriate. - - + + This class will also display instances of subclasses under Event, e.g. Philosophy Department Discussion Club; 2009 Racker Lecture; screening of a documentary. In addition to a location in space and time, an event may have any or all the following qualities: actively participating agents, passive factors, work products. Also, it may be in a virtual space or part of a series such as a lecture series. The previous short definition was: "An arbitrary classification of a space/time region, by a cognitive agent." - - - - - - - + + + + Something that happens at a given place and time. - - + + + + + + + + + + + + + + + 1 + @@ -2737,11 +2635,6 @@ The previous short definition was: "An arbitrary classification of a space/time http://www.fao.org/termportal/contr/es/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - - - - - @@ -2772,10 +2665,10 @@ The previous short definition was: "An arbitrary classification of a space/time - + 1 - + @@ -2783,13 +2676,23 @@ The previous short definition was: "An arbitrary classification of a space/time + + + + + + + + + + - + + An award, honor, or distinction received by a person on a particular date (not the award itself as given repeatedly, and not a grant award). - A specific award on a particular date or for a particular date range. - + Ninth annual Wiley Prize in Biomedical Sciences, for the discovery of a light activated ion channel @@ -2799,6 +2702,11 @@ The previous short definition was: "An arbitrary classification of a space/time + + + + + Short Definition from the bibo ontology http://purl.org/ontology/bibo/ @@ -2820,19 +2728,14 @@ The previous short definition was: "An arbitrary classification of a space/time Role of co-principal investigator of a grant, who devotes a specified percentage of time and is considered key personnel. - - - - - Professor, associate professor and assistant professor are common positions for academic faculty. - - Professor; Associate Professor; Assistant Professor Academic position in a university or institution + + @@ -2846,17 +2749,22 @@ The previous short definition was: "An arbitrary classification of a space/time The dual relationship of a professor advising a student and the student being advised by a professor, typically including start and end dates - + - + 1 - + - + - 1 - + + + + + + + @@ -2868,6 +2776,21 @@ The previous short definition was: "An arbitrary classification of a space/time + + + + + + + + + + + + + + + @@ -2894,10 +2817,15 @@ modern society using the world of Star trek. Los Angeles Times, March - + - - + + + + + + + http://www.fao.org/termportal/contr/en/ @@ -2917,6 +2845,11 @@ modern society using the world of Star trek. Los Angeles Times, March This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration. + + + 1 + + http://purl.org/ontology/bibo/ @@ -2925,23 +2858,28 @@ modern society using the world of Star trek. Los Angeles Times, March An agent that interview another agent. - + - - + + - - - - - + + + + + + + + + + @@ -2954,16 +2892,16 @@ modern society using the world of Star trek. Los Angeles Times, March a specific period or duration, defined by (optional) start and end date/times. - + + + + + + - - - - - @@ -2980,11 +2918,6 @@ modern society using the world of Star trek. Los Angeles Times, March Short Definition from bibo ontology - - - - - @@ -2995,10 +2928,10 @@ modern society using the world of Star trek. Los Angeles Times, March - - + - + + FAO terminology @@ -3013,21 +2946,31 @@ modern society using the world of Star trek. Los Angeles Times, March 2010-06-24 http://www.fao.org/termportal/contr/zh/ + + + + + The value of the datatype property *validSince* associated to a particular area (territory or group) indicates the area's first year of validity. The geopolitical ontology traces back historic changes only until 1985, therefore, if an area has a validSince = 1985, this indicates that the area is/was valid since 1985 or before. - + - 1 - + + - - - + + + + + + + + @@ -3041,10 +2984,10 @@ modern society using the world of Star trek. Los Angeles Times, March - + - - + + @@ -3077,10 +3020,10 @@ Examples of a Publisher include a person, an organization, or a service. Typical http://www.fao.org/termportal/contr/zh/ - + - - + + @@ -3088,6 +3031,11 @@ Examples of a Publisher include a person, an organization, or a service. Typical + + + + + @@ -3126,6 +3074,11 @@ Examples of a Publisher include a person, an organization, or a service. Typical + + + + + @@ -3139,10 +3092,20 @@ Examples of a Publisher include a person, an organization, or a service. Typical http://purl.org/ontology/bibo/ - - + + + + + + + + + + + + + - http://www.fao.org/termportal/contr/es/ @@ -3157,15 +3120,15 @@ Examples of a Publisher include a person, an organization, or a service. Typical 2010-06-24 - - + - - - - + + + + + @@ -3173,18 +3136,23 @@ Examples of a Publisher include a person, an organization, or a service. Typical Resource dependent on other entities This class is here so it can be equivalent to vitro:DependentResource. Deletion in the VIVO system behaves differently when deleting members of this class: related individuals may need to be deleted as well. + + + + + - A distinct, usually specialized educational unit within an educational organization. + - + Endodontics (department within a College of Dentistry); English (department within a College of Liberal Arts) - + - - + + @@ -3193,11 +3161,6 @@ Examples of a Publisher include a person, an organization, or a service. Typical RearcherID is a Thomson Reuters project where researchers have a place to manage and share their professional information. It will allow them to solve author identity issues while simultaneously adding dynamic citation metrics and collaboration networks to your personal profile. Definition source: http://isiwebofknowledge.com/researcherid/ - - - 1 - - @@ -3216,6 +3179,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/A passage selected from a larger work. http://purl.org/ontology/bibo/ + + + 1 + + @@ -3225,27 +3193,22 @@ Definition source: http://isiwebofknowledge.com/researcherid/Critical or explanatory note for a Document. - + - - - - - - 1 - + + - + An intramural or extramural award to support scholarly work, such as UF09179 (VIVO) Short definition is from the Glossary of NIH Terms. - - - + + Financial assistance mechanism providing money, property, or both to an eligible entity to carry out an approved project or activity - + + @@ -3265,11 +3228,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - - - - - @@ -3294,6 +3252,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + 1 + + @@ -3314,11 +3277,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/2010-06-24 http://www.fao.org/termportal/en/ - - - - - Universal Product Code @@ -3327,21 +3285,26 @@ Definition source: http://isiwebofknowledge.com/researcherid/http://purl.org/ontology/bibo/ source for public description: http://en.wikipedia.org/wiki/Universal_Product_Code. + + + + + + + + 1 + + A person with at least one academic appointment to a specific faculty of a university or institution of higher learning. Definition from here: http://research.carleton.ca/htr/defs.php. - + - 1 - - - - - - + + @@ -3350,20 +3313,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/Intel Talent Search; poetry contest Not the same as an award or distinction. - + + - - + - - - - - - - - + + 1 + @@ -3379,11 +3337,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/stable - - - 1 - - @@ -3406,11 +3359,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ 0.7 - - - 1 - - http://purl.org/ontology/bibo/ New Yorker @@ -3421,10 +3369,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/Contains articles of current events or general interest, geared to the reading public as being informative or recreational + + + + + Address has properties for department name, street, city, state or province, postal code, and country. For US specific address, classify using core:US Postal Code. core:Address will display all addresses. + - University of Waterloo, 200 University Avenue West, Waterloo, Ontario, Canada N2L 3G1 A code and abstract concept expressing a location on the Earth's surface. To classify US specific addresses, use core:US Postal Code. @@ -3433,9 +3386,9 @@ Definition source: http://isiwebofknowledge.com/researcherid/It is the common position in libraries. A position held by library and information science professionals, or academic or technical experts, in support of providing information services or materials - + - + http://www.fao.org/termportal/contr/zh/ @@ -3450,21 +3403,21 @@ Definition source: http://isiwebofknowledge.com/researcherid/FAO terminology http://www.fao.org/termportal/contr/es/ - + - - - - - - 1 - + + + + + + + @@ -3480,10 +3433,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/Library of Congress Control Number Source: http://en.wikipedia.org/wiki/Library_of_Congress_Control_Number. - + + - 1 - + @@ -3492,17 +3445,17 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + + + A group can also be an organization but need not be; typically used for looser associations of people or organizations acting together in some fashion, not necessarily through formal agreement or on a long-term basis. Added to the VIVO ontology to be able to support informal and perhaps even private groups of people around an idea, funding opportunity, or event. A group of agents - - - - - http://purl.org/ontology/bibo/ unstable @@ -3514,10 +3467,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ Curriculum Steering Committee; PhD Advisory Committee + A group of people organized for a specific purpose (e.g., a reporting or advisory role), often with a charge and for a specific duration. There could be many subclasses such as thesis committee or tenure committee, but these may typically be differentiated via the moniker unless distinct properties become important. - Short Definition from OCLC Input Standards, EntW @@ -3547,33 +3500,33 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - + + + - + 1 - + + + + + + This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration. - - - - - - + + 1320 East 10th Street, Wells Library 021 Bloomington, IN 47405 - - Formal address in US postal address system. + US postal address follow the format street, apt or office number (optional), city, state, and zipcode. @@ -3587,11 +3540,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - 1 - - @@ -3606,16 +3554,16 @@ Definition source: http://isiwebofknowledge.com/researcherid/A web page is an online document available (at least initially) on the world wide web. A web page is written first and foremost to appear on the web, as distinct from other online resources such as books, manuscripts or audio documents which use the web primarily as a distribution mechanism alongside other more traditional methods such as print. - + Short Definition from the bibo ontology unstable - + A section of a book - - + http://purl.org/ontology/bibo/ + A section of a book. @@ -3629,15 +3577,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - + + + - + - 1 - + + @@ -3669,16 +3617,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - + + + - - - 1 - - Definition was take from here: http://dictionary.reference.com/browse/museum @@ -3719,21 +3662,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - - - - - - - - - - - @@ -3744,6 +3672,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + + + @@ -3756,11 +3689,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - @@ -3798,43 +3726,43 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - - - - - - - - - 1 - - A short form for an longer title or name. B.A. - + - 1 - + + A person holding a position that is not considered to be an academic appointment. + + + + + + + + + + + + + 1 + + @@ -3847,6 +3775,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + 1 + + For example, National Science Foundation providesFundingThrough Graduate Research Fellowship Program; National Institutes of Health providesFundingThrough National Center for Research Resources. @@ -3861,10 +3794,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ Use subclasses of core:Geographic Location subclasses instead of this class if possible. - - - + + + @@ -3885,15 +3818,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - + - - - - - - 1 - + + @@ -3901,10 +3829,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - + - - + + An agent that is interviewed by another agent. @@ -3927,6 +3855,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/Used for a single narrative summary of research, typically covering a wide range of activities and time periods; use Researcher Role for information on individual activities + + + + + A role involving research (funded or unfunded), sometimes linked to a grant @@ -3934,6 +3867,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ Bacteria-resistant bandage; Termite prevention system; Hurricane resistant houses + + + + + Relates a document to some transcribed original. The bibo:transcriptOf public description was found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . Bibo considers this term unstable. @@ -3943,15 +3881,30 @@ Definition source: http://isiwebofknowledge.com/researcherid/unstable + + + + + + + + + + + + + + + - + - - + 1 + @@ -3962,15 +3915,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/Publication Description source http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . This term is also considered unstable. unstable - - - - - - - - + + + @@ -3982,6 +3930,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + + + An offering through an ongoing program or single request of research support: internships, positions, financial awards or other forms of tangible or intangible support + + + + @@ -3994,11 +3951,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - http://purl.org/ontology/bibo/ @@ -4030,11 +3982,6 @@ bibo has the domain of this property set to the union of Collection and Document 2010-06-24 - - - 1 - - FAO terminology @@ -4048,7 +3995,7 @@ bibo has the domain of this property set to the union of Collection and Document http://www.fao.org/termportal/contr/ar/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - + @@ -4057,6 +4004,21 @@ bibo has the domain of this property set to the union of Collection and Document + + + + + + + + 1 + + + + + + + http://purl.org/ontology/bibo/ @@ -4065,20 +4027,10 @@ bibo has the domain of this property set to the union of Collection and Document - - - - - - - - - - @@ -4090,20 +4042,15 @@ bibo has the domain of this property set to the union of Collection and Document - - - 1 - - - + + + - 1 - @@ -4117,6 +4064,11 @@ bibo has the domain of this property set to the union of Collection and Document + + + + + The concept name, URL, and source vocabulary name of a Subject Area. http://www.getty.edu/vow/AATHierarchy?find=&logic=AND&note=&english=N&subjectid=300000000 @@ -4155,6 +4107,11 @@ bibo has the domain of this property set to the union of Collection and Document Definition from: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html + + + + + 1320 E. 10th St. Definition take from: http://dictionary.reference.com/browse/street @@ -4167,19 +4124,24 @@ bibo has the domain of this property set to the union of Collection and Document + + + 1 + + - A bounded physical representation of a body of information designed with the capacity (and usually intent) to communicate - + + - Short Definition from the bibo ontology stable + http://purl.org/ontology/bibo/ - + A document (noun) is a bounded physical representation of body of information designed with the capacity (and usually intent) to communicate. A document may manifest symbolic, diagrammatic or sensory-representational information. - - + + A bounded physical representation of a body of information designed with the capacity (and usually intent) to communicate @@ -4187,11 +4149,6 @@ bibo has the domain of this property set to the union of Collection and Document - - - - - @@ -4227,8 +4184,13 @@ bibo has the domain of this property set to the union of Collection and Document - + + + + + + FAO terminology @@ -4257,38 +4219,18 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - - - - - - - - - - - An edited book. http://purl.org/ontology/bibo/ + Best American Science Writing 2009 stable An edited collection of stand-alone articles published as a book - - - - - - - - - - - - - + + + Use subclasses of core:GeopoliticalEntity subclasses instead of this class if possible. @@ -4297,12 +4239,27 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi Short definition obtained here: http://en.wiktionary.org/wiki/geopolitical_entity. + + + + + + + + + + + + + + + 100 Caldwell Hall; 114 Martha Van Rensselaer (Rushmore Conference Room) Room that provides a particular service or is used for a particular activity. @@ -4310,49 +4267,54 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi Enter room number of name. + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -4373,16 +4335,21 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://www.fao.org/termportal/contr/zh/ - - - - - Examples shows a book has French language version. Public description source: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . + + + 1 + + + + + 1 + + @@ -4390,6 +4357,16 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi + + + 1 + + + + + + + http://www.fao.org/termportal/contr/fr/ @@ -4404,17 +4381,12 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://www.fao.org/termportal/contr/ar/ - College of Arts & Sciences; Ivy Tech Community College + A primary academic unit within a University or a free-standing higher education organization without graduate degree programs. - - - - - Document1 isVersionOf Document2 @@ -4444,10 +4416,20 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - + - - + 1 + + + + + 1 + + + + + + @@ -4456,6 +4438,11 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi + + + + + http://purl.org/ontology/bibo/ Supreme Court Reporter @@ -4478,30 +4465,40 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - + - - + 1 + - + - + - - + + + + + + 1 + - + - - + + + + + + + @@ -4514,11 +4511,16 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://xmlns.com/foaf/spec/#term_firstName. Note from foaf: "The lastName property is provided (alongside firstName) as a mechanism to support legacy data that cannot be easily interpreted in terms of the (otherwise preferred) familyName and givenName properties. The concepts of 'first' and 'last' names do not work well across cultural and linguistic boundaries; however they are widely used in addressbooks and databases." + + + + + - UITS service - + UITS service is the information technology services provided by Indiana University. SC. + A regularly offered service in support of an academic, research, or administrative function (not personal or professional service by an individual) @@ -4528,14 +4530,14 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - - - - - + + + 1 + + @@ -4559,11 +4561,6 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - - - - - unstable @@ -4573,15 +4570,20 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://purl.org/ontology/bibo/ Short Definition from the bibo ontology + + + 1 + + - + - - + 1 + @@ -4599,29 +4601,20 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi A work consisting of texts of rules and regulations related to statutes issued by executive or administrative agencies A collection of statutes. - + + + - 1 - - - + - - - - - - An offering through an ongoing program or single request of research support: internships, positions, financial awards or other forms of tangible or intangible support - - - - + + - + Used information from this definition: http://dictionary.reference.com/browse/library. A collection of any materials, for study and enjoyment, which has been systematically arranged. Marston Science Library @@ -4640,20 +4633,10 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://purl.org/ontology/bibo/ - - + - - - - - - - - - - - + 1 + http://www.fao.org/termportal/contr/ar/ @@ -4668,11 +4651,6 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi FAO terminology FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - - - 1 - - @@ -4691,24 +4669,19 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi Public Description for bibo:distributor taken from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . - - - + + + - + - - - - - - - + 1 + @@ -4717,10 +4690,10 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi full email address - + + + - 1 - @@ -4728,19 +4701,14 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi We would like the range of core:outcome to be the union of Event and Process; and that same union to be the range for core:outcomeOf, but we cannot currently express this with the editor. - - - - - Used to describe any "agent" related to bibliographic items. Such agents can be persons, organizations or groups of any kind. - - - - - + + + + + @@ -4760,10 +4728,15 @@ We would like the range of core:outcome to be the union of Event and Process; an For data ingest from authoritative sources to record the actual way a person was listed as author, as potentially valuable information for author disambiguation. - + + + - - + + + + + @@ -4791,6 +4764,11 @@ We would like the range of core:outcome to be the union of Event and Process; an Used to link a bibliographic item to one of its contributor: can be an author, an editor, a publisher, etc. + + + + + @@ -4813,16 +4791,26 @@ We would like the range of core:outcome to be the union of Event and Process; an Any organization (likely also asserted as another class of Organization) with a primary, ongoing research function, not just through occasional roles - + - 1 - + + + + + + 1 + The result of rendering a work from one language to another + + + + + @@ -4834,6 +4822,11 @@ We would like the range of core:outcome to be the union of Event and Process; an Definition http://en.wikipedia.org/wiki/Job_title#Job_title. + + + 1 + + @@ -4841,15 +4834,10 @@ We would like the range of core:outcome to be the union of Event and Process; an - + 1 - - - - - - + http://www.fao.org/figis/servlet/RefServlet @@ -4863,14 +4851,14 @@ We would like the range of core:outcome to be the union of Event and Process; an - - + + - + Medical Subject Heading (MeSH) definition of Technical Report: Work consisting of a formal report giving details of the investigation and results of a medical or other scientific problem. When issued by a government agency or comparable official body, its contents may be classified, unclassified, or declassified with regard to security clearance. This publication type may also cover a scientific paper or article that records the current state or current position of scientific research and development. If so labeled by the editor or publisher, this publication type may be properly used for journal articles. A document describing an account or statement describing in detail an event, situation, or the like, usually as the result of observation, inquiry, etc.. http://purl.org/ontology/bibo/ @@ -4878,6 +4866,11 @@ We would like the range of core:outcome to be the union of Event and Process; an stable + + + 1 + + @@ -4896,11 +4889,6 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/es/ FAO terminology - - - - - 2010-06-24 http://www.fao.org/termportal/en/ @@ -4914,39 +4902,38 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/fr/ + + + 1 + + - - - + + + + + - - - - + + - - - - - - - + + 1 - - + @@ -4954,26 +4941,31 @@ We would like the range of core:outcome to be the union of Event and Process; an - + 1 - + - - - + + + + + + + + + + + + 1 + A retired professor who retained their rank, title and privileges. - - - - - @@ -5000,35 +4992,20 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ Short Definition from the bibo ontology - - - - - - + A position involving academic work but without faculty status Researcher; Academic Extension Associate; Postdoctoral Associate - Those positions are held by people who do academic work but do not have faculty positions in universities or institutes. + - - - 1 - - - - - - - Currently being used by a restriction on organization. @@ -5048,14 +5025,19 @@ We would like the range of core:outcome to be the union of Event and Process; an An outreach or community service role directed outside a person's primary profession and institution Communicating Astronomy to the Public + + + + + - stable - A loose, thematic, collection of Documents, often Books. A thematic collection of documents, usually books, issued at regular or irregular intervals http://purl.org/ontology/bibo/ + + Methods in Molecular Biology @@ -5065,6 +5047,11 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + Definition take from: http://dictionary.reference.com/browse/foundation. An institution financed by a donation or legacy to aid research, education, the arts, etc. @@ -5072,11 +5059,6 @@ We would like the range of core:outcome to be the union of Event and Process; an The Ford Foundation - - - - - http://purl.org/ontology/bibo/ @@ -5106,20 +5088,20 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - - + 1 - + - + - - + + + + + + + @@ -5138,9 +5120,14 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik Short Definition modified from the one found here: http://www.thefreedictionary.com/county. - Alachua; Baker; Bradford; Kenora; Ottawa; Waterloo The largest administrative division of most states or provinces. + + + + + + @@ -5165,36 +5152,41 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - Short Definition from the bibo ontology A distinct part of a larger document or collected document + http://purl.org/ontology/bibo/ - + a distinct part of a larger document or collected document. - unstable - + + + + 1 + + - - - Short Definition copied from bibo ontology + http://purl.org/ontology/bibo/ + + A written or printed work of fiction or nonfiction, usually on sheets of paper fastened or bound together within covers. - - + A written or printed work of fiction or nonfiction, usually on sheets of paper fastened or bound together within covers stable + + + + + + @@ -5212,17 +5204,31 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - - - - + - - + + + + + + + + An endeavor, frequently collaborative, that occurs over a finite period of time and is intended to achieve a particular aim. + An endeavor, frequently collaborative, that occurs over a finite period of time and is intended to achieve a particular aim. + + + + + + + + + + + + + 1 + @@ -5230,15 +5236,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - + - - - - - - - + + @@ -5251,10 +5252,25 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik A URLLink that is designated (by the user or anyone else) as a primary link for the person, organization, event, etc. + + + 1 + + + + + 1 + + + + + 1 + + A formal organization of people or organizations around a subject or practice. @@ -5269,20 +5285,25 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik Note: Bibo:editor is used as the inverse of core:editorOf. Public Description for bibo:editor was obtained from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . - + - - + 1 + + + + + 1 + A postdoctoral training appointment (job) - + - - + 1 + @@ -5290,16 +5311,6 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - - - - - - @@ -5310,11 +5321,6 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - 1 - - @@ -5327,10 +5333,15 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - + - + 1 + + + + + + http://www.fao.org/termportal/contr/zh/ @@ -5350,6 +5361,11 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik + + + 1 + + @@ -5357,10 +5373,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - + - + 1 + @@ -5370,10 +5386,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - 1 + - + 1 + @@ -5382,11 +5398,6 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik http://purl.org/ontology/bibo/ - - - 1 - - FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ http://www.fao.org/termportal/contr/zh/ @@ -5400,25 +5411,30 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik http://www.fao.org/termportal/en/ 2010-06-24 - - - + + 1 + + + + + 1 + + + + + + - - - - - 2010-04-01 UN Statistics Division http://unstats.un.org/unsd/methods/m49/m49alpha.htm @@ -5429,10 +5445,15 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik http://unstats.un.org/unsd/methods/m49/m49alpha.htm http://unstats.un.org/unsd/methods/m49/m49alpha.htm - - + - + + + + + + 1 + @@ -5443,10 +5464,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik A list of items in a collection; an ordered compilation of item descriptions and sufficient information to afford access to them - + NLM Catalog + Short Definition is the Medical Subject Heading (MeSH) definition - - + diff --git a/productMods/WEB-INF/ontologies/app/menu.n3 b/productMods/WEB-INF/ontologies/app/menu.n3 index 3f14b52f..d43d7585 100644 --- a/productMods/WEB-INF/ontologies/app/menu.n3 +++ b/productMods/WEB-INF/ontologies/app/menu.n3 @@ -69,7 +69,6 @@ display:Organizations a display:Page ; a display:ClassGroupPage; display:forClassGroup vivoweb:vitroClassGrouporganizations ; - display:requiresBodyTemplate "menupage--classgroup-organizations.ftl" ; display:title "Organizations" ; display:urlMapping "/organizations" . diff --git a/productMods/WEB-INF/ontologies/app/search.n3 b/productMods/WEB-INF/ontologies/app/search.n3 index 2538b823..6aafe5dc 100644 --- a/productMods/WEB-INF/ontologies/app/search.n3 +++ b/productMods/WEB-INF/ontologies/app/search.n3 @@ -20,4 +20,7 @@ vitroDisplay:excludeClass core:Position ; vitroDisplay:excludeClass core:ResearchActivity ; vitroDisplay:excludeClass core:EducationalTraining ; - vitroDisplay:excludeClass bibo:DocumentStatus . + vitroDisplay:excludeClass bibo:DocumentStatus ; + vitroDisplay:excludeClass core:DateTimeValue ; + vitroDisplay:excludeClass core:DateTimeInterval . + diff --git a/productMods/WEB-INF/ontologies/optional/mapping/scirr-bfo-1.2.owl b/productMods/WEB-INF/ontologies/optional/mapping/scirr-bfo-1.2.owl deleted file mode 100644 index 8ffcfecf..00000000 --- a/productMods/WEB-INF/ontologies/optional/mapping/scirr-bfo-1.2.owl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/productMods/WEB-INF/ontologies/optional/mapping/scirr-ero-mapping-1.2.owl b/productMods/WEB-INF/ontologies/optional/mapping/scirr-ero-mapping-1.2.owl deleted file mode 100644 index 9992ae8c..00000000 --- a/productMods/WEB-INF/ontologies/optional/mapping/scirr-ero-mapping-1.2.owl +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/productMods/WEB-INF/ontologies/optional/mapping/vivo-bfo-1.2.owl b/productMods/WEB-INF/ontologies/optional/mapping/vivo-bfo-1.2.owl index 337d1879..395a2749 100644 --- a/productMods/WEB-INF/ontologies/optional/mapping/vivo-bfo-1.2.owl +++ b/productMods/WEB-INF/ontologies/optional/mapping/vivo-bfo-1.2.owl @@ -5,8 +5,9 @@ - + + @@ -17,21 +18,22 @@ + - + + + + + + + + @@ -75,16 +85,16 @@ - + - + - + - + @@ -137,6 +147,7 @@ + @@ -193,11 +204,6 @@ - - - - - @@ -206,6 +212,5 @@ - diff --git a/productMods/WEB-INF/ontologies/update/askEmpty.sparql b/productMods/WEB-INF/ontologies/update/askEmpty.sparql new file mode 100644 index 00000000..dccd9892 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/askEmpty.sparql @@ -0,0 +1,5 @@ +PREFIX core: + +ASK { + core:atTime ?p ?o . +} diff --git a/productMods/WEB-INF/ontologies/update/askEver.sparql b/productMods/WEB-INF/ontologies/update/askEver.sparql new file mode 100644 index 00000000..6a3ecdae --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/askEver.sparql @@ -0,0 +1,5 @@ +PREFIX vitro: + +ASK { + vitro:updatedToOntology ?u . +} diff --git a/productMods/WEB-INF/ontologies/update/diff.tab.txt b/productMods/WEB-INF/ontologies/update/diff.tab.txt index f341cf4e..077759c0 100644 --- a/productMods/WEB-INF/ontologies/update/diff.tab.txt +++ b/productMods/WEB-INF/ontologies/update/diff.tab.txt @@ -8,7 +8,6 @@ http://vivoweb.org/ontology/core#organizationGrantingDegree http://vivoweb.org/o http://vivoweb.org/ontology/core#offeredBy http://vivoweb.org/ontology/core#degreeOfferedBy Yes Map Directly-changed http://vivoweb.org/ontology/core#SemesterClass http://vivoweb.org/ontology/core#Course Yes Map Directly-changed http://vivoweb.org/ontology/core#taughtInSemester http://vivoweb.org/ontology/core#dateTimeInterval Yes Map Directly-changed -http://vivoweb.org/ontology/core#courseOffering http://vivoweb.org/ontology/core#dateTimeIntervalFor Yes Map Directly-changed http://vivoweb.org/ontology/core#sectionCredits http://vivoweb.org/ontology/core#courseCredits Yes Map Directly-changed http://vivoweb.org/ontology/core#listsCourse http://vivoweb.org/ontology/core#offersCourse Yes Map Directly-changed http://vivoweb.org/ontology/core#listedBy http://vivoweb.org/ontology/core#courseOfferedBy Yes Map Directly-changed @@ -60,6 +59,7 @@ http://vivoweb.org/ontology/core#endDateTime No Delete Delete http://vivoweb.org/ontology/core#endDate No Delete Delete http://vivoweb.org/ontology/core#endYearMonth No Delete Delete http://vivoweb.org/ontology/core#endTime No Delete Delete +http://vivoweb.org/ontology/core#courseOffering No Delete not set http://vivoweb.org/ontology/core#TimeInterval No Delete Delete http://vivoweb.org/ontology/core#timeIntervalFor No Delete not set http://vivoweb.org/ontology/core#hasTimeInterval No Delete not set \ No newline at end of file diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYear.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYear.sparql index b3028911..53cfc459 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYear.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYear.sparql @@ -20,4 +20,17 @@ Construct { ?thing core:dateTimeValue _:dtv . } where { ?thing core:year ?theDate . + + Optional { + ?thing a ?ettype . + ?thing a core:EducationalTraining + } + + Optional { + ?thing a ?prtype . + ?thing a core:PresenterRole + } + + FILTER (!bound(?ettype)) + FILTER (!bound(?prtype)) } \ No newline at end of file diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYearEducationalTraining.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYearEducationalTraining.sparql new file mode 100644 index 00000000..81ccf55c --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYearEducationalTraining.sparql @@ -0,0 +1,27 @@ +PREFIX rdf: +PREFIX rdfs: +PREFIX xsd: +PREFIX owl: +PREFIX swrl: +PREFIX swrlb: +PREFIX vitro: +PREFIX vivo: +PREFIX bibo: +PREFIX dcterms: +PREFIX event: +PREFIX foaf: +PREFIX skos: +PREFIX core: + +Construct { + _:edtv a core:DateTimeValue . + _:edtv core:dateTime ?theYear . + _:edtv core:dateTimePrecision core:yearPrecision . + ?thing core:dateTimeInterval _:dti . + _:dti a core:DateTimeInterval . + _:dti core:end _:edtv . + _:dti core:dateTimeIntervalFor ?thing . +} where { + ?thing core:year ?theYear . + ?thing a core:EducationalTraining . +} \ No newline at end of file diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYearPresenterRole.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYearPresenterRole.sparql new file mode 100644 index 00000000..5596cbd0 --- /dev/null +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/atYearPresenterRole.sparql @@ -0,0 +1,27 @@ +PREFIX rdf: +PREFIX rdfs: +PREFIX xsd: +PREFIX owl: +PREFIX swrl: +PREFIX swrlb: +PREFIX vitro: +PREFIX vivo: +PREFIX bibo: +PREFIX dcterms: +PREFIX event: +PREFIX foaf: +PREFIX skos: +PREFIX core: + +Construct { + _:sdtv a core:DateTimeValue . + _:sdtv core:dateTime ?theYear . + _:sdtv core:dateTimePrecision core:yearPrecision . + ?thing core:dateTimeInterval _:dti . + _:dti a core:DateTimeInterval . + _:dti core:start _:sdtv . + _:dti core:dateTimeIntervalFor ?thing . +} where { + ?thing core:year ?theYear . + ?thing a core:PresenterRole . +} \ No newline at end of file diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endDate.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endDate.sparql index 24fe0ece..fe8b28b2 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endDate.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endDate.sparql @@ -20,7 +20,6 @@ Construct { _:dti a core:DateTimeInterval . _:dti core:end _:edtv . ?thing core:dateTimeInterval _:dti . - _:dti core:dateTimeIntervalFor ?thing . } where { ?thing core:endDate ?theEndDate . diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endYear.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endYear.sparql index eb68f672..29d1086a 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endYear.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/endYear.sparql @@ -20,7 +20,6 @@ Construct { ?thing core:dateTimeInterval _:dti . _:dti a core:DateTimeInterval . _:dti core:end _:edtv . - _:dti core:dateTimeIntervalFor ?thing . } where { ?thing core:endYear ?theEndYear . diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndDate.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndDate.sparql index e8b31fcc..10ac6d95 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndDate.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndDate.sparql @@ -24,7 +24,6 @@ Construct { _:dti core:start _:sdtv . _:dti core:end _:edtv . ?thing core:dateTimeInterval _:dti . - _:dti core:dateTimeIntervalFor ?thing . } where { ?thing core:startDate ?theStartDate . ?thing core:endDate ?theEndDate . diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndYear.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndYear.sparql index 44949d93..0dae4f95 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndYear.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startAndEndYear.sparql @@ -24,7 +24,6 @@ Construct { _:dti core:start _:sdtv . _:dti core:end _:edtv . ?thing core:dateTimeInterval _:dti . - _:dti core:dateTimeIntervalFor ?thing . } where { ?thing core:startYear ?theStartYear . ?thing core:endYear ?theEndYear . diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startDate.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startDate.sparql index 6b87e4b2..f2aa23e7 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startDate.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startDate.sparql @@ -20,7 +20,6 @@ Construct { _:dti a core:DateTimeInterval . _:dti core:start _:sdtv . ?thing core:dateTimeInterval _:dti . - _:dti core:dateTimeIntervalFor ?thing . } where { ?thing core:startDate ?theStartDate . diff --git a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startYear.sparql b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startYear.sparql index e734a375..5e65ca78 100644 --- a/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startYear.sparql +++ b/productMods/WEB-INF/ontologies/update/sparqlConstructs/additions/startYear.sparql @@ -20,7 +20,6 @@ Construct { _:dti a core:DateTimeInterval . _:dti core:start _:sdtv . ?thing core:dateTimeInterval _:dti . - _:dti core:dateTimeIntervalFor ?thing . } where { ?thing core:startYear ?theStartYear . diff --git a/productMods/WEB-INF/ontologies/user/scires-1.2-annotations.rdf b/productMods/WEB-INF/ontologies/user/scires-1.2-annotations.rdf index c7a781a7..2c977dd6 100644 --- a/productMods/WEB-INF/ontologies/user/scires-1.2-annotations.rdf +++ b/productMods/WEB-INF/ontologies/user/scires-1.2-annotations.rdf @@ -12,55 +12,38 @@ xmlns:j.5="http://purl.org/dc/terms/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > - - - - - 20 - -1 - StorageService + + ero + Research Resources (eagle-i) - - - - - -1 + -1 - ResearchProject + -1 + + + Biological Specimen + - study population count + 20 + study population count - - - 10 - - Instrument - -1 - - - - -1 - - - 15 - - Protocol - - - - - true - realizesProtocol - - true documentationFor + + + + + + + -1 + Protocol + 15 @@ -81,11 +64,13 @@ Scientific Research scires - - - providesAccessTo - true + + -1 + + Human Study + -1 + 5 @@ -95,21 +80,13 @@ -1 - - - - -1 + + StorageService -1 - - Organism - - - ProductionService - 20 - + - -1 + 1 @@ -120,13 +97,34 @@ ClinicalTrials.gov registry number - + + hasDocumentation + - + true + + + + + ProductionService -1 + 20 - AccessService + + + + realizesProtocol + true + + + + + -1 + -1 + + + Reagent @@ -136,28 +134,27 @@ Phase 1 Clinical Trial -1 - + + Organism + + -1 + -1 - -1 - Human Study - - -1 - + + ClinicalTrial + 1 -1 - Biological Specimen - -1 - - Institutional Review Board (IRB) number for a Clinical Trial Institutional Review Board (IRB) number + @@ -167,20 +164,19 @@ -1 - - Reagent - + - -1 + + Instrument -1 - - - + 10 + + + + true + providesAccessTo - -1 - 1 - ClinicalTrial @@ -190,17 +186,26 @@ 6 - - - true - + + ResearchProject + -1 + -1 - hasDocumentation + + - true protocolRealizedBy + true + + + AccessService + 20 + + -1 + + diff --git a/productMods/WEB-INF/ontologies/user/vivo-core-1.2-annotations.rdf b/productMods/WEB-INF/ontologies/user/vivo-core-1.2-annotations.rdf index ac7d23f1..5f87b407 100644 --- a/productMods/WEB-INF/ontologies/user/vivo-core-1.2-annotations.rdf +++ b/productMods/WEB-INF/ontologies/user/vivo-core-1.2-annotations.rdf @@ -61,6 +61,7 @@ 5 date/time value 5 + dateTimeValueForm.jsp true @@ -72,7 +73,6 @@ -1 -1 - sourceVocabularyReference @@ -347,20 +347,12 @@ - - StorageService - -1 - 20 - - - - - - + true + product 5 - true + @@ -405,6 +397,14 @@ + + + + -1 + Protocol + 15 + + 4 Phase 4 Clinical Trial @@ -543,12 +543,12 @@ name prefix + 1 - A title placed before a person's name. 32 - + Dublin Core elements @@ -786,15 +786,36 @@ + + + + true + realizesProtocol + + + Reagent + + + -1 + -1 + + nameOfficialIT + + + -1 + 1 + ClinicalTrial + + - Institutional Review Board (IRB) number Institutional Review Board (IRB) number for a Clinical Trial + Institutional Review Board (IRB) number @@ -862,11 +883,10 @@ - + Academic Year -1 -1 - Academic Year @@ -960,6 +980,13 @@ + + + + hasDocumentation + + true + 5 @@ -1032,14 +1059,6 @@ - - - - Reagent - - -1 - -1 - @@ -1047,6 +1066,14 @@ Authorship -1 + + + + Instrument + -1 + + 10 + Workshop @@ -1458,13 +1485,6 @@ - - hasDocumentation - - - true - - principal investigator role of @@ -1595,6 +1615,14 @@ 5 current positions + + + -1 + + Human Study + -1 + + -1 @@ -1605,6 +1633,7 @@ true + true 5 5 @@ -1761,6 +1790,14 @@ locator + + + + + -1 + ResearchProject + -1 + Position -1 @@ -1863,6 +1900,10 @@ Please enter the complete phone number for your fax, with area code and also country code (if outside the US). + + ero + Research Resources (eagle-i) + 5 @@ -2011,14 +2052,6 @@ transcriptOf Relates a document to some transcribed original. - - ProductionService - - 20 - - - -1 - @@ -2092,6 +2125,14 @@ This relates a person to the description of their educational training. + + + + -1 + Research Opportunity + + -1 + -1 @@ -2174,6 +2215,14 @@ nameCurrencyIT + + + + 20 + AccessService + -1 + + hasListName @@ -2198,7 +2247,7 @@ If applicable, please enter the preferred name suffix. Only one may be entered. - + 34 name suffix @@ -2340,6 +2389,14 @@ Invited Talk + + -1 + StorageService + + + + 20 + @@ -2377,6 +2434,14 @@ 5 + + + ProductionService + -1 + + + 20 + Academic Article @@ -2407,7 +2472,7 @@ true - funded by + funding provided via This relates an organization to the person's position(s) within that organization. @@ -2528,6 +2593,14 @@ 59 + + -1 + -1 + + + Biological Specimen + + School @@ -2592,12 +2665,6 @@ codeCurrency - - realizesProtocol - true - - - credits Number of credits assigned a course by an learning institution. @@ -2694,13 +2761,6 @@ - - ClinicalTrial - 1 - -1 - - - true @@ -2734,6 +2794,19 @@ + + 40 + 20 + 5 + Select a publication, patent or other type of information resource that has been produced as a result of this endeavor. + true + produces + + + + true + 20 + 1 @@ -2975,6 +3048,14 @@ true current member of + + + product of + 40 + true + 5 + + -1 -1 @@ -3093,14 +3174,6 @@ keywords - - - -1 - - -1 - - Research Opportunity - -1 @@ -3139,9 +3212,9 @@ - true - + + true documentationFor @@ -3392,14 +3465,6 @@ - - -1 - - - 15 - - Protocol - countryArea @@ -3470,14 +3535,6 @@ codeAGROVOC - - Organism - - -1 - -1 - - - contributor contributor @@ -3506,12 +3563,12 @@ - - + -1 - - Human Study + Organism + + -1 @@ -3521,14 +3578,6 @@ -1 -1 - - -1 - Biological Specimen - -1 - - - - agriculturalAreaUnit @@ -3614,7 +3663,7 @@ - hasPrerequisite + has prerequisite true hasPrerequisite @@ -3720,6 +3769,7 @@ 20 + study population count @@ -3770,9 +3820,9 @@ 5 true + dateTimeIntervalForm.jsp - desc true 5 @@ -3844,14 +3894,6 @@ -1 - - AccessService - 20 - - -1 - - - @@ -3917,6 +3959,12 @@ -1 Decision + + providesAccessTo + true + + + Professor Emeritus @@ -3965,10 +4013,10 @@ - protocolRealizedBy - true + protocolRealizedBy + @@ -4057,10 +4105,6 @@ Non-Faculty Academic Position - - 5 - date/time interval for - landAreaUnit @@ -4124,14 +4168,6 @@ Outreach Provider Role - - - 10 - - Instrument - -1 - - Series @@ -4325,8 +4361,8 @@ 5 - funding vehicle for true + provides funding for nameOfficialEN @@ -4341,14 +4377,6 @@ true - - ResearchProject - -1 - - - -1 - - -1 Proceedings @@ -4415,6 +4443,7 @@ -1 + individual--foaf-organization.ftl Organization -1 @@ -4438,12 +4467,6 @@ - - - true - providesAccessTo - - true @@ -4665,15 +4688,16 @@ - true - - - 30 - This relates a conference proceeding to the conference that produced the proceeding. - 5 - proceedings - hasProceedings + hasProceedings + true + proceedings + 5 + This relates a conference proceeding to the conference that produced the proceeding. + 30 + + + true diff --git a/productMods/WEB-INF/submodels/scires-1.2.owl b/productMods/WEB-INF/submodels/scires-1.2.owl index f0889199..5fcdbca2 100644 --- a/productMods/WEB-INF/submodels/scires-1.2.owl +++ b/productMods/WEB-INF/submodels/scires-1.2.owl @@ -13,153 +13,156 @@ xmlns:j.5="http://purl.org/dc/terms/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > - - - + + - + + eagle-i: Material entity that is a portion or quantity of a biological material for use in testing, examination, or study. A biological specimen can be an individual animal, part of or derived an animal, plant, part of a plant, or microorganism. When a taxon is described, it is typically based on a single specimen and is referred to as the holotype. - + An individual animal, part of or derived an animal, plant, part of a plant, or microorganism. + A portion or quantity of a biological material for use in testing, examination, or study. - - number of human participants in the study (trial). + + - - - - An implement used to facilitate work, especially precision work. - An implement used to facilitate work, especially precision work. - - - - A plan specification that allows different domain experts to reliably and independently reproduce a process. - 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. + - - - - - - + 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. + A plan specification that allows different domain experts to reliably and independently reproduce a process. - + Phase 4 Clinical Trial In Phase 4 trials, post marketing studies delineate additional information including the drug's or treatment's risks, benefits, and optimal use. - + - - + + - - - - + + + eagle-i: Research project that uses or collects measurements or assessments about humans. + Research project that uses or collects measurements or assessments about humans. + Phase 2 Clinical Trial - + In Phase 2 trials, an experimental study drug or treatment is given to a larger group of people (100-300) to see if it is effective and to further evaluate its safety. - - An organism is a material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. - OBI: An organism is material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. An organism may be unicellular or made up, like humans, of many billions of cells divided into specialized tissues and organs. -NOTE that we are not addressing for now the issue of whether a foaf:Person is a subclass of obi:Organism - - - - A service that produces a physical object or data. - A service that produces a physical object or data, such as a custom micro-array chip, a made to order antibody, or a behavioral dataset + + ClinicalTrials.gov is an ICMJE-acceptable public registry, offering up-to-date information for locating clinical trials for a wide range of diseases and conditions. The U.S. National Institutes of Health (NIH), through its National Library of Medicine (NLM), developed this site in collaboration with the Food and Drug Administration (FDA), as a result of the FDA Modernization Act, which was passed into law in November 1997. - NCT00000419 - + + + + + + + A service that produces a physical object or data, such as a custom micro-array chip, a made to order antibody, or a behavioral dataset + A service that produces a physical object or data. - - - - In Phase I trials, researchers test an experimental drug or treatment in a small group of people (20-80) for the first time to evaluate its safety, determine a safe dosage range, and identify side effects - Phase 1 Clinical Trial + + + + + - - - Research project that uses or collects measurements or assessments about humans. - - eagle-i: Research project that uses or collects measurements or assessments about humans. - - - - - Every clinical trial in the United States must be approved and monitored by an Institutional Review Board (IRB). An IRB is an independent committee of physicians, statisticians, community advocates and others whose objective is to ensure that a clinical trial is ethical and the rights of study participants are protected. - - - - A portion or quantity of a biological material for use in testing, examination, or study. - eagle-i: Material entity that is a portion or quantity of a biological material for use in testing, examination, or study. A biological specimen can be an individual animal, part of or derived an animal, plant, part of a plant, or microorganism. When a taxon is described, it is typically based on a single specimen and is referred to as the holotype. - An individual animal, part of or derived an animal, plant, part of a plant, or microorganism. - - - In Phase 3 trials, an experimental study drug or treatment is given to large groups of people (1,000-3,000) to confirm its effectiveness, monitor side effects, compare it to commonly used treatments, and collect information that will allow the experimental drug or treatment to be used safely. - - - - Phase 3 Clinical Trial - - + eagle-i: Material entity that is used in a chemical reaction or other experimental process to detect, measure, examine, or produce other substances. NOTE: For now we are not addressing whether this is a subclass of foaf:Agent Material entity that is used in a chemical reaction or other experimental process to detect, measure, examine, or produce other substances. - - + + + In Phase I trials, researchers test an experimental drug or treatment in a small group of people (20-80) for the first time to evaluate its safety, determine a safe dosage range, and identify side effects + Phase 1 Clinical Trial + + + + An organism is a material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. + OBI: An organism is material entity that is an individual living system, such as animal, plant, bacteria or virus, that is capable of replicating or reproducing, growth and maintenance in the right environment. An organism may be unicellular or made up, like humans, of many billions of cells divided into specialized tissues and organs. +NOTE that we are not addressing for now the issue of whether a foaf:Person is a subclass of obi:Organism + + + + A research study using human volunteers to answer specifc health-related questions. A clinical trial is a research study using human volunteers to answer questions about treatments for diseases and conditions. Clinical trials are conducted in phases. The trials at each phase have a different purpose and help scientists answer different questions. - A research study using human volunteers to answer specifc health-related questions. + - + + + Every clinical trial in the United States must be approved and monitored by an Institutional Review Board (IRB). An IRB is an independent committee of physicians, statisticians, community advocates and others whose objective is to ensure that a clinical trial is ethical and the rights of study participants are protected. + + + + + In Phase 3 trials, an experimental study drug or treatment is given to large groups of people (1,000-3,000) to confirm its effectiveness, monitor side effects, compare it to commonly used treatments, and collect information that will allow the experimental drug or treatment to be used safely. + - - Phase 0 is a recent designation for exploratory, first-in-human trials conducted in accordance with the United States Food and Drug Administration's (FDA) 2006 Guidance on Exploratory Investigational New Drug (IND) Studies. Phase 0 trials are also known as human microdosing studies and are designed to speed up the development of promising drugs or imaging agents by establishing very early on whether the drug or agent behaves in human subjects as was expected from preclinical studies. - Phase 0 Clinical Trial + Phase 3 Clinical Trial + + + + + An implement used to facilitate work, especially precision work. + + An implement used to facilitate work, especially precision work. + + + + + - + - - - - + + + + Phase 0 is a recent designation for exploratory, first-in-human trials conducted in accordance with the United States Food and Drug Administration's (FDA) 2006 Guidance on Exploratory Investigational New Drug (IND) Studies. Phase 0 trials are also known as human microdosing studies and are designed to speed up the development of promising drugs or imaging agents by establishing very early on whether the drug or agent behaves in human subjects as was expected from preclinical studies. + Phase 0 Clinical Trial + + + + - - - + + + + + + + diff --git a/productMods/WEB-INF/submodels/vitro-0.7.owl b/productMods/WEB-INF/submodels/vitro-0.7.owl index 1050aee6..79ce94f0 100644 --- a/productMods/WEB-INF/submodels/vitro-0.7.owl +++ b/productMods/WEB-INF/submodels/vitro-0.7.owl @@ -278,5 +278,8 @@ xmlns:vitro="&vitro;" + + + diff --git a/productMods/WEB-INF/submodels/vivo-core-1.2.owl b/productMods/WEB-INF/submodels/vivo-core-1.2.owl index d92acb40..168e4474 100644 --- a/productMods/WEB-INF/submodels/vivo-core-1.2.owl +++ b/productMods/WEB-INF/submodels/vivo-core-1.2.owl @@ -27,13 +27,8 @@ - 1 - - - - - - + 1 + http://purl.org/ontology/bibo/ @@ -75,10 +70,20 @@ + + + + + - - + + + + + + 1 + @@ -101,14 +106,19 @@ A person who is enrolled in an educational institution. Use only if no specific subclasses of core:Student describe the person. + + + + + - + UN Cartographic Section UN Cartographic Section - + - + @@ -116,28 +126,18 @@ - - - - - - - - 1 - - - Accounting & Research Services Assistant; Director of Information Technology Staff, support, and other non-academic positions. - A position classified as professional, staff, support, or any other non-academic role + + A position classified as professional, staff, support, or any other non-academic role @@ -152,20 +152,25 @@ Serial Item and Contribution Identifier + + + + + - - - - - + + + + + Definition take from: http://en.wikipedia.org/wiki/Government_agency. United States Library of Congress @@ -180,14 +185,14 @@ Public description modified from the information on this page: http://www.w3.org/TR/2005/WD-swbp-skos-core-guide-20050510/#sechierarchy . - - - - - + + + + + @@ -219,11 +224,6 @@ Definition take from: http://xmlns.com/foaf/spec/#term_based_near . foaf indicates that the status of this term is "unstable". "The based_near relationship relates two "spatial things" (anything that can be somewhere), the latter typically described using the geo:lat / geo:long geo-positioning vocabulary (http://www.w3.org/2003/01/geo/wgs84_pos#). This allows us to say describe the typical latitute and longitude of, say, a Person (people are spatial things - they can be places) without implying that a precise location has been given." Used to link an agent, related to bibliographic things, to a place where it is based near: can be a city, a monument, a building, etc. - - - - - Note that the administering department is not the central research administration office (such as University of Florida DSP or Cornell OSP) -- we didn't see a need to record a relationship to that office because it implicitly manages all grants. @@ -231,18 +231,28 @@ + The most general classification of a person - - The most general classification of a person - + + + + + + + + + + + + http://purl.org/ontology/bibo/ @@ -251,11 +261,6 @@ Starting page number within a continuous page range. stable - - - 1 - - @@ -267,6 +272,11 @@ + + + 1 + + @@ -275,10 +285,10 @@ http://www.fao.org/figis/servlet/RefServlet Fisheries Global Information System http://www.fao.org/figis/servlet/RefServlet - - + - + + @@ -299,20 +309,15 @@ - - - 1 - - - + + - @@ -323,13 +328,12 @@ Short definition was partially taken from http://en.wikipedia.org/wiki/Subnational_entity. - + - - + + - @@ -340,7 +344,6 @@ - @@ -351,6 +354,7 @@ + @@ -358,18 +362,29 @@ - - + - + + + + + + + + + + + + + @@ -378,6 +393,11 @@ + + + 1 + + @@ -401,6 +421,16 @@ http://www.fao.org/termportal/contr/fr/ FAO terminology + + + + + + + + + + 2010-06-24 @@ -414,16 +444,6 @@ http://www.fao.org/termportal/contr/es/ http://www.fao.org/termportal/contr/ar/ - - - - - - - - - - @@ -431,6 +451,11 @@ + + + + + @@ -438,23 +463,18 @@ - + - - - - - - - + 1 + Audiovisual recording in video format - - + + @@ -475,16 +495,6 @@ An explicit individual period considered by an academic institution to be its primary academic cycle. - - - - - - - - 1 - - @@ -514,15 +524,10 @@ UN Statistics Division - + 1 - - - - - - + http://faostat.fao.org @@ -534,30 +539,30 @@ http://faostat.fao.org/default.aspx?lang=es FAOSTAT http://faostat.fao.org - + - - + 1 + + + + + + - - - - - Currently being used by a restriction on organization. - + + - 1 - + @@ -577,11 +582,6 @@ - - - 1 - - http://www.fao.org/termportal/en/ http://www.fao.org/termportal/en/ @@ -598,20 +598,15 @@ http://www.iso.org/iso/fr/country_codes/iso_3166_code_lists.htm - Authorship of journal articles, books and other original works is a means by which academics communicate the results of their scholarly work, establish priority for their discoveries, and build their reputation among their peers. This class allows for linking an author to a publication while indicating information about that author's authorship. Contains the authors name, their rank in the publication, and whether or not they are a corresponding author on the publication. + Currently any abstract name is given to members of this class. This could change in the future. - - - 1 - - A seminar, discussion group, or the like, that emphasizes zxchange of ideas and the demonstration and application of techniques, skills, etc. stable @@ -620,10 +615,20 @@ This class allows for linking an author to a publication while indicating inform Bibo Definition: A seminar, discussion group, or the like, that emphasizes exchange of ideas and the demonstration and application of techniques, skills, etc. - + - - + 1 + + + + + + + + + + 1 + @@ -643,11 +648,11 @@ This class allows for linking an author to a publication while indicating inform stable - + Committee on Institutional Cooperation (CIC); The Five Colleges of Ohio Independent organizations formally working together toward a common goal, under an expressed agreement - + @@ -657,15 +662,15 @@ This class allows for linking an author to a publication while indicating inform - + - + A group of related documents issued at regular intervals. http://purl.org/ontology/bibo/ stable + - - + @@ -676,11 +681,6 @@ This class allows for linking an author to a publication while indicating inform - - - - - http://www.fao.org/termportal/contr/ar/ @@ -707,15 +707,10 @@ This class allows for linking an author to a publication while indicating inform Short Definition take from http://en.wiktionary.org/wiki/continent. - - + - - - - - - + + @@ -725,7 +720,7 @@ This class allows for linking an author to a publication while indicating inform 1 - + http://www.fao.org/termportal/contr/zh/ @@ -740,11 +735,6 @@ This class allows for linking an author to a publication while indicating inform http://www.fao.org/termportal/contr/ar/ 2010-06-24 - - - 1 - - @@ -826,32 +816,22 @@ This class allows for linking an author to a publication while indicating inform 2009-04-30 FAOSTAT - - - 1 - - A unit devoted primarily to extension activities, whether for outreach or research. Alachua County Extension Office + + + 1 + + Public Description for bibo:distributor taken from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . - - - - - - - - 1 - - FAO terminology @@ -867,14 +847,14 @@ This class allows for linking an author to a publication while indicating inform - - - + + + - - + + + - @@ -885,11 +865,6 @@ This class allows for linking an author to a publication while indicating inform A legal decision that affirms a ruling. - - - - - @@ -903,30 +878,25 @@ This class allows for linking an author to a publication while indicating inform Use subclasses of core:Facility subclasses instead of this class if possible - - - - - A gathering of people for a defined purpose, not necessarily public or announced - + 1 - + - + - - + 1 + - + - + @@ -975,11 +945,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - @@ -990,11 +955,6 @@ This class allows for linking an author to a publication while indicating inform Either city or town - a thickly populated area having fixed boundaries and certain local powers of government. - - - - - @@ -1005,25 +965,25 @@ This class allows for linking an author to a publication while indicating inform That is a position held by an academic faculty member who works for administration. + + Associate Dean - - An academic administrative position (associate dean, etc.) as distinct from a professional administrative position (non-academic) - - - - 2 - - server; Bruker Vector-33 FT-IR - + A network server is one example. Medical schools and research laboratories can list professional equipment, such as microscopes. - + A physical object provided for specific purpose, task or occupation. + + + + + + @@ -1033,26 +993,31 @@ This class allows for linking an author to a publication while indicating inform http://purl.org/ontology/bibo/ + + + 1 + + - http://purl.org/ontology/bibo/ A specific journal article - + A written composition in prose, usually nonfiction, on a specific topic, forming an independent part of a periodical or book - + Short Definition modified from the bibo ontology. A written composition in prose, usually nonfiction, on a specific topic, forming an independent part of a book or other publication, as a newspaper or magazine. + stable + + Director of Admissions and Placement; Associate University Librarian Particular position in an organization, commonly identified by job title, and normally associated with a job description that details the tasks and responsibilities that go with the position. - An employment activity, whether compensated or not. Short definition comes from http://en.wikipedia.org/wiki/Position, and has been modified. - @@ -1065,16 +1030,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - - - - - - The thesis degree. @@ -1086,9 +1041,9 @@ This class allows for linking an author to a publication while indicating inform The source of the public description and this info is found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html. Bibo considers this term "unstable". The bibo editorial note is: "We are not defining, using an enumeration, the range of the bibo:degree to the defined list of bibo:ThesisDegree. We won't do it because we want people to be able to define new degress if needed by some special usecases. Creating such an enumeration would restrict this to happen." - + An organizational unit (as opposed to the physical facility) that performs research, provides services, or processes materials @@ -1103,20 +1058,10 @@ This class allows for linking an author to a publication while indicating inform - - - - - - - - 1 - - Relates a document to an event; for example, a paper to a conference. @@ -1128,6 +1073,11 @@ This class allows for linking an author to a publication while indicating inform unstable + + + + + Agricultural area, this category is the sum of areas under a) arable land - land under temporary agricultural crops (multiple-cropped areas are counted only once), temporary meadows for mowing or pasture, land under market and kitchen gardens and land temporarily fallow (less than five years). The abandoned land resulting from shifting cultivation is not included in this category. Data for “Arable land†are not meant to indicate the amount of land that is potentially cultivable; (b) permanent crops - land cultivated with long-term crops which do not have to be replanted for several years (such as cocoa and coffee); land under trees and shrubs producing flowers, such as roses and jasmine; and nurseries (except those for forest trees, which should be classified under "forest"); and (c) permanent meadows and pastures - land used permanently (five years or more) to grow herbaceous forage crops, either cultivated or growing wild (wild prairie or grazing land). Data are expressed in 1000 hectares. http://faostat.fao.org/site/375/default.aspx @@ -1140,6 +1090,11 @@ This class allows for linking an author to a publication while indicating inform 2009-04-30 http://faostat.fao.org/DesktopDefault.aspx?PageID=377&lang=es#ancor + + + + + Public Definition source (http://www.answers.com/topic/publisher). @@ -1151,28 +1106,33 @@ This class allows for linking an author to a publication while indicating inform + + + + + + + + + + + + + 1 + + Use for teaching roles other than specific for-credit courses within a person's home institution. Use for teaching experiences other than specific for-credit courses within a person's home institution. - - - - - - - - 1 - - http://faostat.fao.org/DesktopDefault.aspx?PageID=550&lang=fr#ancor @@ -1184,33 +1144,38 @@ This class allows for linking an author to a publication while indicating inform http://faostat.fao.org/DesktopDefault.aspx?PageID=550&lang=es#ancor 2009-09-21 - - - - - US Patent Data; US Job Data A named collection of data, usually containing only one type of data - - - - - - + Computer program and its related documentation; directs the operation of a computer + + + + + An agreement involving specific deliverables and payment + + + + + + + + + + stable @@ -1220,6 +1185,11 @@ This class allows for linking an author to a publication while indicating inform Definiton from Bibo here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html + + + + + http://purl.org/ontology/bibo/ @@ -1232,6 +1202,11 @@ This class allows for linking an author to a publication while indicating inform A date and/or time + + + 1 + + @@ -1239,11 +1214,6 @@ This class allows for linking an author to a publication while indicating inform - - - - - http://www.fao.org/termportal/contr/es/ @@ -1284,11 +1254,6 @@ This class allows for linking an author to a publication while indicating inform 020530902X - - - 1 - - Member of the International Conference on Complex Systems Organizing Committee @@ -1300,21 +1265,21 @@ This class allows for linking an author to a publication while indicating inform Note that the administering department is not the central research administration office (such as University of Florida DSP or Cornell OSP) -- we didn't see a need to record a relationship to that office because it implicitly manages all grants. - + - 1 - - - - - - + 1 + A person working in a position of librarian or information professional, or academic or technical expert in support of providing information services or materials. + + + + + http://www.fao.org/termportal/contr/zh/ @@ -1329,16 +1294,26 @@ This class allows for linking an author to a publication while indicating inform FAO terminology + stable A scholarly academic article, typically published in a journal. - + http://purl.org/ontology/bibo/ Written by scholars for other scholars, typically published in an academic journal with an abstract and bibliography - A specific academic journal article + + + + + + + + 1 + + @@ -1350,10 +1325,10 @@ This class allows for linking an author to a publication while indicating inform - + - - + + @@ -1361,11 +1336,6 @@ This class allows for linking an author to a publication while indicating inform http://purl.org/ontology/bibo/ Digital Object Identifier - - - 1 - - A short description of the resource. @@ -1385,10 +1355,10 @@ This class allows for linking an author to a publication while indicating inform http://www.un.org/Depts/Cartographic/french/htmain.htm UN Cartographic Section - + - 1 - + + @@ -1429,10 +1399,10 @@ This class allows for linking an author to a publication while indicating inform http://www.fao.org/termportal/en/ - + - - + + http://www.fao.org/termportal/contr/ar/ @@ -1447,6 +1417,11 @@ This class allows for linking an author to a publication while indicating inform http://www.fao.org/termportal/contr/es/ + + + + + @@ -1458,6 +1433,16 @@ This class allows for linking an author to a publication while indicating inform + + + + + + + + + + @@ -1469,17 +1454,12 @@ This class allows for linking an author to a publication while indicating inform - - - - - - Definition taken from: http://en.wikipedia.org/wiki/University University of Florida; Washington University in St. Louis + An institution of higher education and research, which grants academic degrees in a variety of subjects, and provides both undergraduate education and postgraduate education. @@ -1488,43 +1468,49 @@ This class allows for linking an author to a publication while indicating inform Definition from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html + + + + 2 + Top level of all location classes. It's anticipated that the subclasses will be used when classifying items. And, all locations can be viewable via this class. Use subclasses of core:Location when classsifying items. - + - 1 - + + A document created as a basis for discussion or a very early draft of a formal paper - + - - - - - - + - + + + - 1 - + + + + + + Used for a single narrative summary of teaching, typically covering a wide range of courses including for credit and non-credit teaching over multiple semesters; the "teaches" property links a person directly with an instance of a Semester Class, typically from an institutional database of record; then use Teacher Role for information about a person's role in non-credit teaching or their specific contribution to individual courses @@ -1553,11 +1539,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - http://purl.org/ontology/bibo/ @@ -1567,7 +1548,7 @@ This class allows for linking an author to a publication while indicating inform A periodical of scholarly journal Articles. Contains original scholarly research or review articles by experts in the field Journal of Information Science; IEEE Intelligent System; Scientometrics - + http://purl.org/ontology/bibo/ @@ -1578,15 +1559,20 @@ This class allows for linking an author to a publication while indicating inform Contains news articles, opinions, features, advertising, and is usually issued daily or weekly - - + + + + + + + http://www.fao.org/termportal/contr/es/ http://www.fao.org/termportal/contr/zh/ @@ -1606,14 +1592,14 @@ This class allows for linking an author to a publication while indicating inform - - - - - + + + - - + + + + @@ -1627,19 +1613,9 @@ This class allows for linking an author to a publication while indicating inform - - - - - - - - 1 - - - + Wiley Prize in Biomedical Sciences An Award or Honor An Award or Honor @@ -1657,10 +1633,26 @@ This class allows for linking an author to a publication while indicating inform - + + - 1 - + + + + + + + + + + + + + + + + + @@ -1671,21 +1663,21 @@ This class allows for linking an author to a publication while indicating inform An agent that receives a communication document. - - - - - + + + + Only use if no specific subclasses of core:EventSeries desribe the activity. - - - + + A generic class which may include a conference series, a course section, a seminar series, or a workshop series. When possible, use one of these more specific classes. - - + + + Two or more events that follow on one after the other or are connected one after the other. + + - Enter building name. If the building's name is a number (as in many governmental organizations such as national laboratories and military bases), then enter it. Do not confuse with the number that appears in a postal address. @@ -1699,20 +1691,15 @@ This class allows for linking an author to a publication while indicating inform - + + - - + - - - + - - - - - + + @@ -1720,11 +1707,6 @@ This class allows for linking an author to a publication while indicating inform - - - 1 - - @@ -1744,25 +1726,10 @@ use one freetextKeyword assertion for each keyword or phrase. We would like the range of core:outcome to be the union of Event and Process; and that same union to be the range for core:outcomeOf, but we cannot currently express this with the editor. - - - - - - - - - - - - - - - @@ -1770,33 +1737,23 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - - - + + + - Represents educational training that has been received. This connects person to their academic degree through this educational training, but can also be used when the training does not result in a degree. Currently any abstract name is given to individuals of this class. This could change in the future. + - - - - - - + - - + A paper presented at a conference; optionally collected into a Proceedings or a special Journal issue + @@ -1807,13 +1764,13 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ + Facebook; VIVOweb.org; Flickr A group of Webpages accessible on the Web. A group of webpages available within a specific parent address or URL on the World Wide Web unstable - FAO terminology @@ -1828,22 +1785,12 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/ar/ http://www.fao.org/termportal/contr/zh/ - - - - - - - - 1 - - + Work consisting of collections of previously published works Short Definition is the Medical Subject Heading (MeSH) definition - A document that simultaneously contains other documents. http://purl.org/ontology/bibo/ stable @@ -1853,31 +1800,21 @@ We would like the range of core:outcome to be the union of Event and Process; an a reified relationship - - - 1 - - - - - 1 - - + An area of corporate activity organized as an administrative or functional unit. Definition modified from http://www.thefreedictionary.com/division. It is difficult to tell the difference between a division and a department. Cardiovascular Medicine (division within medicine) - - - + - + + The Ornithological Newsletter @@ -1885,22 +1822,27 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + The bibo:reviewOf public description was found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . As of 26 May 2010, bibo:reviewOf is used with the class Review, but core:reviewIn doesn't seem to be being used. - + + + - - VIVO Outreach Team; VIVO Ontology Team - An informal organization brought together for the purposes of a project or event. + @@ -1918,11 +1860,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - 1 - - Definition take from: http://dictionary.reference.com/browse/hospital. Shands at the University of Florida @@ -1940,34 +1877,14 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ The academic degree of a Thesis - - - 1 - - - - - - - - - - - - - Alchohol Education Center; Center for Arts and Public Policy; Hearing Research Center + A place where a particular activity or service is concentrated. Short Definition take from http://www.thefreedictionary.com/center. - - - - - Country area, area of the country including area under inland water bodies, but excluding offshore territorial waters. Possible variations in the data may be due to updating and revisions of the country data and not necessarily to any change of area. Data are expressed in 1000 hectares. http://faostat.fao.org/site/375/default.aspx FAOSTAT @@ -1983,11 +1900,6 @@ We would like the range of core:outcome to be the union of Event and Process; an Indicates the precision of the value of a DateTimeValue instance. - - - - - For example an HR job title for a person might be - Assistant University Librarian, and the preferred job title for that same person could be - Physical Sciences Librarian. @@ -1996,12 +1908,12 @@ We would like the range of core:outcome to be the union of Event and Process; an - + Short Definition from OCLC Input Standards, EntW A document created to summarize research findings associated with the completion of an academic degree. stable - + http://purl.org/ontology/bibo/ Works created to satisfy the requirements for an academic certification or degree; also called dissertation @@ -2013,21 +1925,16 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - + - - + + UN Statistics Division @@ -2042,11 +1949,16 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + Only use if no specific subclasses of core:Role describe the role. - + + - A person's or organization's type of contribution to an endeavor Only use this broad role class if no subclasses of role describe the item being classified. @@ -2055,11 +1967,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - @@ -2073,29 +1980,9 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - - - 1 - - - - - - - - - - - - @@ -2115,7 +2002,7 @@ We would like the range of core:outcome to be the union of Event and Process; an A structured file of information or a set of logically related data stored and retrieved using computer-based means Short Definition is the Medical Subject Heading (MeSH) definition - + PubMed @@ -2134,7 +2021,7 @@ We would like the range of core:outcome to be the union of Event and Process; an A meeting for consultation or discussion. - + @@ -2143,33 +2030,33 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - + A distinct, usually ongoing and specialized unit within a large organization. Definition modified from the definition here: http://dictionary.reference.com/browse/department. It is difficult to tell the difference between and department and a division. Legal (department within a company); Use for any non-academic department - - - 1 - - - + 1 - + + + + + 1 + + + + + + - An online article or commentary appearing on a blog + A specific blog posting @@ -2181,8 +2068,8 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ Hill Ornithology Collection; Wiley Interscience Online Books Biochemisty Collection A collection of Documents or Collections + - submitted; accepted; in-press; published; invited; refereed. @@ -2205,13 +2092,18 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + - + B.A. Bachelor of Arts This list may have multiple abbreviations for some degrees. + An academic degree at any level, both as reported by individuals for employment and as offered by academic degree programs. - @@ -2229,11 +2121,6 @@ We would like the range of core:outcome to be the union of Event and Process; an A legal document proposing or enacting a law or a group of laws. - - - 1 - - Minnesota; Michigan; Indiana; New York; Quebec; Manitoba; Ontario Source of the Short Definition: http://www.thefreedictionary.com/state. @@ -2256,11 +2143,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - @@ -2270,13 +2152,18 @@ We would like the range of core:outcome to be the union of Event and Process; an - phonograph record; tape; CD; DVD; DAT An audio document; aka record. + http://purl.org/ontology/bibo/ stable Recorded audio in any format + + + + + http://unstats.un.org/unsd/methods/m49/m49alpha.htm http://unstats.un.org/unsd/methods/m49/m49chgef.htm @@ -2298,15 +2185,15 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ - + 1 - + - + + + - - FAO terminology @@ -2321,17 +2208,12 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/zh/ 2010-06-24 - - - 1 - - http://purl.org/ontology/bibo/ film; video; Blu-ray Audiovisual recording in any format - + stable An audio-visual document; film, video, and so forth. @@ -2371,6 +2253,11 @@ We would like the range of core:outcome to be the union of Event and Process; an http://xmlns.com/foaf/spec/#term_lastName. Note from foaf: "The lastName property is provided (alongside firstName) as a mechanism to support legacy data that cannot be easily interpreted in terms of the (otherwise preferred) familyName and givenName properties. The concepts of 'first' and 'last' names do not work well across cultural and linguistic boundaries; however they are widely used in addressbooks and databases." + + + + + @@ -2399,20 +2286,10 @@ We would like the range of core:outcome to be the union of Event and Process; an stable - - - - - - + - - - - - - - + + @@ -2422,16 +2299,16 @@ We would like the range of core:outcome to be the union of Event and Process; an - A defined class of organizations that fund Grants. + National Institute of Health (NIH) - + 1 - + @@ -2442,17 +2319,22 @@ We would like the range of core:outcome to be the union of Event and Process; an A person or company whose business is the publishing of books, periodicals, engravings, computer software, etc. Elsevier; Harper & Row; Indiana University Press - + + + + + + - + + + - 1 - A student organization is an organization, operated by students at a university, whose membership normally consists only of students. @@ -2466,6 +2348,11 @@ We would like the range of core:outcome to be the union of Event and Process; an Afghanistan; Antigua and Barbuda; Cameroon; Iceland; Jamaica; Nigeria; United States of America + + + 1 + + @@ -2474,16 +2361,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - - - - - - - - 2010-06-24 @@ -2497,6 +2374,16 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/zh/ http://www.fao.org/termportal/contr/fr/ + + + 1 + + + + + + + @@ -2508,8 +2395,13 @@ We would like the range of core:outcome to be the union of Event and Process; an The full URL. Uniform Resource Locator (URL) specifies where an identified resource is available and the mechanism for retrieving it. - http://info.slis.indiana.edu/~katy/ + + + + + 1 + @@ -2537,6 +2429,16 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ stable + + + + + + + + 1 + + http://www.fao.org/termportal/contr/ar/ @@ -2557,16 +2459,6 @@ We would like the range of core:outcome to be the union of Event and Process; an - - - 1 - - - - - 1 - - Short Definition copied from bibo ontology @@ -2589,17 +2481,18 @@ We would like the range of core:outcome to be the union of Event and Process; an Institute for Fundamental Theory + This class will display all the instances in the subclasses below it, as well as any organizations that were added as part of this generic class because there wasn't a specific class available. - + Only use if no specific subclasses of foaf:organization desribe the organization. + A generic class encompassing several types of organizations. - - - - + - + + + Ued to describe an organization related to bibliographic items such as a publishing company, etc. @@ -2615,16 +2508,21 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/zh/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ + + + + + - + + + - - @@ -2639,57 +2537,47 @@ We would like the range of core:outcome to be the union of Event and Process; an definition modified from: source (http://en.wikipedia.org/wiki/Seating_capacity). 55 - - - - - - + 1 - + The digital file (or physical equivalent), if available after the conference, vs. the act of attending/presenting: use ConferencePresentation for information about date/time/location/name of the event where the poster was presented - - - - - - - - - - An organized series of workshop events, whether repetitions of the same workshop or multiple different workshops. Use workshop for individual events. - - - - - + + + + + + + + + + - + - 1 - + + @@ -2697,24 +2585,34 @@ We would like the range of core:outcome to be the union of Event and Process; an - Only use if no specific subclasses of event:Event are appropriate. - - + + This class will also display instances of subclasses under Event, e.g. Philosophy Department Discussion Club; 2009 Racker Lecture; screening of a documentary. In addition to a location in space and time, an event may have any or all the following qualities: actively participating agents, passive factors, work products. Also, it may be in a virtual space or part of a series such as a lecture series. The previous short definition was: "An arbitrary classification of a space/time region, by a cognitive agent." - - - - - - - + + + + Something that happens at a given place and time. - - + + + + + + + + + + + + + + + 1 + @@ -2737,11 +2635,6 @@ The previous short definition was: "An arbitrary classification of a space/time http://www.fao.org/termportal/contr/es/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - - - - - @@ -2772,10 +2665,10 @@ The previous short definition was: "An arbitrary classification of a space/time - + 1 - + @@ -2783,13 +2676,23 @@ The previous short definition was: "An arbitrary classification of a space/time + + + + + + + + + + - + + An award, honor, or distinction received by a person on a particular date (not the award itself as given repeatedly, and not a grant award). - A specific award on a particular date or for a particular date range. - + Ninth annual Wiley Prize in Biomedical Sciences, for the discovery of a light activated ion channel @@ -2799,6 +2702,11 @@ The previous short definition was: "An arbitrary classification of a space/time + + + + + Short Definition from the bibo ontology http://purl.org/ontology/bibo/ @@ -2820,19 +2728,14 @@ The previous short definition was: "An arbitrary classification of a space/time Role of co-principal investigator of a grant, who devotes a specified percentage of time and is considered key personnel. - - - - - Professor, associate professor and assistant professor are common positions for academic faculty. - - Professor; Associate Professor; Assistant Professor Academic position in a university or institution + + @@ -2846,17 +2749,22 @@ The previous short definition was: "An arbitrary classification of a space/time The dual relationship of a professor advising a student and the student being advised by a professor, typically including start and end dates - + - + 1 - + - + - 1 - + + + + + + + @@ -2868,6 +2776,21 @@ The previous short definition was: "An arbitrary classification of a space/time + + + + + + + + + + + + + + + @@ -2894,10 +2817,15 @@ modern society using the world of Star trek. Los Angeles Times, March - + - - + + + + + + + http://www.fao.org/termportal/contr/en/ @@ -2917,6 +2845,11 @@ modern society using the world of Star trek. Los Angeles Times, March This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration. + + + 1 + + http://purl.org/ontology/bibo/ @@ -2925,23 +2858,28 @@ modern society using the world of Star trek. Los Angeles Times, March An agent that interview another agent. - + - - + + - - - - - + + + + + + + + + + @@ -2954,16 +2892,16 @@ modern society using the world of Star trek. Los Angeles Times, March a specific period or duration, defined by (optional) start and end date/times. - + + + + + + - - - - - @@ -2980,11 +2918,6 @@ modern society using the world of Star trek. Los Angeles Times, March Short Definition from bibo ontology - - - - - @@ -2995,10 +2928,10 @@ modern society using the world of Star trek. Los Angeles Times, March - - + - + + FAO terminology @@ -3013,21 +2946,31 @@ modern society using the world of Star trek. Los Angeles Times, March 2010-06-24 http://www.fao.org/termportal/contr/zh/ + + + + + The value of the datatype property *validSince* associated to a particular area (territory or group) indicates the area's first year of validity. The geopolitical ontology traces back historic changes only until 1985, therefore, if an area has a validSince = 1985, this indicates that the area is/was valid since 1985 or before. - + - 1 - + + - - - + + + + + + + + @@ -3041,10 +2984,10 @@ modern society using the world of Star trek. Los Angeles Times, March - + - - + + @@ -3077,10 +3020,10 @@ Examples of a Publisher include a person, an organization, or a service. Typical http://www.fao.org/termportal/contr/zh/ - + - - + + @@ -3088,6 +3031,11 @@ Examples of a Publisher include a person, an organization, or a service. Typical + + + + + @@ -3126,6 +3074,11 @@ Examples of a Publisher include a person, an organization, or a service. Typical + + + + + @@ -3139,10 +3092,20 @@ Examples of a Publisher include a person, an organization, or a service. Typical http://purl.org/ontology/bibo/ - - + + + + + + + + + + + + + - http://www.fao.org/termportal/contr/es/ @@ -3157,15 +3120,15 @@ Examples of a Publisher include a person, an organization, or a service. Typical 2010-06-24 - - + - - - - + + + + + @@ -3173,18 +3136,23 @@ Examples of a Publisher include a person, an organization, or a service. Typical Resource dependent on other entities This class is here so it can be equivalent to vitro:DependentResource. Deletion in the VIVO system behaves differently when deleting members of this class: related individuals may need to be deleted as well. + + + + + - A distinct, usually specialized educational unit within an educational organization. + - + Endodontics (department within a College of Dentistry); English (department within a College of Liberal Arts) - + - - + + @@ -3193,11 +3161,6 @@ Examples of a Publisher include a person, an organization, or a service. Typical RearcherID is a Thomson Reuters project where researchers have a place to manage and share their professional information. It will allow them to solve author identity issues while simultaneously adding dynamic citation metrics and collaboration networks to your personal profile. Definition source: http://isiwebofknowledge.com/researcherid/ - - - 1 - - @@ -3216,6 +3179,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/A passage selected from a larger work. http://purl.org/ontology/bibo/ + + + 1 + + @@ -3225,27 +3193,22 @@ Definition source: http://isiwebofknowledge.com/researcherid/Critical or explanatory note for a Document. - + - - - - - - 1 - + + - + An intramural or extramural award to support scholarly work, such as UF09179 (VIVO) Short definition is from the Glossary of NIH Terms. - - - + + Financial assistance mechanism providing money, property, or both to an eligible entity to carry out an approved project or activity - + + @@ -3265,11 +3228,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - - - - - @@ -3294,6 +3252,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + 1 + + @@ -3314,11 +3277,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/2010-06-24 http://www.fao.org/termportal/en/ - - - - - Universal Product Code @@ -3327,21 +3285,26 @@ Definition source: http://isiwebofknowledge.com/researcherid/http://purl.org/ontology/bibo/ source for public description: http://en.wikipedia.org/wiki/Universal_Product_Code. + + + + + + + + 1 + + A person with at least one academic appointment to a specific faculty of a university or institution of higher learning. Definition from here: http://research.carleton.ca/htr/defs.php. - + - 1 - - - - - - + + @@ -3350,20 +3313,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/Intel Talent Search; poetry contest Not the same as an award or distinction. - + + - - + - - - - - - - - + + 1 + @@ -3379,11 +3337,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/stable - - - 1 - - @@ -3406,11 +3359,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ 0.7 - - - 1 - - http://purl.org/ontology/bibo/ New Yorker @@ -3421,10 +3369,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/Contains articles of current events or general interest, geared to the reading public as being informative or recreational + + + + + Address has properties for department name, street, city, state or province, postal code, and country. For US specific address, classify using core:US Postal Code. core:Address will display all addresses. + - University of Waterloo, 200 University Avenue West, Waterloo, Ontario, Canada N2L 3G1 A code and abstract concept expressing a location on the Earth's surface. To classify US specific addresses, use core:US Postal Code. @@ -3433,9 +3386,9 @@ Definition source: http://isiwebofknowledge.com/researcherid/It is the common position in libraries. A position held by library and information science professionals, or academic or technical experts, in support of providing information services or materials - + - + http://www.fao.org/termportal/contr/zh/ @@ -3450,21 +3403,21 @@ Definition source: http://isiwebofknowledge.com/researcherid/FAO terminology http://www.fao.org/termportal/contr/es/ - + - - - - - - 1 - + + + + + + + @@ -3480,10 +3433,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/Library of Congress Control Number Source: http://en.wikipedia.org/wiki/Library_of_Congress_Control_Number. - + + - 1 - + @@ -3492,17 +3445,17 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + + + A group can also be an organization but need not be; typically used for looser associations of people or organizations acting together in some fashion, not necessarily through formal agreement or on a long-term basis. Added to the VIVO ontology to be able to support informal and perhaps even private groups of people around an idea, funding opportunity, or event. A group of agents - - - - - http://purl.org/ontology/bibo/ unstable @@ -3514,10 +3467,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ Curriculum Steering Committee; PhD Advisory Committee + A group of people organized for a specific purpose (e.g., a reporting or advisory role), often with a charge and for a specific duration. There could be many subclasses such as thesis committee or tenure committee, but these may typically be differentiated via the moniker unless distinct properties become important. - Short Definition from OCLC Input Standards, EntW @@ -3547,33 +3500,33 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - + + + - + 1 - + + + + + + This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration. - - - - - - + + 1320 East 10th Street, Wells Library 021 Bloomington, IN 47405 - - Formal address in US postal address system. + US postal address follow the format street, apt or office number (optional), city, state, and zipcode. @@ -3587,11 +3540,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - 1 - - @@ -3606,16 +3554,16 @@ Definition source: http://isiwebofknowledge.com/researcherid/A web page is an online document available (at least initially) on the world wide web. A web page is written first and foremost to appear on the web, as distinct from other online resources such as books, manuscripts or audio documents which use the web primarily as a distribution mechanism alongside other more traditional methods such as print. - + Short Definition from the bibo ontology unstable - + A section of a book - - + http://purl.org/ontology/bibo/ + A section of a book. @@ -3629,15 +3577,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - + + + - + - 1 - + + @@ -3669,16 +3617,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - + + + - - - 1 - - Definition was take from here: http://dictionary.reference.com/browse/museum @@ -3719,21 +3662,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - - - - - - - - - - - @@ -3744,6 +3672,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + + + @@ -3756,11 +3689,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - @@ -3798,43 +3726,43 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - - - - - - - - - 1 - - A short form for an longer title or name. B.A. - + - 1 - + + A person holding a position that is not considered to be an academic appointment. + + + + + + + + + + + + + 1 + + @@ -3847,6 +3775,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + 1 + + For example, National Science Foundation providesFundingThrough Graduate Research Fellowship Program; National Institutes of Health providesFundingThrough National Center for Research Resources. @@ -3861,10 +3794,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ Use subclasses of core:Geographic Location subclasses instead of this class if possible. - - - + + + @@ -3885,15 +3818,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - + - - - - - - 1 - + + @@ -3901,10 +3829,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - + - - + + An agent that is interviewed by another agent. @@ -3927,6 +3855,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/Used for a single narrative summary of research, typically covering a wide range of activities and time periods; use Researcher Role for information on individual activities + + + + + A role involving research (funded or unfunded), sometimes linked to a grant @@ -3934,6 +3867,11 @@ Definition source: http://isiwebofknowledge.com/researcherid/ Bacteria-resistant bandage; Termite prevention system; Hurricane resistant houses + + + + + Relates a document to some transcribed original. The bibo:transcriptOf public description was found here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . Bibo considers this term unstable. @@ -3943,15 +3881,30 @@ Definition source: http://isiwebofknowledge.com/researcherid/unstable + + + + + + + + + + + + + + + - + - - + 1 + @@ -3962,15 +3915,10 @@ Definition source: http://isiwebofknowledge.com/researcherid/Publication Description source http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . This term is also considered unstable. unstable - - - - - - - - + + + @@ -3982,6 +3930,15 @@ Definition source: http://isiwebofknowledge.com/researcherid/ + + + + + An offering through an ongoing program or single request of research support: internships, positions, financial awards or other forms of tangible or intangible support + + + + @@ -3994,11 +3951,6 @@ Definition source: http://isiwebofknowledge.com/researcherid/ - - - - - http://purl.org/ontology/bibo/ @@ -4030,11 +3982,6 @@ bibo has the domain of this property set to the union of Collection and Document 2010-06-24 - - - 1 - - FAO terminology @@ -4048,7 +3995,7 @@ bibo has the domain of this property set to the union of Collection and Document http://www.fao.org/termportal/contr/ar/ FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - + @@ -4057,6 +4004,21 @@ bibo has the domain of this property set to the union of Collection and Document + + + + + + + + 1 + + + + + + + http://purl.org/ontology/bibo/ @@ -4065,20 +4027,10 @@ bibo has the domain of this property set to the union of Collection and Document - - - - - - - - - - @@ -4090,20 +4042,15 @@ bibo has the domain of this property set to the union of Collection and Document - - - 1 - - - + + + - 1 - @@ -4117,6 +4064,11 @@ bibo has the domain of this property set to the union of Collection and Document + + + + + The concept name, URL, and source vocabulary name of a Subject Area. http://www.getty.edu/vow/AATHierarchy?find=&logic=AND&note=&english=N&subjectid=300000000 @@ -4155,6 +4107,11 @@ bibo has the domain of this property set to the union of Collection and Document Definition from: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html + + + + + 1320 E. 10th St. Definition take from: http://dictionary.reference.com/browse/street @@ -4167,19 +4124,24 @@ bibo has the domain of this property set to the union of Collection and Document + + + 1 + + - A bounded physical representation of a body of information designed with the capacity (and usually intent) to communicate - + + - Short Definition from the bibo ontology stable + http://purl.org/ontology/bibo/ - + A document (noun) is a bounded physical representation of body of information designed with the capacity (and usually intent) to communicate. A document may manifest symbolic, diagrammatic or sensory-representational information. - - + + A bounded physical representation of a body of information designed with the capacity (and usually intent) to communicate @@ -4187,11 +4149,6 @@ bibo has the domain of this property set to the union of Collection and Document - - - - - @@ -4227,8 +4184,13 @@ bibo has the domain of this property set to the union of Collection and Document - + + + + + + FAO terminology @@ -4257,38 +4219,18 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - - - - - - - - - - - An edited book. http://purl.org/ontology/bibo/ + Best American Science Writing 2009 stable An edited collection of stand-alone articles published as a book - - - - - - - - - - - - - + + + Use subclasses of core:GeopoliticalEntity subclasses instead of this class if possible. @@ -4297,12 +4239,27 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi Short definition obtained here: http://en.wiktionary.org/wiki/geopolitical_entity. + + + + + + + + + + + + + + + 100 Caldwell Hall; 114 Martha Van Rensselaer (Rushmore Conference Room) Room that provides a particular service or is used for a particular activity. @@ -4310,49 +4267,54 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi Enter room number of name. + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -4373,16 +4335,21 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://www.fao.org/termportal/contr/zh/ - - - - - Examples shows a book has French language version. Public description source: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . + + + 1 + + + + + 1 + + @@ -4390,6 +4357,16 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi + + + 1 + + + + + + + http://www.fao.org/termportal/contr/fr/ @@ -4404,17 +4381,12 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://www.fao.org/termportal/contr/ar/ - College of Arts & Sciences; Ivy Tech Community College + A primary academic unit within a University or a free-standing higher education organization without graduate degree programs. - - - - - Document1 isVersionOf Document2 @@ -4444,10 +4416,20 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - + - - + 1 + + + + + 1 + + + + + + @@ -4456,6 +4438,11 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi + + + + + http://purl.org/ontology/bibo/ Supreme Court Reporter @@ -4478,30 +4465,40 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - + - - + 1 + - + - + - - + + + + + + 1 + - + - - + + + + + + + @@ -4514,11 +4511,16 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://xmlns.com/foaf/spec/#term_firstName. Note from foaf: "The lastName property is provided (alongside firstName) as a mechanism to support legacy data that cannot be easily interpreted in terms of the (otherwise preferred) familyName and givenName properties. The concepts of 'first' and 'last' names do not work well across cultural and linguistic boundaries; however they are widely used in addressbooks and databases." + + + + + - UITS service - + UITS service is the information technology services provided by Indiana University. SC. + A regularly offered service in support of an academic, research, or administrative function (not personal or professional service by an individual) @@ -4528,14 +4530,14 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - - - - - + + + 1 + + @@ -4559,11 +4561,6 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi - - - - - unstable @@ -4573,15 +4570,20 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://purl.org/ontology/bibo/ Short Definition from the bibo ontology + + + 1 + + - + - - + 1 + @@ -4599,29 +4601,20 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi A work consisting of texts of rules and regulations related to statutes issued by executive or administrative agencies A collection of statutes. - + + + - 1 - - - + - - - - - - An offering through an ongoing program or single request of research support: internships, positions, financial awards or other forms of tangible or intangible support - - - - + + - + Used information from this definition: http://dictionary.reference.com/browse/library. A collection of any materials, for study and enjoyment, which has been systematically arranged. Marston Science Library @@ -4640,20 +4633,10 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi http://purl.org/ontology/bibo/ - - + - - - - - - - - - - - + 1 + http://www.fao.org/termportal/contr/ar/ @@ -4668,11 +4651,6 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi FAO terminology FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ - - - 1 - - @@ -4691,24 +4669,19 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi Public Description for bibo:distributor taken from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . - - - + + + - + - - - - - - - + 1 + @@ -4717,10 +4690,10 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi full email address - + + + - 1 - @@ -4728,19 +4701,14 @@ The Uniform Code Council (UCC) was the Numbering Organization in the USA to admi We would like the range of core:outcome to be the union of Event and Process; and that same union to be the range for core:outcomeOf, but we cannot currently express this with the editor. - - - - - Used to describe any "agent" related to bibliographic items. Such agents can be persons, organizations or groups of any kind. - - - - - + + + + + @@ -4760,10 +4728,15 @@ We would like the range of core:outcome to be the union of Event and Process; an For data ingest from authoritative sources to record the actual way a person was listed as author, as potentially valuable information for author disambiguation. - + + + - - + + + + + @@ -4791,6 +4764,11 @@ We would like the range of core:outcome to be the union of Event and Process; an Used to link a bibliographic item to one of its contributor: can be an author, an editor, a publisher, etc. + + + + + @@ -4813,16 +4791,26 @@ We would like the range of core:outcome to be the union of Event and Process; an Any organization (likely also asserted as another class of Organization) with a primary, ongoing research function, not just through occasional roles - + - 1 - + + + + + + 1 + The result of rendering a work from one language to another + + + + + @@ -4834,6 +4822,11 @@ We would like the range of core:outcome to be the union of Event and Process; an Definition http://en.wikipedia.org/wiki/Job_title#Job_title. + + + 1 + + @@ -4841,15 +4834,10 @@ We would like the range of core:outcome to be the union of Event and Process; an - + 1 - - - - - - + http://www.fao.org/figis/servlet/RefServlet @@ -4863,14 +4851,14 @@ We would like the range of core:outcome to be the union of Event and Process; an - - + + - + Medical Subject Heading (MeSH) definition of Technical Report: Work consisting of a formal report giving details of the investigation and results of a medical or other scientific problem. When issued by a government agency or comparable official body, its contents may be classified, unclassified, or declassified with regard to security clearance. This publication type may also cover a scientific paper or article that records the current state or current position of scientific research and development. If so labeled by the editor or publisher, this publication type may be properly used for journal articles. A document describing an account or statement describing in detail an event, situation, or the like, usually as the result of observation, inquiry, etc.. http://purl.org/ontology/bibo/ @@ -4878,6 +4866,11 @@ We would like the range of core:outcome to be the union of Event and Process; an stable + + + 1 + + @@ -4896,11 +4889,6 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/es/ FAO terminology - - - - - 2010-06-24 http://www.fao.org/termportal/en/ @@ -4914,39 +4902,38 @@ We would like the range of core:outcome to be the union of Event and Process; an http://www.fao.org/termportal/contr/fr/ + + + 1 + + - - - + + + + + - - - - + + - - - - - - - + + 1 - - + @@ -4954,26 +4941,31 @@ We would like the range of core:outcome to be the union of Event and Process; an - + 1 - + - - - + + + + + + + + + + + + 1 + A retired professor who retained their rank, title and privileges. - - - - - @@ -5000,35 +4992,20 @@ We would like the range of core:outcome to be the union of Event and Process; an http://purl.org/ontology/bibo/ Short Definition from the bibo ontology - - - - - - + A position involving academic work but without faculty status Researcher; Academic Extension Associate; Postdoctoral Associate - Those positions are held by people who do academic work but do not have faculty positions in universities or institutes. + - - - 1 - - - - - - - Currently being used by a restriction on organization. @@ -5048,14 +5025,19 @@ We would like the range of core:outcome to be the union of Event and Process; an An outreach or community service role directed outside a person's primary profession and institution Communicating Astronomy to the Public + + + + + - stable - A loose, thematic, collection of Documents, often Books. A thematic collection of documents, usually books, issued at regular or irregular intervals http://purl.org/ontology/bibo/ + + Methods in Molecular Biology @@ -5065,6 +5047,11 @@ We would like the range of core:outcome to be the union of Event and Process; an + + + + + Definition take from: http://dictionary.reference.com/browse/foundation. An institution financed by a donation or legacy to aid research, education, the arts, etc. @@ -5072,11 +5059,6 @@ We would like the range of core:outcome to be the union of Event and Process; an The Ford Foundation - - - - - http://purl.org/ontology/bibo/ @@ -5106,20 +5088,20 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - - + 1 - + - + - - + + + + + + + @@ -5138,9 +5120,14 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik Short Definition modified from the one found here: http://www.thefreedictionary.com/county. - Alachua; Baker; Bradford; Kenora; Ottawa; Waterloo The largest administrative division of most states or provinces. + + + + + + @@ -5165,36 +5152,41 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - Short Definition from the bibo ontology A distinct part of a larger document or collected document + http://purl.org/ontology/bibo/ - + a distinct part of a larger document or collected document. - unstable - + + + + 1 + + - - - Short Definition copied from bibo ontology + http://purl.org/ontology/bibo/ + + A written or printed work of fiction or nonfiction, usually on sheets of paper fastened or bound together within covers. - - + A written or printed work of fiction or nonfiction, usually on sheets of paper fastened or bound together within covers stable + + + + + + @@ -5212,17 +5204,31 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - - - - + - - + + + + + + + + An endeavor, frequently collaborative, that occurs over a finite period of time and is intended to achieve a particular aim. + An endeavor, frequently collaborative, that occurs over a finite period of time and is intended to achieve a particular aim. + + + + + + + + + + + + + 1 + @@ -5230,15 +5236,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - + - - - - - - - + + @@ -5251,10 +5252,25 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik A URLLink that is designated (by the user or anyone else) as a primary link for the person, organization, event, etc. + + + 1 + + + + + 1 + + + + + 1 + + A formal organization of people or organizations around a subject or practice. @@ -5269,20 +5285,25 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik Note: Bibo:editor is used as the inverse of core:editorOf. Public Description for bibo:editor was obtained from here: http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html . - + - - + 1 + + + + + 1 + A postdoctoral training appointment (job) - + - - + 1 + @@ -5290,16 +5311,6 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - - - - - - - - @@ -5310,11 +5321,6 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - - 1 - - @@ -5327,10 +5333,15 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - + - + 1 + + + + + + http://www.fao.org/termportal/contr/zh/ @@ -5350,6 +5361,11 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik + + + 1 + + @@ -5357,10 +5373,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - + - + 1 + @@ -5370,10 +5386,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik - - 1 + - + 1 + @@ -5382,11 +5398,6 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik http://purl.org/ontology/bibo/ - - - 1 - - FAO terminology. FAOTERM. http://www.fao.org/termportal/en/ http://www.fao.org/termportal/contr/zh/ @@ -5400,25 +5411,30 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik http://www.fao.org/termportal/en/ 2010-06-24 - - - + + 1 + + + + + 1 + + + + + + - - - - - 2010-04-01 UN Statistics Division http://unstats.un.org/unsd/methods/m49/m49alpha.htm @@ -5429,10 +5445,15 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik http://unstats.un.org/unsd/methods/m49/m49alpha.htm http://unstats.un.org/unsd/methods/m49/m49alpha.htm - - + - + + + + + + 1 + @@ -5443,10 +5464,10 @@ Definition and description came from Wikipedia here: http://en.wikipedia.org/wik A list of items in a collection; an ordered compilation of item descriptions and sufficient information to afford access to them - + NLM Catalog + Short Definition is the Medical Subject Heading (MeSH) definition - - + diff --git a/productMods/WEB-INF/web.xml b/productMods/WEB-INF/web.xml index f3fb6f66..d03ca326 100644 --- a/productMods/WEB-INF/web.xml +++ b/productMods/WEB-INF/web.xml @@ -171,7 +171,7 @@ - edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache + edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache$Setup +--> browsecontroller diff --git a/productMods/config/listViewConfig-authorInAuthorship.xml b/productMods/config/listViewConfig-authorInAuthorship.xml index 87c115e4..9b214b58 100644 --- a/productMods/config/listViewConfig-authorInAuthorship.xml +++ b/productMods/config/listViewConfig-authorInAuthorship.xml @@ -4,27 +4,109 @@ - + 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#> - SELECT DISTINCT ?subclass ?authorship (afn:localname(?authorship) AS ?authorshipName) - ?infoResource ?infoResourceName ?dateTime WHERE { - GRAPH ?g1 { ?subject ?property ?authorship } - OPTIONAL { GRAPH ?g2 { ?authorship core:linkedInformationResource ?infoResource } - GRAPH ?g3 { ?infoResource rdfs:label ?infoResourceName } - OPTIONAL { GRAPH ?g4 { ?subclass rdfs:subClassOf core:InformationResource } - GRAPH ?g5 { ?infoResource a ?subclass } - FILTER (?g5 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && - ?g5 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) + SELECT DISTINCT ?authorship + ?infoResource ?infoResourceName + ?dateTime WHERE { + ?subject ?property ?authorship + OPTIONAL { ?authorship core:linkedInformationResource ?infoResource . + ?infoResource rdfs:label ?infoResourceName + OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } + } + } ORDER BY DESC(?dateTime) ?infoResourceName + + + + 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#> + + SELECT DISTINCT ?subclass + ?authorship + ?infoResource ?infoResourceName + ?dateTime WHERE { + ?subject ?property ?authorship + OPTIONAL { ?authorship core:linkedInformationResource ?infoResource . + ?infoResource rdfs:label ?infoResourceName + OPTIONAL { ?subclass rdfs:subClassOf core:InformationResource . + ?infoResource a ?subclass } - OPTIONAL { GRAPH ?g6 { ?infoResource core:dateTimeValue ?dateTimeValue . - ?dateTimeValue core:dateTime ?dateTime . } + OPTIONAL { ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime } } } ORDER BY ?subclass DESC(?dateTime) ?infoResourceName - + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subclass rdfs:subClassOf core:InformationResource + } WHERE { + ?subclass rdfs:subClassOf core:InformationResource + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?authorship . + ?authorship ?authorshipProperty ?authorshipValue . + ?authorship core:linkedInformationResource ?infoResource . + ?infoResource rdfs:label ?infoResourceName + } WHERE { + { + ?subject ?property ?authorship + } + UNION { + ?subject ?property ?authorship . + ?authorship ?authorshipProperty ?authorshipValue . + } UNION { + ?subject ?property ?authorship . + ?authorship core:linkedInformationResource ?infoResource . + ?infoResource rdfs:label ?infoResourceName + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?authorship . + ?authorship core:linkedInformationResource ?infoResource . + ?infoResource a ?subclass + } WHERE { + ?subject ?property ?authorship . + ?authorship core:linkedInformationResource ?infoResource . + ?subclass rdfs:subClassOf core:InformationResource . + ?infoResource a ?subclass + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?authorship . + ?authorship core:linkedInformationResource ?infoResource . + ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } WHERE { + ?subject ?property ?authorship . + ?authorship core:linkedInformationResource ?infoResource . + ?infoResource core:dateTimeValue ?dateTimeValue . + ?dateTimeValue core:dateTime ?dateTime + } + diff --git a/productMods/config/listViewConfig-dateTimeInterval.xml b/productMods/config/listViewConfig-dateTimeInterval.xml index 201c90c0..f9def01e 100644 --- a/productMods/config/listViewConfig-dateTimeInterval.xml +++ b/productMods/config/listViewConfig-dateTimeInterval.xml @@ -4,24 +4,82 @@ - + 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#> - SELECT DISTINCT ?dateTimeStart (afn:localname(?dateTimePrecisionStart) AS ?precisionStart) - ?dateTimeEnd (afn:localname(?dateTimePrecisionEnd) AS ?precisionEnd) WHERE { - GRAPH ?g1 { ?subject ?property ?dateTimeInterval } - OPTIONAL { GRAPH ?g2 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart ; - core:dateTimePrecision ?dateTimePrecisionStart . } - } - OPTIONAL { GRAPH ?g3 { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd ; - core:dateTimePrecision ?dateTimePrecisionEnd . } + SELECT DISTINCT ?dateTimeInterval + ?valueStart ?valueStartName + ?dateTimeStart + ?precisionStart + ?valueEnd ?valueEndName + ?dateTimeEnd + ?precisionEnd WHERE { + ?subject ?property ?dateTimeInterval + + OPTIONAL { ?dateTimeInterval core:start ?valueStart + LET (?valueStartName := afn:localname(?valueStart)) + OPTIONAL { ?valueStart core:dateTime ?dateTimeStart } + OPTIONAL { ?valueStart core:dateTimePrecision ?dateTimePrecisionStart + LET (?precisionStart := afn:localname(?dateTimePrecisionStart)) + } + } + OPTIONAL { ?dateTimeInterval core:end ?valueEnd + LET (?valueEndName := afn:localname(?valueEnd)) + OPTIONAL { ?valueEnd core:dateTime ?dateTimeEnd } + OPTIONAL { ?valueEnd core:dateTimePrecision ?dateTimePrecisionEnd + LET (?precisionEnd := afn:localname(?dateTimePrecisionEnd)) + } } } - - + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?subject ?property ?dateTimeInterval . + ?dateTimeInterval core:start ?valueStart . + ?dateTimeInterval core:end ?valueEnd + } WHERE { + { + ?subject ?property ?dateTimeInterval + } + UNION { + ?subject ?property ?dateTimeInterval . + ?dateTimeInterval core:start ?valueStart + } + UNION { + ?subject ?property ?dateTimeInterval . + ?dateTimeInterval core:end ?valueEnd + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?valueStart ?p ?o + } WHERE { + ?subject ?property ?dateTimeInterval . + ?dateTimeInterval core:start ?valueStart . + ?valueStart ?p ?o + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?valueEnd ?p ?o + } WHERE { + ?subject ?property ?dateTimeInterval . + ?dateTimeInterval core:end ?valueEnd . + ?valueEnd ?p ?o + } + + - \ No newline at end of file + diff --git a/productMods/config/listViewConfig-dateTimeValue.xml b/productMods/config/listViewConfig-dateTimeValue.xml index 653ea916..a26786b3 100644 --- a/productMods/config/listViewConfig-dateTimeValue.xml +++ b/productMods/config/listViewConfig-dateTimeValue.xml @@ -4,17 +4,34 @@ - + 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#> - SELECT DISTINCT ?dateTime (afn:localname(?dateTimePrecision) AS ?precision) WHERE { - GRAPH ?g1 { ?subject ?property ?dateTimeValue } - GRAPH ?g2 { ?dateTimeValue core:dateTime ?dateTime ; - core:dateTimePrecision ?dateTimePrecision . } + SELECT DISTINCT ?dateTimeValue + (afn:localname(?dateTimePrecision) AS ?precision) + ?dateTime WHERE { + ?subject ?property ?dateTimeValue + OPTIONAL { ?dateTimeValue core:dateTime ?dateTime } + OPTIONAL { ?dateTimeValue core:dateTimePrecision ?dateTimePrecision } } - + + + + CONSTRUCT { + ?subject ?property ?dateTimeValue . + ?dateTimeValue ?p ?o . + } WHERE { + { + ?subject ?property ?dateTimeValue + } + UNION { + ?subject ?property ?dateTimeValue . + ?dateTimeValue ?p ?o . + } + } + - \ No newline at end of file + diff --git a/productMods/config/listViewConfig-educationalTraining.xml b/productMods/config/listViewConfig-educationalTraining.xml index e8806ae2..ee68d472 100644 --- a/productMods/config/listViewConfig-educationalTraining.xml +++ b/productMods/config/listViewConfig-educationalTraining.xml @@ -4,35 +4,187 @@ - + 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#> - SELECT DISTINCT ?edTraining (afn:localname(?edTraining) AS ?edTrainingName) ?org ?orgName - ?degreeName ?degreeAbbr ?majorField ?deptOrSchool ?info ?dateTimeStart ?dateTimeEnd + SELECT DISTINCT ?edTraining + ?org ?orgName + ?degreeName ?degreeAbbr + ?majorField ?deptOrSchool ?info + ?dateTimeStart ?dateTimeEnd WHERE { - GRAPH ?g1 { ?subject ?property ?edTraining } - OPTIONAL { GRAPH ?g2 { ?edTraining core:trainingAtOrganization ?org . - ?org rdfs:label ?orgName . } + ?subject ?property ?edTraining + OPTIONAL { ?edTraining core:trainingAtOrganization ?org . + ?org rdfs:label ?orgName } - OPTIONAL { GRAPH ?g3 { ?edTraining core:degreeEarned ?degree } - OPTIONAL { GRAPH ?g4 { ?degree rdfs:label ?degreeName } } - OPTIONAL { GRAPH ?g5 { ?degree core:abbreviation ?degreeAbbr } } + OPTIONAL { ?edTraining core:degreeEarned ?degree + OPTIONAL { ?degree rdfs:label ?degreeName } + OPTIONAL { ?degree core:abbreviation ?degreeAbbr } } - OPTIONAL { GRAPH ?g6 { ?edTraining core:majorField ?majorField } } - OPTIONAL { GRAPH ?g7 { ?edTraining core:departmentOrSchool ?deptOrSchool } } - OPTIONAL { GRAPH ?g8 { ?edTraining core:supplementalInformation ?info } } - OPTIONAL { GRAPH ?g9 { ?edTraining core:dateTimeInterval ?dateTimeInterval } - OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } + 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 { GRAPH ?g11 { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd } } } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) - + + + + 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/> + + SELECT DISTINCT ?subclass + ?edTraining + ?org ?orgName + ?degreeName ?degreeAbbr + ?majorField ?deptOrSchool ?info + ?dateTimeStart ?dateTimeEnd + WHERE { + ?subject ?property ?edTraining + OPTIONAL { ?edTraining core:trainingAtOrganization ?org . + ?org rdfs:label ?orgName + OPTIONAL { ?subclass rdfs:subClassOf foaf:Organization . + ?org a ?subclass + } + } + OPTIONAL { ?edTraining core:degreeEarned ?degree + OPTIONAL { ?degree rdfs:label ?degreeName } + OPTIONAL { ?degree core:abbreviation ?degreeAbbr } + } + 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 + } + } + } 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 foaf: <http://xmlns.com/foaf/0.1/> + + CONSTRUCT { + ?subclass rdfs:subClassOf foaf:Organization . + } WHERE { + ?subclass rdfs:subClassOf foaf:Organization . + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?subject ?property ?edTraining . + ?edTraining ?edTrainingProp ?edTrainingValue . + ?edTraining core:trainingAtOrganization ?org . + ?org rdfs:label ?orgName . + ?edTraining core:degreeEarned ?degree . + ?edTraining core:dateTimeInterval ?dateTimeInterval + } WHERE { + { + ?subject ?property ?edTraining . + } + UNION { + ?subject ?property ?edTraining . + ?edTraining ?edTrainingProp ?edTrainingValue + } + UNION { + ?subject ?property ?edTraining . + ?edTraining core:trainingAtOrganization ?org . + ?org rdfs:label ?orgName + } + UNION { + ?subject ?property ?edTraining . + ?edTraining core:degreeEarned ?degree . + } + UNION { + ?subject ?property ?edTraining . + ?edTraining core:dateTimeInterval ?dateTimeInterval + } + } + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + + CONSTRUCT { + ?org a ?subclass + } WHERE { + ?subject ?property ?edTraining . + ?edTraining core:trainingAtOrganization ?org . + ?org a ?subclass + } + + + + + 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 ?edTraining . + ?edTraining core:degreeEarned ?degree . + ?degree rdfs:label ?degreeName + } UNION { + ?subject ?property ?edTraining . + ?edTraining core:degreeEarned ?degree . + ?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 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 core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + diff --git a/productMods/config/listViewConfig-hasRole.xml b/productMods/config/listViewConfig-hasRole.xml index 7792cbe8..82b60c8c 100644 --- a/productMods/config/listViewConfig-hasRole.xml +++ b/productMods/config/listViewConfig-hasRole.xml @@ -1,31 +1,123 @@ - - - - - - - - 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#> - - SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName) - ?roleLabel ?activity ?activityName ?dateTimeStart ?dateTimeEnd WHERE { - GRAPH ?g1 { ?subject ?property ?role } - OPTIONAL { GRAPH ?g2 { ?role core:roleIn ?activity } - GRAPH ?g3 { ?activity rdfs:label ?activityName } - } - OPTIONAL { GRAPH ?g4 { ?role rdfs:label ?roleLabel } } - OPTIONAL { GRAPH ?g5 { ?role core:dateTimeInterval ?dateTimeInterval } - OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } - } - OPTIONAL { GRAPH ?g7 { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } - } - } - } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName - - - + + + + + + + + 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#> + + SELECT DISTINCT ?role + ?roleLabel + ?activity ?activityName + ?dateTimeStart ?dateTimeEnd WHERE { + ?subject ?property ?role + OPTIONAL { ?role core:roleIn ?activity . + ?activity rdfs:label ?activityName + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } + } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName + + + + 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#> + + SELECT DISTINCT ?subclass + ?role + ?roleLabel + ?activity ?activityName + ?dateTimeStart ?dateTimeEnd WHERE { + ?subject ?property ?role + OPTIONAL { ?role core:roleIn ?activity . + ?activity rdfs:label ?activityName + } + OPTIONAL { ?role a ?subclass . + ?subclass rdfs:subClassOf core:Role + } + OPTIONAL { ?role rdfs:label ?roleLabel } + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?personName + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subclass rdfs:subClassOf core:Role + } WHERE { + ?subclass rdfs:subClassOf core:Role + } + + + + 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 + } UNION { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue + } UNION { + ?subject ?property ?role . + ?role core:roleIn ?activity . + ?activity rdfs:label ?activityName + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + + \ No newline at end of file diff --git a/productMods/config/listViewConfig-informationResourceInAuthorship.xml b/productMods/config/listViewConfig-informationResourceInAuthorship.xml index 2e7b2e2b..4980c8b1 100644 --- a/productMods/config/listViewConfig-informationResourceInAuthorship.xml +++ b/productMods/config/listViewConfig-informationResourceInAuthorship.xml @@ -1,23 +1,80 @@ - - - - - - - - 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#> - - SELECT DISTINCT ?authorship (afn:localname(?authorship) AS ?authorshipName) - ?person ?personName WHERE { - GRAPH ?g1 { ?subject ?property ?authorship } - OPTIONAL { GRAPH ?g2 { ?authorship core:authorRank ?rank } } - OPTIONAL { GRAPH ?g3 { ?authorship core:linkedAuthor ?person } - GRAPH ?g4 { ?person rdfs:label ?personName } - } - } ORDER BY ?rank ?personName - - - - + + + + + + + + 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#> + + SELECT DISTINCT ?authorship + ?person ?personName WHERE { + ?subject ?property ?authorship + OPTIONAL { ?authorship core:authorRank ?rank } + OPTIONAL { ?authorship core:linkedAuthor ?person . + ?person rdfs:label ?personName + } + } ORDER BY ?rank ?personName + + + + 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/> + + SELECT DISTINCT ?subclass + ?authorship + ?person ?personName WHERE { + ?subject ?property ?authorship + OPTIONAL { ?authorship core:authorRank ?rank } + OPTIONAL { ?authorship core:linkedAuthor ?person . + ?person rdfs:label ?personName + OPTIONAL { ?person a ?subclass . + ?subclass rdfs:subClassOf foaf: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#> + CONSTRUCT { + ?subject ?property ?authorship . + ?authorship ?authorshipProperty ?authorshipValue . + ?person rdfs:label ?personName . + ?person a ?subclass + } WHERE { + { + ?subject ?property ?authorship + } UNION { + ?subject ?property ?authorship . + ?authorship ?authorshipProperty ?authorshipValue + } UNION { + ?subject ?property ?authorship . + ?authorship core:linkedAuthor ?person . + ?person rdfs:label ?personName + } UNION { + ?subject ?property ?authorship . + ?authorship core:linkedAuthor ?person . + ?person rdfs:label ?personName . + ?person a ?subclass + } + } + + + + diff --git a/productMods/config/listViewConfig-organizationForPosition.xml b/productMods/config/listViewConfig-organizationForPosition.xml index aeccd837..c7abc188 100644 --- a/productMods/config/listViewConfig-organizationForPosition.xml +++ b/productMods/config/listViewConfig-organizationForPosition.xml @@ -1,36 +1,128 @@ - - - - - - - - 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#> - - SELECT DISTINCT ?subclass ?position (afn:localname(?position) AS ?positionName) - ?positionTitle ?person ?personName ?dateTimeStart ?dateTimeEnd WHERE { - GRAPH ?g1 { ?subject ?property ?position } - OPTIONAL { GRAPH ?g2 { ?position core:positionForPerson ?person } - GRAPH ?g3 { ?person rdfs:label ?personName } - } - OPTIONAL { GRAPH ?g4 { ?position a ?subclass } - GRAPH ?g5 { ?subclass rdfs:subClassOf core:Position } - FILTER (?g5 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && - ?g5 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) - } - OPTIONAL { GRAPH ?g6 { ?position rdfs:label ?positionTitle } } - OPTIONAL { GRAPH ?g7 { ?position core:dateTimeInterval ?dateTimeInterval } - OPTIONAL { GRAPH ?g8 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } - } - OPTIONAL { GRAPH ?g9 { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } - } - } - } ORDER BY ?subclass ?personName - - - - \ No newline at end of file + + + + + + + + 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#> + + SELECT DISTINCT ?position + ?positionTitle + ?person ?personName + ?dateTimeStart ?dateTimeEnd WHERE { + ?subject ?property ?position + OPTIONAL { ?position core:positionForPerson ?person . + ?person rdfs:label ?personName + } + OPTIONAL { ?position rdfs:label ?positionTitle } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + + } + # Current positions only: end date is either null or not in the past + } FILTER ( !bound(?dateTimeEnd) || + afn:substring(str(?dateTimeEnd), 0, 4) >= afn:substring(str(afn:now()), 0, 4) ) + } ORDER BY ?personName + + + + 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#> + + SELECT DISTINCT ?subclass + ?position + ?positionTitle + ?person ?personName + ?dateTimeStart ?dateTimeEnd WHERE { + ?subject ?property ?position + OPTIONAL { ?position core:positionForPerson ?person . + ?person rdfs:label ?personName + } + OPTIONAL { ?position a ?subclass . + ?subclass rdfs:subClassOf core:Position + } + OPTIONAL { ?position rdfs:label ?positionTitle } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + # Current positions only: end date is either null or not in the past + } FILTER ( !bound(?dateTimeEnd) || + afn:substring(str(?dateTimeEnd), 0, 4) >= afn:substring(str(afn:now()), 0, 4) ) + } ORDER BY ?subclass ?personName + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subclass rdfs:subClassOf core:Position + } WHERE { + ?subclass rdfs:subClassOf core:Position + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?position . + ?position ?positionProperty ?positionValue . + ?person rdfs:label ?personName + } WHERE { + { + ?subject ?property ?position + } UNION { + ?subject ?property ?position . + ?position ?positionProperty ?positionValue + } UNION { + ?subject ?property ?position . + ?position core:positionForPerson ?person . + ?person rdfs:label ?personName + } + } + + + + 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 + } + + + + diff --git a/productMods/config/listViewConfig-personInPosition.xml b/productMods/config/listViewConfig-personInPosition.xml index e07bd05d..6db9b722 100644 --- a/productMods/config/listViewConfig-personInPosition.xml +++ b/productMods/config/listViewConfig-personInPosition.xml @@ -1,31 +1,127 @@ - - - - - - - - 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#> - - SELECT DISTINCT ?position (afn:localname(?position) AS ?positionName) - ?positionTitle ?org ?orgName ?dateTimeStart ?dateTimeEnd WHERE { - GRAPH ?g1 { ?subject ?property ?position } - OPTIONAL { GRAPH ?g2 { ?position core:positionInOrganization ?org } - GRAPH ?g3 { ?org rdfs:label ?orgName } - } - OPTIONAL { GRAPH ?g4 { ?position rdfs:label ?positionTitle } } - OPTIONAL { GRAPH ?g5 { ?position core:dateTimeInterval ?dateTimeInterval } - OPTIONAL { GRAPH ?g6 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } - } - OPTIONAL { GRAPH ?g7 { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } - } - } - } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName - - - + + + + + + + + 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#> + + SELECT DISTINCT ?position + ?positionTitle + ?hrJobTitle + ?org ?orgName + ?dateTimeStart ?dateTimeEnd WHERE { + ?subject ?property ?position + OPTIONAL { ?position core:positionInOrganization ?org . + ?org rdfs:label ?orgName + } + OPTIONAL { ?position rdfs:label ?positionTitle } + OPTIONAL { ?position core:hrJobTitle ?hrJobTitle } + OPTIONAL { ?position core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + } + } ORDER BY DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName + + + + 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#> + + SELECT DISTINCT ?subclass + ?position + ?positionTitle + ?hrJobTitle + ?org ?orgName + ?dateTimeStart ?dateTimeEnd WHERE { + ?subject ?property ?position + OPTIONAL { ?position core:positionInOrganization ?org . + ?org rdfs:label ?orgName + } + OPTIONAL { ?position rdfs:label ?positionTitle } + OPTIONAL { ?position core:hrJobTitle ?hrJobTitle } + 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 a ?subclass . + ?subclass rdfs:subClassOf core:Position + } + } ORDER BY ?subclass DESC(?dateTimeEnd) DESC(?dateTimeStart) ?orgName + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subclass rdfs:subClassOf core:Position + } WHERE { + ?subclass rdfs:subClassOf core:Position + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + CONSTRUCT { + ?subject ?property ?position . + ?position ?positionProperty ?positionValue . + ?org rdfs:label ?orgName + } WHERE { + { + ?subject ?property ?position + } UNION { + ?subject ?property ?position . + ?position ?positionProperty ?positionValue + } UNION { + ?subject ?property ?position . + ?position core:positionInOrganization ?org . + ?org rdfs:label ?orgName + } + } + + + + 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 + } + + + \ No newline at end of file diff --git a/productMods/config/listViewConfig-relatedRole.xml b/productMods/config/listViewConfig-relatedRole.xml index 73dd16e9..a4085f00 100644 --- a/productMods/config/listViewConfig-relatedRole.xml +++ b/productMods/config/listViewConfig-relatedRole.xml @@ -4,34 +4,153 @@ - + 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#> - SELECT DISTINCT ?role (afn:localname(?role) AS ?roleName) - ?roleLabel ?roleTypeLabel ?indivInRole ?indivName ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { - GRAPH ?g1 { ?subject ?property ?role } - OPTIONAL { GRAPH ?g2 { ?roleProp rdfs:subPropertyOf core:roleOf } - GRAPH ?g3 { ?role ?roleProp ?indivInRole } - FILTER (?g3 != <http://vitro.mannlib.cornell.edu/default/inferred-tbox> && - ?g3 != <http://vitro.mannlib.cornell.edu/default/vitro-kb-inf> ) - GRAPH ?g4 { ?indivInRole rdfs:label ?indivName } + SELECT DISTINCT ?role + ?roleLabel ?roleTypeLabel + ?indivInRole (afn:localname(?indivInRole) AS ?indivName) + ?indivLabel + ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { + + ?subject ?property ?role + + OPTIONAL { ?role rdfs:label ?roleLabel } + + # We need ?subclass in query-base to get the roleTypeLabel for roles that + # have no label (e.g., InvestigatorRole and its subclasses) + OPTIONAL { ?role a ?subclass . + ?subclass rdfs:subClassOf core:Role + OPTIONAL { ?subclass rdfs:label ?roleTypeLabel } + ?roleProp rdfs:subPropertyOf core:roleOf ; + rdfs:domain ?subclass . + ?role ?roleProp ?indivInRole + OPTIONAL { ?indivInRole rdfs:label ?indivLabel } } - OPTIONAL { GRAPH ?g7 { ?role rdfs:label ?roleLabel } } - OPTIONAL { GRAPH ?g8 { ?role a ?roleType } - GRAPH ?g9 { ?roleType rdfs:label ?roleTypeLabel } - } - OPTIONAL { GRAPH ?g9 { ?role core:dateTimeInterval ?dateTimeInterval } - OPTIONAL { GRAPH ?g10 { ?dateTimeInterval core:start ?dateTimeStartValue . - ?dateTimeStartValue core:dateTime ?dateTimeStart } - } - OPTIONAL { GRAPH ?g11 { ?dateTimeInterval core:end ?dateTimeEndValue . - ?dateTimeEndValue core:dateTime ?dateTimeEnd } + + OPTIONAL { ?role core:dateTimeInterval ?dateTimeInterval + OPTIONAL { ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart } + OPTIONAL { ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } } - } ORDER BY ?indivName ?roleLabel ?roleTypeLabel - + + } ORDER BY ?indivName ?indivLabel ?roleLabel ?roleTypeLabel + + + + 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#> + + SELECT DISTINCT ?subclass + ?role + ?roleLabel ?roleTypeLabel + ?indivInRole (afn:localname(?indivInRole) AS ?indivName) + ?indivLabel + ?dateTimeInterval ?dateTimeStart ?dateTimeEnd WHERE { + + ?subject ?property ?role + + OPTIONAL { ?role rdfs:label ?roleLabel } + + OPTIONAL { ?role a ?subclass . + ?subclass rdfs:subClassOf core:Role + OPTIONAL { ?subclass rdfs:label ?roleTypeLabel } + ?roleProp rdfs:subPropertyOf core:roleOf ; + rdfs:domain ?subclass . + ?role ?roleProp ?indivInRole + OPTIONAL { ?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 + } + } + + } ORDER BY ?subclass ?indivName ?indivLabel ?roleLabel ?roleTypeLabel + + + + PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subclass rdfs:subClassOf core:Role . + ?roleProp rdfs:subPropertyOf core:roleOf . + ?roleProp rdfs:domain ?subclass + } WHERE { + ?subclass rdfs:subClassOf core:Role . + ?roleProp rdfs:subPropertyOf core:roleOf ; + rdfs:domain ?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 . + ?subclass rdfs:label ?roleTypeLabel . + ?indivInRole rdfs:label ?indivLabel + } WHERE { + { + ?subject ?property ?role + } UNION { + ?subject ?property ?role . + ?role ?roleProperty ?roleValue . + } UNION { + ?subject ?property ?role . + ?role a ?subclass . + } UNION { + ?subject ?property ?role . + ?role a ?subclass . + ?subclass rdfs:label ?roleTypeLabel + } UNION { + ?subject ?property ?role . + ?role ?roleProp ?indivInRole . + ?indivInRole rdfs:label ?indivLabel + } + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:start ?dateTimeStartValue . + ?dateTimeStartValue core:dateTime ?dateTimeStart + } + + + + PREFIX core: <http://vivoweb.org/ontology/core#> + CONSTRUCT { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } WHERE { + ?subject ?property ?role . + ?role core:dateTimeInterval ?dateTimeInterval . + ?dateTimeInterval core:end ?dateTimeEndValue . + ?dateTimeEndValue core:dateTime ?dateTimeEnd + } + + - \ No newline at end of file + diff --git a/productMods/css/individual/individual-vivo.css b/productMods/css/individual/individual-vivo.css new file mode 100644 index 00000000..56e2771e --- /dev/null +++ b/productMods/css/individual/individual-vivo.css @@ -0,0 +1,58 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +/* <------ INDIVIDUAL CORE:OVERVIEW */ +#overview { + clear: left; +} +.overview-value { + display: inline; +} +div.overview-value :last-child { + margin-bottom: .2em; +} +.individual-overview { + font-size: 1em; + padding-bottom: 0; + line-height: 1.3em; + padding-right: 10px; + padding-top: 10px; + width: 100%; +} +/* <------ INDIVIDUAL TEMPORAL GRAPH */ +#temporal-graph { + float: right; + padding: 0 3px 20px 0; + background-color: #fff; +} +#temporal-graph h3 { + margin: 0; + padding: 0; +} +#temporal-graph h3 img { + padding-right: 10px; + vertical-align: text-top; +} +/* <------ POSITIONS */ +ul#individual-personInPosition { + list-style-type: circle; + padding-left: 20px; +} +ul#individual-personInPosition li { + line-height: 1em; +} +ul#individual-personInPosition li:last-child { + padding-bottom: 15px; +} +/* <------ RESEARCH AREA */ +ul#individual-hasResearchArea { + padding-bottom: 24px; +} +ul#individual-hasResearchArea li { + float: left; + padding-right: 10px; + padding-left: 10px; + border-right: 1px solid #5e6363; +} +ul#individual-hasResearchArea li:first-child { + padding-left: 0; +} \ No newline at end of file diff --git a/productMods/css/jquery_plugins/ui.notify.css b/productMods/css/jquery_plugins/ui.notify.css index d268344d..f23f10a6 100644 --- a/productMods/css/jquery_plugins/ui.notify.css +++ b/productMods/css/jquery_plugins/ui.notify.css @@ -1,17 +1,76 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -.ui-notify { width:350px; position:fixed; top:10px; right:10px; } -.ui-notify-message { padding:10px; margin-bottom:15px; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px } -.ui-notify-message h1 { font-size:14px; margin:0; padding:0 } -.ui-notify-message p { margin:3px 0; padding:0; line-height:18px } -.ui-notify-message:last-child { margin-bottom:0 } -.ui-notify-message-style { background:#000; background:rgba(0,0,0,0.8); -moz-box-shadow: 0 0 6px #000; -webkit-box-shadow: 0 0 6px #000; box-shadow: 0 0 6px #000; } -.ui-notify-message-style h1 { color:#fff; font-weight:bold } -.ui-notify-message-style p { color:#fff } -.ui-notify-close { color:#fff; text-decoration:underline } -.ui-notify-click { cursor:pointer } -.ui-notify-cross { margin-top:-4px; float:right; cursor:pointer; text-decoration:none; font-size:12px; font-weight:bold; text-shadow:0 1px 1px #fff; padding:2px } -.ui-notify-cross:hover { color:#ffffab } -.ui-notify-cross:active { position:relative; top:1px } -.ui-state-error h1 { font-size:14px; margin:0; padding:0; color: #CD0A0A; font-weight: bold; } -.ui-state-error p { color: #CD0A0A; } \ No newline at end of file +.ui-notify { + width: 350px; + position: fixed; + top: 10px; + right: 10px; +} +.ui-notify-message { + padding: 10px; + margin-bottom: 15px; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; +} +.ui-notify-message h1 { + font-size: 14px; + margin: 0; + padding: 0; +} +.ui-notify-message p { + margin: 3px 0; + padding: 0; + line-height: 18px +} +.ui-notify-message:last-child { + margin-bottom: 0; +} +.ui-notify-message-style { + background: #000; + background: rgba(0,0,0,0.8); + -moz-box-shadow: 0 0 6px #000; + -webkit-box-shadow: 0 0 6px #000; + box-shadow: 0 0 6px #000; +} +.ui-notify-message-style h1 { + color: #fff; + font-weight: bold; +} +.ui-notify-message-style p { + color: #fff; +} +.ui-notify-close { + color: #fff; + text-decoration: underline +} +.ui-notify-click { + cursor: pointer; +} +.ui-notify-cross { + margin-top: -4px; + float: right; + cursor: pointer; + text-decoration: none; + font-size: 12px; + font-weight: bold; + text-shadow: 0 1px 1px #fff; + padding: 2px; +} +.ui-notify-cross:hover { + color: #ffffab; +} +.ui-notify-cross:active { + position:relative; + top: 1px; +} +.ui-state-error h1 { + font-size: 14px; + margin: 0; + padding: 0; + color: #cd0a0a; + font-weight: bold; +} +.ui-state-error p { + color: #cd0a0a; +} \ No newline at end of file diff --git a/productMods/css/visualization/coauthorship/style.css b/productMods/css/visualization/coauthorship/style.css index edfba4a9..b73bd521 100644 --- a/productMods/css/visualization/coauthorship/style.css +++ b/productMods/css/visualization/coauthorship/style.css @@ -1,318 +1,647 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ /* CSS Document */ -body{ - background:url(../../../site_icons/visualization/coauthorship/bg.gif) repeat-x 0 0 #FDF9EE; color:#4E4628; - font:normal 14px/19px Arial, Helvetica, sans-serif; - margin:0; padding:0;} -div, h1, h2, h3, h4, h5, h6, form, label, input, span, ul, li, p, a{ - margin:0; padding:0;} -ul{ - list-style:none;} -.spacer{ - font-size:0; line-height:0; clear:both;} - - -/* ----------------- top navigation start --------------------- */ -#topNav{ - width:1000px; position:relative; - margin:0 auto; padding:8px 0 0 50px;} -#topNav h1{ -color:#786E4E; - - font:normal 28px/42px Georgia, "Times New Roman", Times, serif;} -#topNav h1 span{ -color:#0B0B0B; - font:normal 28px/42px Georgia, "Times New Roman", Times, serif;} -#topNav img{ - } -#topNav ul{ - background:url(../../../site_icons/visualization/coauthorship/top_ul_bg.gif) no-repeat 0 8px; - width:503px; height:23px; padding:8px 0 0 8px; margin:0 0 0 217px;} -#topNav ul li{ - background-color:#E1DBC7; color:#0B0B0B; float:left; - font:bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; text-transform:uppercase;} -#topNav ul li a{ - background-color:#E1DBC7; color:#0B0B0B; - font:bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; - text-transform:uppercase; text-align:center; text-decoration:none; - width:65px; height:23px; display:block;} -#topNav ul li a.hover{ - background:url(../../../site_icons/visualization/coauthorship/top_btn_h.gif) no-repeat 0 0 #E1DBC7; color:#FFFFFF; - font:bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; - text-transform:uppercase; text-align:center; text-decoration:none; - width:65px; height:23px; display:block;} -#topNav ul li a:hover{ - background:url(../../../site_icons/visualization/coauthorship/top_btn_h.gif) no-repeat 0 0 #E1DBC7; color:#FFFFFF; - font:bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; - text-transform:uppercase; text-align:center; text-decoration:none; - width:65px; height:23px; display:block;} - -/* ----------------- top navigation end --------------------- */ -/* ----------------- shadow start --------------------------- */ -#topShadow{ - background:url(../../../site_icons/visualization/coauthorship/top_shadow.gif) no-repeat 0 0 #FDF9EE; - color:#4E4628; - width:822px; - height:34px; - float:left; - margin-top: 9px; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; +body { + background: url(../../../site_icons/visualization/coauthorship/bg.gif) repeat-x 0 0 #FDF9EE; + color: #4E4628; + font: normal 14px/19px Arial, Helvetica, sans-serif; + margin: 0; + padding: 0; } -#bottomShadow{ - background:url(../../../site_icons/visualization/coauthorship/bottom_shadow.gif) no-repeat 0 0 #FDF9EE; color:#4E4628; - width:1000px; height:24px; float:left;} -/* ----------------- shadow end --------------------------- */ -/* ----------------- body start --------------------------- */ -#body{ - width:1000px; margin:0 auto; position:relative;} -#bodyPannel{ - background:url(../../../site_icons/visualization/coauthorship/midle_bg.gif) repeat-y 0 0 #FDF9EE; - color:#4E4628; - width:765px; - float:left; - padding-top: 0; - padding-right: 28px; - padding-bottom: 0; - padding-left: 28px; +div, +h1, +h2, +h3, +h4, +h5, +h6, +form, +label, +input, +span, +ul, +li, +p, +a { + margin: 0; + padding: 0; } -#bodyPannel form.search{ - background-color:#FFFFFF; color:#000000; border:#ECE8DB 1px solid; - width:248px; padding:7px 17px 27px 17px; float:left;} -#bodyPannel form.search h2{ - background:url(../../../site_icons/visualization/coauthorship/search_h2_bg.gif) no-repeat 0 0 #FFFFFF; color:#786E4E; - width:197px; padding:0 0 10px 50px; float:left; - font:normal 24px/42px Georgia, "Times New Roman", Times, serif;} -#bodyPannel form.search h2 span{ - background-color:#FFFFFF; color:#0B0B0B; - font:normal 24px/42px Georgia, "Times New Roman", Times, serif;} -#bodyPannel form.search label{ - background-color:#FFFFFF; color:#0B0B0B; margin:0 0 8px 0; float:left; - font:bold 10px/28px Arial, Helvetica, sans-serif; text-transform:uppercase;} -#bodyPannel form.search input{ - background-color:#EFEBDE; color:#0B0B0B; border:#C3BCA4 1px solid; - width:158px; height:22px; padding:2px; margin:0 0 8px 0; float:right; - font:normal 14px/20px Arial, Helvetica, sans-serif;} -#bodyPannel form.search p{ - background-color:#FFFFFF; color:#CC0000; float:left; margin:6px 0 0 0; - font:normal 13px/15px Arial, Helvetica, sans-serif;} -#bodyPannel form.search input.check{ - background-color:#EFEBDE; color:#0B0B0B; border:#C3BCA4 1px solid; - width:15px; height:15px; float:left; margin:6px 0 0 9px;} -#bodyPannel form.search input.submit{ - background:url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 37px 0 #FFFFFF; color:#0B0B0B; border:none; - width:53px; height:13px; float:right; margin:7px 0 0 0; padding:0 23px 0 0; cursor:pointer; - font:normal 10px/13px Arial, Helvetica, sans-serif; text-transform:uppercase;} -#eventLink{ - width:345px; padding:0 0 0 70px; float:left;} -#eventLink h2{ - background:url(../../../site_icons/visualization/coauthorship/event_link_bg.gif) no-repeat 0 7px #FFFFFF; color:#786E4E; - padding:6px 0 10px 48px; - font:normal 28px/42px Georgia, "Times New Roman", Times, serif;} -#eventLink h2 span{ - background-color:#FFFFFF; color:#0B0B0B; - font:normal 28px/42px Georgia, "Times New Roman", Times, serif;} -#eventLink ul{ - float:left; padding:0 0 0 5px;} -#eventLink ul li{ - font:normal 13px/19px Arial, Helvetica, sans-serif; - background:url(../../../site_icons/visualization/coauthorship/red_arrow.gif) no-repeat 0 7px #FFFFFF; color:#4E4628; - padding:0 0 0 6px;} -#eventLink ul li a{ - font:normal 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; - background-color:#FFFFFF; color:#4E4628; - padding:0 4px; display:block;} -#eventLink ul li a:hover{ - font:normal 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; - background-color:#F4EFDF; color:#4E4628; - padding:0 4px; display:block;} -#eventLink a.more{ - background:url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; color:#0B0B0B; float:right; - font:bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform:uppercase; - padding:0 20px 0 0; margin:5px 10px 0 0;} -#eventLink a.more:hover{ - background:url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; color:#0B0B0B; float:right; - font:bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform:uppercase; - padding:0 20px 0 0; margin:5px 10px 0 0;} -#midle{ - background:url(../../../site_icons/visualization/coauthorship/picture.gif) no-repeat 0 0 #FFFFFF; color:#4E4628; - padding:270px 0 0 0;} -#midle h2{ - background-color:#FFFFFF; color:#0B0B0B; - font:normal 28px/46px Georgia, "Times New Roman", Times, serif;} -#midle h2 span{ - background-color:#FFFFFF; color:#A60101; - font:normal 28px/46px Georgia, "Times New Roman", Times, serif;} -#midle p{ - font:normal 14px/19px Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#4E4628;} -#midle a.more{ - background:url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; color:#0B0B0B; float:right; - font:bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform:uppercase; - padding:0 20px 0 0; margin:5px 35px 0 0;} -#midle a.more:hover{ - background:url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; color:#0B0B0B; float:right; - font:bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform:uppercase; - padding:0 20px 0 0; margin:5px 35px 0 0;} -#colorBg{ - background-color:#FCFAF3; float:left; color:#0B0B0B; - margin:18px 0 0 0; padding:18px 40px 18px 38px; width:642px;} -#futurePlans{ - width:298px; float:left;} -#futurePlans h2.text1{ - background-color:#FCFAF3; color:#0B0B0B; - font:normal 28px/40px Georgia, "Times New Roman", Times, serif;} -#futurePlans h2.text1 span{ - background-color:#FCFAF3; color:#A60101; - font:normal 28px/40px Georgia, "Times New Roman", Times, serif;} -#futurePlans ul{ float:left;} -#futurePlans ul li{ - font:normal 13px/19px Arial, Helvetica, sans-serif; color:#4E4628; - background:url(../../../site_icons/visualization/coauthorship/red_bullet.gif) no-repeat 0 6px #FCFAF3; padding:0 0 0 10px;} -#futurePlans ul li a{ - font:bold 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; - background-color:#FCFAF3; color:#4E4628; display:block;} -#futurePlans ul li a:hover{ - font:bold 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; - background-color:#EAE6D9; color:#4E4628; display:block;} -#futurePlans p{ - background:url(../../../site_icons/visualization/coauthorship/boeder.gif) repeat-x 0 14px #FCFAF3; color:#0B0B0B; - height:13px; line-height:13px; padding:14px 0 19px 0;} -#futurePlans p a.more{ - background:url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 76px 0 #FCFAF3; color:#0B0B0B; float:right; - font:bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform:uppercase; - padding:0 20px 0 10px; margin:0;} -#futurePlans p a.more:hover{ - background:url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 76px 0 #FCFAF3; color:#0B0B0B; float:right; - font:bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; text-transform:uppercase; - padding:0 20px 0 10px; margin:0;} -#newsLetter{ - margin:0 auto;} -#newsLetter span.nltop{ - background:url(../../../site_icons/visualization/coauthorship/newsletter_top.gif) no-repeat 0 0 #FFFFFF; color:#000000; - line-height:0; font-size:0; height:15px; display:block;} -#newsLetter span.nlbottom{ - background:url(../../../site_icons/visualization/coauthorship/newsletter_bottom.gif) no-repeat 0 0 #FFFFFF; color:#000000; - line-height:0; font-size:0; height:14px; display:block;} -#newsLetter .middle{ - background:url(../../../site_icons/visualization/coauthorship/newsletter_midle.gif) repeat-y 0 0 #FFFFFF; - color:#000000; - width:140px; - padding-left:5px; - padding-right:5px; +ul { + list-style: none; +} +.spacer { + font-size:0 ; + line-height: 0; + clear: both; +} +/* top navigation */ +#topNav { + width: 1000px; + position: relative; + margin: 0 auto; + padding: 8px 0 0 50px; +} +#topNav h1 { + color: #786E4E; + font: normal 28px/42px Georgia, "Times New Roman", Times, serif; +} +#topNav h1 span { + color: #0B0B0B; + font:normal 28px/42px Georgia, "Times New Roman", Times, serif; +} +#topNav ul { + background: url(../../../site_icons/visualization/coauthorship/top_ul_bg.gif) no-repeat 0 8px; + width: 503px; + height: 23px; + padding: 8px 0 0 8px; + margin: 0 0 0 217px; +} +#topNav ul li { + background-color: #E1DBC7; + color: #0B0B0B; float:left; + font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +#topNav ul li a { + background-color: #E1DBC7; + color: #0B0B0B; + font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; + text-transform: uppercase; + text-align: center; + text-decoration: none; + width: 65px; + height :23px; + display: block; +} +#topNav ul li a.hover { + background: url(../../../site_icons/visualization/coauthorship/top_btn_h.gif) no-repeat 0 0 #E1DBC7; + color: #FFFFFF; + font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; + text-transform: uppercase; + text-align: center; + text-decoration: none; + width: 65px; + height: 23px; + display: block; +} +#topNav ul li a:hover { + background: url(../../../site_icons/visualization/coauthorship/top_btn_h.gif) no-repeat 0 0 #E1DBC7; + color: #FFFFFF; + font: bold 11px/23px "Trebuchet MS", Arial, Helvetica, sans-serif; + text-transform: uppercase; + text-align: center; + text-decoration: none; + width: 65px; + height: 23px; + display: block; +} +/* shadow */ +#topShadow { + background: url(../../../site_icons/visualization/coauthorship/top_shadow.gif) no-repeat 0 0 #FDF9EE; + color: #4E4628; + width: 822px; + height: 34px; + float: left; + margin-top: 9px; + margin-right: 0; + margin-bottom: 0; + margin-left: 0; +} +#bottomShadow { + background: url(../../../site_icons/visualization/coauthorship/bottom_shadow.gif) no-repeat 0 0 #FDF9EE; + color: #4E4628; + width: 1000px; + height: 24px; + float: left; +} +/* body start */ +#body { + width: 1000px; + margin: 0 auto; + position: relative; +} +#bodyPannel { + background: url(../../../site_icons/visualization/coauthorship/midle_bg.gif) repeat-y 0 0 #FDF9EE; + color: #4E4628; + width: 765px; + float: left; + padding-top: 0; + padding-right: 28px; + padding-bottom: 0; + padding-left: 28px; +} +#bodyPannel form.search { + background-color: #FFFFFF; + color: #000000; + border: #ECE8DB 1px solid; + width: 248px; + padding: 7px 17px 27px 17px; + float: left; +} +#bodyPannel form.search h2 { + background: url(../../../site_icons/visualization/coauthorship/search_h2_bg.gif) no-repeat 0 0 #FFFFFF; + color: #786E4E; + width: 197px; padding:0 0 10px 50px; + float: left; + font: normal 24px/42px Georgia, "Times New Roman", Times, serif; +} +#bodyPannel form.search h2 span { + background-color: #FFFFFF; + color: #0B0B0B; + font: normal 24px/42px Georgia, "Times New Roman", Times, serif; +} +#bodyPannel form.search label { + background-color: #FFFFFF; + color: #0B0B0B; + margin: 0 0 8px 0; + float: left; + font: bold 10px/28px Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +#bodyPannel form.search input { + background-color: #EFEBDE; + color: #0B0B0B; + border: #C3BCA4 1px solid; + width: 158px; + height: 22px; + padding: 2px; + margin: 0 0 8px 0; float: right; + font: normal 14px/20px Arial, Helvetica, sans-serif; +} +#bodyPannel form.search p { + background-color: #FFFFFF; + color: #CC0000; float:left; + margin: 6px 0 0 0; + font: normal 13px/15px Arial, Helvetica, sans-serif; +} +#bodyPannel form.search input.check { + background-color: #EFEBDE; + color: #0B0B0B; + border: #C3BCA4 1px solid; + width: 15px; + height: 15px; + float: left; + margin: 6px 0 0 9px; +} +#bodyPannel form.search input.submit { + background:url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 37px 0 #FFFFFF; + color: #0B0B0B; + border: none; + width: 53px; height:13px; + float:right; margin:7px 0 0 0; + padding: 0 23px 0 0; + cursor: pointer; + font:normal 10px/13px Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +#eventLink { + width: 345px; + padding: 0 0 0 70px; + float: left; +} +#eventLink h2 { + background: url(../../../site_icons/visualization/coauthorship/event_link_bg.gif) no-repeat 0 7px #FFFFFF; + color: #786E4E; + padding: 6px 0 10px 48px; + font: normal 28px/42px Georgia, "Times New Roman", Times, serif; +} +#eventLink h2 span { + background-color: #FFFFFF; + color: #0B0B0B; + font: normal 28px/42px Georgia, "Times New Roman", Times, serif; +} +#eventLink ul { + float: left; + padding: 0 0 0 5px; +} +#eventLink ul li { + font: normal 13px/19px Arial, Helvetica, sans-serif; + background: url(../../../site_icons/visualization/coauthorship/red_arrow.gif) no-repeat 0 7px #FFFFFF; + color: #4E4628; + padding: 0 0 0 6px; +} +#eventLink ul li a { + font: normal 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; + background-color: #FFFFFF; + color: #4E4628; + padding: 0 4px; + display: block; +} +#eventLink ul li a:hover { + font: normal 13px/19px Arial, Helvetica, sans-serif; + text-decoration: none; + background-color: #F4EFDF; + color: #4E4628; + padding: 0 4px; + display: block; +} +#eventLink a.more { + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; + float: right; + font: bold 10px/13px Arial, Helvetica, sans-serif; text-decoration: none; + text-transform: uppercase; + padding: 0 20px 0 0; + margin: 5px 10px 0 0; +} +#eventLink a.more:hover { + background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; + float: right; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; + text-transform: uppercase; + padding: 0 20px 0 0; + margin:5px 10px 0 0; +} +#midle { + background: url(../../../site_icons/visualization/coauthorship/picture.gif) no-repeat 0 0 #FFFFFF; + color: #4E4628; + padding: 270px 0 0 0; +} +#midle h2 { + background-color: #FFFFFF; + color: #0B0B0B; + font: normal 28px/46px Georgia, "Times New Roman", Times, serif; +} +#midle h2 span { + background-color: #FFFFFF; + color: #A60101; + font: normal 28px/46px Georgia, "Times New Roman", Times, serif; +} +#midle p { + font: normal 14px/19px Arial, Helvetica, sans-serif; + background-color: #FFFFFF; + color: #4E4628; +} +#midle a.more { + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; + float:right; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; + text-transform: uppercase; + padding: 0 20px 0 0; + margin: 5px 35px 0 0; +} +#midle a.more: hover { + background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 66px 0 #FFFFFF; + color: #0B0B0B; float:right; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; + text-transform: uppercase; + padding: 0 20px 0 0; + margin: 5px 35px 0 0; +} +#colorBg { + background-color: #FCFAF3; + float: left; + color: #0B0B0B; + margin: 18px 0 0 0; + padding: 18px 40px 18px 38px; + width: 642px; +} +#futurePlans { + width: 298px; + float: left; +} +#futurePlans h2.text1 { + background-color: #FCFAF3; + color: #0B0B0B; + font: normal 28px/40px Georgia, "Times New Roman", Times, serif; +} +#futurePlans h2.text1 span { + background-color: #FCFAF3; + color: #A60101; + font: normal 28px/40px Georgia, "Times New Roman", Times, serif; +} +#futurePlans ul { + float: left; +} +#futurePlans ul li { + font: normal 13px/19px Arial, Helvetica, sans-serif; + color: #4E4628; + background: url(../../../site_icons/visualization/coauthorship/red_bullet.gif) no-repeat 0 6px #FCFAF3; + padding: 0 0 0 10px; +} +#futurePlans ul li a { + font: bold 13px/19px Arial, Helvetica, sans-serif; text-decoration:none; + background-color: #FCFAF3; + color: #4E4628; + display: block; +} +#futurePlans ul li a:hover { + font: bold 13px/19px Arial, Helvetica, sans-serif; + text-decoration: none; + background-color: #EAE6D9; + color: #4E4628; + display: block; +} +#futurePlans p { + background: url(../../../site_icons/visualization/coauthorship/boeder.gif) repeat-x 0 14px #FCFAF3; + color: #0B0B0B; + height: 13px; + line-height: 13px; + padding: 14px 0 19px 0; +} +#futurePlans p a.more { + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 76px 0 #FCFAF3; + color: #0B0B0B; + float: right; + font: bold 10px/13px Arial, Helvetica, sans-serif; + text-decoration: none; + text-transform: uppercase; + padding: 0 20px 0 10px; + margin: 0; +} +#futurePlans p a.more:hover { + background: url(../../../site_icons/visualization/coauthorship/more_bg_h.gif) no-repeat 76px 0 #FCFAF3; + color: #0B0B0B; + float: right; + font: bold 10px/13px Arial, Helvetica, sans-serif; text-decoration:none; + text-transform: uppercase; + padding: 0 20px 0 10px; + margin: 0; +} +#newsLetter { + margin: 0 auto; +} +#newsLetter span.nltop { + background: url(../../../site_icons/visualization/coauthorship/newsletter_top.gif) no-repeat 0 0 #FFFFFF; + color: #000000; + line-height: 0; + font-size: 0; + height: 15px; + display: block; +} +#newsLetter span.nlbottom { + background: url(../../../site_icons/visualization/coauthorship/newsletter_bottom.gif) no-repeat 0 0 #FFFFFF; + color: #000000; + line-height: 0; + font-size: 0; + height: 14px; + display: block; +} +#newsLetter .middle { + background: url(../../../site_icons/visualization/coauthorship/newsletter_midle.gif) repeat-y 0 0 #FFFFFF; + color: #000000; + width: 140px; + padding-left: 5px; + padding-right: 5px; +} +#newsLetter form.newsLetter h2.text2 { + background:u rl(../../../site_icons/visualization/coauthorship/newsletter_h2_bg.gif) no-repeat 0 0; + color: #786E4E; + padding: 0 0 10px 65px; + float: left; + width: 228px; + height: 37px; + font: normal 24px/30px Georgia, "Times New Roman", Times, serif; +} +#newsLetter form.newsLetter h2.text2 span { + background-color: #FFFFFF; + color: #0B0B0B; + font: normal 24px/30px Georgia, "Times New Roman", Times, serif; +} +#newsLetter form.newsLetter label { + background-color: #FFFFFF; + color: #0B0B0B; + margin: 0 0 8px 0; + float: left; + font: bold 10px/28px Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +#newsLetter form.newsLetter input { + background-color: #EFEBDE; + color: #0B0B0B; + border: #C3BCA4 1px solid; + width: 168px; + height: 22px; + padding: 2px; + margin: 0 0 8px 15px; + float: left; + font: normal 14px/20px Arial, Helvetica, sans-serif; +} +#newsLetter form.newsLetter input.submit { + background: url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; + color: #0B0B0B; + border: none; + width: 60px; + height: 13px; + float: right; + margin: 7px 34px 0 0; + padding: 0 30px 0 0; + cursor: pointer; + font: normal 10px/13px Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +#contact { + width: 312px; + float: right; +} +#contact span.ctop { + background: url(../../../site_icons/visualization/coauthorship/contact_top.gif) no-repeat 0 0 #FCFAF3; + color: #000000; + line-height: 0; + font-size: 0; + height: 14px; + display: block; +} +#contact span.cbottom { + background: url(../../../site_icons/visualization/coauthorship/contact_bottom.gif) no-repeat 0 0 #FCFAF3; + color: #000000; + line-height: 0; + font-size: 0; + height: 25px; + display: block; +} +#contact form.contact { + background: url(../../../site_icons/visualization/coauthorship/contact_midle.gif) repeat-y 0 0 #FCFAF3; + color: #000; + width: 272px; + padding: 0 20px; + float: left; +} +#contact form.contact h2.text3 { + background: url(../../../site_icons/visualization/coauthorship/contact_h2_bg.gif) no-repeat 0 0 #FFFFFF; + color: #0B0B0B; + padding: 0 0 10px 55px; + float: left; width:228px; + height: 37px; + font: normal 24px/30px Georgia, "Times New Roman", Times, serif; +} +#contact form.contact h2.text3 span { + background-color: #FFFFFF; + color: #A60101; + font: normal 24px/30px Georgia, "Times New Roman", Times, serif; +} +#contact form.contact label { + background-color: #FFFFFF; + color: #0B0B0B; + margin: 0 0 8px 0; + float: left; + font: bold 10px/28px Arial, Helvetica, sans-serif; text-transform:uppercase; +} +#contact form.contact input { + background-color: #EFEBDE; + color: #0B0B0B; + border: #C3BCA4 1px solid; + width: 168px; + height: 22px; + padding: 2px; + margin: 0 0 8px 15px; + float: right; + font: normal 14px/20px Arial, Helvetica, sans-serif; +} +#contact form.contact textarea { + background-color: #EFEBDE; + color: #0B0B0B; + border: #C3BCA4 1px solid; + width: 168px; + height: 66px; + padding: 2px; + margin: 0 0 13px 15px; + float: right; + font: normal 14px/20px Arial, Helvetica, sans-serif; +} +#contact form.contact input.submit { + background: url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; + color: #0B0B0B; + border: none; + width: 60px; + height: 13px; + float: right; + margin: 0 0 0 10px; + padding: 0 20px 0 0; + cursor: pointer; + font: normal 10px/13px Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +#contact form.contact input.reset { + background: url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 45px 0 #FFFFFF; + color: #0B0B0B; + border: none; + width: 60px; height:13px; + float: right; + margin: 0; + padding: 0 15px 0 0; + cursor: pointer; + font: normal 10px/13px Arial, Helvetica, sans-serif; + text-transform: uppercase; +} +/* footer */ +#footer { + position: relative; + margin: 0 auto; + width: 678px; + padding: 12px 0 50px; +} +#footer a.xhtml { + background-color: #CC0000; + color: #FFFFFF; + width: 49px; + height: 16px; + margin: 0 6px 0 0; + font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; + display: block; + text-align: center; + text-decoration: none; + float: left; +} +#footer a.xhtml:hover { + background-color: #0B0B0B; + color: #FFFFFF; + width: 49px; + height: 16px; + margin: 0 6px 0 0; + font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; + display: block; + text-align: center; + text-decoration: none; + float: left; +} +#footer a.css { + background-color: #0B0B0B; + color: #FFFFFF; + width: 38px; + height: 16px; + font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; + display: block; + text-align: center; + text-decoration: none; + float: left; +} +#footer a.css:hover { + background-color: #CC0000; + color: #FFFFFF; + width: 38px; + height: 16px; + font: bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; + display: block; text-align:center; + text-decoration: none; + float: left; +} +#footer ul { + float: right; +} +#footer ul li { + float: left; color:#0B0B0B; + background-color: #FDF9EE; + font: normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; +} +#footer ul li a { + color: #0B0B0B; + background-color: #FDF9EE; + padding: 0 8px; + text-decoration: none; + font: normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; +} +#footer ul li a:hover { + color: #0B0B0B; + background-color: #EFEBDE; + padding: 0 8px; + text-decoration: none; + font: normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; +} +#footer p { + color: #A90000; + background-color: #FDF9EE; + padding: 0 8px; + float: right; + font: normal 12px/22px "Trebuchet MS", Arial, Helvetica, sans-serif; +} +#footer p.tworld { + color: #0B0B0B; + background-color: #FDF9EE; + padding: 0 8px; + float: right; + font: normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif; +} +#footer p.tworld a { + color: #0B0B0B; + background-color: #FDF9EE; + text-decoration: none; + font: normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif; +} +#footer p.tworld a:hover { + color: #0B0B0B; + background-color: #EFEBDE; + text-decoration: none; + font: normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif; } -#newsLetter form.newsLetter h2.text2{ - background:url(../../../site_icons/visualization/coauthorship/newsletter_h2_bg.gif) no-repeat 0 0; color:#786E4E; - padding:0 0 10px 65px; float:left; width:228px; height:37px; - font:normal 24px/30px Georgia, "Times New Roman", Times, serif;} -#newsLetter form.newsLetter h2.text2 span{ - background-color:#FFFFFF; color:#0B0B0B; - font:normal 24px/30px Georgia, "Times New Roman", Times, serif;} -#newsLetter form.newsLetter label{ - background-color:#FFFFFF; color:#0B0B0B; margin:0 0 8px 0; float:left; - font:bold 10px/28px Arial, Helvetica, sans-serif; text-transform:uppercase;} -#newsLetter form.newsLetter input{ - background-color:#EFEBDE; color:#0B0B0B; border:#C3BCA4 1px solid; - width:168px; height:22px; padding:2px; margin:0 0 8px 15px; float:left; - font:normal 14px/20px Arial, Helvetica, sans-serif;} -#newsLetter form.newsLetter input.submit{ - background:url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; color:#0B0B0B; border:none; - width:60px; height:13px; float:right; margin:7px 34px 0 0; padding:0 30px 0 0; cursor:pointer; - font:normal 10px/13px Arial, Helvetica, sans-serif; text-transform:uppercase;} -#contact{ - width:312px; float:right;} -#contact span.ctop{ - background:url(../../../site_icons/visualization/coauthorship/contact_top.gif) no-repeat 0 0 #FCFAF3; color:#000000; - line-height:0; font-size:0; height:14px; display:block;} -#contact span.cbottom{ - background:url(../../../site_icons/visualization/coauthorship/contact_bottom.gif) no-repeat 0 0 #FCFAF3; color:#000000; - line-height:0; font-size:0; height:25px; display:block;} -#contact form.contact{ - background:url(../../../site_icons/visualization/coauthorship/contact_midle.gif) repeat-y 0 0 #FCFAF3; color:#000000; - width:272px; padding:0 20px; float:left;} -#contact form.contact h2.text3{ - background:url(../../../site_icons/visualization/coauthorship/contact_h2_bg.gif) no-repeat 0 0 #FFFFFF; color:#0B0B0B; - padding:0 0 10px 55px; float:left; width:228px; height:37px; - font:normal 24px/30px Georgia, "Times New Roman", Times, serif;} -#contact form.contact h2.text3 span{ - background-color:#FFFFFF; color:#A60101; - font:normal 24px/30px Georgia, "Times New Roman", Times, serif;} -#contact form.contact label{ - background-color:#FFFFFF; color:#0B0B0B; margin:0 0 8px 0; float:left; - font:bold 10px/28px Arial, Helvetica, sans-serif; text-transform:uppercase;} -#contact form.contact input{ - background-color:#EFEBDE; color:#0B0B0B; border:#C3BCA4 1px solid; - width:168px; height:22px; padding:2px; margin:0 0 8px 15px; float:right; - font:normal 14px/20px Arial, Helvetica, sans-serif;} -#contact form.contact textarea{ - background-color:#EFEBDE; color:#0B0B0B; border:#C3BCA4 1px solid; - width:168px; height:66px; padding:2px; margin:0 0 13px 15px; float:right; - font:normal 14px/20px Arial, Helvetica, sans-serif;} -#contact form.contact input.submit{ - background:url(../../../site_icons/visualization/coauthorship/submit_bg.gif) no-repeat 45px 0 #FFFFFF; color:#0B0B0B; border:none; - width:60px; height:13px; float:right; margin:0 0 0 10px; padding:0 20px 0 0; cursor:pointer; - font:normal 10px/13px Arial, Helvetica, sans-serif; text-transform:uppercase;} -#contact form.contact input.reset{ - background:url(../../../site_icons/visualization/coauthorship/more_bg.gif) no-repeat 45px 0 #FFFFFF; color:#0B0B0B; border:none; - width:60px; height:13px; float:right; margin:0; padding:0 15px 0 0; cursor:pointer; - font:normal 10px/13px Arial, Helvetica, sans-serif; text-transform:uppercase;} -/* ----------------- body end --------------------------- */ -/* ----------------- footer start --------------------------- */ -#footer{ - position:relative; margin:0 auto; width:678px; padding:12px 0 50px;} -#footer a.xhtml{ - background-color:#CC0000; color:#FFFFFF; width:49px; height:16px; margin:0 6px 0 0; - font:bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display:block; text-align:center; text-decoration:none; float:left;} -#footer a.xhtml:hover{ - background-color:#0B0B0B; color:#FFFFFF; width:49px; height:16px; margin:0 6px 0 0; - font:bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display:block; text-align:center; text-decoration:none; float:left;} -#footer a.css{ - background-color:#0B0B0B; color:#FFFFFF; width:38px; height:16px; - font:bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display:block; text-align:center; text-decoration:none; float:left;} -#footer a.css:hover{ - background-color:#CC0000; color:#FFFFFF; width:38px; height:16px; - font:bold 13px/16px "Trebuchet MS", Arial, Helvetica, sans-serif; - display:block; text-align:center; text-decoration:none; float:left;} -#footer ul{ - float:right;} -#footer ul li{ - float:left; color:#0B0B0B; background-color:#FDF9EE; - font:normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif;} -#footer ul li a{ - color:#0B0B0B; background-color:#FDF9EE; padding:0 8px; text-decoration:none; - font:normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif;} -#footer ul li a:hover{ - color:#0B0B0B; background-color:#EFEBDE; padding:0 8px; text-decoration:none; - font:normal 12px/16px "Trebuchet MS", Arial, Helvetica, sans-serif;} -#footer p{ - color:#A90000; background-color:#FDF9EE; padding:0 8px; float:right; - font:normal 12px/22px "Trebuchet MS", Arial, Helvetica, sans-serif;} -#footer p.tworld{ - color:#0B0B0B; background-color:#FDF9EE; padding:0 8px; float:right; - font:normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif;} -#footer p.tworld a{ - color:#0B0B0B; background-color:#FDF9EE; text-decoration:none; - font:normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif;} -#footer p.tworld a:hover{ - color:#0B0B0B; background-color:#EFEBDE; text-decoration:none; - font:normal 12px/19px "Trebuchet MS", Arial, Helvetica, sans-serif;} #nodeData div { - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; - color: #000; + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000; } #nodeData .italicize { - font-style: italic; + font-style: italic; } #nodeData .bold { - font-weight: bold; + font-weight: bold; } #nodeData .works .numbers { - text-align: right; - width: 40px; - float:left; -} + text-align: right; + width: 40px; + float: left; +} \ No newline at end of file diff --git a/productMods/css/visualization/entitycomparison/layout-ie-67.css b/productMods/css/visualization/entitycomparison/layout-ie-67.css new file mode 100644 index 00000000..b58e34e5 --- /dev/null +++ b/productMods/css/visualization/entitycomparison/layout-ie-67.css @@ -0,0 +1,5 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +#yaxislabel { + margin-left: -27px; +} \ No newline at end of file diff --git a/productMods/css/visualization/entitycomparison/layout-ie.css b/productMods/css/visualization/entitycomparison/layout-ie.css index 6b0dd0ad..19bcc537 100644 --- a/productMods/css/visualization/entitycomparison/layout-ie.css +++ b/productMods/css/visualization/entitycomparison/layout-ie.css @@ -1,4 +1,5 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ + .disabled-checkbox-event-receiver { - background-color: white; -} + background-color: #fff; +} \ No newline at end of file diff --git a/productMods/css/visualization/entitycomparison/layout.css b/productMods/css/visualization/entitycomparison/layout.css index 56955d43..af9592ba 100644 --- a/productMods/css/visualization/entitycomparison/layout.css +++ b/productMods/css/visualization/entitycomparison/layout.css @@ -1,37 +1,51 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -@CHARSET "UTF-8"; - #body { font: 0.9em Helvetica; background-color: #fff; min-height: 800px; width: 100%; - /*min-width: 900px;*/ margin: auto; overflow: hidden; } - -a.temporalGraphLinks { - margin-top: 10px; - /*float:right;*/ - height: 20px; - text-decoration: none; - width: 30%; - /*margin: 0 1% 0 1%;*/ - background-color: #EAEAEA; - text-align: center; - padding: 3px; - padding-top: 4px; - cursor: pointer; +.easy-deselect-label a.temporal-vis-url { + float: right; +} +a.temporalGraphLinks { + background-color: #2485AE; + color: white; + cursor: pointer; + font-weight: bold; + height: 20px; + margin-top: 10px; + padding: 4px 3px 3px; + text-align: center; + text-decoration: none; + padding-bottom: 3px; +} +a.clear-selected-entities { + background-color: #878787; +} +#paginated-table-footer { + margin-top: 10px; + text-align: left; + height: 25px; +} +#loading-comparisons { + font-size: 1.2em; + font-weight: bold; +} +#loading-comparisons img { + vertical-align: sub; +} +#legend-row-header a { + background-color: #878787; } - #reset-search { color: #2485AE; cursor: pointer; margin-left: 10px; } - #yaxislabel { font-size: 12px; float:right; @@ -40,32 +54,27 @@ a.temporalGraphLinks { display: block; height: 150px; text-align: center; - padding-top: 50px; + margin-top: 50px; position: absolute !important; } - #xaxislabel{ font-size: 12px; margin-top: -5px; text-align: center; } - #notification-container { position: inherit; } - .disabled-checkbox-event-receiver { height: 21px; position: absolute; width: 21px; display:none; } - #functions{ margin-top: 20px; margin-bottom: -40px; } - #bar { height: 20px; float: left; @@ -76,74 +85,59 @@ a.temporalGraphLinks { #checkbox{ float:left; } - .easy-deselect-label { float: left; font-size: 12px; width: 160px; - text-align: right; + text-align: left; } - -.easy-deselect-label a, #text { +.easy-deselect-label a, +#text { text-decoration: none; color: black; font-family: Helvetica; font-size: 1em; } - .easy-deselect-label .entity-label { - color:red; + color: #f00; } - .small-arrows { font-size: 0.9em; padding: 0 !important; + text-decoration: none; + vertical-align: top; } - #header-entity-label { - font-size: 1.1em; font-weight: bold; - } - -#header-entity-label a { - color: #13968C; -} - .ellipsis { - white-space: nowrap; - overflow: hidden; + white-space: nowrap; + overflow: hidden; } - .entity-label-url { width: 125px; - margin-right: 10px; - display:inline-block; + margin-left: 10px; + display: inline-block; text-decoration: underline; + color: #2485AE; } - .ellipsis.multiline { - white-space: normal; + white-space: normal; } - #searchresult { margin-top: 50px; } - #graphContainer { margin-bottom: 15px; width: 450px; height: 250px; margin-left: 23px; } - #leftblock { float: left; - /*margin-left: 5%;*/ width: 39%; } - #text { margin-left: 5px; } @@ -154,54 +148,48 @@ a.temporalGraphLinks { font-size: 13px; font-weight: normal; } - #rightblock { float:right; margin-right:3%; width:54%; } - -#counter,#total { - color: red; +#counter, +#total { + color: #f00; } - #heading { margin-top: 10px; } - #paginatedTable { - margin-top:0px; + margin-top: 0; } - .sDomSearchBar { margin-bottom: -10px; margin-left: 41%; } - .datatablerowhighlight { background-color: #ECFFB3 !important; } - .datatablerowhighlight td { font-weight: bold !important; } - #bottomButtons{ width: 100%; float:right; margin: 20px 0 20px 0; } - #stopwordsdiv{ margin-top: 10px; margin-left: 10px; } - p.displayCounter{ padding-bottom: 4px; border-bottom: 1px solid gray; } - -#comparisonHeader, #entityHeader, #entitylevelheading, #comparisonParameter, #headerText { +#comparisonHeader, +#entityHeader, +#entitylevelheading, +#comparisonParameter, +#headerText { color: #2485ae; } \ No newline at end of file diff --git a/productMods/css/visualization/personlevel/page.css b/productMods/css/visualization/personlevel/page.css index 6d9b0bb2..b31c2515 100644 --- a/productMods/css/visualization/personlevel/page.css +++ b/productMods/css/visualization/personlevel/page.css @@ -1,120 +1,113 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ + a.no_href_styles { - border: 0; + border: 0; } - -.no_href_styles a:ACTIVE,.no_href_styles a:BEFORE,.no_href_styles a:FOCUS,.no_href_styles a:HOVER,.no_href_styles a:VISITED,.no_href_styles a:LINK - { /*color: white;*/ - border: 0; +.no_href_styles a:ACTIVE, +.no_href_styles a:BEFORE, +.no_href_styles a:FOCUS, +.no_href_styles a:HOVER, +.no_href_styles a:VISITED, +.no_href_styles a:LINK + { /*color: white;*/ + border: 0; } - .vis_stats { - background: #fff; - clear: right; - width:67%; - margin-left:33%; -} - -.vis-tables { - padding: 10px; - background-color: #FFF; - border: 1px solid #ddebf1; - float:left; - font-size: 0.8em; - width: 44%; - margin: 0 10px 10px 0; -} - - -p.datatable { - font-size: 12px; - display: block; - margin: 2px; - padding: 0 -} - -.datatable table { - text-align: left; -} - -.datatable img { - float: left; - cursor: pointer; -} - -#sparkline-container { - margin-left: 33%; + background: #fff; + clear: right; width: 67%; + margin-left: 33%; +} +.vis-tables { + padding: 10px; + background-color: #FFF; + border: 1px solid #ddebf1; + float: left; + font-size: 0.8em; + width: 44%; + margin: 0 10px 10px 0; +} +p.datatable { + font-size: 12px; + display: block; + margin: 2px; + padding: 0 +} +.datatable table { + text-align: left; +} +.datatable img { + float: left; + cursor: pointer; +} +#sparkline-container { + clear: both; + margin-left: 33%; + width: 67%; + float: right; } - #profileImage img{ - width: 90px; - height: auto; + width: 90px; + height: auto; } - #body h1 { - margin:0.0em; + margin: 0; } - #ego_profile h1 a { text-decoration: none; } - .sparkline_wrapper_table { - display: inline; - vertical-align: bottom; + display: inline; + vertical-align: bottom; } - .investigator_name, .author_name { - color: #2485AE; - font-weight: bold; + color: #2485AE; + font-weight: bold; } - .neutral_investigator_name, .neutral_author_name { - color: #2485AE; - font-weight: bold; + color: #2485AE; + font-weight: bold; } - .investigator_moniker, .author_moniker { - color: #9C9C9C; + color: #9C9C9C; } - .sub_headings { - color: #121b3c; - padding-top: 10px; - float:left; - margin-right: 10px; + color: #121b3c; + padding-top: 10px; + float: left; + margin-right: 10px; } - .toggle_visualization { - max-width: 180px; - float:right; + max-width: 180px; + float: right; + display: none; } - -#grant-count-sparkline-include, #publication-count-sparkline-include { - float: left; + float: left; width: 50%; } - -#coinvestigator-count-sparkline-include, #coauthor-count-sparkline-include { - float: right; + float: right; + width: 50%; +} +#grant-count-sparkline-include { + float: left; + width: 50%; +} +#coinvestigator-count-sparkline-include { + float: right; width: 50%; } - .sub_headings a { - font-size:0.7em; - font-weight:normal; + font-size: .7em; + font-weight:normal; } - table.sparkline_wrapper_table td, th { - vertical-align: bottom; + vertical-align: bottom; } - #ego_profile { height: 1%; /* this was the key to killing the IE6 bug (no upper photo and sparklines jump on hover). Solution? Give the parent layout */ background: #fff; @@ -122,179 +115,139 @@ table.sparkline_wrapper_table td, th { float: left; max-width: 50%; } - #ego_label { - font-size:1.1em; + font-size: 1.1em; } - #ego_profile_image { - float:left; + float: left; padding-right: 5px; } - #ego_profile_image img { width: 90px; height: auto; } - #ego_sparkline { - cursor:pointer; - height:36px; - width:471px; + cursor: pointer; + height: 36px; + width: 471px; } - #coauthorships_table th { - vertical-align: top; + vertical-align: top; } - -.sparkline_range{ - font-size: 0.9em; - font-weight: bold; +.sparkline_range { + font-size: .9em; + font-weight: bold; } - .vis-tables table td{ - padding-right: 10px; - width: 50%; + padding-right: 10px; + width: 50%; } - #visPanel { - float: right; - width: 600px; + float: right; + width: 600px; } - -.vis-tables table caption{ - width: 100%; - padding-bottom: 10px; - font-weight: bold; - font-size: 16px; - text-align: left; +.vis-tables table caption { + width: 100%; + padding-bottom: 10px; + font-weight: bold; + font-size: 16px; + text-align: left; } - -.vis-tables table{ - width: 100%; +.vis-tables table { + width: 100%; } - -.vis-tables table thead{ - text-align: left; +.vis-tables table thead { + text-align: left; } - .vis-tables table thead tr th { - background-color:#eaeaea; - font-size:14px; - padding:5px; - vertical-align:top; - text-align:left; + background-color: #eaeaea; + font-size: 14px; + padding: 5px; + vertical-align: top; + text-align: left; } - .vis-tables table tbody { - font-size:12px; + font-size: 12px; } - .vis-tables table tbody td { - text-align:left; - padding:5px; + text-align: left; + padding: 5px; } - -moniker{ - margin-top: 0px; +.moniker { + margin-top: 0; } - - -.spacer{ - font-size:0; line-height:0; clear:both;} - - -/* ----------------- body start --------------------------- */ -#body{ - max-width:900px; - min-width:800px; - margin:0 auto; - position:relative; - background: white; +.spacer { + font-size: 0; + line-height: 0; + clear: both; } -#bodyPannel{ - background: #FFFFFF; -/* width:765px; - float:left;*/ - /*padding-top: 0; - padding-right: 28px; - padding-bottom: 0; - padding-left: 16px;*/ - height: 840px; +/* <------ BODY START*/ +#body { + max-width: 900px; + min-width: 800px; + margin: 0 auto; + position: relative; + background: white; } - -#dataPanel { -/* margin-top: 50px; - width: 25%; - background-color: #f7f9f9; - height: 80%; - padding-left: 10px; - padding-bottom: 30px;*/ - - border-color: #DFE6E6; - border: 1px solid; - background: #F7F9F9; - width:250px; - height:615px; - margin-top: 15px; +#bodyPannel { + background: #FFFFFF; + height: 840px; + width: 100%; + clear: both; +} +#dataPanel { + border: 1px solid #e9e9e9; + background: #F7F9F9; + width: 250px; + height: 615px; + float: left; } - #dataPanel div { - font-family: Arial, Helvetica, sans-serif; - font-size: 11px; + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; } #dataPanel .italicize { - font-style: italic; + font-style: italic; } #dataPanel .bold { - font-weight: bold; - color: #2485AE; - font-size: 14px; + font-weight: bold; + color: #2485AE; + font-size: 14px; } - #dataPanel .investigator_stats .numbers, #dataPanel .author_stats .numbers { - text-align: right; - width: 40px; - float:left; + text-align: right; + width: 40px; + float:left; } - - #data-panel-content h4 { - padding-bottom: 0; + padding-bottom: 0; } - #data-panel-content { margin-left: 15px; margin-top: 15px; } - -/* container override from liquid.css */ +/* <------ CONTAINER OVERRIDE FROM LIQUID.CSS*/ .container { - width: inherit; + width: inherit; } - #incomplete-data { - line-height: 150%; - margin-right: 15px; + line-height: 150%; + margin-right: 15px; } - .graphml-file-link { - padding-top: 20px; - height: 20px; - font-size: 0.9em; + padding-top: 20px; + height: 20px; + font-size: .9em; } - #profileTitle { - background-color: #2A2A2A; + background-color: #2485AE; color: white; font-weight: bold; line-height: 1em !important; padding: 10px; width: 54px; } - -#table_heading{ -/* margin-bottom:20px; */ - width: 80%; -} +#table_heading { + width: 80%; +} \ No newline at end of file diff --git a/productMods/css/visualization/visualization.css b/productMods/css/visualization/visualization.css index e78749ca..6a817977 100644 --- a/productMods/css/visualization/visualization.css +++ b/productMods/css/visualization/visualization.css @@ -7,81 +7,73 @@ span.incomplete-data-holder, #incomplete-data { padding: 5px; - font-size: 0.8em; + font-size: .8em; color: #444; border: dotted 1px #eee; background-color: #ffb; } - #incomplete-data { margin-top: 1.6em; - font-size: 1.0em; + font-size: 1em; } - .collaboratorship-icon { float: left; padding-right: 5px; } - -.collaboratorship-link { - padding-top: 3px; -} - .collaboratorship-link a { font-size: 0.9em; } - .collaboratorship-link h3 { - line-height: 1em; + line-height: 1em !important; font-size: 1em !important; - margin-bottom: 0px !important; - padding-top: 0px !important; - padding-right: 0px !important; - padding-left: 0px !important; - padding-bottom: 0px !important; + margin-bottom: 0 !important; + padding-top: 10px !important; + padding-right: 0 !important; + padding-left: 0 !important; + padding-bottom: 0 !important; } - .collaboratorship-link h3 a { color: #2485AE; font-size: .9em !important; text-decoration: underline; } - -#coauthorship_link_container { - display: none; +.collaboratorship-link-container { + width: 180px; } - -#coauthorship_link_container, -#coinvestigator_link_container { +.collaboratorship-link-separator { margin-top: 20px; + border-top: 1px dotted #A6B1B0; + padding-top: 20px; } - .sparkline_text { font-size: .8em; font-weight: bold; text-align: left; - padding-bottom: 20px; - border-bottom: 1px dotted #A6B1B0; + line-height: 1.5em; + width: 180px; } - .google-visualization-sparkline-default { margin-bottom: 5px; } - .google-visualization-sparkline-image { - border: 1px solid #cfe4ed; + border: 1px solid #cfe4ed; + display: block; } - .google-visualization-sparkline-selected { background-color: blue; + border-spacing: 0; + color: gray; + font-size: small; + padding: 1px; } - .visualization-menupage-link { float: right; - margin-top: 0.8em; + margin: 0 2em 1em 0; padding-left: 1.6em; } - .temporal-graph { background: url(../../images/visualization/temporal_vis_small_icon.jpg) top left no-repeat; +} +.infoIcon { + padding-right:30px; } \ No newline at end of file diff --git a/productMods/edit/forms/addClinicalRoleToPerson.jsp b/productMods/edit/forms/addClinicalRoleToPerson.jsp index 7b7e5e90..2390270d 100644 --- a/productMods/edit/forms/addClinicalRoleToPerson.jsp +++ b/productMods/edit/forms/addClinicalRoleToPerson.jsp @@ -5,5 +5,8 @@ - + \ No newline at end of file diff --git a/productMods/edit/forms/addGrantRoleToPerson.jsp b/productMods/edit/forms/addGrantRoleToPerson.jsp index 80bab24d..6e36d87d 100644 --- a/productMods/edit/forms/addGrantRoleToPerson.jsp +++ b/productMods/edit/forms/addGrantRoleToPerson.jsp @@ -26,6 +26,8 @@ This is intended to create a set of statements like: <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.JavaScript" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StartYearBeforeEndYear"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %> @@ -46,18 +48,59 @@ This is intended to create a set of statements like: String predicateUri = (String)request.getAttribute("predicateUri"); ObjectProperty op = wdf.getObjectPropertyDao().getObjectPropertyByURI( predicateUri ); if( op != null && op.getURIInverse() != null ){ - %> <%=op.getURIInverse()%> <% + %> +<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field"%> +<%@page import="edu.cornell.mannlib.vitro.webapp.edit.elements.DateTimeWithPrecision"%> +<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.DateTimeIntervalValidation"%><%=op.getURIInverse()%> <% }else{ %> <% } + + /* + There are 4 modes that this form can be in: + 1. Add, there is a subject and a predicate but no role 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:roleIn stmt. + + 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:roleIn stmt. This should be similar to an add but the form should be expanded. + + 4. Really bad node. multiple core:roleIn statements. + */ + + EditMode mode = FrontEndEditingUtils.getEditMode(request, "http://vivoweb.org/ontology/core#roleIn"); + + if( mode == EditMode.ADD ) { + %> <% + } else if(mode == EditMode.EDIT){ + %> <% + } else if(mode == EditMode.REPAIR){ + %> <% + } + %> + %> <%@page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty"%> + + + + + + + + + + + + + <% // set role type based on predicate String subjectName = ((Individual) request.getAttribute("subject")).getName(); if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvestigatorRole") ) { %> @@ -73,51 +116,64 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest Investigator investigator entry for <%= subjectName %> <% } %> - + +<%-- Configure add vs. edit --%> - "> - - - - - - - + - + + + + + + + + + + <%-- editMode == "repair" --%> + + + + - - - ?role <${startYearUri}> ?startYear . - - - - - ?role <${endYearUri}> ?endYear . - - @prefix core: <${vivoCore}> . @prefix rdf: <${rdf}> . - ?person ?rolePredicate ?role. - ?role rdf:type ?roleType . - ?role core:roleIn ?grant . - ?grant core:relatedRole ?role . + ?person ?rolePredicate ?role. + + ?role a ?roleType ; + core:roleIn ?grant . + + ?grant a core:Grant ; + core:relatedRole ?role . + ?role ?inverseRolePredicate ?person. - - @prefix core: <${vivoCore}> . - @prefix rdf: <${rdf}> . - ?grant rdf:type core:Grant . + + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToStart}> ?startNode . + ?startNode <${type}> <${dateTimeValueType}> . + ?startNode <${dateTimeValue}> ?startField.value . + ?startNode <${dateTimePrecision}> ?startField.precision . + + + + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToEnd}> ?endNode . + ?endNode <${type}> <${dateTimeValueType}> . + ?endNode <${dateTimeValue}> ?endField.value . + ?endNode <${dateTimePrecision}> ?endField.precision . @@ -133,22 +189,72 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest ?existingGrant rdfs:label ?existingGrantLabel . } - - PREFIX core: <${vivoCore}> - SELECT ?existingStartYear WHERE { ?role core:startYear ?existingStartYear .} - - - -PREFIX core: <${vivoCore}> - SELECT ?existingStartYear WHERE { ?role core:endYear ?existingStartYear .} - - PREFIX core: <${vivoCore}> SELECT ?existingGrant WHERE { ?role core:roleIn ?existingGrant . } ${vivoOnt}#Grant + + + SELECT ?existingIntervalNode WHERE { + ?role <${roleToInterval}> ?existingIntervalNode . + ?existingIntervalNode <${type}> <${intervalType}> . } + + + + SELECT ?existingStartNode WHERE { + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToStart}> ?existingStartNode . + ?existingStartNode <${type}> <${dateTimeValueType}> .} + + + + SELECT ?existingDateStart WHERE { + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToStart}> ?startNode . + ?startNode <${type}> <${dateTimeValueType}> . + ?startNode <${dateTimeValue}> ?existingDateStart . } + + + + SELECT ?existingStartPrecision WHERE { + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToStart}> ?startNode . + ?startNode <${type}> <${dateTimeValueType}> . + ?startNode <${dateTimePrecision}> ?existingStartPrecision . } + + + + SELECT ?existingEndNode WHERE { + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToEnd}> ?existingEndNode . + ?existingEndNode <${type}> <${dateTimeValueType}> .} + + + + SELECT ?existingEndDate WHERE { + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToEnd}> ?endNode . + ?endNode <${type}> <${dateTimeValueType}> . + ?endNode <${dateTimeValue}> ?existingEndDate . } + + + + SELECT ?existingEndPrecision WHERE { + ?role <${roleToInterval}> ?intervalNode . + ?intervalNode <${type}> <${intervalType}> . + ?intervalNode <${intervalToEnd}> ?endNode . + ?endNode <${type}> <${dateTimeValueType}> . + ?endNode <${dateTimePrecision}> ?existingEndPrecision . } + + + { "formUrl" : "${formUrl}", @@ -159,23 +265,36 @@ PREFIX core: <${vivoCore}> "predicate" : ["rolePredicate", "${predicateUriJson}" ], "object" : ["role", "${objectUriJson}", "URI" ], - "n3required" : [ "${n3ForGrantRole}", "${startYearAssertion}" ], + "n3required" : [ "${n3ForGrantRole}" ], - "n3optional" : [ "${n3ForGrantType}", "${n3ForGrantLabel}", "${n3ForInverse}", "${endYearAssertion}" ], + "n3optional" : [ "${n3ForGrantLabel}", "${n3ForInverse}", "${n3ForStart}", "${n3ForEnd}" ], "newResources" : { "role" : "${defaultNamespace}", - "grant" : "${defaultNamespace}" }, - + "grant" : "${defaultNamespace}", + "intervalNode" : "${defaultNamespace}", + "startNode" : "${defaultNamespace}", + "endNode" : "${defaultNamespace}" }, "urisInScope" : { "roleType" : "${roleType}", "inverseRolePredicate" : "${inversePredicate}" }, "literalsInScope": { }, "urisOnForm" : [ "grant" ], - "literalsOnForm" : [ "grantLabel", "startYear", "endYear", "existingGrantLabel" ], + "literalsOnForm" : [ "grantLabel", "existingGrantLabel" ], "filesOnForm" : [ ], "sparqlForLiterals" : { }, "sparqlForUris" : { }, - "sparqlForExistingLiterals" : { "grantLabel":"${grantLabelQuery}" , "startYear":"${startYearQuery}", "endYear":"${endYearQuery}" }, - "sparqlForExistingUris" : { "grant":"${grantQuery}" }, + "sparqlForExistingLiterals" : { + "grantLabel":"${grantLabelQuery}" , + "startField.value" : "${existingStartDateQuery}", + "endField.value" : "${existingEndDateQuery}" + }, + "sparqlForExistingUris" : { + "grant":"${grantQuery}", + "intervalNode" : "${existingIntervalNodeQuery}", + "startNode" : "${existingStartNodeQuery}", + "endNode" : "${existingEndNodeQuery}", + "startField.precision": "${existingStartPrecisionQuery}", + "endField.precision" : "${existingEndPrecisionQuery}" + }, "fields" : { "grant" : { "newResource" : "false", @@ -186,7 +305,7 @@ PREFIX core: <${vivoCore}> "objectClassUri" : "${grantTypeUriJson}", "rangeDatatypeUri" : "", "rangeLang" : "", - "assertions" : [ ] + "assertions" : [ "${n3ForGrantRole}" ] }, "grantLabel" : { "newResource" : "false", @@ -197,7 +316,7 @@ PREFIX core: <${vivoCore}> "objectClassUri" : "", "rangeDatatypeUri" : "${stringDatatypeUriJson}", "rangeLang" : "", - "assertions" : ["${n3ForGrantLabel}"] + "assertions" : ["${n3ForGrantLabel}", "${n3ForGrantRole}" ] }, "existingGrantLabel" : { /* Needed iff we return from an invalid submission */ "newResource" : "false", @@ -210,41 +329,52 @@ PREFIX core: <${vivoCore}> "rangeLang" : "", "assertions" : [ ] }, - "startYear" : { + "startField" : { "newResource" : "false", - "validators" : [ "nonempty", "datatype:${gYearDatatypeUriJson}" ], + "validators" : [ ], "optionsType" : "UNDEFINED", "literalOptions" : [ ], "predicateUri" : "", "objectClassUri" : "", - "rangeDatatypeUri" : "${gYearDatatypeUriJson}", + "rangeDatatypeUri" : "", "rangeLang" : "", - "assertions" : ["${startYearAssertion}"] + "assertions" : [ "${n3ForStart}" ] }, - "endYear" : { + "endField" : { "newResource" : "false", - "validators" : [ "datatype:${gYearDatatypeUriJson}" ], + "validators" : [ ], "optionsType" : "UNDEFINED", "literalOptions" : [ ], "predicateUri" : "", "objectClassUri" : "", - "rangeDatatypeUri" : "${gYearDatatypeUriJson}", + "rangeDatatypeUri" : "", "rangeLang" : "", - "assertions" : ["${endYearAssertion}"] + "assertions" : ["${n3ForEnd}" ] } } } <% + EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); if (editConfig == null) { editConfig = new EditConfiguration((String) request.getAttribute("editjson")); EditConfiguration.putConfigInSession(editConfig,session); - } - - editConfig.addValidator(new StartYearBeforeEndYear("startYear","endYear") ); + //setup date time edit elements + Field startField = editConfig.getField("startField"); + startField.setEditElement( + new DateTimeWithPrecision(startField, + VitroVocabulary.Precision.YEAR.uri(), + VitroVocabulary.Precision.NONE.uri())); + Field endField = editConfig.getField("endField"); + endField.setEditElement( + new DateTimeWithPrecision(endField, + VitroVocabulary.Precision.YEAR.uri(), + VitroVocabulary.Precision.NONE.uri())); + editConfig.addValidator(new DateTimeIntervalValidation("startField","endField") ); + } Model model = (Model) application.getAttribute("jenaOntModel"); String objectUri = (String) request.getAttribute("objectUri"); @@ -279,6 +409,11 @@ PREFIX core: <${vivoCore}> +<% if( mode == EditMode.ERROR ){ %> +
This form is unable to handle the editing of this position because it is associated with + multiple Position individuals.
+<% }else{ %> +

${formHeading}

<%@ include file="unsupportedBrowserMessage.jsp" %> @@ -288,7 +423,7 @@ PREFIX core: <${vivoCore}>

- <%-- Store this value in a hidden field, because the displayed field is disabled and don't submit. This ensures that when + <%-- Store this value in a hidden field, because the displayed field is disabled and doesn't submit. This ensures that when returning from a validation error, we retain the value. --%> @@ -301,8 +436,8 @@ PREFIX core: <${vivoCore}>

Years of Participation in Grant

- - + +

@@ -330,4 +465,6 @@ var customFormData = { }; +<% } %> + \ No newline at end of file diff --git a/productMods/edit/forms/addHeadOfRoleToPerson.jsp b/productMods/edit/forms/addHeadOfRoleToPerson.jsp index 85167fc2..ce14f563 100644 --- a/productMods/edit/forms/addHeadOfRoleToPerson.jsp +++ b/productMods/edit/forms/addHeadOfRoleToPerson.jsp @@ -11,14 +11,14 @@ value='["", "Select one"], [ "http://vivoweb.org/ontology/core#Association", "Association" ], [ "http://vivoweb.org/ontology/core#Center", "Center" ], - [ "http://vivoweb.org/ontology/core#Clinical Organization", "Clinical Organization" ], + [ "http://vivoweb.org/ontology/core#ClinicalOrganization", "Clinical Organization" ], [ "http://vivoweb.org/ontology/core#College", "College" ], [ "http://vivoweb.org/ontology/core#Committee", "Committee" ], [ "http://vivoweb.org/ontology/core#Consortium", "Consortium" ], [ "http://vivoweb.org/ontology/core#Department", "Department" ], [ "http://vivoweb.org/ontology/core#Division", "Division" ], [ "http://purl.org/NET/c4dm/event.owl#Event", "Event" ], - [ "http://vivoweb.org/ontology/core#Extension Unit", "Extension Unit" ], + [ "http://vivoweb.org/ontology/core#ExtensionUnit", "Extension Unit" ], [ "http://vivoweb.org/ontology/core#Foundation", "Foundation" ], [ "http://vivoweb.org/ontology/core#FundingOrganization", "Funding Organization" ], [ "http://vivoweb.org/ontology/core#GovernmentAgency", "Government Agency" ], @@ -33,9 +33,9 @@ [ "http://vivoweb.org/ontology/core#Project", "Project" ], [ "http://vivoweb.org/ontology/core#Publisher", "Publisher" ], [ "http://vivoweb.org/ontology/core#ResearchOrganization", "Research Organization" ], - [ "http://vivoweb.org/ontology/core#Team", "Team" ], [ "http://vivoweb.org/ontology/core#School", "School" ], [ "http://vivoweb.org/ontology/core#Service","Service"], - [ "http://vivoweb.org/ontology/core#Student Organization", "Student Organization" ], + [ "http://vivoweb.org/ontology/core#Team", "Team" ], + [ "http://vivoweb.org/ontology/core#StudentOrganization", "Student Organization" ], [ "http://vivoweb.org/ontology/core#University", "University" ]' /> \ No newline at end of file diff --git a/productMods/edit/forms/addMemberRoleToPerson.jsp b/productMods/edit/forms/addMemberRoleToPerson.jsp index 442382e2..59175f38 100644 --- a/productMods/edit/forms/addMemberRoleToPerson.jsp +++ b/productMods/edit/forms/addMemberRoleToPerson.jsp @@ -2,8 +2,7 @@ - - + diff --git a/productMods/edit/forms/addOutreachRoleToPerson.jsp b/productMods/edit/forms/addOutreachRoleToPerson.jsp index d8896b4f..0f309540 100644 --- a/productMods/edit/forms/addOutreachRoleToPerson.jsp +++ b/productMods/edit/forms/addOutreachRoleToPerson.jsp @@ -10,14 +10,14 @@ value='["", "Select one"], [ "http://vivoweb.org/ontology/core#Association", "Association" ], [ "http://vivoweb.org/ontology/core#Center", "Center" ], - [ "http://vivoweb.org/ontology/core#Clinical Organization", "Clinical Organization" ], + [ "http://vivoweb.org/ontology/core#ClinicalOrganization", "Clinical Organization" ], [ "http://vivoweb.org/ontology/core#College", "College" ], [ "http://vivoweb.org/ontology/core#Committee", "Committee" ], [ "http://vivoweb.org/ontology/core#Consortium", "Consortium" ], [ "http://vivoweb.org/ontology/core#Department", "Department" ], [ "http://vivoweb.org/ontology/core#Division", "Division" ], [ "http://purl.org/NET/c4dm/event.owl#Event", "Event" ], - [ "http://vivoweb.org/ontology/core#Extension Unit", "Extension Unit" ], + [ "http://vivoweb.org/ontology/core#ExtensionUnit", "Extension Unit" ], [ "http://vivoweb.org/ontology/core#Foundation", "Foundation" ], [ "http://vivoweb.org/ontology/core#FundingOrganization", "Funding Organization" ], [ "http://vivoweb.org/ontology/core#GovernmentAgency", "Government Agency" ], @@ -35,6 +35,6 @@ [ "http://vivoweb.org/ontology/core#Team", "Team" ], [ "http://vivoweb.org/ontology/core#School", "School" ], [ "http://vivoweb.org/ontology/core#Service","Service"], - [ "http://vivoweb.org/ontology/core#Student Organization", "Student Organization" ], + [ "http://vivoweb.org/ontology/core#StudentOrganization", "Student Organization" ], [ "http://vivoweb.org/ontology/core#University", "University" ]' /> \ No newline at end of file diff --git a/productMods/edit/forms/addPresenterRoleToPerson.jsp b/productMods/edit/forms/addPresenterRoleToPerson.jsp index 3b29cc77..6bb02e92 100644 --- a/productMods/edit/forms/addPresenterRoleToPerson.jsp +++ b/productMods/edit/forms/addPresenterRoleToPerson.jsp @@ -8,5 +8,8 @@ - +
\ No newline at end of file diff --git a/productMods/edit/forms/addPublicationToPerson.jsp b/productMods/edit/forms/addPublicationToPerson.jsp index 2c3b0489..701bd385 100644 --- a/productMods/edit/forms/addPublicationToPerson.jsp +++ b/productMods/edit/forms/addPublicationToPerson.jsp @@ -63,7 +63,7 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers Individual subject = (Individual) request.getAttribute("subject"); Individual obj = (Individual) request.getAttribute("object"); - //check to see if this is an edit of existing, if yes redirect to pub + // Check to see if this is an edit of existing, if yes redirect to pub if( obj != null ){ List stmts = obj.getObjectPropertyStatements( nodeToPubProp ); if( stmts != null && stmts.size() > 0 ){ @@ -78,6 +78,20 @@ core:informationResourceInAuthorship (InformationResource : Authorship) - invers } } } + + /* This form is not prepared to deal with editing an existing relationship, so redirect + * to authorship page if no publication was found. This is not ideal, because you can't add + * a linked information resource from that page, but you can at least continue to the back end. + * May want to modify form in a future version to support repair mode. + */ + if (obj != null) { + String objectUri = obj.getURI(); + %> + + + + <% + } %> diff --git a/productMods/edit/forms/addResearcherRoleToPerson.jsp b/productMods/edit/forms/addResearcherRoleToPerson.jsp index e075311c..e7158f1e 100644 --- a/productMods/edit/forms/addResearcherRoleToPerson.jsp +++ b/productMods/edit/forms/addResearcherRoleToPerson.jsp @@ -6,5 +6,8 @@ - + \ No newline at end of file diff --git a/productMods/edit/forms/addRoleToPersonTwoStage.jsp b/productMods/edit/forms/addRoleToPersonTwoStage.jsp index 1ab781c0..12cb02d8 100644 --- a/productMods/edit/forms/addRoleToPersonTwoStage.jsp +++ b/productMods/edit/forms/addRoleToPersonTwoStage.jsp @@ -25,10 +25,17 @@ <%@ page import="java.util.List" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Arrays" %> +<%@ page import="java.util.Set" %> +<%@ page import="java.util.HashSet" %> +<%@ page import="java.util.Iterator" %> <%@ page import="com.hp.hpl.jena.rdf.model.Model" %> <%@ page import="com.hp.hpl.jena.vocabulary.XSD" %> +<%@ page import="org.json.JSONObject" %> +<%@ page import="org.json.JSONException" %> +<%@ page import="org.json.JSONArray" %> + <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %> @@ -40,18 +47,20 @@ <%@ page import="edu.cornell.mannlib.vitro.webapp.utils.TitleCase" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StartYearBeforeEndYear"%> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode"%> +<%@ page import="org.apache.commons.lang.StringUtils" %> <%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.LogFactory" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %> -<%@page import="edu.cornell.mannlib.vitro.webapp.beans.ObjectPropertyStatement"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.elements.DateTimeWithPrecision"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StartDateBeforeEndDate"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.DateTimeIntervalValidation"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.elements.DateTimeWithPrecision"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.StartDateBeforeEndDate"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.DateTimeIntervalValidation"%> <%! public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.edit.forms.addRoleToPersonTwoStage.jsp"); @@ -103,9 +112,9 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. }else{ %> <% } -%> - -<%-- There are 4 modes that this form can be in: + +/* + There are 4 modes that this form can be in: 1. Add, there is a subject and a predicate but no role and nothing else. 2. normal edit where everything should already be filled out. There is a subject, a object and an individual on @@ -114,35 +123,18 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. 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:roleIn stmt. This should be similar to an add but the form should be expanded. - 4. Really bad node. multiple roleIn statements. - ---%> -<% - /* check to see if this is mode 3 */ - int mode = 1; - Individual obj = (Individual)request.getAttribute("object"); - if( obj != null){ - List stmts = obj.getObjectPropertyStatements("http://vivoweb.org/ontology/core#roleIn"); - if( stmts != null){ - if( stmts.size() > 1 ){ - mode = 4; // Multiple roleIn statements, yuck. - }else if( stmts.size() == 0 ){ - mode = 3; // need to repair the role node - }else if(stmts.size() == 1 ){ - mode = 2; - } - } + 4. Really bad node. multiple core:roleIn statements. +*/ + + EditMode mode = FrontEndEditingUtils.getEditMode(request, "http://vivoweb.org/ontology/core#roleIn"); + + if( mode == EditMode.ADD ) { + %> <% + } else if(mode == EditMode.EDIT){ + %> <% + } else if(mode == EditMode.REPAIR){ + %> <% } - if( mode == 1 ) - log.debug("This form will be for an add. Setting mode to " + mode); - else if(mode == 2){ - log.debug("This form will be for a normal edit. Setting mode to " + mode); - %> <% - } else if(mode == 3){ - log.debug("This form will be for the repair of a bad role node. Setting mode to " + mode); - %> <% - }else if(mode == 4) - log.debug("No form will be shown, since there are multiple core:roleIn statements. Setting mode to " + mode); %> @@ -164,33 +156,8 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. <%-- label and type required if we are doing an add or a repair, but not an edit --%> -<%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %> -<%= (mode == 1 || mode == 3) ?"\"nonempty\"" : "" %> - -<%-- - - - - - - - - ---%> - - - ${vivoCore}year - ${vivoCore}startYear - - - - ?role <${startYearPredicate}> ?startYear . - - - - - ?role <${endYearPredicate}> ?endYear . - +<%= (mode == EditMode.ADD || mode == EditMode.REPAIR) ?"\"nonempty\"," : "" %> +<%= (mode == EditMode.ADD || mode == EditMode.REPAIR) ?"\"nonempty\"" : "" %> ?role <${label}> ?roleLabel . @@ -249,14 +216,6 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. ?existingActivity rdfs:label ?existingTitle . } - - SELECT ?existingStartYear WHERE { ?role <${startYearPredicate}> ?existingStartYear .} - - - - SELECT ?existingStartYear WHERE { ?role <${endYearPredicate}> ?existingStartYear .} - - PREFIX core: <${vivoCore}> SELECT ?existingActivity WHERE { ?role core:roleIn ?existingActivity . } @@ -266,13 +225,19 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. SELECT ?existingRoleLabel WHERE { ?role <${label}> ?existingRoleLabel . } +<%-- - PREFIX core: <${vivoCore}> - SELECT ?existingActivityType WHERE { - ?role core:roleIn ?existingActivity . - ?existingActivity a ?existingActivityType . - } + PREFIX core: <${vivoCore}> + SELECT ?existingActivityType WHERE { + ?role core:roleIn ?existingActivity . + ?existingActivity a ?existingActivityType . + } +--%> +<% +request.setAttribute("typeQuery", getActivityTypeQuery(vreq)); +%> +${typeQuery} SELECT ?existingIntervalNode WHERE { @@ -510,7 +475,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. -<% if( mode == 4 ){ %> +<% if( mode == EditMode.ERROR ){ %>
This form is unable to handle the editing of this role because it is associated with multiple ${param.roleActivityTypeLabel} individuals.
<% }else{ %> @@ -571,4 +536,64 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp. <% } %> - \ No newline at end of file + + +<%! + +private static final String VIVO_CORE = "http://vivoweb.org/ontology/core#"; +private static final String DEFAULT_ACTIVITY_TYPE_QUERY = + "PREFIX core: <" + VIVO_CORE + ">\n" + + "SELECT ?existingActivityType WHERE { \n" + + "?role core:roleIn ?existingActivity . \n" + + "?existingActivity a ?existingActivityType . \n" + + "}"; +// 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. +private String getActivityTypeQuery(VitroRequest vreq) { + + String activityTypeQuery = null; + + // Select options are subclasses of a specified class + String objectClassUri = vreq.getParameter("roleActivityType_objectClassUri"); + if (StringUtils.isNotBlank(objectClassUri)) { + log.debug("objectClassUri = " + objectClassUri); + activityTypeQuery = + "PREFIX core: <" + VIVO_CORE + ">\n" + + "PREFIX rdfs: <" + VitroVocabulary.RDFS + ">\n" + + "SELECT ?existingActivityType WHERE {\n" + + "?role core:roleIn ?existingActivity . \n" + + "?existingActivity a ?existingActivityType . \n" + + "?existingActivityType rdfs:subClassOf <" + objectClassUri + "> . \n" + + "}"; + } else { + String optionsType = vreq.getParameter("roleActivityType_optionsType"); + // Select options are hardcoded + if ("HARDCODED_LITERALS".equals(optionsType)) { + String typeLiteralOptions = vreq.getParameter("roleActivityType_literalOptions"); + if (StringUtils.isNotBlank(typeLiteralOptions)) { + try { + JSONObject json = new JSONObject("{values: [" + typeLiteralOptions + "]}"); + Set typeUris = new HashSet(); + JSONArray values = json.getJSONArray("values"); + int valueCount = values.length(); + for (int i = 0; i < valueCount; i++) { + JSONArray option = values.getJSONArray(i); + String uri = option.getString(0); + if (StringUtils.isNotBlank(uri)) { + typeUris.add("(?existingActivityType = <" + uri + ">)"); + } + } + String typeFilters = "FILTER (" + StringUtils.join(typeUris, "||") + ")"; + activityTypeQuery = DEFAULT_ACTIVITY_TYPE_QUERY.replace("}", "") + typeFilters + "}"; + } catch (JSONException e) { + activityTypeQuery = DEFAULT_ACTIVITY_TYPE_QUERY; + } + } + } else { + activityTypeQuery = DEFAULT_ACTIVITY_TYPE_QUERY; + } + } + log.debug("Activity type query: " + activityTypeQuery); + return activityTypeQuery; +} +%> \ No newline at end of file diff --git a/productMods/edit/forms/addServiceProviderRoleToPerson.jsp b/productMods/edit/forms/addServiceProviderRoleToPerson.jsp index c483a58f..ccab85c6 100644 --- a/productMods/edit/forms/addServiceProviderRoleToPerson.jsp +++ b/productMods/edit/forms/addServiceProviderRoleToPerson.jsp @@ -10,14 +10,14 @@ value='["", "Select one"], [ "http://vivoweb.org/ontology/core#Association", "Association" ], [ "http://vivoweb.org/ontology/core#Center", "Center" ], - [ "http://vivoweb.org/ontology/core#Clinical Organization", "Clinical Organization" ], + [ "http://vivoweb.org/ontology/core#ClinicalOrganization", "Clinical Organization" ], [ "http://vivoweb.org/ontology/core#College", "College" ], [ "http://vivoweb.org/ontology/core#Committee", "Committee" ], [ "http://vivoweb.org/ontology/core#Consortium", "Consortium" ], [ "http://vivoweb.org/ontology/core#Department", "Department" ], [ "http://vivoweb.org/ontology/core#Division", "Division" ], [ "http://purl.org/NET/c4dm/event.owl#Event", "Event" ], - [ "http://vivoweb.org/ontology/core#Extension Unit", "Extension Unit" ], + [ "http://vivoweb.org/ontology/core#ExtensionUnit", "Extension Unit" ], [ "http://vivoweb.org/ontology/core#Foundation", "Foundation" ], [ "http://vivoweb.org/ontology/core#FundingOrganization", "Funding Organization" ], [ "http://vivoweb.org/ontology/core#GovernmentAgency", "Government Agency" ], @@ -35,6 +35,6 @@ [ "http://vivoweb.org/ontology/core#Team", "Team" ], [ "http://vivoweb.org/ontology/core#School", "School" ], [ "http://vivoweb.org/ontology/core#Service","Service"], - [ "http://vivoweb.org/ontology/core#Student Organization", "Student Organization" ], + [ "http://vivoweb.org/ontology/core#StudentOrganization", "Student Organization" ], [ "http://vivoweb.org/ontology/core#University", "University" ]' /> \ No newline at end of file diff --git a/productMods/edit/forms/addTeacherRoleToPerson.jsp b/productMods/edit/forms/addTeacherRoleToPerson.jsp index adc333d1..75c1d7d7 100644 --- a/productMods/edit/forms/addTeacherRoleToPerson.jsp +++ b/productMods/edit/forms/addTeacherRoleToPerson.jsp @@ -6,5 +6,9 @@ - + \ No newline at end of file diff --git a/productMods/edit/forms/css/addAuthorsToInformationResource.css b/productMods/edit/forms/css/addAuthorsToInformationResource.css index e9c526d5..a8106be2 100644 --- a/productMods/edit/forms/css/addAuthorsToInformationResource.css +++ b/productMods/edit/forms/css/addAuthorsToInformationResource.css @@ -3,47 +3,43 @@ #authorships { margin-left: 0; } - #authorships li { list-style: none; margin-bottom: .75em; } - -/* Use class dd rather than jQuery UI's class ui-sortable, so that we can remove - * the class if there's fewer than one author. We don't want to remove the ui-sortable - * class, in case we want to re-enable DD without a page reload. - */ +/* Use class dd rather than jQuery UI's class ui-sortable, so that we can remove +the class if there's fewer than one author. We don't want to remove the ui-sortable +class, in case we want to re-enable DD without a page reload. */ #authorships.dd li { padding-left: 1em; background: url("../images/sortable_icon.png") no-repeat left center; cursor: move; } - #authorships .authorNameWrapper { display: inline-block; width: 15em; } - #showAddForm span.or { display: none; } - #showAddForm a.cancel { margin-left: 2em; } - form h3 { - margin-bottom: .5em; + margin-bottom: 0; + padding-bottom: 0; } - -form a:link.cancel, form a:visited.cancel, -#authorships a:link.remove, #authorships a:visited.remove, -#authorships a:link.undo, #authorships a:visited.undo, -#showAddForm a:link.cancel, #showAddForm a:visited.cancel { +form a:link.cancel, +form a:visited.cancel, +#authorships a:link.remove, +#authorships a:visited.remove, +#authorships a:link.undo, +#authorships a:visited.undo, +#showAddForm a:link.cancel, +#showAddForm a:visited.cancel { color: #f70; border-color: #f70; } - form a:hover.cancel, #authorships a:hover.remove, #authorships a:hover.undo, @@ -51,49 +47,38 @@ form a:hover.cancel, color: #fff; background: #f70; } - #authorships a.undo { margin-left: 1em; } - #content form p.inline { clear: left; margin-bottom: 0; padding-top: 1em; } - #content form p.inline input, #content form p.inline label { float: left; clear: none; } - #content form p.inline label { width: 13em; margin-top: 0; - } - #content form p.inline input { margin-bottom: 0; } - #content form p.inline span.hint { margin-left: .5em; } - #selectedAuthor { clear: left; } - #content form #selectedAuthor p.inline label { width: 10em; } - #content form p.submit { margin-top: 3em; } - /* Disabling undo links for the present. Add back later. */ /* a.undo { @@ -114,4 +99,4 @@ a.undo { /* These styles will need to be redone or removed to support a non-JS version of the form. */ form#addAuthorForm { display: none; -} +} \ No newline at end of file diff --git a/productMods/edit/forms/css/autocomplete.css b/productMods/edit/forms/css/autocomplete.css index 502d4590..40fa593d 100644 --- a/productMods/edit/forms/css/autocomplete.css +++ b/productMods/edit/forms/css/autocomplete.css @@ -1,31 +1,24 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -/* - * Styles for autocomplete and autocomplete selections using jQuery UI. This is separated out so that forms - * that don't load customFormWithAutocomplete.css still have access to these styles. - */ +/* Styles for autocomplete and autocomplete selections using jQuery UI. This is separated out so that forms +that don't load customFormWithAutocomplete.css still have access to these styles. */ .acSelection { display: none; margin-top: 2em; } - .acSelectionInfo { background-color: #d9d9d9; padding: .5em 1em; } - - ul.ui-autocomplete { font-size: .95em; } - li.ui-menu-item a.ui-corner-all { text-align: left; padding-left: .25em; } - .acSelectorWithHelpText{ - font-style: italic; - color: #555; + font-style: italic; + color: #555; } \ No newline at end of file diff --git a/productMods/edit/forms/css/customForm.css b/productMods/edit/forms/css/customForm.css index 3a3a4047..1a83a2aa 100644 --- a/productMods/edit/forms/css/customForm.css +++ b/productMods/edit/forms/css/customForm.css @@ -3,136 +3,99 @@ form.customForm div { clear: left; } - form.customForm h6 { font-size: 110%; } - form.customForm div.addNewLink { float: left; clear: none; margin-left: 5em; margin-top: .9em; width: 200px; - padding: 0.8em; + padding: .8em; border: 1px solid #9c9c9c; display: none; /* Hide if Javascript disabled. Javascript will show. */ } - form.customForm .existing span.requiredHint, form.customForm .new span.requiredHint { display: none; /* Hide if Javascript disabled. Javascript will show. */ } - form.customForm .existing { float: left; clear: none; } - .existingOrNew { font-style: italic; margin-left: 1em; } - .new { padding: .6em 0 .6em 1.5em; border: 1px solid #9c9c9c; width: 300px; } - - - form.customForm p.inline input, form.customForm p.inline label { float: left; clear: left; } - form.customForm p.inline.year input { margin-top: -1.75em; } - -/* -#form.customForm p.inline.year span.hint { - margin-right: 38.5em; - margin-top: -2.4em; -} -*/ - input, select, form.customForm p { - /*margin-bottom: 1em;*/ margin-top: 0; padding-top: 0; margin-bottom: 0; padding-bottom: 0; } - option { padding: 0 2px; } - form.customForm .hint { color: #9c9c9c; font-weight: normal; } - form.customForm .requiredHint { color: #c00; font-weight: normal; font-size: small; } - form.customForm #requiredLegend { font-style: italic; margin-top: .5em; } - form.customForm p.validationError { clear: both; margin-bottom: 1.8em; margin-top: 0; padding-top: 0; - padding-left: 0.4em; + padding-left: .4em; font-size: .8em; } - form.customForm a.close { float: right; margin-right: 1em; font-size: 90%; } - form.customForm a.close:link, form.customForm a.close:visited { - border-color: #FF7700; - color: #FF7700; + border-color: #ff7700; + color: #ff7700; } - form.customForm textarea { width: 30%; } - -/* fix bad alignment in IE 6 and 7 -.or, .cancel{ -vertical-align:top; -}*/ - -/* Message displayed for an unsupported browser. Hide on page load; JavaScript - * shows if needed. - */ +div.acSelection { + margin-bottom: 15px; +} #ie67DisableWrapper { display: none; } - -/********** -dateTime -**********/ -fieldset#dateTime { - margin-top: 0.5em; -} - -fieldset#dateTime label { +/* <------ DATE TIME*/ +fieldset.dateTime label { display: inline; +} +fieldset.dateTime select { + margin-top: 0; } \ No newline at end of file diff --git a/productMods/edit/forms/css/customFormWithAutocomplete.css b/productMods/edit/forms/css/customFormWithAutocomplete.css index 5e284c3a..aa5dc66c 100644 --- a/productMods/edit/forms/css/customFormWithAutocomplete.css +++ b/productMods/edit/forms/css/customFormWithAutocomplete.css @@ -10,30 +10,21 @@ #requiredLegend { display: none; } - form.customForm p.inline label { display: inline; clear: none; float: none; margin-right: 1em; } - .verifyMatch { margin-left: .5em; } - form.customForm h4 { margin-top: 1em; margin-bottom: .75em; } -.acSelector[disabled="disabled"] -{ -border-width:0px; -background:none; -color:#000; -} - -#typeSelector[disabled="disabled"] { -color:#000; -} - +.acSelector[disabled="disabled"]{ + border-width: 0; + background: none; + color: #000; +} \ No newline at end of file diff --git a/productMods/edit/forms/organizationHasPositionHistory.jsp b/productMods/edit/forms/organizationHasPositionHistory.jsp index 77e1cc8a..76bb3e00 100644 --- a/productMods/edit/forms/organizationHasPositionHistory.jsp +++ b/productMods/edit/forms/organizationHasPositionHistory.jsp @@ -250,6 +250,8 @@ } }
+ + <% EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); @@ -285,10 +287,10 @@ String submitLabel = ""; if (objectUri != null) { request.setAttribute("title","Edit position history entry for "+ subject.getName()); - submitLabel = "Save changes"; + submitLabel = "Save Changes"; } else { request.setAttribute("title","Create position history entry for " + subject.getName()); - submitLabel = "Create position history entry"; + submitLabel = "Create Position History"; } %> @@ -296,10 +298,10 @@

${title}

" > - - - - + + + +

diff --git a/productMods/edit/forms/personHasEducationalTraining.jsp b/productMods/edit/forms/personHasEducationalTraining.jsp index 33aa576c..37b5075c 100644 --- a/productMods/edit/forms/personHasEducationalTraining.jsp +++ b/productMods/edit/forms/personHasEducationalTraining.jsp @@ -52,8 +52,10 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision) <%@ page import="org.apache.commons.logging.LogFactory" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.JavaScript" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field"%> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.elements.DateTimeWithPrecision"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.elements.DateTimeWithPrecision"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %> @@ -68,6 +70,29 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision) request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString())); request.setAttribute("gYearDatatypeUriJson", MiscWebUtils.escape(XSD.gYear.toString())); + + /* + 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. + + 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. + + 4. Really bad node. multiple core:trainingAtOrganization statements. + */ + + EditMode mode = FrontEndEditingUtils.getEditMode(request, "http://vivoweb.org/ontology/core#trainingAtOrganization"); + + if( mode == EditMode.ADD ) { + %> <% + } else if(mode == EditMode.EDIT){ + %> <% + } else if(mode == EditMode.REPAIR){ + %> <% + } %> @@ -167,10 +192,14 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision) }
+<%-- Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another +type is returned and we don't get a match to the select element options. --%> + PREFIX rdfs: <${rdfs}> SELECT ?existingOrgType WHERE { ?edTraining <${trainingAtOrg}> ?existingOrg . ?existingOrg a ?existingOrgType . + ?existingOrgType rdfs:subClassOf <${orgClass}> . } @@ -435,25 +464,6 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision) editConfig.setSubmitToUrl("/edit/processRdfForm2.jsp"); String subjectName = ((Individual) request.getAttribute("subject")).getName(); -%> - - -<% - if (objectUri != null) { // editing existing entry -%> - - - - - -<% - } else { // adding new entry -%> - - - - -<% } List customJs = new ArrayList(Arrays.asList(JavaScript.JQUERY_UI.path(), JavaScript.CUSTOM_FORM_UTILS.path(), @@ -468,6 +478,25 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision) request.setAttribute("customCss", customCss); %> + + +<%-- Configure add vs. edit --%> + + + + + + + + + + + + + ${editMode == "repair" ? "" : "disabled" } + + + <%-- This goes to an experimental FM based form: @@ -478,6 +507,11 @@ This goes to an experimental FM based form: +<% if( mode == EditMode.ERROR ){ %> +
This form is unable to handle the editing of this position because it is associated with + multiple Position individuals.
+<% }else{ %> +

${titleVerb} education and training entry for <%= subjectName %>

" > @@ -493,6 +527,8 @@ This goes to an experimental FM based form:

+ <%-- Store these values in hidden fields, because the displayed fields are disabled and don't submit. This ensures that when + returning from a validation error, we retain the values. --%> @@ -525,4 +561,6 @@ var customFormData = { }; +<% } %> + diff --git a/productMods/edit/forms/personHasPositionHistory.jsp b/productMods/edit/forms/personHasPositionHistory.jsp index b39b9f82..ed9e22c7 100644 --- a/productMods/edit/forms/personHasPositionHistory.jsp +++ b/productMods/edit/forms/personHasPositionHistory.jsp @@ -19,10 +19,12 @@ <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.edit.elements.DateTimeWithPrecision"%> <%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.Field"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode"%> <%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.LogFactory" %> -<%@page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.DateTimeIntervalValidation"%> +<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.DateTimeIntervalValidation"%> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %> @@ -37,6 +39,29 @@ request.setAttribute("stringDatatypeUriJson", MiscWebUtils.escape(XSD.xstring.toString())); request.setAttribute("gYearDatatypeUriJson", MiscWebUtils.escape(XSD.gYear.toString())); + +/* + 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:personInOrganization stmt. + + 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:personInOrganization stmt. This should be similar to an add but the form should be expanded. + + 4. Really bad node. multiple core:personInOrganization statements. +*/ + + EditMode mode = FrontEndEditingUtils.getEditMode(request, "http://vivoweb.org/ontology/core#positionInOrganization"); + + if( mode == EditMode.ADD ) { + %> <% + } else if(mode == EditMode.EDIT){ + %> <% + } else if(mode == EditMode.REPAIR){ + %> <% + } %> @@ -127,11 +152,15 @@ } - +<%-- Limit type to subclasses of foaf:Organization. Otherwise, sometimes owl:Thing or another +type is returned and we don't get a match to the select element options. --%> + + PREFIX rdfs: <${rdfs}> SELECT ?existingOrgType WHERE { ?position <${positionInOrgPred}> ?existingOrg . ?existingOrg a ?existingOrgType . - } + ?existingOrgType rdfs:subClassOf <${orgClass}> . + } @@ -210,24 +239,19 @@ -<%-- Configure add vs. edit --%> -<% - - String objectUri = (String) request.getAttribute("objectUri"); - if (objectUri != null) { // editing existing entry -%> - - - - -<% - } else { // adding new entry -%> - +<%-- Configure add vs. edit --%> + + -<% } %> + + + + + ${editMode == "repair" ? "" : "disabled" } + + { @@ -356,7 +380,7 @@ <% - log.debug(request.getAttribute("editjson")); + //log.debug(request.getAttribute("editjson")); EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); if (editConfig == null) { @@ -375,6 +399,7 @@ Model model = (Model) application.getAttribute("jenaOntModel"); + String objectUri = (String) request.getAttribute("objectUri"); if (objectUri != null) { // editing existing editConfig.prepareForObjPropUpdate(model); } else { // adding new @@ -398,6 +423,11 @@ +<% if( mode == EditMode.ERROR ){ %> +
This form is unable to handle the editing of this position because it is associated with + multiple Position individuals.
+<% }else{ %> +

${titleVerb} position entry for <%= subjectName %>

" > @@ -441,8 +471,10 @@ var customFormData = { acUrl: '${acUrl}', editMode: '${editMode}', - submitButtonTextType: 'compound' + submitButtonTextType: 'compound', + defaultTypeName: 'organization' // used in repair mode, to generate button text and org name field label }; +<% } %> diff --git a/productMods/favicon.ico b/productMods/favicon.ico new file mode 100644 index 00000000..fe936708 Binary files /dev/null and b/productMods/favicon.ico differ diff --git a/productMods/images/visualization/co_author_icon.png b/productMods/images/visualization/co_author_icon.png index c3fe8672..464ca75c 100755 Binary files a/productMods/images/visualization/co_author_icon.png and b/productMods/images/visualization/co_author_icon.png differ diff --git a/productMods/images/visualization/co_investigator_icon.png b/productMods/images/visualization/co_investigator_icon.png index 10d2c6dc..edd74b25 100755 Binary files a/productMods/images/visualization/co_investigator_icon.png and b/productMods/images/visualization/co_investigator_icon.png differ diff --git a/productMods/images/visualization/coauthorship/EgoCentric.swf b/productMods/images/visualization/coauthorship/EgoCentric.swf index b13d9352..f9487cc9 100644 Binary files a/productMods/images/visualization/coauthorship/EgoCentric.swf and b/productMods/images/visualization/coauthorship/EgoCentric.swf differ diff --git a/productMods/images/visualization/collaboration/VIVO_COAUTHOR_PUBS_100x100.png b/productMods/images/visualization/collaboration/VIVO_COAUTHOR_PUBS_100x100.png new file mode 100644 index 00000000..37486305 Binary files /dev/null and b/productMods/images/visualization/collaboration/VIVO_COAUTHOR_PUBS_100x100.png differ diff --git a/productMods/images/visualization/collaboration/VIVO_COAUTHOR_PUBS_200x200.png b/productMods/images/visualization/collaboration/VIVO_COAUTHOR_PUBS_200x200.png new file mode 100644 index 00000000..58cad447 Binary files /dev/null and b/productMods/images/visualization/collaboration/VIVO_COAUTHOR_PUBS_200x200.png differ diff --git a/productMods/images/visualization/collaboration/VIVO_COPI_moneybag_100x100.png b/productMods/images/visualization/collaboration/VIVO_COPI_moneybag_100x100.png new file mode 100644 index 00000000..fbfc1e8c Binary files /dev/null and b/productMods/images/visualization/collaboration/VIVO_COPI_moneybag_100x100.png differ diff --git a/productMods/images/visualization/collaboration/VIVO_COPI_moneybag_200x200.png b/productMods/images/visualization/collaboration/VIVO_COPI_moneybag_200x200.png new file mode 100644 index 00000000..0eccd6db Binary files /dev/null and b/productMods/images/visualization/collaboration/VIVO_COPI_moneybag_200x200.png differ diff --git a/productMods/images/visualization/collaboration/co_author_icon_old.png b/productMods/images/visualization/collaboration/co_author_icon_old.png new file mode 100755 index 00000000..c3fe8672 Binary files /dev/null and b/productMods/images/visualization/collaboration/co_author_icon_old.png differ diff --git a/productMods/images/visualization/collaboration/co_investigator_icon_old.png b/productMods/images/visualization/collaboration/co_investigator_icon_old.png new file mode 100755 index 00000000..10d2c6dc Binary files /dev/null and b/productMods/images/visualization/collaboration/co_investigator_icon_old.png differ diff --git a/productMods/images/visualization/collaboration/vivo_money_36x36.png b/productMods/images/visualization/collaboration/vivo_money_36x36.png new file mode 100644 index 00000000..edd74b25 Binary files /dev/null and b/productMods/images/visualization/collaboration/vivo_money_36x36.png differ diff --git a/productMods/images/visualization/collaboration/vivo_pubs_36x36.png b/productMods/images/visualization/collaboration/vivo_pubs_36x36.png new file mode 100644 index 00000000..464ca75c Binary files /dev/null and b/productMods/images/visualization/collaboration/vivo_pubs_36x36.png differ diff --git a/productMods/js/individual/individualUtils.js b/productMods/js/individual/individualUtils.js new file mode 100644 index 00000000..04d2ffae --- /dev/null +++ b/productMods/js/individual/individualUtils.js @@ -0,0 +1,8 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +$(document).ready(function(){ + + // "more"/"less" HTML truncator for showing more or less content in data property core:overview + $('.overview-value').truncate({max_length: 500}); + +}); \ No newline at end of file diff --git a/productMods/js/jquery_plugins/jquery.truncator.js b/productMods/js/jquery_plugins/jquery.truncator.js new file mode 100644 index 00000000..5861d1dd --- /dev/null +++ b/productMods/js/jquery_plugins/jquery.truncator.js @@ -0,0 +1,98 @@ +// HTML Truncator for jQuery +// by Henrik Nyh 2008-02-28. +// Free to modify and redistribute with credit. + +(function($) { + + var trailing_whitespace = true; + + $.fn.truncate = function(options) { + + var opts = $.extend({}, $.fn.truncate.defaults, options); + + $(this).each(function() { + + var content_length = $.trim(squeeze($(this).text())).length; + if (content_length <= opts.max_length) + return; // bail early if not overlong + + var actual_max_length = opts.max_length - opts.more.length - 3; // 3 for " ()" + var truncated_node = recursivelyTruncate(this, actual_max_length); + var full_node = $(this).hide(); + + truncated_node.insertAfter(full_node); + + findNodeForMore(truncated_node).append(' (... '+opts.more+')'); + findNodeForLess(full_node).append(' ('+opts.less+')'); + + truncated_node.find('a:last').click(function() { + truncated_node.hide(); full_node.show(); return false; + }); + full_node.find('a:last').click(function() { + truncated_node.show(); full_node.hide(); return false; + }); + + }); + } + + // Note that the " (…more)" bit counts towards the max length – so a max + // length of 10 would truncate "1234567890" to "12 (…more)". + $.fn.truncate.defaults = { + max_length: 100, + more: 'more', + less: 'less' + }; + + function recursivelyTruncate(node, max_length) { + return (node.nodeType == 3) ? truncateText(node, max_length) : truncateNode(node, max_length); + } + + function truncateNode(node, max_length) { + var node = $(node); + var new_node = node.clone().empty(); + var truncatedChild; + node.contents().each(function() { + var remaining_length = max_length - new_node.text().length; + if (remaining_length == 0) return; // breaks the loop + truncatedChild = recursivelyTruncate(this, remaining_length); + if (truncatedChild) new_node.append(truncatedChild); + }); + return new_node; + } + + function truncateText(node, max_length) { + var text = squeeze(node.data); + if (trailing_whitespace) // remove initial whitespace if last text + text = text.replace(/^ /, ''); // node had trailing whitespace. + trailing_whitespace = !!text.match(/ $/); + var text = text.slice(0, max_length); + // Ensure HTML entities are encoded + // http://debuggable.com/posts/encode-html-entities-with-jquery:480f4dd6-13cc-4ce9-8071-4710cbdd56cb + text = $('
').text(text).html(); + return text; + } + + // Collapses a sequence of whitespace into a single space. + function squeeze(string) { + return string.replace(/\s+/g, ' '); + } + + // Finds the last, innermost block-level element + function findNodeForMore(node) { + var $node = $(node); + var last_child = $node.children(":last"); + if (!last_child) return node; + var display = last_child.css('display'); + if (!display || display=='inline') return $node; + return findNodeForMore(last_child); + }; + + // Finds the last child if it's a p; otherwise the parent + function findNodeForLess(node) { + var $node = $(node); + var last_child = $node.children(":last"); + if (last_child && last_child.is('p')) return last_child; + return node; + }; + +})(jQuery); diff --git a/productMods/js/menupage/browseByVClassPeople.js b/productMods/js/menupage/browseByVClassPeople.js index 6289fa33..c6e90f59 100644 --- a/productMods/js/menupage/browseByVClassPeople.js +++ b/productMods/js/menupage/browseByVClassPeople.js @@ -6,59 +6,97 @@ var getPersonIndividuals = browseByVClass.getIndividuals; // Assigning the proxy function -browseByVClass.getIndividuals = function(vclassUri, alpha) { - // alert("This is the mothership!"); +browseByVClass.getIndividuals = function(vclassUri, alpha, page, scroll) { url = this.dataServiceUrl + encodeURIComponent(vclassUri); if ( alpha && alpha != "all") { url = url + '&alpha=' + alpha; } + if ( page ) { + url += '&page=' + page; + } else { + page = 1; + } + if ( typeof scroll === "undefined" ) { + scroll = true; + } - // First wipe currently displayed individuals - this.individualsInVClass.empty(); + // Scroll to #menupage-intro page unless told otherwise + if ( scroll != false ) { + // only scroll back up if we're past the top of the #browse-by section + scrollPosition = browseByVClass.getPageScroll(); + browseByOffset = $('#browse-by').offset(); + if ( scrollPosition[1] > browseByOffset.top) { + $.scrollTo('#menupage-intro', 500); + } + } $.getJSON(url, function(results) { - $.each(results.individuals, function(i, item) { - label = results.individuals[i].label; - firstName = results.individuals[i].firstName; - lastName = results.individuals[i].lastName; - if ( firstName && lastName ) { - fullName = firstName + ' ' + lastName; - } else { - fullName = label; + individualList = ""; + + // Catch exceptions when empty individuals result set is returned + // This is very likely to happen now since we don't have individual counts for each letter and always allow the result set to be filtered by any letter + if ( results.individuals.length == 0 ) { + browseByVClass.emptyResultSet(results.vclass, alpha) + } else { + $.each(results.individuals, function(i, item) { + label = results.individuals[i].label; + firstName = results.individuals[i].firstName; + lastName = results.individuals[i].lastName; + if ( firstName && lastName ) { + fullName = firstName + ' ' + lastName; + } else { + fullName = label; + } + moniker = results.individuals[i].moniker; + vclassName = results.individuals[i].vclassName; + if ( results.individuals[i].preferredTitle == "") { + // Use the moniker only if it's not empty and not equal to the VClass name + if ( moniker != vclassName && moniker != "" ) { + preferredTitle = moniker; + } else { + preferredTitle = ""; + } + } else { + preferredTitle = results.individuals[i].preferredTitle; + } + uri = results.individuals[i].URI; + profileUrl = results.individuals[i].profileUrl; + if ( !results.individuals[i].thumbUrl ) { + image = browseByVClass.baseUrl + '/images/placeholders/person.thumbnail.jpg'; + } else { + image = browseByVClass.baseUrl + results.individuals[i].thumbUrl; + } + // Build the content of each list item, piecing together each component + listItem = '
  • '; + listItem += ''+ fullName +''; + listItem += '

    '+ fullName +'

    '; + // Include the calculated preferred title (see above) only if it's not empty + if ( preferredTitle != "" ) { + listItem += ''+ preferredTitle +''; + } + listItem += '
  • '; + // browseByVClass.individualsInVClass.append(listItem); + individualList += listItem; + }) + + // Remove existing content + browseByVClass.wipeSlate(); + + // And then add the new content + browseByVClass.individualsInVClass.append(individualList); + + // Check to see if we're dealing with pagination + if ( results.pages.length ) { + pages = results.pages; + browseByVClass.pagination(pages, page); } - moniker = results.individuals[i].moniker; - vclassName = results.individuals[i].vclassName; - if ( results.individuals[i].preferredTitle == "") { - // Use the moniker only if it's not empty and not equal to the VClass name - if ( moniker != vclassName && moniker != "" ) { - preferredTitle = moniker; - } else { - preferredTitle = ""; - } - } else { - preferredTitle = results.individuals[i].preferredTitle; - } - // preferredTitle = results.individuals[i].preferredTitle; - uri = results.individuals[i].URI; - profileUrl = results.individuals[i].profileUrl; - if ( !results.individuals[i].thumbUrl ) { - image = browseByVClass.baseUrl + '/images/placeholders/person.thumbnail.jpg'; - } else { - image = browseByVClass.baseUrl + results.individuals[i].thumbUrl; - } - // Build the content of each list item, piecing together each component - listItem = '
  • '; - listItem += ''+ fullName +''; - listItem += '

    '+ fullName +'

    '; - // Include the calculated preferred title (see above) only if it's not empty - if ( preferredTitle != "" ) { - listItem += '

    '+ preferredTitle +'

    '; - } - listItem += '
  • '; - browseByVClass.individualsInVClass.append(listItem); - }) - // set selected class and alpha - browseByVClass.selectedVClass(results.vclass.URI); - browseByVClass.selectedAlpha(alpha); + + selectedClassHeading = '

    '+ results.vclass.name +'

    '; + browseByVClass.individualsContainer.prepend(selectedClassHeading); + + // set selected class, alpha and page + browseByVClass.selectedVClass(results.vclass.URI); + browseByVClass.selectedAlpha(alpha); + } }); }; \ No newline at end of file diff --git a/productMods/js/menupage/visualizationLink.js b/productMods/js/menupage/visualizationLink.js deleted file mode 100644 index b3744ff0..00000000 --- a/productMods/js/menupage/visualizationLink.js +++ /dev/null @@ -1,48 +0,0 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - -// NC: I've discussed this with Chintan and my hope is to have the temporal graph vis -// load the top level org by default (when the uri parameter is not included), therefore -// rendering this entire file unnecessary and obsolete. -var visualizationLink = { - // Initial page setup - onLoad: function() { - this.mergeFromTemplate(); - this.initObjects(); - }, - - // Add variables from menupage template - mergeFromTemplate: function() { - $.extend(this, menupageData); - }, - - // Create references to frequently used elements for convenience - initObjects: function() { - this.visLink = $('.visualization-menupage-link'); - }, - - // Temporarily hide the link while we determine the href value via AJAX - hideLink: function() { - this.visLink.addClass('hidden'); - }, - - // Determine the URL parameters for temporal graph of top level org - getURL: function() { - $.ajax({ - url: this.baseUrl + "/visualizationAjax", - data: ({vis: "utilities", vis_mode: "HIGHEST_LEVEL_ORGANIZATION"}), - dataType: "text", - success:function(data){ - if (data != null && data != "") { - visualizationLink.visLink.attr("href", data); - visualizationLink.visLink.removeClass('hidden'); - } - } - }); - } -}; - -$(document).ready(function() { - visualizationLink.onLoad(); - visualizationLink.hideLink(); - visualizationLink.getURL(); -}); \ No newline at end of file diff --git a/productMods/js/visualization/coPIship/coPIship-person-level.js b/productMods/js/visualization/coPIship/coPIship-person-level.js index 29f29ef4..b0cb2a3c 100644 --- a/productMods/js/visualization/coPIship/coPIship-person-level.js +++ b/productMods/js/visualization/coPIship/coPIship-person-level.js @@ -40,7 +40,7 @@ function renderStatsOnNodeClicked(json){ */ if(obj.url){ - if (obj.url == egoURI) { + if (obj.url === unEncodedEgoURI) { $("#investigatorName").addClass('investigator_name').removeClass('neutral_investigator_name'); $('#num_works > .investigator_stats_text').text(works); diff --git a/productMods/js/visualization/coauthorship/coauthorship-personlevel.js b/productMods/js/visualization/coauthorship/coauthorship-personlevel.js index 958873c2..d56700a9 100644 --- a/productMods/js/visualization/coauthorship/coauthorship-personlevel.js +++ b/productMods/js/visualization/coauthorship/coauthorship-personlevel.js @@ -38,7 +38,7 @@ function renderStatsOnNodeClicked(json){ */ if(obj.url){ - if (obj.url == egoURI) { + if (obj.url === unEncodedEgoURI) { $("#authorName").addClass('author_name').removeClass('neutral_author_name'); $('#num_works > .author_stats_text').text(works); diff --git a/productMods/js/visualization/entitycomparison/constants.js b/productMods/js/visualization/entitycomparison/constants.js index bf1cd930..725efd94 100644 --- a/productMods/js/visualization/entitycomparison/constants.js +++ b/productMods/js/visualization/entitycomparison/constants.js @@ -10,6 +10,7 @@ var LIGHT_RED = "#FB8072"; var DARK_RED = "#520000"; var SKY_BLUE = "#80B1D3"; var DARK_BLUE = "#80B1D3"; +var NAVY_BLUE = "#003366"; var LIGHT_BLUE = "#3399FF"; var ORANGE = "#FDB462"; var DARK_ORANGE = "#FF9900"; @@ -21,63 +22,83 @@ var LIGHT_GREY = "#D9D9D9"; var PURPLE = "#BC80BD"; var DARK_PURPLE = "#6600CC"; var PINK_PURPLE = "#CC00CC"; +var HOT_PINK = "#FF00B4"; +var MEHENDI_GREEN = "#7A7900"; -var colorConstantQueue = [ DARK_BLUE, DARK_TURQUOISE, - LIGHT_BLUE, DARK_GREEN, - VIBRANT_GREEN, DARK_PURPLE, - PINK_PURPLE, DARK_ORANGE, - DARK_RED, RED ]; +var colorConstantQueue = [ LIGHT_BLUE, DARK_ORANGE, VIBRANT_GREEN, + NAVY_BLUE, RED, PINK_PURPLE, + DARK_TURQUOISE, MEHENDI_GREEN, HOT_PINK, + DARK_RED ]; -var freeColors = colorConstantQueue.slice(); +var freeColors; -var year = { - min: 1998, - max: 2018, - globalMin: 1995, - globalMax: 2025 -}; +var globalDateObject; -var colors = {}; -var prevColor = {}; -var colorToAssign, colorToRemove; -var renderedObjects = []; -var labelToEntityRecord = {}; -var setOfLabels = []; -var labelToCheckedEntities = {}; -var stopWordsToCount = {}; +var year; + +var colors, prevColor, colorToAssign, + colorToRemove, renderedObjects, labelToEntityRecord, + setOfLabels, labelToCheckedEntities, stopWordsToCount; var graphContainer; var tableDiv; var entityLevel; //options for Flot -var FlotOptions = { - legend : { - show : false - }, - lines : { - show : true - }, - points : { - show : false - }, - xaxis : { - tickDecimals : 0, - tickSize : 10 - }, - series : { - lines : { - lineWidth : 7 - } - }, - yaxis : { - tickSize : 1, - tickDecimals : 0, - min : 0 - }, - grid : { - borderColor : "#D9D9D9" - } -}; +var FlotOptions; -FlotOptions.colors = colorConstantQueue; \ No newline at end of file +function initConstants() { + + freeColors = colorConstantQueue.slice(); + + globalDateObject = new Date(); + + year = { + min: globalDateObject.getFullYear() - 9, + max: globalDateObject.getFullYear(), + globalMin: globalDateObject.getFullYear() - 9, + globalMax: globalDateObject.getFullYear() + }; + + colors = {}; + prevColor = {}; + colorToAssign, colorToRemove; + renderedObjects = []; + labelToEntityRecord = {}; + setOfLabels = []; + labelToCheckedEntities = {}; + stopWordsToCount = {}; + + //options for Flot + FlotOptions = { + legend : { + show : false + }, + lines : { + show : true + }, + points : { + show : false + }, + xaxis : { + tickDecimals : 0, + tickSize : 10 + }, + series : { + lines : { + lineWidth : 7 + } + }, + yaxis : { + tickSize : 1, + tickDecimals : 0, + min : 0 + }, + grid : { + borderColor : "#D9D9D9" + } + }; + + FlotOptions.colors = colorConstantQueue; + +} \ No newline at end of file diff --git a/productMods/js/visualization/entitycomparison/gui-event-manager.js b/productMods/js/visualization/entitycomparison/gui-event-manager.js new file mode 100644 index 00000000..938b41e1 --- /dev/null +++ b/productMods/js/visualization/entitycomparison/gui-event-manager.js @@ -0,0 +1,220 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +$(document).ready(function() { + + /* + * This will set intitial values of the constants present in constants.js + * */ + initConstants(); + + /* This is used to cache the current state whether the user is allowed to select more entities from + the datatable or not. Once Max number of entity selection is reached the user can no longer select + more & this variable will be set to false. */ + $("#datatable").data("isEntitySelectionAllowed", true); + + $("#organizationLabel").text(organizationLabel).css("color", "#2485ae"); + $("#organizationMoniker").text(organizationLabel); + $("#organizationMoniker").attr("href", organizationVIVOProfileURL); + + $notificationContainer = $("#notification-container").notify(); + + graphContainer = $("#graphContainer"); + tableDiv = $('#paginatedTable'); + + //click event handler for clear button + $("a.clear-selected-entities").click(function(){ + clearRenderedObjects(); + }); + + /* + * When the intra-entity parameters are clicked, + * update the status accordingly. + */ + + $("select.comparisonValues").change(function(){ + + var selectedValue = $("select.comparisonValues option:selected").val(); + + var selectedParameter; + + $.each(COMPARISON_PARAMETERS_INFO, function(index, parameter) { + + if (parameter.value === selectedValue) { + selectedParameter = parameter; + window.location = parameter.viewLink; + } + + }); + + //$("#body").empty().html("
    Loading " + selectedValue + "  
    "); + + /* + * This piece of code is not executed at all because the redirect happens before there is a chance + * to render the below contents. + * */ + + /* + + $("#comparisonParameter").text("Total Number of " + selectedValue); + $('#yaxislabel').html("Number of " + selectedValue).mbFlipText(false); + $('#yaxislabel').css("color", "#595B5B"); + $('#comparisonHeader').html(selectedValue).css('font-weight', 'bold'); + + + */ + + }); + + $("input[type=checkbox].easyDeselectCheckbox").live('click', function(){ + + var checkbox = $(this); + var checkboxValue = $(this).attr("value"); + var linkedCheckbox = labelToCheckedEntities[checkboxValue]; + var entityToBeRemoved = labelToEntityRecord[checkboxValue]; + + if(!checkbox.is(':checked')){ + //console.log("Easy deselect checkbox is unclicked!"); + updateRowHighlighter(linkedCheckbox); + removeUsedColor(entityToBeRemoved); + removeEntityUnChecked(renderedObjects, entityToBeRemoved); + removeLegendRow(linkedCheckbox); + removeCheckBoxFromGlobalSet(linkedCheckbox); + $(linkedCheckbox).attr('checked', false); + checkIfColorLimitIsReached(); + displayLineGraphs(); + updateCounter(); + } + }); + + function performEntityCheckboxUnselectedActions(entity, checkboxValue, checkbox) { + + removeUsedColor(entity); + removeEntityUnChecked(renderedObjects, entity); + removeLegendRow(checkbox); + removeCheckBoxFromGlobalSet(checkbox); + + checkbox.closest("tr").removeClass('datatablerowhighlight'); + + } + + function performEntityCheckboxSelectedActions(entity, checkboxValue, checkbox) { + + getNextFreeColor(entity); + + //Generate the bar, checkbox and label for the legend. + createLegendRow(entity, $("#bottom")); + + renderLineGraph(renderedObjects, entity); + labelToCheckedEntities[checkboxValue] = checkbox; + labelToCheckedEntities[checkboxValue].entity = entity; + +// console.log(labelToCheckedEntities[checkboxValue], entity); + + /* + * To highlight the rows belonging to selected entities. + * */ + checkbox.closest("tr").addClass('datatablerowhighlight'); + + } + + function performEntityCheckboxClickedRedrawActions() { + + setTickSizeOfAxes(); + checkIfColorLimitIsReached(); + displayLineGraphs(); + updateCounter(); + + } + + /* + * function to populate the labelToEntityRecord object with the + * values from the json file and + * dynamically generate checkboxes + */ + function loadData(jsonData) { + + $.each(jsonData, function (index, val) { + setOfLabels.push(val.label); + labelToEntityRecord[val.label] = val; + }); + + prepareTableForDataTablePagination(jsonData); + setEntityLevel(getEntityVisMode(jsonData)); + + $(".disabled-checkbox-event-receiver").live("click", function () { + + if ($(this).next().is(':disabled')) { + + createNotification("warning-notification", { + title: 'Error', + text: 'A Maximum 10 entities can be compared. Please remove some & try again.' + }, { + custom: true, + expires: false + }); + + } + + }); + + /* + * When the elements in the paginated div + * are clicked this event handler is called + */ + $("input." + entityCheckboxSelectorDOMClass).live('click', function () { + + var checkbox = $(this); + var checkboxValue = $(this).attr("value"); + var entity = labelToEntityRecord[checkboxValue]; + + if (checkbox.is(':checked')) { + + performEntityCheckboxSelectedActions(entity, checkboxValue, checkbox); + + } else { + + performEntityCheckboxUnselectedActions(entity, checkboxValue, checkbox); + + } + + performEntityCheckboxClickedRedrawActions(); + + }); + } + + function initiateTemporalGraphRenderProcess(givenGraphContainer, jsonData) { + + /* + * initial display of the grid when the page loads + * */ + init(givenGraphContainer); + + /* + * render the temporal graph per the sent content. + * */ + loadData(jQuery.parseJSON(jsonData)); + + /* + * This will make sure that top 3 entities are selected by default when the page loads. + */ + $.each($("input." + entityCheckboxSelectorDOMClass), function(index, checkbox) { + + if (index > 2) { + return false; + } + + $(this).attr('checked', true); + + var checkboxValue = $(this).attr("value"); + var entity = labelToEntityRecord[checkboxValue]; + + performEntityCheckboxSelectedActions(entity, checkboxValue, $(this)); + + performEntityCheckboxClickedRedrawActions(); + + }); + + } + + initiateTemporalGraphRenderProcess(graphContainer, jsonString); +}); \ No newline at end of file diff --git a/productMods/js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css b/productMods/js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css index fea3c9e8..88fa30a2 100644 --- a/productMods/js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css +++ b/productMods/js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css @@ -1,25 +1,36 @@ @CHARSET "UTF-8"; .filterInfo { - /*font-size: 0.9em;*/ - display: inline-block; + float:left; + margin-top: 15px; +} + +.filterInfo div { + font-weight: bold; } .paginate_button { - text-decoration: underline; + /*text-decoration: underline;*/ } .paginatedtabs { /* border-top: 1px #3D454E solid; text-align: center;*/ margin-bottom: 10px; - padding-top: 10px; font-size: 0.9em; + /*display: inline-block;*/ + float:right; + margin-top: 15px; } .paginatedtabs span { padding-right: 5px; cursor: pointer; + color: #2485AE; +} + +.paginate-nav-text { + text-decoration: underline; } .datatablewrapper td, th { @@ -41,11 +52,17 @@ text-align: left; } +.table-separator { + clear: both; +} + .datatablewrapper th { border-top: 1px #3D454E solid; background:#F1F2ee; font-weight:bold; font-size:12px; + padding-bottom: 3px; + padding-top: 3px; } #infoContainer { diff --git a/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.js b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.js new file mode 100644 index 00000000..c40d6f70 --- /dev/null +++ b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.js @@ -0,0 +1,1427 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Filling very large shapes (above 5000 points) is buggy. +// * Optimize. There is always room for speed improvements. + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + +(function() { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function() { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespacesAndStylesheet(doc) { + // create xmlns + if (!doc.namespaces['g_vml_']) { + doc.namespaces.add('g_vml_', 'urn:schemas-microsoft-com:vml', + '#default#VML'); + + } + if (!doc.namespaces['g_o_']) { + doc.namespaces.add('g_o_', 'urn:schemas-microsoft-com:office:office', + '#default#VML'); + } + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function(opt_doc) { + if (/MSIE/.test(navigator.userAgent) && !window.opera) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + } + }, + + init_: function(doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function(el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.arcScaleX_ = o1.arcScaleX_; + o2.arcScaleY_ = o1.arcScaleY_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length == 4 && styleString.substr(3, 1) == 'a') { + alpha = Number(parts[3]); + } else { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts){ + var r, g, b; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + function processStyle(styleString) { + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = Number(parts[i]); + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return {color: str, alpha: alpha}; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 10, + family: 'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + try { + style.font = styleString; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: style.fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if(style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + computedStyle.size *= 0.981; + + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + style.size + 'px ' + style.family; + } + + function processLineCap(lineCap) { + switch (lineCap) { + case 'butt': + return 'flat'; + case 'round': + return 'round'; + case 'square': + default: + return 'square'; + } + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} surfaceElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(surfaceElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + this.font = '10px sans-serif'; + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = surfaceElement; + + var el = surfaceElement.ownerDocument.createElement('div'); + el.style.width = surfaceElement.clientWidth + 'px'; + el.style.height = surfaceElement.clientHeight + 'px'; + el.style.overflow = 'hidden'; + el.style.position = 'absolute'; + surfaceElement.appendChild(el); + + this.element_ = el; + this.arcScaleX_ = 1; + this.arcScaleY_ = 1; + this.lineScale_ = 1; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function() { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.beginPath = function() { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function(aX, aY) { + var p = this.getCoords_(aX, aY); + this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y}); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function(aX, aY) { + var p = this.getCoords_(aX, aY); + this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y}); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = this.getCoords_(aX, aY); + var cp1 = this.getCoords_(aCP1x, aCP1y); + var cp2 = this.getCoords_(aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = this.getCoords_(aCPx, aCPy); + var p = this.getCoords_(aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function(aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = this.getCoords_(aX, aY); + var pStart = this.getCoords_(xStart, yStart); + var pEnd = this.getCoords_(xEnd, yEnd); + + this.currentPath_.push({type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y}); + + }; + + contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + + contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + + contextPrototype.drawImage = function(image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + + var d = this.getCoords_(dx, dy); + + var w2 = sw / 2; + var h2 = sh / 2; + + var vmlStr = []; + + var W = 10; + var H = 10; + + // For some reason that I've now forgotten, using divs didn't work + vmlStr.push(' ' , + '', + ''); + + this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + }; + + contextPrototype.stroke = function(aFill) { + var W = 10; + var H = 10; + // Divide the shape into chunks if it's too long because IE has a limit + // somewhere for how long a VML shape can be. This simple division does + // not work with fills, only strokes, unfortunately. + var chunkSize = 5000; + + var min = {x: null, y: null}; + var max = {x: null, y: null}; + + for (var j = 0; j < this.currentPath_.length; j += chunkSize) { + var lineStr = []; + var lineOpen = false; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + } + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push( + '' + ); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.arcScaleX_; + var arcScaleY = ctx.arcScaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = {x: 0, y: 0}; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = ctx.getCoords_(x0, y0); + var p1 = ctx.getCoords_(x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = ctx.getCoords_(fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function(cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + // When colors attribute is used, the meanings of opacity and o:opacity2 + // are reversed. + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + + contextPrototype.fill = function() { + this.stroke(true); + }; + + contextPrototype.closePath = function() { + this.currentPath_.push({type: 'close'}); + }; + + /** + * @private + */ + contextPrototype.getCoords_ = function(aX, aY) { + var m = this.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + contextPrototype.save = function() { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function() { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + contextPrototype.translate = function(aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function(aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.scale = function(aX, aY) { + this.arcScaleX_ *= aX; + this.arcScaleY_ *= aY; + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + var m = this.m_, + delta = 1000, + left = 0, + right = delta, + offset = {x: 0, y: 0}, + lineStr = []; + + var fontStyle = getComputedStyle(processFontStyle(this.font), + this.element_); + + var fontStyleString = buildStyle(fontStyle); + + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + switch(textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + + var d = this.getCoords_(x + offset.x, y + offset.y); + + lineStr.push(''); + + if (stroke) { + appendStroke(this, lineStr); + } else { + // TODO: Fix the min and max params. + appendFill(this, lineStr, {x: -left, y: 0}, + {x: right, y: fontStyle.size}); + } + + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + lineStr.push('', + '', + ''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + contextPrototype.fillText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function(text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return {width: this.textMeasureEl_.offsetWidth}; + }; + + /******** STUBS ********/ + contextPrototype.clip = function() { + // TODO: Implement + }; + + contextPrototype.arcTo = function() { + // TODO: Implement + }; + + contextPrototype.createPattern = function(image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({offset: aOffset, + color: aColor.color, + alpha: aColor.alpha}); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s +': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; +})(); + +} // if diff --git a/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.min.js b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.min.js new file mode 100644 index 00000000..12c74f7b --- /dev/null +++ b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.min.js @@ -0,0 +1 @@ +if(!document.createElement("canvas").getContext){(function(){var z=Math;var K=z.round;var J=z.sin;var U=z.cos;var b=z.abs;var k=z.sqrt;var D=10;var F=D/2;function T(){return this.context_||(this.context_=new W(this))}var O=Array.prototype.slice;function G(i,j,m){var Z=O.call(arguments,2);return function(){return i.apply(j,Z.concat(O.call(arguments)))}}function AD(Z){return String(Z).replace(/&/g,"&").replace(/"/g,""")}function r(i){if(!i.namespaces.g_vml_){i.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!i.namespaces.g_o_){i.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!i.styleSheets.ex_canvas_){var Z=i.createStyleSheet();Z.owningElement.id="ex_canvas_";Z.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}r(document);var E={init:function(Z){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var i=Z||document;i.createElement("canvas");i.attachEvent("onreadystatechange",G(this.init_,this,i))}},init_:function(m){var j=m.getElementsByTagName("canvas");for(var Z=0;Z1){j--}if(6*j<1){return i+(Z-i)*6*j}else{if(2*j<1){return Z}else{if(3*j<2){return i+(Z-i)*(2/3-j)*6}else{return i}}}}function Y(Z){var AE,p=1;Z=String(Z);if(Z.charAt(0)=="#"){AE=Z}else{if(/^rgb/.test(Z)){var m=g(Z);var AE="#",AF;for(var j=0;j<3;j++){if(m[j].indexOf("%")!=-1){AF=Math.floor(C(m[j])*255)}else{AF=Number(m[j])}AE+=I[N(AF,0,255)]}p=m[3]}else{if(/^hsl/.test(Z)){var m=g(Z);AE=c(m);p=m[3]}else{AE=B[Z]||Z}}}return{color:AE,alpha:p}}var L={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var f={};function X(Z){if(f[Z]){return f[Z]}var m=document.createElement("div");var j=m.style;try{j.font=Z}catch(i){}return f[Z]={style:j.fontStyle||L.style,variant:j.fontVariant||L.variant,weight:j.fontWeight||L.weight,size:j.fontSize||L.size,family:j.fontFamily||L.family}}function P(j,i){var Z={};for(var AF in j){Z[AF]=j[AF]}var AE=parseFloat(i.currentStyle.fontSize),m=parseFloat(j.size);if(typeof j.size=="number"){Z.size=j.size}else{if(j.size.indexOf("px")!=-1){Z.size=m}else{if(j.size.indexOf("em")!=-1){Z.size=AE*m}else{if(j.size.indexOf("%")!=-1){Z.size=(AE/100)*m}else{if(j.size.indexOf("pt")!=-1){Z.size=m/0.75}else{Z.size=AE}}}}}Z.size*=0.981;return Z}function AA(Z){return Z.style+" "+Z.variant+" "+Z.weight+" "+Z.size+"px "+Z.family}function t(Z){switch(Z){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function W(i){this.m_=V();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=D*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var Z=i.ownerDocument.createElement("div");Z.style.width=i.clientWidth+"px";Z.style.height=i.clientHeight+"px";Z.style.overflow="hidden";Z.style.position="absolute";i.appendChild(Z);this.element_=Z;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var M=W.prototype;M.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};M.beginPath=function(){this.currentPath_=[]};M.moveTo=function(i,Z){var j=this.getCoords_(i,Z);this.currentPath_.push({type:"moveTo",x:j.x,y:j.y});this.currentX_=j.x;this.currentY_=j.y};M.lineTo=function(i,Z){var j=this.getCoords_(i,Z);this.currentPath_.push({type:"lineTo",x:j.x,y:j.y});this.currentX_=j.x;this.currentY_=j.y};M.bezierCurveTo=function(j,i,AI,AH,AG,AE){var Z=this.getCoords_(AG,AE);var AF=this.getCoords_(j,i);var m=this.getCoords_(AI,AH);e(this,AF,m,Z)};function e(Z,m,j,i){Z.currentPath_.push({type:"bezierCurveTo",cp1x:m.x,cp1y:m.y,cp2x:j.x,cp2y:j.y,x:i.x,y:i.y});Z.currentX_=i.x;Z.currentY_=i.y}M.quadraticCurveTo=function(AG,j,i,Z){var AF=this.getCoords_(AG,j);var AE=this.getCoords_(i,Z);var AH={x:this.currentX_+2/3*(AF.x-this.currentX_),y:this.currentY_+2/3*(AF.y-this.currentY_)};var m={x:AH.x+(AE.x-this.currentX_)/3,y:AH.y+(AE.y-this.currentY_)/3};e(this,AH,m,AE)};M.arc=function(AJ,AH,AI,AE,i,j){AI*=D;var AN=j?"at":"wa";var AK=AJ+U(AE)*AI-F;var AM=AH+J(AE)*AI-F;var Z=AJ+U(i)*AI-F;var AL=AH+J(i)*AI-F;if(AK==Z&&!j){AK+=0.125}var m=this.getCoords_(AJ,AH);var AG=this.getCoords_(AK,AM);var AF=this.getCoords_(Z,AL);this.currentPath_.push({type:AN,x:m.x,y:m.y,radius:AI,xStart:AG.x,yStart:AG.y,xEnd:AF.x,yEnd:AF.y})};M.rect=function(j,i,Z,m){this.moveTo(j,i);this.lineTo(j+Z,i);this.lineTo(j+Z,i+m);this.lineTo(j,i+m);this.closePath()};M.strokeRect=function(j,i,Z,m){var p=this.currentPath_;this.beginPath();this.moveTo(j,i);this.lineTo(j+Z,i);this.lineTo(j+Z,i+m);this.lineTo(j,i+m);this.closePath();this.stroke();this.currentPath_=p};M.fillRect=function(j,i,Z,m){var p=this.currentPath_;this.beginPath();this.moveTo(j,i);this.lineTo(j+Z,i);this.lineTo(j+Z,i+m);this.lineTo(j,i+m);this.closePath();this.fill();this.currentPath_=p};M.createLinearGradient=function(i,m,Z,j){var p=new v("gradient");p.x0_=i;p.y0_=m;p.x1_=Z;p.y1_=j;return p};M.createRadialGradient=function(m,AE,j,i,p,Z){var AF=new v("gradientradial");AF.x0_=m;AF.y0_=AE;AF.r0_=j;AF.x1_=i;AF.y1_=p;AF.r1_=Z;return AF};M.drawImage=function(AO,j){var AH,AF,AJ,AV,AM,AK,AQ,AX;var AI=AO.runtimeStyle.width;var AN=AO.runtimeStyle.height;AO.runtimeStyle.width="auto";AO.runtimeStyle.height="auto";var AG=AO.width;var AT=AO.height;AO.runtimeStyle.width=AI;AO.runtimeStyle.height=AN;if(arguments.length==3){AH=arguments[1];AF=arguments[2];AM=AK=0;AQ=AJ=AG;AX=AV=AT}else{if(arguments.length==5){AH=arguments[1];AF=arguments[2];AJ=arguments[3];AV=arguments[4];AM=AK=0;AQ=AG;AX=AT}else{if(arguments.length==9){AM=arguments[1];AK=arguments[2];AQ=arguments[3];AX=arguments[4];AH=arguments[5];AF=arguments[6];AJ=arguments[7];AV=arguments[8]}else{throw Error("Invalid number of arguments")}}}var AW=this.getCoords_(AH,AF);var m=AQ/2;var i=AX/2;var AU=[];var Z=10;var AE=10;AU.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",AU.join(""))};M.stroke=function(AM){var m=10;var AN=10;var AE=5000;var AG={x:null,y:null};var AL={x:null,y:null};for(var AH=0;AHAL.x){AL.x=Z.x}if(AG.y==null||Z.yAL.y){AL.y=Z.y}}}AK.push(' ">');if(!AM){R(this,AK)}else{a(this,AK,AG,AL)}AK.push("");this.element_.insertAdjacentHTML("beforeEnd",AK.join(""))}};function R(j,AE){var i=Y(j.strokeStyle);var m=i.color;var p=i.alpha*j.globalAlpha;var Z=j.lineScale_*j.lineWidth;if(Z<1){p*=Z}AE.push("')}function a(AO,AG,Ah,AP){var AH=AO.fillStyle;var AY=AO.arcScaleX_;var AX=AO.arcScaleY_;var Z=AP.x-Ah.x;var m=AP.y-Ah.y;if(AH instanceof v){var AL=0;var Ac={x:0,y:0};var AU=0;var AK=1;if(AH.type_=="gradient"){var AJ=AH.x0_/AY;var j=AH.y0_/AX;var AI=AH.x1_/AY;var Aj=AH.y1_/AX;var Ag=AO.getCoords_(AJ,j);var Af=AO.getCoords_(AI,Aj);var AE=Af.x-Ag.x;var p=Af.y-Ag.y;AL=Math.atan2(AE,p)*180/Math.PI;if(AL<0){AL+=360}if(AL<0.000001){AL=0}}else{var Ag=AO.getCoords_(AH.x0_,AH.y0_);Ac={x:(Ag.x-Ah.x)/Z,y:(Ag.y-Ah.y)/m};Z/=AY*D;m/=AX*D;var Aa=z.max(Z,m);AU=2*AH.r0_/Aa;AK=2*AH.r1_/Aa-AU}var AS=AH.colors_;AS.sort(function(Ak,i){return Ak.offset-i.offset});var AN=AS.length;var AR=AS[0].color;var AQ=AS[AN-1].color;var AW=AS[0].alpha*AO.globalAlpha;var AV=AS[AN-1].alpha*AO.globalAlpha;var Ab=[];for(var Ae=0;Ae')}else{if(AH instanceof u){if(Z&&m){var AF=-Ah.x;var AZ=-Ah.y;AG.push("')}}else{var Ai=Y(AO.fillStyle);var AT=Ai.color;var Ad=Ai.alpha*AO.globalAlpha;AG.push('')}}}M.fill=function(){this.stroke(true)};M.closePath=function(){this.currentPath_.push({type:"close"})};M.getCoords_=function(j,i){var Z=this.m_;return{x:D*(j*Z[0][0]+i*Z[1][0]+Z[2][0])-F,y:D*(j*Z[0][1]+i*Z[1][1]+Z[2][1])-F}};M.save=function(){var Z={};Q(this,Z);this.aStack_.push(Z);this.mStack_.push(this.m_);this.m_=d(V(),this.m_)};M.restore=function(){if(this.aStack_.length){Q(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function H(Z){return isFinite(Z[0][0])&&isFinite(Z[0][1])&&isFinite(Z[1][0])&&isFinite(Z[1][1])&&isFinite(Z[2][0])&&isFinite(Z[2][1])}function y(i,Z,j){if(!H(Z)){return }i.m_=Z;if(j){var p=Z[0][0]*Z[1][1]-Z[0][1]*Z[1][0];i.lineScale_=k(b(p))}}M.translate=function(j,i){var Z=[[1,0,0],[0,1,0],[j,i,1]];y(this,d(Z,this.m_),false)};M.rotate=function(i){var m=U(i);var j=J(i);var Z=[[m,j,0],[-j,m,0],[0,0,1]];y(this,d(Z,this.m_),false)};M.scale=function(j,i){this.arcScaleX_*=j;this.arcScaleY_*=i;var Z=[[j,0,0],[0,i,0],[0,0,1]];y(this,d(Z,this.m_),true)};M.transform=function(p,m,AF,AE,i,Z){var j=[[p,m,0],[AF,AE,0],[i,Z,1]];y(this,d(j,this.m_),true)};M.setTransform=function(AE,p,AG,AF,j,i){var Z=[[AE,p,0],[AG,AF,0],[j,i,1]];y(this,Z,true)};M.drawText_=function(AK,AI,AH,AN,AG){var AM=this.m_,AQ=1000,i=0,AP=AQ,AF={x:0,y:0},AE=[];var Z=P(X(this.font),this.element_);var j=AA(Z);var AR=this.element_.currentStyle;var p=this.textAlign.toLowerCase();switch(p){case"left":case"center":case"right":break;case"end":p=AR.direction=="ltr"?"right":"left";break;case"start":p=AR.direction=="rtl"?"right":"left";break;default:p="left"}switch(this.textBaseline){case"hanging":case"top":AF.y=Z.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":AF.y=-Z.size/2.25;break}switch(p){case"right":i=AQ;AP=0.05;break;case"center":i=AP=AQ/2;break}var AO=this.getCoords_(AI+AF.x,AH+AF.y);AE.push('');if(AG){R(this,AE)}else{a(this,AE,{x:-i,y:0},{x:AP,y:Z.size})}var AL=AM[0][0].toFixed(3)+","+AM[1][0].toFixed(3)+","+AM[0][1].toFixed(3)+","+AM[1][1].toFixed(3)+",0,0";var AJ=K(AO.x/D)+","+K(AO.y/D);AE.push('','','');this.element_.insertAdjacentHTML("beforeEnd",AE.join(""))};M.fillText=function(j,Z,m,i){this.drawText_(j,Z,m,i,false)};M.strokeText=function(j,Z,m,i){this.drawText_(j,Z,m,i,true)};M.measureText=function(j){if(!this.textMeasureEl_){var Z='';this.element_.insertAdjacentHTML("beforeEnd",Z);this.textMeasureEl_=this.element_.lastChild}var i=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(i.createTextNode(j));return{width:this.textMeasureEl_.offsetWidth}};M.clip=function(){};M.arcTo=function(){};M.createPattern=function(i,Z){return new u(i,Z)};function v(Z){this.type_=Z;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}v.prototype.addColorStop=function(i,Z){Z=Y(Z);this.colors_.push({offset:i,color:Z.color,alpha:Z.alpha})};function u(i,Z){q(i);switch(Z){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=Z;break;default:n("SYNTAX_ERR")}this.src_=i.src;this.width_=i.width;this.height_=i.height}function n(Z){throw new o(Z)}function q(Z){if(!Z||Z.nodeType!=1||Z.tagName!="IMG"){n("TYPE_MISMATCH_ERR")}if(Z.readyState!="complete"){n("INVALID_STATE_ERR")}}function o(Z){this.code=this[Z];this.message=Z+": DOM Exception "+this.code}var x=o.prototype=new Error;x.INDEX_SIZE_ERR=1;x.DOMSTRING_SIZE_ERR=2;x.HIERARCHY_REQUEST_ERR=3;x.WRONG_DOCUMENT_ERR=4;x.INVALID_CHARACTER_ERR=5;x.NO_DATA_ALLOWED_ERR=6;x.NO_MODIFICATION_ALLOWED_ERR=7;x.NOT_FOUND_ERR=8;x.NOT_SUPPORTED_ERR=9;x.INUSE_ATTRIBUTE_ERR=10;x.INVALID_STATE_ERR=11;x.SYNTAX_ERR=12;x.INVALID_MODIFICATION_ERR=13;x.NAMESPACE_ERR=14;x.INVALID_ACCESS_ERR=15;x.VALIDATION_ERR=16;x.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=E;CanvasRenderingContext2D=W;CanvasGradient=v;CanvasPattern=u;DOMException=o})()}; \ No newline at end of file diff --git a/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.js b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.js new file mode 100644 index 00000000..52cbe82a --- /dev/null +++ b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.js @@ -0,0 +1,2548 @@ +/* Javascript plotting library for jQuery, v. 0.6. + * + * Released under the MIT license by IOLA, December 2007. + * + */ + +// first an inline dependency, jquery.colorhelpers.js, we inline it here +// for convenience + +/* Plugin for jQuery for working with colors. + * + * Version 1.0. + * + * Inspiration from jQuery color animation plugin by John Resig. + * + * Released under the MIT license by Ole Laursen, October 2009. + * + * Examples: + * + * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString() + * var c = $.color.extract($("#mydiv"), 'background-color'); + * console.log(c.r, c.g, c.b, c.a); + * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)" + * + * Note that .scale() and .add() work in-place instead of returning + * new objects. + */ +(function($){$.color={};$.color.make=function(E,D,B,C){var F={};F.r=E||0;F.g=D||0;F.b=B||0;F.a=C!=null?C:1;F.add=function(I,H){for(var G=0;G=1){return"rgb("+[F.r,F.g,F.b].join(",")+")"}else{return"rgba("+[F.r,F.g,F.b,F.a].join(",")+")"}};F.normalize=function(){function G(I,J,H){return JH?H:J)}F.r=G(0,parseInt(F.r),255);F.g=G(0,parseInt(F.g),255);F.b=G(0,parseInt(F.b),255);F.a=G(0,F.a,1);return F};F.clone=function(){return $.color.make(F.r,F.b,F.g,F.a)};return F.normalize()};$.color.extract=function(C,B){var D;do{D=C.css(B).toLowerCase();if(D!=""&&D!="transparent"){break}C=C.parent()}while(!$.nodeName(C.get(0),"body"));if(D=="rgba(0, 0, 0, 0)"){D="transparent"}return $.color.parse(D)};$.color.parse=function(E){var D,B=$.color.make;if(D=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(E)){return B(parseInt(D[1],10),parseInt(D[2],10),parseInt(D[3],10))}if(D=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(E)){return B(parseInt(D[1],10),parseInt(D[2],10),parseInt(D[3],10),parseFloat(D[4]))}if(D=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(E)){return B(parseFloat(D[1])*2.55,parseFloat(D[2])*2.55,parseFloat(D[3])*2.55)}if(D=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(E)){return B(parseFloat(D[1])*2.55,parseFloat(D[2])*2.55,parseFloat(D[3])*2.55,parseFloat(D[4]))}if(D=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(E)){return B(parseInt(D[1],16),parseInt(D[2],16),parseInt(D[3],16))}if(D=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(E)){return B(parseInt(D[1]+D[1],16),parseInt(D[2]+D[2],16),parseInt(D[3]+D[3],16))}var C=$.trim(E).toLowerCase();if(C=="transparent"){return B(255,255,255,0)}else{D=A[C];return B(D[0],D[1],D[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery); + +// the actual Flot code +(function($) { + function Plot(placeholder, data_, options_, plugins) { + // data is on the form: + // [ series1, series2 ... ] + // where series is either just the data as [ [x1, y1], [x2, y2], ... ] + // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... } + + var series = [], + options = { + // the color theme used for graphs + colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"], + legend: { + show: true, + noColumns: 1, // number of colums in legend table + labelFormatter: null, // fn: string -> string + labelBoxBorderColor: "#ccc", // border color for the little label boxes + container: null, // container (as jQuery object) to put legend in, null means default on top of graph + position: "ne", // position of default legend container within plot + margin: 5, // distance from grid edge to default legend container within plot + backgroundColor: null, // null means auto-detect + backgroundOpacity: 0.85 // set to 0 to avoid background + }, + xaxis: { + position: "bottom", // or "top" + mode: null, // null or "time" + color: null, // base color, labels, ticks + tickColor: null, // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)" + transform: null, // null or f: number -> number to transform axis + inverseTransform: null, // if transform is set, this should be the inverse function + min: null, // min. value to show, null means set automatically + max: null, // max. value to show, null means set automatically + autoscaleMargin: null, // margin in % to add if auto-setting min/max + ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks + tickFormatter: null, // fn: number -> string + labelWidth: null, // size of tick labels in pixels + labelHeight: null, + tickLength: null, // size in pixels of ticks, or "full" for whole line + alignTicksWithAxis: null, // axis number or null for no sync + + // mode specific options + tickDecimals: null, // no. of decimals, null means auto + tickSize: null, // number or [number, "unit"] + minTickSize: null, // number or [number, "unit"] + monthNames: null, // list of names of months + timeformat: null, // format string to use + twelveHourClock: false // 12 or 24 time in time mode + }, + yaxis: { + autoscaleMargin: 0.02, + position: "left" // or "right" + }, + xaxes: [], + yaxes: [], + series: { + points: { + show: false, + radius: 3, + lineWidth: 2, // in pixels + fill: true, + fillColor: "#ffffff", + symbol: "circle" // or callback + }, + lines: { + // we don't put in show: false so we can see + // whether lines were actively disabled + lineWidth: 2, // in pixels + fill: false, + fillColor: null, + steps: false + }, + bars: { + show: false, + lineWidth: 2, // in pixels + barWidth: 1, // in units of the x axis + fill: true, + fillColor: null, + align: "left", // or "center" + horizontal: false + }, + shadowSize: 3 + }, + grid: { + show: true, + aboveData: false, + color: "#545454", // primary color used for outline and labels + backgroundColor: null, // null for transparent, else color + borderColor: null, // set if different from the grid color + tickColor: null, // color for the ticks, e.g. "rgba(0,0,0,0.15)" + labelMargin: 5, // in pixels + axisMargin: 8, // in pixels + borderWidth: 2, // in pixels + markings: null, // array of ranges or fn: axes -> array of ranges + markingsColor: "#f4f4f4", + markingsLineWidth: 2, + // interactive stuff + clickable: false, + hoverable: false, + autoHighlight: true, // highlight in case mouse is near + mouseActiveRadius: 10 // how far the mouse can be away to activate an item + }, + hooks: {} + }, + canvas = null, // the canvas for the plot itself + overlay = null, // canvas for interactive stuff on top of plot + eventHolder = null, // jQuery object that events should be bound to + ctx = null, octx = null, + xaxes = [], yaxes = [], + plotOffset = { left: 0, right: 0, top: 0, bottom: 0}, + canvasWidth = 0, canvasHeight = 0, + plotWidth = 0, plotHeight = 0, + hooks = { + processOptions: [], + processRawData: [], + processDatapoints: [], + drawSeries: [], + draw: [], + bindEvents: [], + drawOverlay: [] + }, + plot = this; + + // public functions + plot.setData = setData; + plot.setupGrid = setupGrid; + plot.draw = draw; + plot.getPlaceholder = function() { return placeholder; }; + plot.getCanvas = function() { return canvas; }; + plot.getPlotOffset = function() { return plotOffset; }; + plot.width = function () { return plotWidth; }; + plot.height = function () { return plotHeight; }; + plot.offset = function () { + var o = eventHolder.offset(); + o.left += plotOffset.left; + o.top += plotOffset.top; + return o; + }; + plot.getData = function () { return series; }; + plot.getAxis = function (dir, number) { + var a = (dir == "x" ? xaxes : yaxes)[number - 1]; + if (a && !a.used) + a = null; + return a; + }; + plot.getAxes = function () { + var res = {}, i; + for (i = 0; i < xaxes.length; ++i) + res["x" + (i ? (i + 1) : "") + "axis"] = xaxes[i] || {}; + for (i = 0; i < yaxes.length; ++i) + res["y" + (i ? (i + 1) : "") + "axis"] = yaxes[i] || {}; + + // backwards compatibility - to be removed + if (!res.x2axis) + res.x2axis = { n: 2 }; + if (!res.y2axis) + res.y2axis = { n: 2 }; + + return res; + }; + plot.getXAxes = function () { return xaxes; }; + plot.getYAxes = function () { return yaxes; }; + plot.getUsedAxes = getUsedAxes; // return flat array with x and y axes that are in use + plot.c2p = canvasToAxisCoords; + plot.p2c = axisToCanvasCoords; + plot.getOptions = function () { return options; }; + plot.highlight = highlight; + plot.unhighlight = unhighlight; + plot.triggerRedrawOverlay = triggerRedrawOverlay; + plot.pointOffset = function(point) { + return { + left: parseInt(xaxes[axisNumber(point, "x") - 1].p2c(+point.x) + plotOffset.left), + top: parseInt(yaxes[axisNumber(point, "y") - 1].p2c(+point.y) + plotOffset.top) + }; + }; + + // public attributes + plot.hooks = hooks; + + // initialize + initPlugins(plot); + parseOptions(options_); + constructCanvas(); + setData(data_); + setupGrid(); + draw(); + bindEvents(); + + + function executeHooks(hook, args) { + args = [plot].concat(args); + for (var i = 0; i < hook.length; ++i) + hook[i].apply(this, args); + } + + function initPlugins() { + for (var i = 0; i < plugins.length; ++i) { + var p = plugins[i]; + p.init(plot); + if (p.options) + $.extend(true, options, p.options); + } + } + + function parseOptions(opts) { + var i; + + $.extend(true, options, opts); + + if (options.xaxis.color == null) + options.xaxis.color = options.grid.color; + if (options.yaxis.color == null) + options.yaxis.color = options.grid.color; + + if (options.xaxis.tickColor == null) // backwards-compatibility + options.xaxis.tickColor = options.grid.tickColor; + if (options.yaxis.tickColor == null) // backwards-compatibility + options.yaxis.tickColor = options.grid.tickColor; + + if (options.grid.borderColor == null) + options.grid.borderColor = options.grid.color; + if (options.grid.tickColor == null) + options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString(); + + // fill in defaults in axes, copy at least always the + // first as the rest of the code assumes it'll be there + for (i = 0; i < Math.max(1, options.xaxes.length); ++i) + options.xaxes[i] = $.extend(true, {}, options.xaxis, options.xaxes[i]); + for (i = 0; i < Math.max(1, options.yaxes.length); ++i) + options.yaxes[i] = $.extend(true, {}, options.yaxis, options.yaxes[i]); + // backwards compatibility, to be removed in future + if (options.xaxis.noTicks && options.xaxis.ticks == null) + options.xaxis.ticks = options.xaxis.noTicks; + if (options.yaxis.noTicks && options.yaxis.ticks == null) + options.yaxis.ticks = options.yaxis.noTicks; + if (options.x2axis) { + options.x2axis.position = "top"; + options.xaxes[1] = options.x2axis; + } + if (options.y2axis) { + if (options.y2axis.autoscaleMargin === undefined) + options.y2axis.autoscaleMargin = 0.02; + options.y2axis.position = "right"; + options.yaxes[1] = options.y2axis; + } + if (options.grid.coloredAreas) + options.grid.markings = options.grid.coloredAreas; + if (options.grid.coloredAreasColor) + options.grid.markingsColor = options.grid.coloredAreasColor; + if (options.lines) + $.extend(true, options.series.lines, options.lines); + if (options.points) + $.extend(true, options.series.points, options.points); + if (options.bars) + $.extend(true, options.series.bars, options.bars); + if (options.shadowSize != null) + options.series.shadowSize = options.shadowSize; + + for (i = 0; i < options.xaxes.length; ++i) + getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i]; + for (i = 0; i < options.yaxes.length; ++i) + getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i]; + + // add hooks from options + for (var n in hooks) + if (options.hooks[n] && options.hooks[n].length) + hooks[n] = hooks[n].concat(options.hooks[n]); + + executeHooks(hooks.processOptions, [options]); + } + + function setData(d) { + series = parseData(d); + fillInSeriesOptions(); + processData(); + } + + function parseData(d) { + var res = []; + for (var i = 0; i < d.length; ++i) { + var s = $.extend(true, {}, options.series); + + if (d[i].data != null) { + s.data = d[i].data; // move the data instead of deep-copy + delete d[i].data; + + $.extend(true, s, d[i]); + + d[i].data = s.data; + } + else + s.data = d[i]; + res.push(s); + } + + return res; + } + + function axisNumber(obj, coord) { + var a = obj[coord + "axis"]; + if (typeof a == "object") // if we got a real axis, extract number + a = a.n; + if (typeof a != "number") + a = 1; // default to first axis + return a; + } + + function canvasToAxisCoords(pos) { + // return an object with x/y corresponding to all used axes + var res = {}, i, axis; + for (i = 0; i < xaxes.length; ++i) { + axis = xaxes[i]; + if (axis && axis.used) + res["x" + axis.n] = axis.c2p(pos.left); + } + + for (i = 0; i < yaxes.length; ++i) { + axis = yaxes[i]; + if (axis && axis.used) + res["y" + axis.n] = axis.c2p(pos.top); + } + + if (res.x1 !== undefined) + res.x = res.x1; + if (res.y1 !== undefined) + res.y = res.y1; + + return res; + } + + function axisToCanvasCoords(pos) { + // get canvas coords from the first pair of x/y found in pos + var res = {}, i, axis, key; + + for (i = 0; i < xaxes.length; ++i) { + axis = xaxes[i]; + if (axis && axis.used) { + key = "x" + axis.n; + if (pos[key] == null && axis.n == 1) + key = "x"; + + if (pos[key] != null) { + res.left = axis.p2c(pos[key]); + break; + } + } + } + + for (i = 0; i < yaxes.length; ++i) { + axis = yaxes[i]; + if (axis && axis.used) { + key = "y" + axis.n; + if (pos[key] == null && axis.n == 1) + key = "y"; + + if (pos[key] != null) { + res.top = axis.p2c(pos[key]); + break; + } + } + } + + return res; + } + + function getUsedAxes() { + var res = [], i, axis; + for (i = 0; i < xaxes.length; ++i) { + axis = xaxes[i]; + if (axis && axis.used) + res.push(axis); + } + for (i = 0; i < yaxes.length; ++i) { + axis = yaxes[i]; + if (axis && axis.used) + res.push(axis); + } + return res; + } + + function getOrCreateAxis(axes, number) { + if (!axes[number - 1]) + axes[number - 1] = { + n: number, // save the number for future reference + direction: axes == xaxes ? "x" : "y", + options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis) + }; + + return axes[number - 1]; + } + + function fillInSeriesOptions() { + var i; + + // collect what we already got of colors + var neededColors = series.length, + usedColors = [], + assignedColors = []; + for (i = 0; i < series.length; ++i) { + var sc = series[i].color; + if (sc != null) { + --neededColors; + if (typeof sc == "number") + assignedColors.push(sc); + else + usedColors.push($.color.parse(series[i].color)); + } + } + + // we might need to generate more colors if higher indices + // are assigned + for (i = 0; i < assignedColors.length; ++i) { + neededColors = Math.max(neededColors, assignedColors[i] + 1); + } + + // produce colors as needed + var colors = [], variation = 0; + i = 0; + while (colors.length < neededColors) { + var c; + if (options.colors.length == i) // check degenerate case + c = $.color.make(100, 100, 100); + else + c = $.color.parse(options.colors[i]); + + // vary color if needed + var sign = variation % 2 == 1 ? -1 : 1; + c.scale('rgb', 1 + sign * Math.ceil(variation / 2) * 0.2) + + // FIXME: if we're getting to close to something else, + // we should probably skip this one + colors.push(c); + + ++i; + if (i >= options.colors.length) { + i = 0; + ++variation; + } + } + + // fill in the options + var colori = 0, s; + for (i = 0; i < series.length; ++i) { + s = series[i]; + + // assign colors + if (s.color == null) { + s.color = colors[colori].toString(); + ++colori; + } + else if (typeof s.color == "number") + s.color = colors[s.color].toString(); + + // turn on lines automatically in case nothing is set + if (s.lines.show == null) { + var v, show = true; + for (v in s) + if (s[v] && s[v].show) { + show = false; + break; + } + if (show) + s.lines.show = true; + } + + // setup axes + s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, "x")); + s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, "y")); + } + } + + function processData() { + var topSentry = Number.POSITIVE_INFINITY, + bottomSentry = Number.NEGATIVE_INFINITY, + i, j, k, m, length, + s, points, ps, x, y, axis, val, f, p; + + function initAxis(axis, number) { + if (!axis) + return; + + axis.datamin = topSentry; + axis.datamax = bottomSentry; + axis.used = false; + } + + function updateAxis(axis, min, max) { + if (min < axis.datamin) + axis.datamin = min; + if (max > axis.datamax) + axis.datamax = max; + } + + for (i = 0; i < xaxes.length; ++i) + initAxis(xaxes[i]); + for (i = 0; i < yaxes.length; ++i) + initAxis(yaxes[i]); + + for (i = 0; i < series.length; ++i) { + s = series[i]; + s.datapoints = { points: [] }; + + executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]); + } + + // first pass: clean and copy data + for (i = 0; i < series.length; ++i) { + s = series[i]; + + var data = s.data, format = s.datapoints.format; + + if (!format) { + format = []; + // find out how to copy + format.push({ x: true, number: true, required: true }); + format.push({ y: true, number: true, required: true }); + + if (s.bars.show || (s.lines.show && s.lines.fill)) { + format.push({ y: true, number: true, required: false, defaultValue: 0 }); + if (s.bars.horizontal) { + delete format[format.length - 1].y; + format[format.length - 1].x = true; + } + } + + s.datapoints.format = format; + } + + if (s.datapoints.pointsize != null) + continue; // already filled in + + s.datapoints.pointsize = format.length; + + ps = s.datapoints.pointsize; + points = s.datapoints.points; + + insertSteps = s.lines.show && s.lines.steps; + s.xaxis.used = s.yaxis.used = true; + + for (j = k = 0; j < data.length; ++j, k += ps) { + p = data[j]; + + var nullify = p == null; + if (!nullify) { + for (m = 0; m < ps; ++m) { + val = p[m]; + f = format[m]; + + if (f) { + if (f.number && val != null) { + val = +val; // convert to number + if (isNaN(val)) + val = null; + } + + if (val == null) { + if (f.required) + nullify = true; + + if (f.defaultValue != null) + val = f.defaultValue; + } + } + + points[k + m] = val; + } + } + + if (nullify) { + for (m = 0; m < ps; ++m) { + val = points[k + m]; + if (val != null) { + f = format[m]; + // extract min/max info + if (f.x) + updateAxis(s.xaxis, val, val); + if (f.y) + updateAxis(s.yaxis, val, val); + } + points[k + m] = null; + } + } + else { + // a little bit of line specific stuff that + // perhaps shouldn't be here, but lacking + // better means... + if (insertSteps && k > 0 + && points[k - ps] != null + && points[k - ps] != points[k] + && points[k - ps + 1] != points[k + 1]) { + // copy the point to make room for a middle point + for (m = 0; m < ps; ++m) + points[k + ps + m] = points[k + m]; + + // middle point has same y + points[k + 1] = points[k - ps + 1]; + + // we've added a point, better reflect that + k += ps; + } + } + } + } + + // give the hooks a chance to run + for (i = 0; i < series.length; ++i) { + s = series[i]; + + executeHooks(hooks.processDatapoints, [ s, s.datapoints]); + } + + // second pass: find datamax/datamin for auto-scaling + for (i = 0; i < series.length; ++i) { + s = series[i]; + points = s.datapoints.points, + ps = s.datapoints.pointsize; + + var xmin = topSentry, ymin = topSentry, + xmax = bottomSentry, ymax = bottomSentry; + + for (j = 0; j < points.length; j += ps) { + if (points[j] == null) + continue; + + for (m = 0; m < ps; ++m) { + val = points[j + m]; + f = format[m]; + if (!f) + continue; + + if (f.x) { + if (val < xmin) + xmin = val; + if (val > xmax) + xmax = val; + } + if (f.y) { + if (val < ymin) + ymin = val; + if (val > ymax) + ymax = val; + } + } + } + + if (s.bars.show) { + // make sure we got room for the bar on the dancing floor + var delta = s.bars.align == "left" ? 0 : -s.bars.barWidth/2; + if (s.bars.horizontal) { + ymin += delta; + ymax += delta + s.bars.barWidth; + } + else { + xmin += delta; + xmax += delta + s.bars.barWidth; + } + } + + updateAxis(s.xaxis, xmin, xmax); + updateAxis(s.yaxis, ymin, ymax); + } + + $.each(getUsedAxes(), function (i, axis) { + if (axis.datamin == topSentry) + axis.datamin = null; + if (axis.datamax == bottomSentry) + axis.datamax = null; + }); + } + + function constructCanvas() { + canvasWidth = placeholder.width(); + canvasHeight = placeholder.height(); + + // excanvas hack, if there are any canvases here, whack + // the state on them manually + if (window.G_vmlCanvasManager) + placeholder.find("canvas").each(function () { + this.context_ = null; + }); + + placeholder.html(""); // clear placeholder + + if (placeholder.css("position") == 'static') + placeholder.css("position", "relative"); // for positioning labels and overlay + + if (canvasWidth <= 0 || canvasHeight <= 0) + throw "Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight; + + function makeCanvas(skipPositioning) { + var c = document.createElement('canvas'); + c.width = canvasWidth; + c.height = canvasHeight; + + if (!skipPositioning) + $(c).css({ position: 'absolute', left: 0, top: 0 }); + + $(c).appendTo(placeholder); + + if (!c.getContext) // excanvas hack + c = window.G_vmlCanvasManager.initElement(c); + + return c; + } + + // the canvas + canvas = makeCanvas(true); + ctx = canvas.getContext("2d"); + + // overlay canvas for interactive features + overlay = makeCanvas(); + octx = overlay.getContext("2d"); + } + + function bindEvents() { + // we include the canvas in the event holder too, because IE 7 + // sometimes has trouble with the stacking order + eventHolder = $([overlay, canvas]); + + // bind events + if (options.grid.hoverable) { + eventHolder.mousemove(onMouseMove); + eventHolder.mouseleave(onMouseLeave); + } + + if (options.grid.clickable) + eventHolder.click(onClick); + + executeHooks(hooks.bindEvents, [eventHolder]); + } + + function setTransformationHelpers(axis) { + // set helper functions on the axis, assumes plot area + // has been computed already + + function identity(x) { return x; } + + var s, m, t = axis.options.transform || identity, + it = axis.options.inverseTransform; + + if (axis.direction == "x") { + // precompute how much the axis is scaling a point + // in canvas space + s = axis.scale = plotWidth / (t(axis.max) - t(axis.min)); + m = t(axis.min); + + // data point to canvas coordinate + if (t == identity) // slight optimization + axis.p2c = function (p) { return (p - m) * s; }; + else + axis.p2c = function (p) { return (t(p) - m) * s; }; + // canvas coordinate to data point + if (!it) + axis.c2p = function (c) { return m + c / s; }; + else + axis.c2p = function (c) { return it(m + c / s); }; + } + else { + s = axis.scale = plotHeight / (t(axis.max) - t(axis.min)); + m = t(axis.max); + + if (t == identity) + axis.p2c = function (p) { return (m - p) * s; }; + else + axis.p2c = function (p) { return (m - t(p)) * s; }; + if (!it) + axis.c2p = function (c) { return m - c / s; }; + else + axis.c2p = function (c) { return it(m - c / s); }; + } + } + + function measureTickLabels(axis) { + if (!axis) + return; + + var opts = axis.options, i, ticks = axis.ticks || [], labels = [], + l, w = opts.labelWidth, h = opts.labelHeight, dummyDiv; + + function makeDummyDiv(labels, width) { + return $('
    ' + + '
    ' + + labels.join("") + '
    ') + .appendTo(placeholder); + } + + if (axis.direction == "x") { + // to avoid measuring the widths of the labels (it's slow), we + // construct fixed-size boxes and put the labels inside + // them, we don't need the exact figures and the + // fixed-size box content is easy to center + if (w == null) + w = Math.floor(canvasWidth / (ticks.length > 0 ? ticks.length : 1)); + + // measure x label heights + if (h == null) { + labels = []; + for (i = 0; i < ticks.length; ++i) { + l = ticks[i].label; + if (l) + labels.push('
    ' + l + '
    '); + } + + if (labels.length > 0) { + // stick them all in the same div and measure + // collective height + labels.push('
    '); + dummyDiv = makeDummyDiv(labels, "width:10000px;"); + h = dummyDiv.height(); + dummyDiv.remove(); + } + } + } + else if (w == null || h == null) { + // calculate y label dimensions + for (i = 0; i < ticks.length; ++i) { + l = ticks[i].label; + if (l) + labels.push('
    ' + l + '
    '); + } + + if (labels.length > 0) { + dummyDiv = makeDummyDiv(labels, ""); + if (w == null) + w = dummyDiv.children().width(); + if (h == null) + h = dummyDiv.find("div.tickLabel").height(); + dummyDiv.remove(); + } + } + + if (w == null) + w = 0; + if (h == null) + h = 0; + + axis.labelWidth = w; + axis.labelHeight = h; + } + + function computeAxisBox(axis) { + if (!axis || !axis.labelWidth || !axis.labelHeight) + return; + + // find the bounding box of the axis by looking at label + // widths/heights and ticks, make room by diminishing the + // plotOffset + + var lw = axis.labelWidth, + lh = axis.labelHeight, + pos = axis.options.position, + tickLength = axis.options.tickLength, + axismargin = options.grid.axisMargin, + padding = options.grid.labelMargin, + all = axis.direction == "x" ? xaxes : yaxes, + index; + + // determine axis margin + var samePosition = $.grep(all, function (a) { + return a && a.options.position == pos && (a.labelHeight || a.labelWidth); + }); + if ($.inArray(axis, samePosition) == samePosition.length - 1) + axismargin = 0; // outermost + + // determine tick length - if we're innermost, we can use "full" + if (tickLength == null) + tickLength = "full"; + + var sameDirection = $.grep(all, function (a) { + return a && (a.labelHeight || a.labelWidth); + }); + + var innermost = $.inArray(axis, sameDirection) == 0; + if (!innermost && tickLength == "full") + tickLength = 5; + + if (!isNaN(+tickLength)) + padding += +tickLength; + + // compute box + if (axis.direction == "x") { + lh += padding; + + if (pos == "bottom") { + plotOffset.bottom += lh + axismargin; + axis.box = { top: canvasHeight - plotOffset.bottom, height: lh }; + } + else { + axis.box = { top: plotOffset.top + axismargin, height: lh }; + plotOffset.top += lh + axismargin; + } + } + else { + lw += padding; + + if (pos == "left") { + axis.box = { left: plotOffset.left + axismargin, width: lw }; + plotOffset.left += lw + axismargin; + } + else { + plotOffset.right += lw + axismargin; + axis.box = { left: canvasWidth - plotOffset.right, width: lw }; + } + } + + // save for future reference + axis.position = pos; + axis.tickLength = tickLength; + axis.box.padding = padding; + axis.innermost = innermost; + } + + function fixupAxisBox(axis) { + if (!axis || !axis.labelWidth || !axis.labelHeight) + return; + + // set remaining bounding box coordinates + if (axis.direction == "x") { + axis.box.left = plotOffset.left; + axis.box.width = plotWidth; + } + else { + axis.box.top = plotOffset.top; + axis.box.height = plotHeight; + } + } + + function setupGrid() { + var axes = getUsedAxes(), j, k; + + // compute axis intervals + for (k = 0; k < axes.length; ++k) + setRange(axes[k]); + + + plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = 0; + if (options.grid.show) { + // make the ticks + for (k = 0; k < axes.length; ++k) { + setupTickGeneration(axes[k]); + setTicks(axes[k]); + snapRangeToTicks(axes[k], axes[k].ticks); + } + + // find labelWidth/Height, do this on all, not just + // used as we might need to reserve space for unused + // too if their labelWidth/Height is set + for (j = 0; j < xaxes.length; ++j) + measureTickLabels(xaxes[j]); + for (j = 0; j < yaxes.length; ++j) + measureTickLabels(yaxes[j]); + + // compute the axis boxes, start from the outside (reverse order) + for (j = xaxes.length - 1; j >= 0; --j) + computeAxisBox(xaxes[j]); + for (j = yaxes.length - 1; j >= 0; --j) + computeAxisBox(yaxes[j]); + + // make sure we've got enough space for things that + // might stick out + var maxOutset = 0; + for (var i = 0; i < series.length; ++i) + maxOutset = Math.max(maxOutset, 2 * (series[i].points.radius + series[i].points.lineWidth/2)); + + for (var a in plotOffset) { + plotOffset[a] += options.grid.borderWidth; + plotOffset[a] = Math.max(maxOutset, plotOffset[a]); + } + } + + plotWidth = canvasWidth - plotOffset.left - plotOffset.right; + plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top; + + // now we got the proper plotWidth/Height, we can compute the scaling + for (k = 0; k < axes.length; ++k) + setTransformationHelpers(axes[k]); + + if (options.grid.show) { + for (k = 0; k < axes.length; ++k) + fixupAxisBox(axes[k]); + + insertAxisLabels(); + } + + insertLegend(); + } + + function setRange(axis) { + var opts = axis.options, + min = +(opts.min != null ? opts.min : axis.datamin), + max = +(opts.max != null ? opts.max : axis.datamax), + delta = max - min; + + if (delta == 0.0) { + // degenerate case + var widen = max == 0 ? 1 : 0.01; + + if (opts.min == null) + min -= widen; + // alway widen max if we couldn't widen min to ensure we + // don't fall into min == max which doesn't work + if (opts.max == null || opts.min != null) + max += widen; + } + else { + // consider autoscaling + var margin = opts.autoscaleMargin; + if (margin != null) { + if (opts.min == null) { + min -= delta * margin; + // make sure we don't go below zero if all values + // are positive + if (min < 0 && axis.datamin != null && axis.datamin >= 0) + min = 0; + } + if (opts.max == null) { + max += delta * margin; + if (max > 0 && axis.datamax != null && axis.datamax <= 0) + max = 0; + } + } + } + axis.min = min; + axis.max = max; + } + + function setupTickGeneration(axis) { + var opts = axis.options; + + // estimate number of ticks + var noTicks; + if (typeof opts.ticks == "number" && opts.ticks > 0) + noTicks = opts.ticks; + else if (axis.direction == "x") + // heuristic based on the model a*sqrt(x) fitted to + // some reasonable data points + noTicks = 0.3 * Math.sqrt(canvasWidth); + else + noTicks = 0.3 * Math.sqrt(canvasHeight); + + var delta = (axis.max - axis.min) / noTicks, + size, generator, unit, formatter, i, magn, norm; + + if (opts.mode == "time") { + // pretty handling of time + + // map of app. size of time units in milliseconds + var timeUnitSize = { + "second": 1000, + "minute": 60 * 1000, + "hour": 60 * 60 * 1000, + "day": 24 * 60 * 60 * 1000, + "month": 30 * 24 * 60 * 60 * 1000, + "year": 365.2425 * 24 * 60 * 60 * 1000 + }; + + + // the allowed tick sizes, after 1 year we use + // an integer algorithm + var spec = [ + [1, "second"], [2, "second"], [5, "second"], [10, "second"], + [30, "second"], + [1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"], + [30, "minute"], + [1, "hour"], [2, "hour"], [4, "hour"], + [8, "hour"], [12, "hour"], + [1, "day"], [2, "day"], [3, "day"], + [0.25, "month"], [0.5, "month"], [1, "month"], + [2, "month"], [3, "month"], [6, "month"], + [1, "year"] + ]; + + var minSize = 0; + if (opts.minTickSize != null) { + if (typeof opts.tickSize == "number") + minSize = opts.tickSize; + else + minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]]; + } + + for (var i = 0; i < spec.length - 1; ++i) + if (delta < (spec[i][0] * timeUnitSize[spec[i][1]] + + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2 + && spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) + break; + size = spec[i][0]; + unit = spec[i][1]; + + // special-case the possibility of several years + if (unit == "year") { + magn = Math.pow(10, Math.floor(Math.log(delta / timeUnitSize.year) / Math.LN10)); + norm = (delta / timeUnitSize.year) / magn; + if (norm < 1.5) + size = 1; + else if (norm < 3) + size = 2; + else if (norm < 7.5) + size = 5; + else + size = 10; + + size *= magn; + } + + axis.tickSize = opts.tickSize || [size, unit]; + + generator = function(axis) { + var ticks = [], + tickSize = axis.tickSize[0], unit = axis.tickSize[1], + d = new Date(axis.min); + + var step = tickSize * timeUnitSize[unit]; + + if (unit == "second") + d.setUTCSeconds(floorInBase(d.getUTCSeconds(), tickSize)); + if (unit == "minute") + d.setUTCMinutes(floorInBase(d.getUTCMinutes(), tickSize)); + if (unit == "hour") + d.setUTCHours(floorInBase(d.getUTCHours(), tickSize)); + if (unit == "month") + d.setUTCMonth(floorInBase(d.getUTCMonth(), tickSize)); + if (unit == "year") + d.setUTCFullYear(floorInBase(d.getUTCFullYear(), tickSize)); + + // reset smaller components + d.setUTCMilliseconds(0); + if (step >= timeUnitSize.minute) + d.setUTCSeconds(0); + if (step >= timeUnitSize.hour) + d.setUTCMinutes(0); + if (step >= timeUnitSize.day) + d.setUTCHours(0); + if (step >= timeUnitSize.day * 4) + d.setUTCDate(1); + if (step >= timeUnitSize.year) + d.setUTCMonth(0); + + + var carry = 0, v = Number.NaN, prev; + do { + prev = v; + v = d.getTime(); + ticks.push(v); + if (unit == "month") { + if (tickSize < 1) { + // a bit complicated - we'll divide the month + // up but we need to take care of fractions + // so we don't end up in the middle of a day + d.setUTCDate(1); + var start = d.getTime(); + d.setUTCMonth(d.getUTCMonth() + 1); + var end = d.getTime(); + d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize); + carry = d.getUTCHours(); + d.setUTCHours(0); + } + else + d.setUTCMonth(d.getUTCMonth() + tickSize); + } + else if (unit == "year") { + d.setUTCFullYear(d.getUTCFullYear() + tickSize); + } + else + d.setTime(v + step); + } while (v < axis.max && v != prev); + + return ticks; + }; + + formatter = function (v, axis) { + var d = new Date(v); + + // first check global format + if (opts.timeformat != null) + return $.plot.formatDate(d, opts.timeformat, opts.monthNames); + + var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]]; + var span = axis.max - axis.min; + var suffix = (opts.twelveHourClock) ? " %p" : ""; + + if (t < timeUnitSize.minute) + fmt = "%h:%M:%S" + suffix; + else if (t < timeUnitSize.day) { + if (span < 2 * timeUnitSize.day) + fmt = "%h:%M" + suffix; + else + fmt = "%b %d %h:%M" + suffix; + } + else if (t < timeUnitSize.month) + fmt = "%b %d"; + else if (t < timeUnitSize.year) { + if (span < timeUnitSize.year) + fmt = "%b"; + else + fmt = "%b %y"; + } + else + fmt = "%y"; + + return $.plot.formatDate(d, fmt, opts.monthNames); + }; + } + else { + // pretty rounding of base-10 numbers + var maxDec = opts.tickDecimals; + var dec = -Math.floor(Math.log(delta) / Math.LN10); + if (maxDec != null && dec > maxDec) + dec = maxDec; + + magn = Math.pow(10, -dec); + norm = delta / magn; // norm is between 1.0 and 10.0 + + if (norm < 1.5) + size = 1; + else if (norm < 3) { + size = 2; + // special case for 2.5, requires an extra decimal + if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) { + size = 2.5; + ++dec; + } + } + else if (norm < 7.5) + size = 5; + else + size = 10; + + size *= magn; + + if (opts.minTickSize != null && size < opts.minTickSize) + size = opts.minTickSize; + + axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec); + axis.tickSize = opts.tickSize || size; + + generator = function (axis) { + var ticks = []; + + // spew out all possible ticks + var start = floorInBase(axis.min, axis.tickSize), + i = 0, v = Number.NaN, prev; + do { + prev = v; + v = start + i * axis.tickSize; + ticks.push(v); + ++i; + } while (v < axis.max && v != prev); + return ticks; + }; + + formatter = function (v, axis) { + return v.toFixed(axis.tickDecimals); + }; + } + + if (opts.alignTicksWithAxis != null) { + var otherAxis = (axis.direction == "x" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1]; + if (otherAxis && otherAxis.used && otherAxis != axis) { + // consider snapping min/max to outermost nice ticks + var niceTicks = generator(axis); + if (niceTicks.length > 0) { + if (opts.min == null) + axis.min = Math.min(axis.min, niceTicks[0]); + if (opts.max == null && niceTicks.length > 1) + axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]); + } + + generator = function (axis) { + // copy ticks, scaled to this axis + var ticks = [], v, i; + for (i = 0; i < otherAxis.ticks.length; ++i) { + v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min); + v = axis.min + v * (axis.max - axis.min); + ticks.push(v); + } + return ticks; + }; + + // we might need an extra decimal since forced + // ticks don't necessarily fit naturally + if (axis.mode != "time" && opts.tickDecimals == null) { + var extraDec = Math.max(0, -Math.floor(Math.log(delta) / Math.LN10) + 1), + ts = generator(axis); + + // only proceed if the tick interval rounded + // with an extra decimal doesn't give us a + // zero at end + if (!(ts.length > 1 && /\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec)))) + axis.tickDecimals = extraDec; + } + } + } + + axis.tickGenerator = generator; + if ($.isFunction(opts.tickFormatter)) + axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); }; + else + axis.tickFormatter = formatter; + } + + function setTicks(axis) { + axis.ticks = []; + + var oticks = axis.options.ticks, ticks = []; + if (oticks == null || (typeof oticks == "number" && oticks > 0)) + ticks = axis.tickGenerator(axis); + else if (oticks) { + if ($.isFunction(oticks)) + // generate the ticks + ticks = oticks({ min: axis.min, max: axis.max }); + else + ticks = oticks; + } + + // clean up/labelify the supplied ticks, copy them over + var i, v; + for (i = 0; i < ticks.length; ++i) { + var label = null; + var t = ticks[i]; + if (typeof t == "object") { + v = t[0]; + if (t.length > 1) + label = t[1]; + } + else + v = t; + if (label == null) + label = axis.tickFormatter(v, axis); + axis.ticks[i] = { v: v, label: label }; + } + } + + function snapRangeToTicks(axis, ticks) { + if (axis.options.autoscaleMargin && ticks.length > 0) { + // snap to ticks + if (axis.options.min == null) + axis.min = Math.min(axis.min, ticks[0].v); + if (axis.options.max == null && ticks.length > 1) + axis.max = Math.max(axis.max, ticks[ticks.length - 1].v); + } + } + + function draw() { + ctx.clearRect(0, 0, canvasWidth, canvasHeight); + + var grid = options.grid; + + // draw background, if any + if (grid.show && grid.backgroundColor) + drawBackground(); + + if (grid.show && !grid.aboveData) + drawGrid(); + + for (var i = 0; i < series.length; ++i) { + executeHooks(hooks.drawSeries, [ctx, series[i]]); + drawSeries(series[i]); + } + + executeHooks(hooks.draw, [ctx]); + + if (grid.show && grid.aboveData) + drawGrid(); + } + + function extractRange(ranges, coord) { + var axis, from, to, axes, key; + + axes = getUsedAxes(); + for (i = 0; i < axes.length; ++i) { + axis = axes[i]; + if (axis.direction == coord) { + key = coord + axis.n + "axis"; + if (!ranges[key] && axis.n == 1) + key = coord + "axis"; // support x1axis as xaxis + if (ranges[key]) { + from = ranges[key].from; + to = ranges[key].to; + break; + } + } + } + + // backwards-compat stuff - to be removed in future + if (!ranges[key]) { + axis = coord == "x" ? xaxes[0] : yaxes[0]; + from = ranges[coord + "1"]; + to = ranges[coord + "2"]; + } + + // auto-reverse as an added bonus + if (from != null && to != null && from > to) { + var tmp = from; + from = to; + to = tmp; + } + + return { from: from, to: to, axis: axis }; + } + + function drawBackground() { + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, "rgba(255, 255, 255, 0)"); + ctx.fillRect(0, 0, plotWidth, plotHeight); + ctx.restore(); + } + + function drawGrid() { + var i; + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + // draw markings + var markings = options.grid.markings; + if (markings) { + if ($.isFunction(markings)) { + var axes = plot.getAxes(); + // xmin etc. is backwards compatibility, to be + // removed in the future + axes.xmin = axes.xaxis.min; + axes.xmax = axes.xaxis.max; + axes.ymin = axes.yaxis.min; + axes.ymax = axes.yaxis.max; + + markings = markings(axes); + } + + for (i = 0; i < markings.length; ++i) { + var m = markings[i], + xrange = extractRange(m, "x"), + yrange = extractRange(m, "y"); + + // fill in missing + if (xrange.from == null) + xrange.from = xrange.axis.min; + if (xrange.to == null) + xrange.to = xrange.axis.max; + if (yrange.from == null) + yrange.from = yrange.axis.min; + if (yrange.to == null) + yrange.to = yrange.axis.max; + + // clip + if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max || + yrange.to < yrange.axis.min || yrange.from > yrange.axis.max) + continue; + + xrange.from = Math.max(xrange.from, xrange.axis.min); + xrange.to = Math.min(xrange.to, xrange.axis.max); + yrange.from = Math.max(yrange.from, yrange.axis.min); + yrange.to = Math.min(yrange.to, yrange.axis.max); + + if (xrange.from == xrange.to && yrange.from == yrange.to) + continue; + + // then draw + xrange.from = xrange.axis.p2c(xrange.from); + xrange.to = xrange.axis.p2c(xrange.to); + yrange.from = yrange.axis.p2c(yrange.from); + yrange.to = yrange.axis.p2c(yrange.to); + + if (xrange.from == xrange.to || yrange.from == yrange.to) { + // draw line + ctx.beginPath(); + ctx.strokeStyle = m.color || options.grid.markingsColor; + ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth; + ctx.moveTo(xrange.from, yrange.from); + ctx.lineTo(xrange.to, yrange.to); + ctx.stroke(); + } + else { + // fill area + ctx.fillStyle = m.color || options.grid.markingsColor; + ctx.fillRect(xrange.from, yrange.to, + xrange.to - xrange.from, + yrange.from - yrange.to); + } + } + } + + // draw the ticks + var axes = getUsedAxes(), bw = options.grid.borderWidth; + + for (var j = 0; j < axes.length; ++j) { + var axis = axes[j], box = axis.box, + t = axis.tickLength, x, y, xoff, yoff; + + if (axis.ticks.length == 0) + continue; + + ctx.strokeStyle = axis.options.tickColor || $.color.parse(axis.options.color).scale('a', 0.22).toString(); + ctx.lineWidth = 1; + + // find the edges + if (axis.direction == "x") { + x = 0; + if (t == "full") + y = (axis.position == "top" ? 0 : plotHeight); + else + y = box.top - plotOffset.top + (axis.position == "top" ? box.height : 0); + } + else { + y = 0; + if (t == "full") + x = (axis.position == "left" ? 0 : plotWidth); + else + x = box.left - plotOffset.left + (axis.position == "left" ? box.width : 0); + } + + // draw tick bar + if (!axis.innermost) { + ctx.beginPath(); + xoff = yoff = 0; + if (axis.direction == "x") + xoff = plotWidth; + else + yoff = plotHeight; + + if (ctx.lineWidth == 1) { + x = Math.floor(x) + 0.5; + y = Math.floor(y) + 0.5; + } + + ctx.moveTo(x, y); + ctx.lineTo(x + xoff, y + yoff); + ctx.stroke(); + } + + // draw ticks + ctx.beginPath(); + for (i = 0; i < axis.ticks.length; ++i) { + var v = axis.ticks[i].v; + + xoff = yoff = 0; + + if (v < axis.min || v > axis.max + // skip those lying on the axes if we got a border + || (t == "full" && bw > 0 + && (v == axis.min || v == axis.max))) + continue; + + if (axis.direction == "x") { + x = axis.p2c(v); + yoff = t == "full" ? -plotHeight : t; + + if (axis.position == "top") + yoff = -yoff; + } + else { + y = axis.p2c(v); + xoff = t == "full" ? -plotWidth : t; + + if (axis.position == "left") + xoff = -xoff; + } + + if (ctx.lineWidth == 1) { + if (axis.direction == "x") + x = Math.floor(x) + 0.5; + else + y = Math.floor(y) + 0.5; + } + + ctx.moveTo(x, y); + ctx.lineTo(x + xoff, y + yoff); + } + + ctx.stroke(); + } + + + // draw border + if (bw) { + ctx.lineWidth = bw; + ctx.strokeStyle = options.grid.borderColor; + ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw); + } + + ctx.restore(); + } + + function insertAxisLabels() { + placeholder.find(".tickLabels").remove(); + + var html = ['
    ']; + + var axes = getUsedAxes(); + for (var j = 0; j < axes.length; ++j) { + var axis = axes[j], box = axis.box; + //debug: html.push('
    ') + html.push('
    '); + for (var i = 0; i < axis.ticks.length; ++i) { + var tick = axis.ticks[i]; + if (!tick.label || tick.v < axis.min || tick.v > axis.max) + continue; + + var pos = {}, align; + + if (axis.direction == "x") { + align = "center"; + pos.left = Math.round(plotOffset.left + axis.p2c(tick.v) - axis.labelWidth/2); + if (axis.position == "bottom") + pos.top = box.top + box.padding; + else + pos.bottom = canvasHeight - (box.top + box.height - box.padding); + } + else { + pos.top = Math.round(plotOffset.top + axis.p2c(tick.v) - axis.labelHeight/2); + if (axis.position == "left") { + pos.right = canvasWidth - (box.left + box.width - box.padding) + align = "right"; + } + else { + pos.left = box.left + box.padding; + align = "left"; + } + } + + pos.width = axis.labelWidth; + + var style = ["position:absolute", "text-align:" + align ]; + for (var a in pos) + style.push(a + ":" + pos[a] + "px") + + html.push('
    ' + tick.label + '
    '); + } + html.push('
    '); + } + + html.push('
    '); + + placeholder.append(html.join("")); + } + + function drawSeries(series) { + if (series.lines.show) + drawSeriesLines(series); + if (series.bars.show) + drawSeriesBars(series); + if (series.points.show) + drawSeriesPoints(series); + } + + function drawSeriesLines(series) { + function plotLine(datapoints, xoffset, yoffset, axisx, axisy) { + var points = datapoints.points, + ps = datapoints.pointsize, + prevx = null, prevy = null; + + ctx.beginPath(); + for (var i = ps; i < points.length; i += ps) { + var x1 = points[i - ps], y1 = points[i - ps + 1], + x2 = points[i], y2 = points[i + 1]; + + if (x1 == null || x2 == null) + continue; + + // clip with ymin + if (y1 <= y2 && y1 < axisy.min) { + if (y2 < axisy.min) + continue; // line segment is outside + // compute new intersection point + x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.min; + } + else if (y2 <= y1 && y2 < axisy.min) { + if (y1 < axisy.min) + continue; + x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.min; + } + + // clip with ymax + if (y1 >= y2 && y1 > axisy.max) { + if (y2 > axisy.max) + continue; + x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.max; + } + else if (y2 >= y1 && y2 > axisy.max) { + if (y1 > axisy.max) + continue; + x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.max; + } + + // clip with xmin + if (x1 <= x2 && x1 < axisx.min) { + if (x2 < axisx.min) + continue; + y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.min; + } + else if (x2 <= x1 && x2 < axisx.min) { + if (x1 < axisx.min) + continue; + y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.min; + } + + // clip with xmax + if (x1 >= x2 && x1 > axisx.max) { + if (x2 > axisx.max) + continue; + y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.max; + } + else if (x2 >= x1 && x2 > axisx.max) { + if (x1 > axisx.max) + continue; + y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.max; + } + + if (x1 != prevx || y1 != prevy) + ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset); + + prevx = x2; + prevy = y2; + ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset); + } + ctx.stroke(); + } + + function plotLineArea(datapoints, axisx, axisy) { + var points = datapoints.points, + ps = datapoints.pointsize, + bottom = Math.min(Math.max(0, axisy.min), axisy.max), + i = 0, top, areaOpen = false, + ypos = 1, segmentStart = 0, segmentEnd = 0; + + // we process each segment in two turns, first forward + // direction to sketch out top, then once we hit the + // end we go backwards to sketch the bottom + while (true) { + if (ps > 0 && i > points.length + ps) + break; + + i += ps; // ps is negative if going backwards + + var x1 = points[i - ps], + y1 = points[i - ps + ypos], + x2 = points[i], y2 = points[i + ypos]; + + if (areaOpen) { + if (ps > 0 && x1 != null && x2 == null) { + // at turning point + segmentEnd = i; + ps = -ps; + ypos = 2; + continue; + } + + if (ps < 0 && i == segmentStart + ps) { + // done with the reverse sweep + ctx.fill(); + areaOpen = false; + ps = -ps; + ypos = 1; + i = segmentStart = segmentEnd + ps; + continue; + } + } + + if (x1 == null || x2 == null) + continue; + + // clip x values + + // clip with xmin + if (x1 <= x2 && x1 < axisx.min) { + if (x2 < axisx.min) + continue; + y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.min; + } + else if (x2 <= x1 && x2 < axisx.min) { + if (x1 < axisx.min) + continue; + y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.min; + } + + // clip with xmax + if (x1 >= x2 && x1 > axisx.max) { + if (x2 > axisx.max) + continue; + y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x1 = axisx.max; + } + else if (x2 >= x1 && x2 > axisx.max) { + if (x1 > axisx.max) + continue; + y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; + x2 = axisx.max; + } + + if (!areaOpen) { + // open area + ctx.beginPath(); + ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom)); + areaOpen = true; + } + + // now first check the case where both is outside + if (y1 >= axisy.max && y2 >= axisy.max) { + ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max)); + ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max)); + continue; + } + else if (y1 <= axisy.min && y2 <= axisy.min) { + ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min)); + ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min)); + continue; + } + + // else it's a bit more complicated, there might + // be a flat maxed out rectangle first, then a + // triangular cutout or reverse; to find these + // keep track of the current x values + var x1old = x1, x2old = x2; + + // clip the y values, without shortcutting, we + // go through all cases in turn + + // clip with ymin + if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) { + x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.min; + } + else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) { + x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.min; + } + + // clip with ymax + if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) { + x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y1 = axisy.max; + } + else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) { + x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; + y2 = axisy.max; + } + + // if the x value was changed we got a rectangle + // to fill + if (x1 != x1old) { + ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1)); + // it goes to (x1, y1), but we fill that below + } + + // fill triangular section, this sometimes result + // in redundant points if (x1, y1) hasn't changed + // from previous line to, but we just ignore that + ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1)); + ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2)); + + // fill the other rectangle if it's there + if (x2 != x2old) { + ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2)); + ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2)); + } + } + } + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + ctx.lineJoin = "round"; + + var lw = series.lines.lineWidth, + sw = series.shadowSize; + // FIXME: consider another form of shadow when filling is turned on + if (lw > 0 && sw > 0) { + // draw shadow as a thick and thin line with transparency + ctx.lineWidth = sw; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + // position shadow at angle from the mid of line + var angle = Math.PI/18; + plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis); + ctx.lineWidth = sw/2; + plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis); + } + + ctx.lineWidth = lw; + ctx.strokeStyle = series.color; + var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight); + if (fillStyle) { + ctx.fillStyle = fillStyle; + plotLineArea(series.datapoints, series.xaxis, series.yaxis); + } + + if (lw > 0) + plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis); + ctx.restore(); + } + + function drawSeriesPoints(series) { + function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) { + var points = datapoints.points, ps = datapoints.pointsize; + + for (var i = 0; i < points.length; i += ps) { + var x = points[i], y = points[i + 1]; + if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) + continue; + + ctx.beginPath(); + x = axisx.p2c(x); + y = axisy.p2c(y) + offset; + if (symbol == "circle") + ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false); + else + symbol(ctx, x, y, radius, shadow); + ctx.closePath(); + + if (fillStyle) { + ctx.fillStyle = fillStyle; + ctx.fill(); + } + ctx.stroke(); + } + } + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + var lw = series.points.lineWidth, + sw = series.shadowSize, + radius = series.points.radius, + symbol = series.points.symbol; + if (lw > 0 && sw > 0) { + // draw shadow in two steps + var w = sw / 2; + ctx.lineWidth = w; + ctx.strokeStyle = "rgba(0,0,0,0.1)"; + plotPoints(series.datapoints, radius, null, w + w/2, true, + series.xaxis, series.yaxis, symbol); + + ctx.strokeStyle = "rgba(0,0,0,0.2)"; + plotPoints(series.datapoints, radius, null, w/2, true, + series.xaxis, series.yaxis, symbol); + } + + ctx.lineWidth = lw; + ctx.strokeStyle = series.color; + plotPoints(series.datapoints, radius, + getFillStyle(series.points, series.color), 0, false, + series.xaxis, series.yaxis, symbol); + ctx.restore(); + } + + function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) { + var left, right, bottom, top, + drawLeft, drawRight, drawTop, drawBottom, + tmp; + + // in horizontal mode, we start the bar from the left + // instead of from the bottom so it appears to be + // horizontal rather than vertical + if (horizontal) { + drawBottom = drawRight = drawTop = true; + drawLeft = false; + left = b; + right = x; + top = y + barLeft; + bottom = y + barRight; + + // account for negative bars + if (right < left) { + tmp = right; + right = left; + left = tmp; + drawLeft = true; + drawRight = false; + } + } + else { + drawLeft = drawRight = drawTop = true; + drawBottom = false; + left = x + barLeft; + right = x + barRight; + bottom = b; + top = y; + + // account for negative bars + if (top < bottom) { + tmp = top; + top = bottom; + bottom = tmp; + drawBottom = true; + drawTop = false; + } + } + + // clip + if (right < axisx.min || left > axisx.max || + top < axisy.min || bottom > axisy.max) + return; + + if (left < axisx.min) { + left = axisx.min; + drawLeft = false; + } + + if (right > axisx.max) { + right = axisx.max; + drawRight = false; + } + + if (bottom < axisy.min) { + bottom = axisy.min; + drawBottom = false; + } + + if (top > axisy.max) { + top = axisy.max; + drawTop = false; + } + + left = axisx.p2c(left); + bottom = axisy.p2c(bottom); + right = axisx.p2c(right); + top = axisy.p2c(top); + + // fill the bar + if (fillStyleCallback) { + c.beginPath(); + c.moveTo(left, bottom); + c.lineTo(left, top); + c.lineTo(right, top); + c.lineTo(right, bottom); + c.fillStyle = fillStyleCallback(bottom, top); + c.fill(); + } + + // draw outline + if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) { + c.beginPath(); + + // FIXME: inline moveTo is buggy with excanvas + c.moveTo(left, bottom + offset); + if (drawLeft) + c.lineTo(left, top + offset); + else + c.moveTo(left, top + offset); + if (drawTop) + c.lineTo(right, top + offset); + else + c.moveTo(right, top + offset); + if (drawRight) + c.lineTo(right, bottom + offset); + else + c.moveTo(right, bottom + offset); + if (drawBottom) + c.lineTo(left, bottom + offset); + else + c.moveTo(left, bottom + offset); + c.stroke(); + } + } + + function drawSeriesBars(series) { + function plotBars(datapoints, barLeft, barRight, offset, fillStyleCallback, axisx, axisy) { + var points = datapoints.points, ps = datapoints.pointsize; + + for (var i = 0; i < points.length; i += ps) { + if (points[i] == null) + continue; + drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, offset, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth); + } + } + + ctx.save(); + ctx.translate(plotOffset.left, plotOffset.top); + + // FIXME: figure out a way to add shadows (for instance along the right edge) + ctx.lineWidth = series.bars.lineWidth; + ctx.strokeStyle = series.color; + var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2; + var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null; + plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, 0, fillStyleCallback, series.xaxis, series.yaxis); + ctx.restore(); + } + + function getFillStyle(filloptions, seriesColor, bottom, top) { + var fill = filloptions.fill; + if (!fill) + return null; + + if (filloptions.fillColor) + return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor); + + var c = $.color.parse(seriesColor); + c.a = typeof fill == "number" ? fill : 0.4; + c.normalize(); + return c.toString(); + } + + function insertLegend() { + placeholder.find(".legend").remove(); + + if (!options.legend.show) + return; + + var fragments = [], rowStarted = false, + lf = options.legend.labelFormatter, s, label; + for (var i = 0; i < series.length; ++i) { + s = series[i]; + label = s.label; + if (!label) + continue; + + if (i % options.legend.noColumns == 0) { + if (rowStarted) + fragments.push(''); + fragments.push(''); + rowStarted = true; + } + + if (lf) + label = lf(label, s); + + fragments.push( + '
    ' + + '' + label + ''); + } + if (rowStarted) + fragments.push(''); + + if (fragments.length == 0) + return; + + var table = '' + fragments.join("") + '
    '; + if (options.legend.container != null) + $(options.legend.container).html(table); + else { + var pos = "", + p = options.legend.position, + m = options.legend.margin; + if (m[0] == null) + m = [m, m]; + if (p.charAt(0) == "n") + pos += 'top:' + (m[1] + plotOffset.top) + 'px;'; + else if (p.charAt(0) == "s") + pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;'; + if (p.charAt(1) == "e") + pos += 'right:' + (m[0] + plotOffset.right) + 'px;'; + else if (p.charAt(1) == "w") + pos += 'left:' + (m[0] + plotOffset.left) + 'px;'; + var legend = $('
    ' + table.replace('style="', 'style="position:absolute;' + pos +';') + '
    ').appendTo(placeholder); + if (options.legend.backgroundOpacity != 0.0) { + // put in the transparent background + // separately to avoid blended labels and + // label boxes + var c = options.legend.backgroundColor; + if (c == null) { + c = options.grid.backgroundColor; + if (c && typeof c == "string") + c = $.color.parse(c); + else + c = $.color.extract(legend, 'background-color'); + c.a = 1; + c = c.toString(); + } + var div = legend.children(); + $('
    ').prependTo(legend).css('opacity', options.legend.backgroundOpacity); + } + } + } + + + // interactive features + + var highlights = [], + redrawTimeout = null; + + // returns the data item the mouse is over, or null if none is found + function findNearbyItem(mouseX, mouseY, seriesFilter) { + var maxDistance = options.grid.mouseActiveRadius, + smallestDistance = maxDistance * maxDistance + 1, + item = null, foundPoint = false, i, j; + + for (i = series.length - 1; i >= 0; --i) { + if (!seriesFilter(series[i])) + continue; + + var s = series[i], + axisx = s.xaxis, + axisy = s.yaxis, + points = s.datapoints.points, + ps = s.datapoints.pointsize, + mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster + my = axisy.c2p(mouseY), + maxx = maxDistance / axisx.scale, + maxy = maxDistance / axisy.scale; + + if (s.lines.show || s.points.show) { + for (j = 0; j < points.length; j += ps) { + var x = points[j], y = points[j + 1]; + if (x == null) + continue; + + // For points and lines, the cursor must be within a + // certain distance to the data point + if (x - mx > maxx || x - mx < -maxx || + y - my > maxy || y - my < -maxy) + continue; + + // We have to calculate distances in pixels, not in + // data units, because the scales of the axes may be different + var dx = Math.abs(axisx.p2c(x) - mouseX), + dy = Math.abs(axisy.p2c(y) - mouseY), + dist = dx * dx + dy * dy; // we save the sqrt + + // use <= to ensure last point takes precedence + // (last generally means on top of) + if (dist < smallestDistance) { + smallestDistance = dist; + item = [i, j / ps]; + } + } + } + + if (s.bars.show && !item) { // no other point can be nearby + var barLeft = s.bars.align == "left" ? 0 : -s.bars.barWidth/2, + barRight = barLeft + s.bars.barWidth; + + for (j = 0; j < points.length; j += ps) { + var x = points[j], y = points[j + 1], b = points[j + 2]; + if (x == null) + continue; + + // for a bar graph, the cursor must be inside the bar + if (series[i].bars.horizontal ? + (mx <= Math.max(b, x) && mx >= Math.min(b, x) && + my >= y + barLeft && my <= y + barRight) : + (mx >= x + barLeft && mx <= x + barRight && + my >= Math.min(b, y) && my <= Math.max(b, y))) + item = [i, j / ps]; + } + } + } + + if (item) { + i = item[0]; + j = item[1]; + ps = series[i].datapoints.pointsize; + + return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps), + dataIndex: j, + series: series[i], + seriesIndex: i }; + } + + return null; + } + + function onMouseMove(e) { + if (options.grid.hoverable) + triggerClickHoverEvent("plothover", e, + function (s) { return s["hoverable"] != false; }); + } + + function onMouseLeave(e) { + if (options.grid.hoverable) + triggerClickHoverEvent("plothover", e, + function (s) { return false; }); + } + + function onClick(e) { + triggerClickHoverEvent("plotclick", e, + function (s) { return s["clickable"] != false; }); + } + + // trigger click or hover event (they send the same parameters + // so we share their code) + function triggerClickHoverEvent(eventname, event, seriesFilter) { + var offset = eventHolder.offset(), + canvasX = event.pageX - offset.left - plotOffset.left, + canvasY = event.pageY - offset.top - plotOffset.top, + pos = canvasToAxisCoords({ left: canvasX, top: canvasY }); + + pos.pageX = event.pageX; + pos.pageY = event.pageY; + + var item = findNearbyItem(canvasX, canvasY, seriesFilter); + + if (item) { + // fill in mouse pos for any listeners out there + item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left); + item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top); + } + + if (options.grid.autoHighlight) { + // clear auto-highlights + for (var i = 0; i < highlights.length; ++i) { + var h = highlights[i]; + if (h.auto == eventname && + !(item && h.series == item.series && + h.point[0] == item.datapoint[0] && + h.point[1] == item.datapoint[1])) + unhighlight(h.series, h.point); + } + + if (item) + highlight(item.series, item.datapoint, eventname); + } + + placeholder.trigger(eventname, [ pos, item ]); + } + + function triggerRedrawOverlay() { + if (!redrawTimeout) + redrawTimeout = setTimeout(drawOverlay, 30); + } + + function drawOverlay() { + redrawTimeout = null; + + // draw highlights + octx.save(); + octx.clearRect(0, 0, canvasWidth, canvasHeight); + octx.translate(plotOffset.left, plotOffset.top); + + var i, hi; + for (i = 0; i < highlights.length; ++i) { + hi = highlights[i]; + + if (hi.series.bars.show) + drawBarHighlight(hi.series, hi.point); + else + drawPointHighlight(hi.series, hi.point); + } + octx.restore(); + + executeHooks(hooks.drawOverlay, [octx]); + } + + function highlight(s, point, auto) { + if (typeof s == "number") + s = series[s]; + + if (typeof point == "number") { + var ps = s.datapoints.pointsize; + point = s.datapoints.points.slice(ps * point, ps * (point + 1)); + } + + var i = indexOfHighlight(s, point); + if (i == -1) { + highlights.push({ series: s, point: point, auto: auto }); + + triggerRedrawOverlay(); + } + else if (!auto) + highlights[i].auto = false; + } + + function unhighlight(s, point) { + if (s == null && point == null) { + highlights = []; + triggerRedrawOverlay(); + } + + if (typeof s == "number") + s = series[s]; + + if (typeof point == "number") + point = s.data[point]; + + var i = indexOfHighlight(s, point); + if (i != -1) { + highlights.splice(i, 1); + + triggerRedrawOverlay(); + } + } + + function indexOfHighlight(s, p) { + for (var i = 0; i < highlights.length; ++i) { + var h = highlights[i]; + if (h.series == s && h.point[0] == p[0] + && h.point[1] == p[1]) + return i; + } + return -1; + } + + function drawPointHighlight(series, point) { + var x = point[0], y = point[1], + axisx = series.xaxis, axisy = series.yaxis; + + if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) + return; + + var pointRadius = series.points.radius + series.points.lineWidth / 2; + octx.lineWidth = pointRadius; + octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString(); + var radius = 1.5 * pointRadius, + x = axisx.p2c(x), + y = axisy.p2c(y); + + octx.beginPath(); + if (series.points.symbol == "circle") + octx.arc(x, y, radius, 0, 2 * Math.PI, false); + else + series.points.symbol(octx, x, y, radius, false); + octx.closePath(); + octx.stroke(); + } + + function drawBarHighlight(series, point) { + octx.lineWidth = series.bars.lineWidth; + octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString(); + var fillStyle = $.color.parse(series.color).scale('a', 0.5).toString(); + var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2; + drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth, + 0, function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth); + } + + function getColorOrGradient(spec, bottom, top, defaultColor) { + if (typeof spec == "string") + return spec; + else { + // assume this is a gradient spec; IE currently only + // supports a simple vertical gradient properly, so that's + // what we support too + var gradient = ctx.createLinearGradient(0, top, 0, bottom); + + for (var i = 0, l = spec.colors.length; i < l; ++i) { + var c = spec.colors[i]; + if (typeof c != "string") { + var co = $.color.parse(defaultColor); + if (c.brightness != null) + co = co.scale('rgb', c.brightness) + if (c.opacity != null) + co.a *= c.opacity; + c = co.toString(); + } + gradient.addColorStop(i / (l - 1), c); + } + + return gradient; + } + } + } + + $.plot = function(placeholder, data, options) { + //var t0 = new Date(); + var plot = new Plot($(placeholder), data, options, $.plot.plugins); + //(window.console ? console.log : alert)("time used (msecs): " + ((new Date()).getTime() - t0.getTime())); + return plot; + }; + + $.plot.plugins = []; + + // returns a string with the date d formatted according to fmt + $.plot.formatDate = function(d, fmt, monthNames) { + var leftPad = function(n) { + n = "" + n; + return n.length == 1 ? "0" + n : n; + }; + + var r = []; + var escape = false, padNext = false; + var hours = d.getUTCHours(); + var isAM = hours < 12; + if (monthNames == null) + monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + + if (fmt.search(/%p|%P/) != -1) { + if (hours > 12) { + hours = hours - 12; + } else if (hours == 0) { + hours = 12; + } + } + for (var i = 0; i < fmt.length; ++i) { + var c = fmt.charAt(i); + + if (escape) { + switch (c) { + case 'h': c = "" + hours; break; + case 'H': c = leftPad(hours); break; + case 'M': c = leftPad(d.getUTCMinutes()); break; + case 'S': c = leftPad(d.getUTCSeconds()); break; + case 'd': c = "" + d.getUTCDate(); break; + case 'm': c = "" + (d.getUTCMonth() + 1); break; + case 'y': c = "" + d.getUTCFullYear(); break; + case 'b': c = "" + monthNames[d.getUTCMonth()]; break; + case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break; + case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break; + case '0': c = ""; padNext = true; break; + } + if (c && padNext) { + c = leftPad(c); + padNext = false; + } + r.push(c); + if (!padNext) + escape = false; + } + else { + if (c == "%") + escape = true; + else + r.push(c); + } + } + return r.join(""); + }; + + // round to nearby lower multiple of base + function floorInBase(n, base) { + return base * Math.floor(n / base); + } + +})(jQuery); diff --git a/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.min.js b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.min.js new file mode 100644 index 00000000..fe56e589 --- /dev/null +++ b/productMods/js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.min.js @@ -0,0 +1,462 @@ +(function($){$.color={};$.color.make=function(E,D,B,C){var F={};F.r=E||0;F.g=D||0;F.b=B||0;F.a=C!=null?C:1;F.add=function(I,H){for(var G=0;G=1){return"rgb("+[F.r,F.g,F.b].join(",")+")"}else{return"rgba("+[F.r,F.g,F.b,F.a].join(",")+")"}};F.normalize=function(){function G(I,J,H){return JH?H:J)}F.r=G(0,parseInt(F.r),255);F.g=G(0,parseInt(F.g),255);F.b=G(0,parseInt(F.b),255);F.a=G(0,F.a,1);return F};F.clone=function(){return $.color.make(F.r,F.b,F.g,F.a)};return F.normalize()};$.color.extract=function(C,B){var D;do{D=C.css(B).toLowerCase();if(D!=""&&D!="transparent"){break}C=C.parent()}while(!$.nodeName(C.get(0),"body"));if(D=="rgba(0, 0, 0, 0)"){D="transparent"}return $.color.parse(D)};$.color.parse=function(E){var D,B=$.color.make;if(D=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(E)){return B(parseInt(D[1],10),parseInt(D[2],10),parseInt(D[3],10))}if(D=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(E)){return B(parseInt(D[1],10),parseInt(D[2],10),parseInt(D[3],10),parseFloat(D[4]))}if(D=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(E)){return B(parseFloat(D[1])*2.55,parseFloat(D[2])*2.55,parseFloat(D[3])*2.55)}if(D=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(E)){return B(parseFloat(D[1])*2.55,parseFloat(D[2])*2.55,parseFloat(D[3])*2.55,parseFloat(D[4]))}if(D=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(E)){return B(parseInt(D[1],16),parseInt(D[2],16),parseInt(D[3],16))}if(D=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(E)){return B(parseInt(D[1]+D[1],16),parseInt(D[2]+D[2],16),parseInt(D[3]+D[3],16))}var C=$.trim(E).toLowerCase();if(C=="transparent"){return B(255,255,255,0)}else{D=A[C];return B(D[0],D[1],D[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function($){function Plot(placeholder,data_,options_,plugins){var series=[],options={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:0.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},hooks:{}},canvas=null,overlay=null,eventHolder=null,ctx=null,octx=null,xaxes=[],yaxes=[],plotOffset={left:0,right:0,top:0,bottom:0},canvasWidth=0,canvasHeight=0,plotWidth=0,plotHeight=0,hooks={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[]},plot=this;plot.setData=setData;plot.setupGrid=setupGrid;plot.draw=draw;plot.getPlaceholder=function(){return placeholder;};plot.getCanvas=function(){return canvas;};plot.getPlotOffset=function(){return plotOffset;};plot.width=function(){return plotWidth;};plot.height=function(){return plotHeight;};plot.offset=function(){var o=eventHolder.offset();o.left+=plotOffset.left;o.top+=plotOffset.top;return o;};plot.getData=function(){return series;};plot.getAxis=function(dir,number){var a=(dir=="x"?xaxes:yaxes)[number-1];if(a&&!a.used) +a=null;return a;};plot.getAxes=function(){var res={},i;for(i=0;i=options.colors.length){i=0;++variation;}} +var colori=0,s;for(i=0;iaxis.datamax) +axis.datamax=max;} +for(i=0;i0&&points[k-ps]!=null&&points[k-ps]!=points[k]&&points[k-ps+1]!=points[k+1]){for(m=0;mxmax) +xmax=val;} +if(f.y){if(valymax) +ymax=val;}}} +if(s.bars.show){var delta=s.bars.align=="left"?0:-s.bars.barWidth/2;if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth;} +else{xmin+=delta;xmax+=delta+s.bars.barWidth;}} +updateAxis(s.xaxis,xmin,xmax);updateAxis(s.yaxis,ymin,ymax);} +$.each(getUsedAxes(),function(i,axis){if(axis.datamin==topSentry) +axis.datamin=null;if(axis.datamax==bottomSentry) +axis.datamax=null;});} +function constructCanvas(){canvasWidth=placeholder.width();canvasHeight=placeholder.height();if(window.G_vmlCanvasManager) +placeholder.find("canvas").each(function(){this.context_=null;});placeholder.html("");if(placeholder.css("position")=='static') +placeholder.css("position","relative");if(canvasWidth<=0||canvasHeight<=0) +throw"Invalid dimensions for plot, width = "+canvasWidth+", height = "+canvasHeight;function makeCanvas(skipPositioning){var c=document.createElement('canvas');c.width=canvasWidth;c.height=canvasHeight;if(!skipPositioning) +$(c).css({position:'absolute',left:0,top:0});$(c).appendTo(placeholder);if(!c.getContext) +c=window.G_vmlCanvasManager.initElement(c);return c;} +canvas=makeCanvas(true);ctx=canvas.getContext("2d");overlay=makeCanvas();octx=overlay.getContext("2d");} +function bindEvents(){eventHolder=$([overlay,canvas]);if(options.grid.hoverable){eventHolder.mousemove(onMouseMove);eventHolder.mouseleave(onMouseLeave);} +if(options.grid.clickable) +eventHolder.click(onClick);executeHooks(hooks.bindEvents,[eventHolder]);} +function setTransformationHelpers(axis){function identity(x){return x;} +var s,m,t=axis.options.transform||identity,it=axis.options.inverseTransform;if(axis.direction=="x"){s=axis.scale=plotWidth/(t(axis.max)-t(axis.min));m=t(axis.min);if(t==identity) +axis.p2c=function(p){return(p-m)*s;};else +axis.p2c=function(p){return(t(p)-m)*s;};if(!it) +axis.c2p=function(c){return m+c/s;};else +axis.c2p=function(c){return it(m+c/s);};} +else{s=axis.scale=plotHeight/(t(axis.max)-t(axis.min));m=t(axis.max);if(t==identity) +axis.p2c=function(p){return(m-p)*s;};else +axis.p2c=function(p){return(m-t(p))*s;};if(!it) +axis.c2p=function(c){return m-c/s;};else +axis.c2p=function(c){return it(m-c/s);};}} +function measureTickLabels(axis){if(!axis) +return;var opts=axis.options,i,ticks=axis.ticks||[],labels=[],l,w=opts.labelWidth,h=opts.labelHeight,dummyDiv;function makeDummyDiv(labels,width){return $('
    '+'
    ' ++labels.join("")+'
    ').appendTo(placeholder);} +if(axis.direction=="x"){if(w==null) +w=Math.floor(canvasWidth/(ticks.length>0?ticks.length:1));if(h==null){labels=[];for(i=0;i'+l+'
    ');} +if(labels.length>0){labels.push('
    ');dummyDiv=makeDummyDiv(labels,"width:10000px;");h=dummyDiv.height();dummyDiv.remove();}}} +else if(w==null||h==null){for(i=0;i'+l+'');} +if(labels.length>0){dummyDiv=makeDummyDiv(labels,"");if(w==null) +w=dummyDiv.children().width();if(h==null) +h=dummyDiv.find("div.tickLabel").height();dummyDiv.remove();}} +if(w==null) +w=0;if(h==null) +h=0;axis.labelWidth=w;axis.labelHeight=h;} +function computeAxisBox(axis){if(!axis||!axis.labelWidth||!axis.labelHeight) +return;var lw=axis.labelWidth,lh=axis.labelHeight,pos=axis.options.position,tickLength=axis.options.tickLength,axismargin=options.grid.axisMargin,padding=options.grid.labelMargin,all=axis.direction=="x"?xaxes:yaxes,index;var samePosition=$.grep(all,function(a){return a&&a.options.position==pos&&(a.labelHeight||a.labelWidth);});if($.inArray(axis,samePosition)==samePosition.length-1) +axismargin=0;if(tickLength==null) +tickLength="full";var sameDirection=$.grep(all,function(a){return a&&(a.labelHeight||a.labelWidth);});var innermost=$.inArray(axis,sameDirection)==0;if(!innermost&&tickLength=="full") +tickLength=5;if(!isNaN(+tickLength)) +padding+=+tickLength;if(axis.direction=="x"){lh+=padding;if(pos=="bottom"){plotOffset.bottom+=lh+axismargin;axis.box={top:canvasHeight-plotOffset.bottom,height:lh};} +else{axis.box={top:plotOffset.top+axismargin,height:lh};plotOffset.top+=lh+axismargin;}} +else{lw+=padding;if(pos=="left"){axis.box={left:plotOffset.left+axismargin,width:lw};plotOffset.left+=lw+axismargin;} +else{plotOffset.right+=lw+axismargin;axis.box={left:canvasWidth-plotOffset.right,width:lw};}} +axis.position=pos;axis.tickLength=tickLength;axis.box.padding=padding;axis.innermost=innermost;} +function fixupAxisBox(axis){if(!axis||!axis.labelWidth||!axis.labelHeight) +return;if(axis.direction=="x"){axis.box.left=plotOffset.left;axis.box.width=plotWidth;} +else{axis.box.top=plotOffset.top;axis.box.height=plotHeight;}} +function setupGrid(){var axes=getUsedAxes(),j,k;for(k=0;k=0;--j) +computeAxisBox(xaxes[j]);for(j=yaxes.length-1;j>=0;--j) +computeAxisBox(yaxes[j]);var maxOutset=0;for(var i=0;i=0) +min=0;} +if(opts.max==null){max+=delta*margin;if(max>0&&axis.datamax!=null&&axis.datamax<=0) +max=0;}}} +axis.min=min;axis.max=max;} +function setupTickGeneration(axis){var opts=axis.options;var noTicks;if(typeof opts.ticks=="number"&&opts.ticks>0) +noTicks=opts.ticks;else if(axis.direction=="x") +noTicks=0.3*Math.sqrt(canvasWidth);else +noTicks=0.3*Math.sqrt(canvasHeight);var delta=(axis.max-axis.min)/noTicks,size,generator,unit,formatter,i,magn,norm;if(opts.mode=="time"){var timeUnitSize={"second":1000,"minute":60*1000,"hour":60*60*1000,"day":24*60*60*1000,"month":30*24*60*60*1000,"year":365.2425*24*60*60*1000};var spec=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var minSize=0;if(opts.minTickSize!=null){if(typeof opts.tickSize=="number") +minSize=opts.tickSize;else +minSize=opts.minTickSize[0]*timeUnitSize[opts.minTickSize[1]];} +for(var i=0;i=minSize) +break;size=spec[i][0];unit=spec[i][1];if(unit=="year"){magn=Math.pow(10,Math.floor(Math.log(delta/timeUnitSize.year)/Math.LN10));norm=(delta/timeUnitSize.year)/magn;if(norm<1.5) +size=1;else if(norm<3) +size=2;else if(norm<7.5) +size=5;else +size=10;size*=magn;} +axis.tickSize=opts.tickSize||[size,unit];generator=function(axis){var ticks=[],tickSize=axis.tickSize[0],unit=axis.tickSize[1],d=new Date(axis.min);var step=tickSize*timeUnitSize[unit];if(unit=="second") +d.setUTCSeconds(floorInBase(d.getUTCSeconds(),tickSize));if(unit=="minute") +d.setUTCMinutes(floorInBase(d.getUTCMinutes(),tickSize));if(unit=="hour") +d.setUTCHours(floorInBase(d.getUTCHours(),tickSize));if(unit=="month") +d.setUTCMonth(floorInBase(d.getUTCMonth(),tickSize));if(unit=="year") +d.setUTCFullYear(floorInBase(d.getUTCFullYear(),tickSize));d.setUTCMilliseconds(0);if(step>=timeUnitSize.minute) +d.setUTCSeconds(0);if(step>=timeUnitSize.hour) +d.setUTCMinutes(0);if(step>=timeUnitSize.day) +d.setUTCHours(0);if(step>=timeUnitSize.day*4) +d.setUTCDate(1);if(step>=timeUnitSize.year) +d.setUTCMonth(0);var carry=0,v=Number.NaN,prev;do{prev=v;v=d.getTime();ticks.push(v);if(unit=="month"){if(tickSize<1){d.setUTCDate(1);var start=d.getTime();d.setUTCMonth(d.getUTCMonth()+1);var end=d.getTime();d.setTime(v+carry*timeUnitSize.hour+(end-start)*tickSize);carry=d.getUTCHours();d.setUTCHours(0);} +else +d.setUTCMonth(d.getUTCMonth()+tickSize);} +else if(unit=="year"){d.setUTCFullYear(d.getUTCFullYear()+tickSize);} +else +d.setTime(v+step);}while(vmaxDec) +dec=maxDec;magn=Math.pow(10,-dec);norm=delta/magn;if(norm<1.5) +size=1;else if(norm<3){size=2;if(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec;}} +else if(norm<7.5) +size=5;else +size=10;size*=magn;if(opts.minTickSize!=null&&size0){if(opts.min==null) +axis.min=Math.min(axis.min,niceTicks[0]);if(opts.max==null&&niceTicks.length>1) +axis.max=Math.max(axis.max,niceTicks[niceTicks.length-1]);} +generator=function(axis){var ticks=[],v,i;for(i=0;i1&&/\..*0$/.test((ts[1]-ts[0]).toFixed(extraDec)))) +axis.tickDecimals=extraDec;}}} +axis.tickGenerator=generator;if($.isFunction(opts.tickFormatter)) +axis.tickFormatter=function(v,axis){return""+opts.tickFormatter(v,axis);};else +axis.tickFormatter=formatter;} +function setTicks(axis){axis.ticks=[];var oticks=axis.options.ticks,ticks=[];if(oticks==null||(typeof oticks=="number"&&oticks>0)) +ticks=axis.tickGenerator(axis);else if(oticks){if($.isFunction(oticks)) +ticks=oticks({min:axis.min,max:axis.max});else +ticks=oticks;} +var i,v;for(i=0;i1) +label=t[1];} +else +v=t;if(label==null) +label=axis.tickFormatter(v,axis);axis.ticks[i]={v:v,label:label};}} +function snapRangeToTicks(axis,ticks){if(axis.options.autoscaleMargin&&ticks.length>0){if(axis.options.min==null) +axis.min=Math.min(axis.min,ticks[0].v);if(axis.options.max==null&&ticks.length>1) +axis.max=Math.max(axis.max,ticks[ticks.length-1].v);}} +function draw(){ctx.clearRect(0,0,canvasWidth,canvasHeight);var grid=options.grid;if(grid.show&&grid.backgroundColor) +drawBackground();if(grid.show&&!grid.aboveData) +drawGrid();for(var i=0;ito){var tmp=from;from=to;to=tmp;} +return{from:from,to:to,axis:axis};} +function drawBackground(){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,"rgba(255, 255, 255, 0)");ctx.fillRect(0,0,plotWidth,plotHeight);ctx.restore();} +function drawGrid(){var i;ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var markings=options.grid.markings;if(markings){if($.isFunction(markings)){var axes=plot.getAxes();axes.xmin=axes.xaxis.min;axes.xmax=axes.xaxis.max;axes.ymin=axes.yaxis.min;axes.ymax=axes.yaxis.max;markings=markings(axes);} +for(i=0;ixrange.axis.max||yrange.toyrange.axis.max) +continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max);yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);if(xrange.from==xrange.to&&yrange.from==yrange.to) +continue;xrange.from=xrange.axis.p2c(xrange.from);xrange.to=xrange.axis.p2c(xrange.to);yrange.from=yrange.axis.p2c(yrange.from);yrange.to=yrange.axis.p2c(yrange.to);if(xrange.from==xrange.to||yrange.from==yrange.to){ctx.beginPath();ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.lineWidth=m.lineWidth||options.grid.markingsLineWidth;ctx.moveTo(xrange.from,yrange.from);ctx.lineTo(xrange.to,yrange.to);ctx.stroke();} +else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to);}}} +var axes=getUsedAxes(),bw=options.grid.borderWidth;for(var j=0;jaxis.max||(t=="full"&&bw>0&&(v==axis.min||v==axis.max))) +continue;if(axis.direction=="x"){x=axis.p2c(v);yoff=t=="full"?-plotHeight:t;if(axis.position=="top") +yoff=-yoff;} +else{y=axis.p2c(v);xoff=t=="full"?-plotWidth:t;if(axis.position=="left") +xoff=-xoff;} +if(ctx.lineWidth==1){if(axis.direction=="x") +x=Math.floor(x)+0.5;else +y=Math.floor(y)+0.5;} +ctx.moveTo(x,y);ctx.lineTo(x+xoff,y+yoff);} +ctx.stroke();} +if(bw){ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw);} +ctx.restore();} +function insertAxisLabels(){placeholder.find(".tickLabels").remove();var html=['
    '];var axes=getUsedAxes();for(var j=0;j');for(var i=0;iaxis.max) +continue;var pos={},align;if(axis.direction=="x"){align="center";pos.left=Math.round(plotOffset.left+axis.p2c(tick.v)-axis.labelWidth/2);if(axis.position=="bottom") +pos.top=box.top+box.padding;else +pos.bottom=canvasHeight-(box.top+box.height-box.padding);} +else{pos.top=Math.round(plotOffset.top+axis.p2c(tick.v)-axis.labelHeight/2);if(axis.position=="left"){pos.right=canvasWidth-(box.left+box.width-box.padding) +align="right";} +else{pos.left=box.left+box.padding;align="left";}} +pos.width=axis.labelWidth;var style=["position:absolute","text-align:"+align];for(var a in pos) +style.push(a+":"+pos[a]+"px") +html.push('
    '+tick.label+'
    ');} +html.push('
    ');} +html.push('');placeholder.append(html.join(""));} +function drawSeries(series){if(series.lines.show) +drawSeriesLines(series);if(series.bars.show) +drawSeriesBars(series);if(series.points.show) +drawSeriesPoints(series);} +function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,prevx=null,prevy=null;ctx.beginPath();for(var i=ps;i=y2&&y1>axisy.max){if(y2>axisy.max) +continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max;} +else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max) +continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max;} +if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max) +continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max;} +else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max) +continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max;} +if(x1!=prevx||y1!=prevy) +ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset,axisy.p2c(y2)+yoffset);} +ctx.stroke();} +function plotLineArea(datapoints,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize,bottom=Math.min(Math.max(0,axisy.min),axisy.max),i=0,top,areaOpen=false,ypos=1,segmentStart=0,segmentEnd=0;while(true){if(ps>0&&i>points.length+ps) +break;i+=ps;var x1=points[i-ps],y1=points[i-ps+ypos],x2=points[i],y2=points[i+ypos];if(areaOpen){if(ps>0&&x1!=null&&x2==null){segmentEnd=i;ps=-ps;ypos=2;continue;} +if(ps<0&&i==segmentStart+ps){ctx.fill();areaOpen=false;ps=-ps;ypos=1;i=segmentStart=segmentEnd+ps;continue;}} +if(x1==null||x2==null) +continue;if(x1<=x2&&x1=x2&&x1>axisx.max){if(x2>axisx.max) +continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max;} +else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max) +continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max;} +if(!areaOpen){ctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true;} +if(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));continue;} +else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));continue;} +var x1old=x1,x2old=x2;if(y1<=y2&&y1=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min;} +else if(y2<=y1&&y2=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min;} +if(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max;} +else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max;} +if(x1!=x1old){ctx.lineTo(axisx.p2c(x1old),axisy.p2c(y1));} +ctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));if(x2!=x2old){ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(y2));}}} +ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineJoin="round";var lw=series.lines.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw;ctx.strokeStyle="rgba(0,0,0,0.1)";var angle=Math.PI/18;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/2),Math.cos(angle)*(lw/2+sw/2),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,Math.sin(angle)*(lw/2+sw/4),Math.cos(angle)*(lw/2+sw/4),series.xaxis,series.yaxis);} +ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis);} +if(lw>0) +plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore();} +function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,shadow,axisx,axisy,symbol){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;iaxisx.max||yaxisy.max) +continue;ctx.beginPath();x=axisx.p2c(x);y=axisy.p2c(y)+offset;if(symbol=="circle") +ctx.arc(x,y,radius,0,shadow?Math.PI:Math.PI*2,false);else +symbol(ctx,x,y,radius,shadow);ctx.closePath();if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill();} +ctx.stroke();}} +ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.points.lineWidth,sw=series.shadowSize,radius=series.points.radius,symbol=series.points.symbol;if(lw>0&&sw>0){var w=sw/2;ctx.lineWidth=w;ctx.strokeStyle="rgba(0,0,0,0.1)";plotPoints(series.datapoints,radius,null,w+w/2,true,series.xaxis,series.yaxis,symbol);ctx.strokeStyle="rgba(0,0,0,0.2)";plotPoints(series.datapoints,radius,null,w/2,true,series.xaxis,series.yaxis,symbol);} +ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,false,series.xaxis,series.yaxis,symbol);ctx.restore();} +function drawBar(x,y,b,barLeft,barRight,offset,fillStyleCallback,axisx,axisy,c,horizontal,lineWidth){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;if(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight;if(rightaxisx.max||topaxisy.max) +return;if(leftaxisx.max){right=axisx.max;drawRight=false;} +if(bottomaxisy.max){top=axisy.max;drawTop=false;} +left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top);if(fillStyleCallback){c.beginPath();c.moveTo(left,bottom);c.lineTo(left,top);c.lineTo(right,top);c.lineTo(right,bottom);c.fillStyle=fillStyleCallback(bottom,top);c.fill();} +if(lineWidth>0&&(drawLeft||drawRight||drawTop||drawBottom)){c.beginPath();c.moveTo(left,bottom+offset);if(drawLeft) +c.lineTo(left,top+offset);else +c.moveTo(left,top+offset);if(drawTop) +c.lineTo(right,top+offset);else +c.moveTo(right,top+offset);if(drawRight) +c.lineTo(right,bottom+offset);else +c.moveTo(right,bottom+offset);if(drawBottom) +c.lineTo(left,bottom+offset);else +c.moveTo(left,bottom+offset);c.stroke();}} +function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,offset,fillStyleCallback,axisx,axisy){var points=datapoints.points,ps=datapoints.pointsize;for(var i=0;i');fragments.push('');rowStarted=true;} +if(lf) +label=lf(label,s);fragments.push('
    '+''+label+'');} +if(rowStarted) +fragments.push('');if(fragments.length==0) +return;var table=''+fragments.join("")+'
    ';if(options.legend.container!=null) +$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;if(m[0]==null) +m=[m,m];if(p.charAt(0)=="n") +pos+='top:'+(m[1]+plotOffset.top)+'px;';else if(p.charAt(0)=="s") +pos+='bottom:'+(m[1]+plotOffset.bottom)+'px;';if(p.charAt(1)=="e") +pos+='right:'+(m[0]+plotOffset.right)+'px;';else if(p.charAt(1)=="w") +pos+='left:'+(m[0]+plotOffset.left)+'px;';var legend=$('
    '+table.replace('style="','style="position:absolute;'+pos+';')+'
    ').appendTo(placeholder);if(options.legend.backgroundOpacity!=0.0){var c=options.legend.backgroundColor;if(c==null){c=options.grid.backgroundColor;if(c&&typeof c=="string") +c=$.color.parse(c);else +c=$.color.extract(legend,'background-color');c.a=1;c=c.toString();} +var div=legend.children();$('
    ').prependTo(legend).css('opacity',options.legend.backgroundOpacity);}}} +var highlights=[],redrawTimeout=null;function findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,smallestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j;for(i=series.length-1;i>=0;--i){if(!seriesFilter(series[i])) +continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,ps=s.datapoints.pointsize,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;if(s.lines.show||s.points.show){for(j=0;jmaxx||x-mx<-maxx||y-my>maxy||y-my<-maxy) +continue;var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;if(dist=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight):(mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y))) +item=[i,j/ps];}}} +if(item){i=item[0];j=item[1];ps=series[i].datapoints.pointsize;return{datapoint:series[i].datapoints.points.slice(j*ps,(j+1)*ps),dataIndex:j,series:series[i],seriesIndex:i};} +return null;} +function onMouseMove(e){if(options.grid.hoverable) +triggerClickHoverEvent("plothover",e,function(s){return s["hoverable"]!=false;});} +function onMouseLeave(e){if(options.grid.hoverable) +triggerClickHoverEvent("plothover",e,function(s){return false;});} +function onClick(e){triggerClickHoverEvent("plotclick",e,function(s){return s["clickable"]!=false;});} +function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top,pos=canvasToAxisCoords({left:canvasX,top:canvasY});pos.pageX=event.pageX;pos.pageY=event.pageY;var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top);} +if(options.grid.autoHighlight){for(var i=0;iaxisx.max||yaxisy.max) +return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=$.color.parse(series.color).scale('a',0.5).toString();var radius=1.5*pointRadius,x=axisx.p2c(x),y=axisy.p2c(y);octx.beginPath();if(series.points.symbol=="circle") +octx.arc(x,y,radius,0,2*Math.PI,false);else +series.points.symbol(octx,x,y,radius,false);octx.closePath();octx.stroke();} +function drawBarHighlight(series,point){octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=$.color.parse(series.color).scale('a',0.5).toString();var fillStyle=$.color.parse(series.color).scale('a',0.5).toString();var barLeft=series.bars.align=="left"?0:-series.bars.barWidth/2;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,0,function(){return fillStyle;},series.xaxis,series.yaxis,octx,series.bars.horizontal,series.bars.lineWidth);} +function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec=="string") +return spec;else{var gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i12){hours=hours-12;}else if(hours==0){hours=12;}} +for(var i=0;i currentMaxYear)) + if (((val.data[i][0] < normalizedYearRange.normalizedMinYear) || (val.data[i][0] > normalizedYearRange.normalizedMaxYear)) && val.data[i][1] == 0) { val.data.splice(i, 1); @@ -320,6 +319,43 @@ function unStuffZerosFromLineGraph(jsonObject) { } } + +/** + * This is used to normalize the year range for the currently selected entities to always + * display the last 10 years worth of data points. + * + */ +function getNormalizedYearRange() { + + /* + * This is done to make sure that at least last 10 years worth of data points + * can be displayed. + * */ + if (globalDateObject.getFullYear() < year.globalMax) { + + inferredMaxYear = year.globalMax; + + } else { + + inferredMaxYear = globalDateObject.getFullYear(); + } + + if (globalDateObject.getFullYear() - 9 > year.globalMin) { + + inferredMinYear = year.globalMin; + + } else { + + inferredMinYear = globalDateObject.getFullYear() - 9; + } + + return { + normalizedMinYear: inferredMinYear, + normalizedMaxYear: inferredMaxYear, + normalizedRange: inferredMaxYear - inferredMinYear + }; +} + /** * stuffZerosIntoLineGraphs is used to fill discontinuities in data points. For * example, if a linegraph has the following data points [1990, @@ -335,23 +371,25 @@ function unStuffZerosFromLineGraph(jsonObject) { * @returns jsonObject with stuffed data points. */ function stuffZerosIntoLineGraphs(jsonObject, year) { - + calcZeroLessMinAndMax(jsonObject, year); - var arrayOfMinAndMaxYears = [ year.globalMin, year.globalMax ]; - - $ - .each( - jsonObject, + var normalizedYearRange = getNormalizedYearRange(); + + $.each(jsonObject, function(key, val) { - var position = arrayOfMinAndMaxYears[0], i = 0; + var position = normalizedYearRange.normalizedMinYear, i = 0; + + //console.log(key, val, position, (arrayOfMinAndMaxYears[1] - arrayOfMinAndMaxYears[0]) + 1); - for (i = 0; i < (arrayOfMinAndMaxYears[1] - arrayOfMinAndMaxYears[0]) + 1; i++) { + for (i = 0; i < normalizedYearRange.normalizedRange + 1; i++) { + //console.log("val.data[i]", val.data[i]); + if (val.data[i]) { if (val.data[i][0] != position - && position <= arrayOfMinAndMaxYears[1]) { + && position <= normalizedYearRange.normalizedMaxYear) { val.data.splice(i, 0, [ position, 0 ]); } } @@ -362,6 +400,8 @@ function stuffZerosIntoLineGraphs(jsonObject, year) { position++; } }); + + //console.log("after stuffing", jsonObject); } /** * During runtime, when the user checks/unchecks a checkbox, the zeroes have to @@ -375,36 +415,27 @@ function stuffZerosIntoLineGraphs(jsonObject, year) { */ function calcZeroLessMinAndMax(jsonObject, year) { - var globalMinYear = 5000, globalMaxYear = 0, minYear, maxYear, i = 0; + var validYearsInData = new Array(); $.each(jsonObject, function(key, val) { for (i = 0; i < val.data.length; i++) { - if (val.data[i][1] != 0) { - minYear = val.data[i][0]; - break; - } - } - - for (i = val.data.length - 1; i >= 0; i--) { - if (val.data[i][1] != 0 && val.data[i][0] != -1) { - maxYear = val.data[i][0]; - break; - } - - } - if (globalMinYear > minYear) { - globalMinYear = minYear; - } - if (globalMaxYear < maxYear) { - globalMaxYear = maxYear; + /* + * TO make sure that, + * 1. Not to consider years that dont have any counts attached to it. + * 2. Not to consider unknown years indicated by "-1". + * */ + if (val.data[i][1] != 0 && val.data[i][0] != -1) { + validYearsInData.push(val.data[i][0]); + } } - + }); - year.globalMin = globalMinYear; - year.globalMax = globalMaxYear; + year.globalMin = Math.min.apply(Math, validYearsInData); + year.globalMax = Math.max.apply(Math, validYearsInData); + } /** @@ -416,86 +447,85 @@ function calcZeroLessMinAndMax(jsonObject, year) { * @returns [minYear, maxYear] */ function calcMinandMaxYears(jsonObject, year) { - var minYear = 5000, maxYear = 0; + + var validYearsInData = new Array(); + $.each(jsonObject, function(key, val) { - if (minYear > val.data[0][0]) { - minYear = val.data[0][0]; - } - if (maxYear < val.data[val.data.length - 1][0] - && val.data[val.data.length - 1][0] != -1){ - maxYear = val.data[val.data.length - 1][0]; - }else { - if(val.data.length != 1){ - maxYear = val.data[val.data.length - 2][0]; + + for (i = 0; i < val.data.length; i++) { + + /* + * TO make sure that, + * 1. Not to consider years that dont have any counts attached to it. + * 2. Not to consider unknown years indicated by "-1". + * */ + if (val.data[i][1] != 0 && val.data[i][0] != -1) { + validYearsInData.push(val.data[i][0]); } } + }); - - year.min = minYear; - year.max = maxYear; + + + year.min = Math.min.apply(Math, validYearsInData); + year.max = Math.max.apply(Math, validYearsInData); + } /** - * y is an an object with two properties label and data. data is of the form - * [year,value] This function returns the max of all values. - * - * @param {Object} - * jsonObject + * This function returns the max from the counts of all the entities. Mainly used to + * normalize the width of bar below the line graph, also known as legend row. + * @returns maxCount */ -function calcMaxOfComparisonParameter(jsonObject) { - var sum = 0, i = 0, maxCount = 0; +function calcMaxOfComparisonParameter(allEntities) { - $.each(jsonObject, function(key, val) { - for (i = 0; i < val.data.length; i++) - sum += val.data[i][1]; + var validCountsInData = new Array(); + + $.each(allEntities, function(key, currentEntity) { + validCountsInData.push(calcSumOfComparisonParameter(currentEntity)); + }); - if (maxCount < sum) - maxCount = sum; - - sum = 0; - }); - -// console.log('returning max value' + maxCount); - return maxCount; + return Math.max.apply(Math, validCountsInData); } function calcMaxWithinComparisonParameter(jsonObject){ - var value = 0, i = 0, maxCount = 0; - + var validCountsInData = new Array(); + $.each(jsonObject, function(key, val) { - for (i = 0; i < val.data.length; i++){ - value = val.data[i][1]; - // console.log(val.data[i][1]); - - if (maxCount < value){ - maxCount = value; + + for (i = 0; i < val.data.length; i++) { + + /* + * TO make sure that, + * 1. Not to consider years that dont have any counts attached to it. + * 2. Not to consider unknown years indicated by "-1". + * */ + if (val.data[i][1] != 0 && val.data[i][0] != -1) { + validCountsInData.push(val.data[i][1]); } } + }); - //console.log('max value: ' + maxCount); - return maxCount; + return Math.max.apply(Math, validCountsInData); } /** - * x is an object and it has two properties label and data. data is a two - * dimensional array of the form [year, value] This function returns the sum of - * all the values. - * - * @param {Object} - * jsonObject + * This is used to find out the sum of all the counts of a particular entity. This is + * especially useful to render the bars below the line graph where it doesnt matter if + * a count has any associated year to it or not. * @returns sum{values}. */ -function calcSumOfComparisonParameter(jsonObject) { +function calcSumOfComparisonParameter(entity) { - var sum = 0, i = 0; - for (i = 0; i < jsonObject.data.length; i++) { - sum += jsonObject.data[i][1]; - } + var sum = 0; + + $.each(entity.data, function(index, data){ + sum += this[1]; + }); - // sum += jsonObject.publicationCount; return sum; } @@ -533,6 +563,9 @@ function setLineWidthAndTickSize(yearRange, flotOptions) { } else if (yearRange > 15 && yearRange < 70) { flotOptions.series.lines.lineWidth = 2; flotOptions.xaxis.tickSize = 5; + } else if (yearRange == 0 ) { + flotOptions.series.lines.lineWidth = 3; + flotOptions.xaxis.tickSize = 1; } else { flotOptions.series.lines.lineWidth = 1; flotOptions.xaxis.tickSize = 10; @@ -715,7 +748,9 @@ function setOptionsForPagination(object, itemsPerPage, numberOfDisplayEntries, * * @jsonRecords the set of entities from which the unknowns have to be removed. */ + function removeUnknowns(jsonRecords) { + var i = 0, j = 0; while (j < jsonRecords.length) { @@ -731,9 +766,11 @@ function removeUnknowns(jsonRecords) { } j++; } + } function insertBackUnknowns(jsonRecords) { + var i = 0, j = 0; while (j < jsonRecords.length) { @@ -775,8 +812,13 @@ function getNormalizedWidth(entity, sum){ var normalizedWidth = 0; normalizedWidth = Math.floor(225 * (sum / maxValueOfComparisonParameter)); - - return normalizedWidth; + + /* + * This will make sure that the entites that have very low count have at least + * 1 pixel width bar. This happens when the highest count organization has a very high count + * compared to the lowest count organization. + * */ + return normalizedWidth === 0 ? 1 : normalizedWidth; } function renderLineGraph(renderedObjects, entity){ @@ -804,12 +846,13 @@ function removeEntityUnChecked(renderedObjects, entity){ //remove the entity that is unchecked var ii = 0; while (ii < renderedObjects.length) { + if (renderedObjects[ii].label == entity.label) { unStuffZerosFromLineGraph(renderedObjects[ii]); renderedObjects.splice(ii, 1); } else { ii++; - } + } } unStuffZerosFromLineGraphs(renderedObjects, year); @@ -824,7 +867,7 @@ function generateCheckBoxes(label, checkedFlag, fontFlag){ var checkbox = $(''); checkbox.attr('type','checkbox'); - checkbox.attr('class','if_clicked_on_school'); + checkbox.attr('class', entityCheckboxSelectorDOMClass); checkbox.attr('value', label); if(checkedFlag == 1){ checkbox.attr('checked'); @@ -853,7 +896,6 @@ function clearRenderedObjects(){ removeEntityUnChecked(renderedObjects, labelToEntityRecord[$(val).attr("value")]); removeLegendRow(val); displayLineGraphs(); - //console.log(index); } }); @@ -873,16 +915,23 @@ function updateCounter(){ } function displayLineGraphs(){ + //plot all we got if (renderedObjects.length == 0) { + init(graphContainer); + } else { + removeUnknowns(renderedObjects); $.plot(graphContainer, renderedObjects, FlotOptions); insertBackUnknowns(renderedObjects); + } } + + function removeCheckBoxFromGlobalSet(checkbox){ //remove checkbox object from the globals var value = $(checkbox).attr("value"); @@ -907,6 +956,7 @@ function prepareTableForDataTablePagination(jsonData){ table.attr('border', '0'); table.attr('id', 'datatable'); table.css('font-size', '0.9em'); + table.css('width', '100%'); var thead = $(''); var tr = $(''); @@ -915,7 +965,7 @@ function prepareTableForDataTablePagination(jsonData){ checkboxTH.html(' '); var entityLabelTH = $(''); - entityLabelTH.html('Entity Label'); + entityLabelTH.html('Entity Name'); var publicationCountTH = $(''); if($("select.comparisonValues option:selected").text() === "by Publications"){ @@ -943,7 +993,7 @@ function prepareTableForDataTablePagination(jsonData){ var row = $(''); var checkboxTD = $(''); - checkboxTD.html('
     
    '); + checkboxTD.html('
     
    '); var labelTD = $(''); labelTD.css("width", "100px"); @@ -970,17 +1020,17 @@ function prepareTableForDataTablePagination(jsonData){ var searchBarParentContainerDIVClass = "searchbar"; var entityListTable = $('#datatable').dataTable({ - "sDom": '<"' + searchBarParentContainerDIVClass + '"f><"filterInfo"i><"paginatedtabs"p><"datatablewrapper"t>', + "sDom": '<"' + searchBarParentContainerDIVClass + '"f><"filterInfo"i><"paginatedtabs"p><"table-separator"><"datatablewrapper"t>', "aaSorting": [ - [2, "desc"] + [2, "desc"], [1,'asc'] ], "asStripClasses": [], "iDisplayLength": 10, "bInfo": true, "oLanguage": { - "sInfo": "_START_ - _END_ of _TOTAL_", + "sInfo": "Records _START_ - _END_ of _TOTAL_", "sInfoEmpty": "No matching entities found", - "sInfoFiltered": "", + "sInfoFiltered": "" }, "sPaginationType": "gmail_style", "fnDrawCallback": function () { @@ -1003,8 +1053,10 @@ function prepareTableForDataTablePagination(jsonData){ entityListTable.fnFilter(""); }); + /* var filterInfo = $(".filterInfo").detach(); $("#infoContainer").append(filterInfo); + */ } @@ -1033,26 +1085,41 @@ function removeStopWords(val){ return typeStringWithoutStopWords.substring(1, typeStringWithoutStopWords.length); } -function setEntityLevel(){ - $('#entitylevelheading').text(' - ' + toCamelCase(entityLevel) + ' Level').css('font-style', 'italic'); +function setEntityLevel(entityLevel){ + //$('#entitylevelheading').text(' - ' + toCamelCase(entityLevel) + ' Level').css('font-style', 'italic'); $('#entityleveltext').text(' ' + entityLevel.toLowerCase()).css('font-style', 'italic'); - $('#entityHeader').text(toCamelCase(entityLevel)).css('font-weight', 'bold'); + $('#entityHeader').text(entityLevel).css('font-weight', 'bold'); $('#headerText').css("color", "#2485ae"); } function getEntityVisMode(jsonData){ + var entityLevels = new Array(); + $.each(jsonData, function(index, val) { if (val.visMode == "PERSON"){ - entityLevel = "People"; + entityLevels.push("People"); } else { - entityLevel = "Organizations"; + entityLevels.push("Organizations"); } - return; }); - /* To provide graceful degradation set entity level to a default error message.*/ - entitylevel = "ENTITY LEVEL UNDEFINED ERROR"; + var uniqueEntityLevels = $.unique(entityLevels); + + /* + * This case is when organizations & people are mixed because both are directly attached + * to the parent organization. + * */ + if (uniqueEntityLevels.length > 1) { + entityLevel = "Organizations & People"; + } else if (uniqueEntityLevels.length === 1) { + entityLevel = uniqueEntityLevels[0]; + } else { + /* To provide graceful degradation set entity level to a default error message.*/ + entitylevel = "ENTITY LEVEL UNDEFINED ERROR"; + } + + return entityLevel; } function toCamelCase(string){ @@ -1071,7 +1138,7 @@ function getSize(map){ function disableUncheckedEntities(){ - $.each($("input[type=checkbox].if_clicked_on_school:not(:checked)"), function(index, val){ + $.each($("input[type=checkbox]." + entityCheckboxSelectorDOMClass + ":not(:checked)"), function(index, val){ $(val).attr('disabled', true); $(val).prev().show(); }); @@ -1100,7 +1167,7 @@ function disableUncheckedEntities(){ function enableUncheckedEntities(){ - $.each($("input[type=checkbox].if_clicked_on_school:not(:checked)"), function(index, val){ + $.each($("input[type=checkbox]." + entityCheckboxSelectorDOMClass + ":not(:checked)"), function(index, val){ $(val).attr('disabled', false); $(val).prev().hide(); }); @@ -1112,9 +1179,7 @@ function enableUncheckedEntities(){ function checkIfColorLimitIsReached(){ -// console.log(getSize(labelToCheckedEntities)); - - if(getSize(labelToCheckedEntities) >= 10){ + if (getSize(labelToCheckedEntities) >= 10) { disableUncheckedEntities(); } else { enableUncheckedEntities(); @@ -1130,9 +1195,8 @@ function setTickSizeOfAxes(){ checkedLabelToEntityRecord[index] = labelToEntityRecord[index]; }); - calcMinandMaxYears(checkedLabelToEntityRecord, year); - yearRange = (year.max - year.min); + var normalizedYearRange = getNormalizedYearRange(); - setLineWidthAndTickSize(yearRange, FlotOptions); + setLineWidthAndTickSize(normalizedYearRange.normalizedRange, FlotOptions); setTickSizeOfYAxis(calcMaxWithinComparisonParameter(checkedLabelToEntityRecord), FlotOptions); } \ No newline at end of file diff --git a/productMods/js/visualization/personlevel/person-level.js b/productMods/js/visualization/personlevel/person-level.js index 62f4bd97..ec625d33 100644 --- a/productMods/js/visualization/personlevel/person-level.js +++ b/productMods/js/visualization/personlevel/person-level.js @@ -82,17 +82,6 @@ function getWellFormedURLs(given_uri, type) { } } -$.fn.image = function(src, successFunc, failureFunc){ - return this.each(function(){ - var profileImage = new Image(); - profileImage.onerror = failureFunc; - profileImage.onload = successFunc; - profileImage.src = src; - - return profileImage; - }); -}; - function setProfileImage(imageContainerID, mainImageURL) { if (imageContainerID == "") { diff --git a/productMods/js/visualization/sparkline.js b/productMods/js/visualization/sparkline.js index f5033a41..36abc5f2 100644 --- a/productMods/js/visualization/sparkline.js +++ b/productMods/js/visualization/sparkline.js @@ -21,10 +21,6 @@ var visualization = { if ($.trim(data) != "") { containerCoAuthor.html(data); containerCoAuthor.children("#pub_count_short_sparkline_vis"); - - /* Since there are publications there are chances that there will be co-authors as well, so show the - * co-author network icon.*/ - $("#coauthorship_link_container").show(); } } diff --git a/productMods/js/visualization/visualization-helper-functions.js b/productMods/js/visualization/visualization-helper-functions.js new file mode 100644 index 00000000..fff90383 --- /dev/null +++ b/productMods/js/visualization/visualization-helper-functions.js @@ -0,0 +1,97 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +/** + * For rendering images dynamically. + * + */ +$.fn.image = function(src, successFunc, failureFunc){ + return this.each(function(){ + var profileImage = new Image(); + profileImage.onerror = failureFunc; + profileImage.onload = successFunc; + profileImage.src = src; + + return profileImage; + }); +}; + + +/** + * Function by Google Charts API Team to do "extended encode" of data. +*/ +function extendedEncodeDataForChartURL(arrVals, maxVal) { + + var EXTENDED_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.'; + var EXTENDED_MAP_LENGTH = EXTENDED_MAP.length; + var chartData = 'e:'; + + for (i = 0, len = arrVals.length; i < len; i++) { + // In case the array vals were translated to strings. + var numericVal = new Number(arrVals[i]); + // Scale the value to maxVal. + var scaledVal = Math.floor(EXTENDED_MAP_LENGTH * EXTENDED_MAP_LENGTH * numericVal / maxVal); + + if (scaledVal > (EXTENDED_MAP_LENGTH * EXTENDED_MAP_LENGTH) - 1) { + chartData += ".."; + } else if (scaledVal < 0) { + chartData += '__'; + } else { + // Calculate first and second digits and add them to the output. + var quotient = Math.floor(scaledVal / EXTENDED_MAP_LENGTH); + var remainder = scaledVal - EXTENDED_MAP_LENGTH * quotient; + chartData += EXTENDED_MAP.charAt(quotient) + EXTENDED_MAP.charAt(remainder); + } + } + + return chartData; +} + +/** + * This will be used for getting images directly from the secure https://charts.googleapis.com + * instead of http://charts.apis.google.com which currently throws security warnings. + * + * see http://code.google.com/apis/chart/docs/chart_params.html FOR chart parameters + * see http://code.google.com/apis/chart/docs/data_formats.html FOR how to encode data + * + * sample constructed URL - https://chart.googleapis.com/chart?cht=ls&chs=148x58&chdlp=r&chco=3399CC&chd=e%3AW2ttpJbb..ttgAbbNtAA + */ +function constructVisualizationURLForSparkline(dataString, visualizationOptions) { + + /* + * Since we are directly going to use this URL in img tag, we are supposed to enocde "&" + * update: But since we are directly using it in an Image creating function we dont need to encode it. + */ + //var parameterDifferentiator = "&"; + var parameterDifferentiator = "&"; + + var rootGoogleChartAPI_URL = "https://chart.googleapis.com/chart?"; + + /* + * cht=ls indicates chart of type "line chart sparklines". + * see http://code.google.com/apis/chart/docs/gallery/chart_gall.html + */ + var chartType = "cht=" + visualizationOptions.chartType; + + /* + * It seems google reduces 2px from width & height before rendering the actual image. + * We will do the same. + */ + var chartSize = "chs=" + (visualizationOptions.width - 2) + "x" + (visualizationOptions.height - 2); + + /* + * It means that legend, if present, is to be displayed to the right of the chart, + * legend entries in a vertical column. + */ + var chartLabelPosition = "chdlp=" + visualizationOptions.chartLabel; + + /* + * Color of the sparkline. + */ + var chartColor = "chco=" + visualizationOptions.color; + + return rootGoogleChartAPI_URL + chartType + parameterDifferentiator + + chartSize + parameterDifferentiator + + chartLabelPosition + parameterDifferentiator + + chartColor + parameterDifferentiator + + "chd=" + dataString +} \ No newline at end of file diff --git a/productMods/templates/entity/authorshipShortView.jsp b/productMods/templates/entity/authorshipShortView.jsp deleted file mode 100644 index 866c1317..00000000 --- a/productMods/templates/entity/authorshipShortView.jsp +++ /dev/null @@ -1,78 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> - - - <%-- individual is the OBJECT of the property referenced -- the Authorship individual, not the Person or Publication --%> - - - - <%-- SUBJECT is a Person, so get info from Authorship about related Publication --%> - - <%-- this Authorship is linked to an InformationResource --%> - - - - - - - <%-- this Position is not linked to a Publication yet; use Authorship name as a placeholder and add link to the Authorship so user can add more information --%> - - - - - - - - - - - - - - <%-- SUBJECT is a Publication, so get info from Authorship about the related Person --%> - - <%-- there is a related Person --%> - - - - - - <%-- only an author name has been specified --%> - - - <%-- no related Person yet (likely from before custom form available) --%> - - - - - - - - - - - - - - - - - - - ">${name} ${label} ${year} - - - ${name} ${label} ${year} - - - - - - - - - - - - diff --git a/productMods/templates/entity/clinicalRoleShortView.jsp b/productMods/templates/entity/clinicalRoleShortView.jsp deleted file mode 100644 index e4ba13df..00000000 --- a/productMods/templates/entity/clinicalRoleShortView.jsp +++ /dev/null @@ -1,7 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - diff --git a/productMods/templates/entity/educationalTrainingShortView.jsp b/productMods/templates/entity/educationalTrainingShortView.jsp deleted file mode 100644 index a65ee313..00000000 --- a/productMods/templates/entity/educationalTrainingShortView.jsp +++ /dev/null @@ -1,129 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.StringUtils" %> - -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - -<%-- - This is a custom short view render for educational background. - The variable individual is the OBJECT of the property statement to be rendered. -- - In this JSP that is the Educational Training object, not the Person, Organization or DegreeType - --%> - - - - - <%-- SUBJECT is a Person --%> - - - <%-- Degree type and major --%> - - - - - - - - <%-- RY 12/10/10 majorField is no longer required, so make sure we display something reasonable if there is no major field. --%> - - - - - - - - - - - - - - - - - - <%-- Organization granting degree --%> - - - - - - ${selectedOrganization.name} - - - <%-- Optional department/school to organization --%> - - - - - <%-- Year of degree --%> - - - <%-- Supplemental information --%> - - - <%-- Build the output string --%> - - - educational background ${individual.name} - - - <%= StringUtils.join(", ", (String) pageContext.getAttribute("degreeStr"), - (String) pageContext.getAttribute("selectedOrganizationStr"), - (String) pageContext.getAttribute("degreeDeptOrSchool"), - (String) pageContext.getAttribute("year"), - (String) pageContext.getAttribute("degreeSupplementalInfo") ) %> - - - - - <%-- SUBJECT is a Degree Type --%> - - - - - - - - - - - ${personName} - - - - - - ${personLink} in ${degreeMajor}, ${selectedOrganizationName}, ${year} - - - ${personLink} in ${degreeMajor}, ${selectedOrganizationName} - - - ${personLink} in ${degreeMajor} - - - ${personLink} ${selectedOrganizationName}, ${year} - - - educational background ${individual.name} - - - - - <%-- The predicate was not one of the predicted ones, so create a normal link --%> - - - ${individual.name} - - - - - - - <%-- This clause is when there is no object individual defined, it should never be reached. --%> - - - - diff --git a/productMods/templates/entity/grantCoPiRoleShortView.jsp b/productMods/templates/entity/grantCoPiRoleShortView.jsp deleted file mode 100644 index e3c3770b..00000000 --- a/productMods/templates/entity/grantCoPiRoleShortView.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - - diff --git a/productMods/templates/entity/grantPiRoleShortView.jsp b/productMods/templates/entity/grantPiRoleShortView.jsp deleted file mode 100644 index b25f12f6..00000000 --- a/productMods/templates/entity/grantPiRoleShortView.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - - diff --git a/productMods/templates/entity/grantRoleShortView.jsp b/productMods/templates/entity/grantRoleShortView.jsp deleted file mode 100644 index 20ad027f..00000000 --- a/productMods/templates/entity/grantRoleShortView.jsp +++ /dev/null @@ -1,9 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - - diff --git a/productMods/templates/entity/headOfRoleShortView.jsp b/productMods/templates/entity/headOfRoleShortView.jsp deleted file mode 100644 index bb6ce9d5..00000000 --- a/productMods/templates/entity/headOfRoleShortView.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - diff --git a/productMods/templates/entity/informationResourceShortView.jsp b/productMods/templates/entity/informationResourceShortView.jsp deleted file mode 100644 index 8f3c2a71..00000000 --- a/productMods/templates/entity/informationResourceShortView.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%-- rjy7 NIHVIVO-1158 Under core:authorInAuthorship on a person's page, we are now displaying the object property statements -for the related property core:linkedInformationResource, so that we can collate by publication subclass. The subject is the -Authorship, and the object is the InformationResource, so the authorship short view defined on Authorships no longer applies. -We thus define an information resource short view to display the publications. --%> - -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> - - - <%-- individual is the OBJECT of the property referenced -- the InformationResource individual --%> - - - - - - - - - - - - - - - - - ">${name} ${year} - - - ${name} ${year} - - - - - - - - - - - - diff --git a/productMods/templates/entity/memberRoleShortView.jsp b/productMods/templates/entity/memberRoleShortView.jsp deleted file mode 100644 index 775c94ff..00000000 --- a/productMods/templates/entity/memberRoleShortView.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - diff --git a/productMods/templates/entity/outreachRoleShortView.jsp b/productMods/templates/entity/outreachRoleShortView.jsp deleted file mode 100644 index 31a87784..00000000 --- a/productMods/templates/entity/outreachRoleShortView.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - diff --git a/productMods/templates/entity/positionShortView.jsp b/productMods/templates/entity/positionShortView.jsp deleted file mode 100644 index 6108709f..00000000 --- a/productMods/templates/entity/positionShortView.jsp +++ /dev/null @@ -1,140 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag" prefix="p" %> - - - - <%-- individual is the OBJECT of the property referenced -- the Position, not the Person or Organization --%> - - - - - - - - - - - - - - - - - - - - <%-- use working title in preference to HR title --%> - - - - - - - - - - - - - - - <%-- SUBJECT is a Person, so get info from Position about related Organization --%> - - <%-- this Position is linked to an Organization --%> - - - - - - - - - - - - <%-- this Position is not linked to an Organization --%> - - <%-- an Organization name has been specified --%> - - - - <%-- not even an organization name, so just display the title in place of the name --%> - - <%-- don't show title twice --%> - - - - - - <%-- Hack to control extra spaces...should be done differently though. --%> - - - - - - - - ">${objName}${objLabel}${timeSpan} - - - ${objName}${objLabel}${timeSpan} - - - - - <%-- SUBJECT is an Organization, so get info from Position about the related Person --%> - - - - <%-- don't show because the position is not current --%> - - - <%-- there is a related Person --%> - - - - - - - - - - - - - - - ">${objName} ${objLabel} ${timeSpan} - - - ${objName} ${objLabel} ${timeSpan} - - - - - <%-- no related Person, which should not happen --%> - - - - - - - - - - - - - - - - - - - - - - diff --git a/productMods/templates/entity/presenterRoleShortView.jsp b/productMods/templates/entity/presenterRoleShortView.jsp deleted file mode 100644 index b991bd39..00000000 --- a/productMods/templates/entity/presenterRoleShortView.jsp +++ /dev/null @@ -1,10 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - - - diff --git a/productMods/templates/entity/researcherRoleShortView.jsp b/productMods/templates/entity/researcherRoleShortView.jsp deleted file mode 100644 index 5f19ff8e..00000000 --- a/productMods/templates/entity/researcherRoleShortView.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - diff --git a/productMods/templates/entity/roleShortView.jsp b/productMods/templates/entity/roleShortView.jsp deleted file mode 100644 index df4e1040..00000000 --- a/productMods/templates/entity/roleShortView.jsp +++ /dev/null @@ -1,138 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/StringProcessorTag" prefix="p" %> - -<%-- -This short view is intended to be called to handle short views for roles - -The following vars should be set by the jsp that is calling this short view - personToRolePredicate: URI of the person to role predicate. - roleToPersonPredicate: URI of the role to person predicate. - roleActivityToRolePredicate: URI of the activity to role predicate. - - roleActivityLabel: human readable label of activity used for error messages - -Optional vars: - roleLabelForPerson: human readable label for person when viewing from non-person side of role. Most short views - don't specify this value because the role name is displayed instead. Grant-related short views specify - this value because there is no specific role name. - startYearPredicate: defaults to http://vivoweb.org/ontology/core#startYear if not specified - --%> - -${! empty param.startYearPredicate ? param.startYearPredicate : 'http://vivoweb.org/ontology/core#startYear'} -${ startYearPredicate == 'http://vivoweb.org/ontology/core#startYear' } - - - - <%-- individual is the OBJECT of the property referenced -- the Role individual, not the Person or grant --%> - - - - <%-- get years off role --%> - - - - - - - - - - - - - - - - <%-- SUBJECT is a Person, so get info from other part of the role --%> - - - - - - <%-- On the person page, it's redundant to display the role label in this case, since the object property - label contains the same information. --%> - - - - - - - - - <%-- This Role is not linked to anything yet; use name as a placeholder and - add link to the Role so user can add more information. --%> - - - - - - - - - <%-- SUBJECT is an activity of some sort, so get info from the Role about the related Person --%> - - - - <%-- there is a related Person --%> - - - - - - - - - - - - - <%-- this is a Role with out a Person (likely from before custom form available) --%> - - - - - - - - - - - - - - - - - - - - - <%-- only show error messages if logged in --%> - - - - - <%-- output the actual html --%> - - - - ">${name} ${label} ${startYear}${endYearVal} ${errorMsg} - - - ${name} ${label} ${errorMsg} - - - - - - - - - - - - - diff --git a/productMods/templates/entity/serviceProviderRoleShortView.jsp b/productMods/templates/entity/serviceProviderRoleShortView.jsp deleted file mode 100644 index ef90c5cc..00000000 --- a/productMods/templates/entity/serviceProviderRoleShortView.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - diff --git a/productMods/templates/entity/sparklineVisualization.jsp b/productMods/templates/entity/sparklineVisualization.jsp deleted file mode 100644 index 223c5454..00000000 --- a/productMods/templates/entity/sparklineVisualization.jsp +++ /dev/null @@ -1,144 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean"%> -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.Individual" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.flags.PortalFlagChoices" %> -<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> -<%@ page errorPage="/error.jsp"%> -<% /*********************************************** - Displays the sparkline visualizations on individual profile pages - - request.attributes: - an Entity object with the name "entity" - - - request.parameters: - None, should only work with requestScope attributes for security reasons. - - Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output - for debugging info. - - **********************************************/ - Individual entity = (Individual)request.getAttribute("entity"); - boolean displayVisualization = false; - - if (entity == null){ - String e = "sparklineVisuzalition.jsp expects that request attribute 'entity' be set to the Entity object to display."; - displayVisualization = false; - throw new JspException(e); - } else { - for (VClass currClass : entity.getVClasses()) { - if ("http://xmlns.com/foaf/0.1/Person".equalsIgnoreCase(currClass.getURI())) { - displayVisualization = true; - break; - } - } - } - //System.out.println("visualization is supposed to be displayed? > " + displayVisualization); - if (displayVisualization) { - -%> - - - - - - - - - - - - - - - <%-- PDF Visualization URL - - For now we have disabled this. - - - - - - - - - - --%> - - - - - - - -
     
    - - - - <%-- - - For now we have disabled PDF report vis. - -
    - This is the link to PDF report. -
    - - --%> - - - -<% - - } - -%> \ No newline at end of file diff --git a/productMods/templates/entity/teacherRoleShortView.jsp b/productMods/templates/entity/teacherRoleShortView.jsp deleted file mode 100644 index e147fde5..00000000 --- a/productMods/templates/entity/teacherRoleShortView.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - - - - - - - diff --git a/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl b/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl new file mode 100644 index 00000000..15769149 --- /dev/null +++ b/productMods/templates/freemarker/body/individual/individual--foaf-organization.ftl @@ -0,0 +1,12 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Individual profile page template for foaf:Organization individuals (extends individual.ftl in vivo)--> + +<#-- Do not show the link for temporal visualization unless it's enabled --> +<#if temporalVisualizationEnabled> + <#assign classSpecificExtension> + <#include "individual-visualizationTemporalGraph.ftl"> + + + +<#include "individual.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl b/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl index 22a44f62..cc5cc81f 100644 --- a/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl +++ b/productMods/templates/freemarker/body/individual/individual--foaf-person.ftl @@ -3,26 +3,33 @@ <#-- Individual profile page template for foaf:Person individuals --> <#include "individual-setup.ftl"> - -<#if individual.showAdminPanel> - <#include "individual-adminPanel.ftl"> - -
    +
    - - <#-- Image --> - <@p.imageLinks individual propertyGroups editing "${urls.images}/placeholders/person.thumbnail.jpg" /> + <#-- Image --> + <#assign individualImage> + <@p.image individual=individual + propertyGroups=propertyGroups + namespaces=namespaces + editable=editable + showPlaceholder="always" + placeholder="${urls.images}/placeholders/person.thumbnail.jpg" /> + + <#if ( individualImage?contains(' + <#assign infoClass = 'class="withThumb"'/> + + +
    ${individualImage}
    + @@ -30,13 +37,13 @@ <#-- Email --> <#assign email = propertyGroups.getPropertyAndRemoveFromList("${core}email")!> <#if email?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> - <@p.addLinkWithLabel email editing /> + <@p.addLinkWithLabel email editable /> <#if email.statements?has_content> <#-- if there are any statements -->
      <#list email.statements as statement>
    • email icon - <@p.editingLinks statement editing /> + <@p.editingLinks "${email.localName}" statement editable />
    @@ -46,13 +53,13 @@ <#-- Phone --> <#assign phone = propertyGroups.getPropertyAndRemoveFromList("${core}phoneNumber")!> <#if phone?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> - <@p.addLinkWithLabel phone editing /> + <@p.addLinkWithLabel phone editable /> <#if phone.statements?has_content> <#-- if there are any statements -->
      <#list phone.statements as statement>
    • phone icon${statement.value} - <@p.editingLinks statement editing /> + <@p.editingLinks "${phone.localName}" statement editable />
    @@ -60,24 +67,48 @@ <#-- Links --> - <@p.vitroLinks propertyGroups editing "individual-urls-people" /> + <@p.vitroLinks propertyGroups namespaces editable "individual-urls-people" />
    - -
    + +
    + <#include "individual-visualizationFoafPerson.ftl"> + <#-- Disable for now until controller sends data --> + <#-- +
    +
    +

    10 Co-Authors

    +
    + +
      +
    • +
    • +
    + +

    View All arrow icon

    +
    + --> + + <#if individual.showAdminPanel> + <#include "individual-adminPanel.ftl"> + +
    <#if relatedSubject??>

    ${relatedSubject.relatingPredicateDomainPublic} for ${relatedSubject.name}

    -

    ← return to ${relatedSubject.name}

    +

    ← return to ${relatedSubject.name}

    <#else>

    <#-- Label --> - <#assign label = individual.nameStatement> - ${label.value} - <@p.editingLinks label editing /> + <@p.label individual editable /> - <#-- Moniker --> - <#if individual.moniker?has_content> - ${individual.moniker} + <#-- Moniker / Preferred Title --> + <#-- Use Preferred Title over Moniker if it is populated --> + <#assign title = (propertyGroups.getProperty("${core}preferredTitle").firstValue)! /> + <#if ! title?has_content> + <#assign title = individual.moniker> + + <#if title?has_content> + ${title}

    @@ -85,13 +116,8 @@ <#-- Positions --> <#assign positions = propertyGroups.getPropertyAndRemoveFromList("${core}personInPosition")!> <#if positions?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> -

    Positions <@p.addLink positions editing />

    - <#if positions.statements?has_content> <#-- if there are any statements --> -
      - <@p.objectPropertyList positions.statements positions.template editing /> -
    - - + <@p.objectPropertyListing positions editable /> +
    <#-- Overview --> @@ -100,44 +126,11 @@ <#-- Research Areas --> <#assign researchAreas = propertyGroups.getPropertyAndRemoveFromList("${core}hasResearchArea")!> <#if researchAreas?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> - <#--

    Research Areas <@p.addLink researchAreas editing />

    --> - <@p.addLinkWithLabel researchAreas editing /> - <#if researchAreas.statements?has_content> <#-- if there are any statements --> -
      - <@p.simpleObjectPropertyList researchAreas editing/> -
    - - - -
    -
    - -
    -
    - <#include "individual-sparklineVisualization.ftl"> + <@p.objectPropertyListing researchAreas editable /> +
    - <#-- Disable for now until controller sends data --> - <#-- -
    -
    -

    10 Co-Authors

    -
    - -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    - -

    View All arrow icon

    -
    - -->
    - <#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl --> <#-- Property group menu --> @@ -148,13 +141,16 @@ ${stylesheets.add("/css/individual/individual.css")} +${stylesheets.add("/css/individual/individual-vivo.css")} <#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) --> -${headScripts.add("/js/jquery_plugins/getUrlParam.js", +${headScripts.add("/js/jquery_plugins/getURLParam.js", "/js/jquery_plugins/colorAnimations.js", "/js/jquery_plugins/jquery.form.js", "/js/tiny_mce/tiny_mce.js", "/js/controls.js", - "/js/toggle.js")} + "/js/toggle.js", + "/js/jquery_plugins/jquery.truncator.js")} -${scripts.add("/js/imageUpload/imageUploadUtils.js")} \ No newline at end of file +${scripts.add("/js/imageUpload/imageUploadUtils.js")} +${scripts.add("/js/individual/individualUtils.js")} \ No newline at end of file diff --git a/productMods/templates/freemarker/body/individual/individual.ftl b/productMods/templates/freemarker/body/individual/individual.ftl index f70db5e9..b6ea87d9 100644 --- a/productMods/templates/freemarker/body/individual/individual.ftl +++ b/productMods/templates/freemarker/body/individual/individual.ftl @@ -1,90 +1,22 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Default individual profile page template --> +<#-- Default VIVO individual profile page template (extends individual.ftl in vitro) --> <#include "individual-setup.ftl"> -<#if individual.showAdminPanel> - <#include "individual-adminPanel.ftl"> - +<#assign individualProductExtension> + <#-- Include for any class specific template additions --> + ${classSpecificExtension!} + + <#include "individual-overview.ftl"> +
    +
    + -
    -
    - <#-- Image --> - <@p.imageLinks individual propertyGroups editing /> -
    +<#include "individual-vitro.ftl"> -
    -
    - <#if relatedSubject??> -

    ${relatedSubject.relatingPredicateDomainPublic} for ${relatedSubject.name}

    -

    ← return to ${relatedSubject.name}

    - <#else> -

    - <#-- Label --> - <#assign label = individual.nameStatement> - ${label.value} - <@p.editingLinks label editing /> - - <#-- Moniker --> - <#if individual.moniker?has_content> - ${individual.moniker} - -

    - -
    - - <#-- Overview --> - <#include "individual-overview.ftl"> - - - - <#-- Links --> - <@p.vitroLinks propertyGroups editing /> -
    -
    +${stylesheets.add("/css/individual/individual-vivo.css")} - <#-- RY Will we have an individual--foaf-organization.ftl template? If so, move this there and remove from here. - Also remove the method IndividualTemplateModel.isOrganization(). --> - <#if individual.organization > - <#-- Logically we only need section#temporal-graph, but css may depend on the outer sections. Leaving here for UI - team to check. --> -
    -
    -
    -

    Temporal Graph

    -
    -
    -
    - +${headScripts.add("/js/jquery_plugins/jquery.truncator.js")} -<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl --> - -<#-- Property group menu --> -<#include "individual-propertyGroupMenu.ftl"> - -<#-- Ontology properties --> -<#include "individual-properties.ftl"> - - -${stylesheets.add("/css/individual/individual.css")} - -<#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) --> -${headScripts.add("/js/jquery_plugins/getURLParam.js", - "/js/jquery_plugins/colorAnimations.js", - "/js/jquery_plugins/jquery.form.js", - "/js/tiny_mce/tiny_mce.js", - "/js/controls.js", - "/js/toggle.js")} - -${scripts.add("/js/imageUpload/imageUploadUtils.js")} \ No newline at end of file +${scripts.add("/js/individual/individualUtils.js")} \ No newline at end of file diff --git a/productMods/templates/freemarker/body/menupage/menupage--classgroup-organizations.ftl b/productMods/templates/freemarker/body/menupage/menupage--classgroup-organizations.ftl deleted file mode 100644 index 2ffd11de..00000000 --- a/productMods/templates/freemarker/body/menupage/menupage--classgroup-organizations.ftl +++ /dev/null @@ -1,10 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#assign visualizationLink> - Temporal Graph - - -<#include "menupage.ftl"> - -${stylesheets.add("/css/visualization/visualization.css")} - -${scripts.add("/js/menupage/visualizationLink.js")} \ No newline at end of file diff --git a/productMods/templates/freemarker/body/menupage/menupage--classgroup-people.ftl b/productMods/templates/freemarker/body/menupage/menupage--classgroup-people.ftl index b34325d0..db62e535 100644 --- a/productMods/templates/freemarker/body/menupage/menupage--classgroup-people.ftl +++ b/productMods/templates/freemarker/body/menupage/menupage--classgroup-people.ftl @@ -3,49 +3,32 @@ <#include "menupage-checkForData.ftl"> <#if !noData> -
    -

    ${page.title}

    - -
    -

    Visual Graph

    + -
    -
    - -
    -

    Network stats

    -

    (n) Persons | (n) with authorship | (n) researchers | (n) are principal investigators | (n) with awards | (n) are teaching | (n) have positions in organization

    -
    - <#include "menupage-browse.ftl"> - + ${stylesheets.add("/css/menupage/menupage.css")} - + <#include "menupage-scripts.ftl"> - + ${scripts.add("/js/menupage/browseByVClassPeople.js")} <#else> ${noDataNotification} diff --git a/productMods/templates/freemarker/body/partials/individual/individual-overview.ftl b/productMods/templates/freemarker/body/partials/individual/individual-overview.ftl index 45a3c5f5..13c6b5c3 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-overview.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-overview.ftl @@ -4,11 +4,13 @@ <#assign overview = propertyGroups.getPropertyAndRemoveFromList("${core}overview")!> <#if overview?has_content> <#-- true when the property is in the list, even if not populated (when editing) --> - <@p.addLinkWithLabel overview editing /> + <@p.addLinkWithLabel overview editable /> <#list overview.statements as statement> -

    - ${statement.value} - <@p.editingLinks statement editing /> -

    +
    +
    + ${statement.value} +
    + <@p.editingLinks "${overview.localName}" statement editable /> +
    \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/individual-setup.ftl b/productMods/templates/freemarker/body/partials/individual/individual-setup.ftl index 6500e021..fb2a2fc2 100644 --- a/productMods/templates/freemarker/body/partials/individual/individual-setup.ftl +++ b/productMods/templates/freemarker/body/partials/individual/individual-setup.ftl @@ -5,11 +5,7 @@ <#import "lib-list.ftl" as l> <#import "lib-properties.ftl" as p> -<#assign editing = individual.showEditingLinks> - -<#assign editingClass> - <#if editing>editing - +<#assign editable = individual.editable> <#assign propertyGroups = individual.propertyList> diff --git a/productMods/templates/freemarker/body/partials/individual/individual-sparklineVisualization.ftl b/productMods/templates/freemarker/body/partials/individual/individual-sparklineVisualization.ftl deleted file mode 100644 index bcba8680..00000000 --- a/productMods/templates/freemarker/body/partials/individual/individual-sparklineVisualization.ftl +++ /dev/null @@ -1,42 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#-- Template for sparkline visualization on individual profile page --> - -<#if individual.visualizationUrl??> - -<#assign coAuthorIcon = '${urls.images}/visualization/co_author_icon.png'> -<#assign coInvestigatorIcon = '${urls.images}/visualization/co_investigator_icon.png'> -<#assign standardVisualizationURLRoot ="/visualization"> -<#assign googleJSAPI = 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22imagesparkline%22%5D%7D%5D%7D'> -<#assign coAuthorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=coauthor'> -<#assign coInvestigatorURL = '${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=copi'> - -
     
    - - - - - - ${stylesheets.add("css/visualization/visualization.css")} - ${scripts.add(googleJSAPI)} - ${scripts.add("/js/visualization/sparkline.js")} - - - - \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/individual-visualizationFoafPerson.ftl b/productMods/templates/freemarker/body/partials/individual/individual-visualizationFoafPerson.ftl new file mode 100644 index 00000000..69aff107 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-visualizationFoafPerson.ftl @@ -0,0 +1,62 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for sparkline visualization on individual profile page --> + +<#-- Determine whether this person is an author --> +<#assign isAuthor = p.hasStatements(propertyGroups, "${core}authorInAuthorship") /> + +<#-- Determine whether this person is involved in any grants --> +<#assign isInvestigator = ( p.hasStatements(propertyGroups, "${core}hasInvestigatorRole") || + p.hasStatements(propertyGroups, "${core}hasPrincipalInvestigatorRole") || + p.hasStatements(propertyGroups, "${core}hasCo-PrincipalInvestigatorRole") ) > + +<#if (isAuthor || isInvestigator)> + + ${stylesheets.add("css/visualization/visualization.css")} + <#assign standardVisualizationURLRoot ="/visualization"> + +
    + <#if isAuthor> + <#assign coAuthorIcon = "${urls.images}/visualization/co_author_icon.png"> + <#assign coAuthorURL = "${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=coauthor"> + <#assign googleJSAPI = "https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22imagesparkline%22%5D%7D%5D%7D"> + + information icon + +
     
    + + + + + + ${scripts.add(googleJSAPI)} + ${scripts.add("js/visualization/visualization-helper-functions.js")} + ${scripts.add("/js/visualization/sparkline.js")} + + + + <#if isInvestigator> + + + + + <#if isInvestigator> + <#assign coInvestigatorURL = "${urls.base}${standardVisualizationURLRoot}?vis=person_level&uri=${individual.uri}&vis_mode=copi"> + <#assign coInvestigatorIcon = "${urls.images}/visualization/co_investigator_icon.png"> + + + +
    + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/individual-visualizationTemporalGraph.ftl b/productMods/templates/freemarker/body/partials/individual/individual-visualizationTemporalGraph.ftl new file mode 100644 index 00000000..e6316e84 --- /dev/null +++ b/productMods/templates/freemarker/body/partials/individual/individual-visualizationTemporalGraph.ftl @@ -0,0 +1,7 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Temporal graph visualization --> + +
    +

    Temporal Graph

    +
    \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl index c965a5ab..851aea43 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-authorInAuthorship.ftl @@ -16,7 +16,7 @@ ${statement.infoResourceName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${statement.authorshipName} (no linked information resource) + missing information resource diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl index 92ec115d..b0a7a410 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeInterval.ftl @@ -4,5 +4,8 @@ <#import "lib-datetime.ftl" as dt> -${dt.dateTimeIntervalLong("${statement.dateTimeStart!}", "${statement.precisionStart!}", - "${statement.dateTimeEnd!}", "${statement.precisionEnd!}")} +<#if ! statement.valueStart?? && ! statement.valueEnd??> + incomplete date/time interval +<#else> + ${dt.dateTimeIntervalLong("${statement.dateTimeStart!}", "${statement.precisionStart!}", "${statement.dateTimeEnd!}", "${statement.precisionEnd!}")} + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl index 4fb04f6a..d6122d45 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-dateTimeValue.ftl @@ -4,4 +4,9 @@ <#import "lib-datetime.ftl" as dt> -${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision)} +<#-- No core:dateTime data property assigned. Display a link to the core:DateTimeValue object --> +<#if ! statement.dateTime??> + incomplete date/time +<#else> + ${dt.formatXsdDateTimeLong(statement.dateTime, statement.precision!)} + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl index 27aafd78..1e0e4670 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-educationalTraining.ftl @@ -13,7 +13,12 @@ <#local degree> <#if statement.degreeName??> - <@s.join [ statement.degreeAbbr!statement.degreeName, statement.majorField! ], " in " /> + <#-- RY Giving up on join here. Freemarker insists on removing the space before "in" + and leaving no space between the degree and major field, even though compress + should only delete consecutive spaces. Even   doesn't help. + <@s.join [ statement.degreeAbbr!statement.degreeName, statement.majorField! ], " in " /> --> + ${statement.degreeAbbr!statement.degreeName} + <#if statement.majorField??> in ${statement.majorField} @@ -22,7 +27,7 @@ ${statement.orgName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${statement.edTrainingName} (no linked organization) + missing organization diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl index d73e48c0..fb19fc5a 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-hasRole.ftl @@ -13,10 +13,10 @@ <#local linkedIndividual> <#if statement.activity??> - ${statement.activityName} + ${statement.activityLabel!statement.activityName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${statement.roleName} (no linked activity) + missing activity diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl index 9097ebb5..1ec51f00 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-informationResourceInAuthorship.ftl @@ -9,16 +9,10 @@ <#-- Use a macro to keep variable assignments local; otherwise the values carry over to the next statement --> <#macro showAuthorship statement> - - <#local linkedIndividual> - <#if statement.person??> - ${statement.personName} - <#else> - <#-- This shouldn't happen, but we must provide for it --> - ${statement.authorshipName} (no linked author) - - - - <@s.join [ linkedIndividual ] /> - + <#if statement.person??> + ${statement.personName} + <#else> + <#-- This shouldn't happen, but we must provide for it --> + missing author + \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl index 26a9a909..b7957428 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-organizationForPosition.ftl @@ -16,7 +16,7 @@ ${statement.personName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${statement.positionName} (no linked person) + missing person in this position diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl index 1a7cf68c..2f659aca 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-personInPosition.ftl @@ -16,10 +16,10 @@ ${statement.orgName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${statement.positionName} (no linked organization) + missing organization - <@s.join [ linkedIndividual, statement.positionTitle! ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> + <@s.join [ linkedIndividual, statement.positionTitle!statement.hrJobTitle! ] /> <@dt.yearIntervalSpan "${statement.dateTimeStart!}" "${statement.dateTimeEnd!}" /> \ No newline at end of file diff --git a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl index e039845b..5d7d7793 100644 --- a/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl +++ b/productMods/templates/freemarker/body/partials/individual/propStatement-relatedRole.ftl @@ -13,10 +13,10 @@ <#local linkedIndividual> <#if statement.indivInRole??> - ${statement.indivName} + ${statement.indivLabel!statement.indivName} <#else> <#-- This shouldn't happen, but we must provide for it --> - ${statement.roleName} (no linked individual in this role) + missing person in this role diff --git a/productMods/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl b/productMods/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl new file mode 100644 index 00000000..5d96d8e4 --- /dev/null +++ b/productMods/templates/freemarker/body/siteAdmin/siteAdmin-siteConfiguration.ftl @@ -0,0 +1,34 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Template for Site Administration site configuration panel --> + +<#if siteConfig??> +
    + +

    Site Configuration

    + + +
    + \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/coauthorship/coAuthorshipSparklineContent.ftl b/productMods/templates/freemarker/visualization/coauthorship/coAuthorshipSparklineContent.ftl index 605e567a..3b10e956 100644 --- a/productMods/templates/freemarker/visualization/coauthorship/coAuthorshipSparklineContent.ftl +++ b/productMods/templates/freemarker/visualization/coauthorship/coAuthorshipSparklineContent.ftl @@ -17,15 +17,21 @@ - -
    -

    This Organization has neither Sub-Organizations nor People. Please visit the Organization's profile page.

    -
    \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorCommonBody.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorCommonBody.ftl new file mode 100644 index 00000000..36194a1b --- /dev/null +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonErrorCommonBody.ftl @@ -0,0 +1,15 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#assign standardVisualizationURLRoot ="/visualization"> + +<#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI?url}"> +<#assign temporalGraphURL = '${urls.base}${standardVisualizationURLRoot}?vis=${otherVisType}&uri=${organizationURI}&labelField=label'> + +

    ${organizationLabel}

    + +

    ${textForCurrentEntityComparisonType?capitalize} Temporal Graph + view ${textForOtherEntityComparisonType} temporal graph +

    +
    +

    This organization has neither sub-organizations nor people with ${textForCurrentEntityComparisonType} in the system. Please visit the full ${organizationLabel} profile page for a more complete overview.

    +
    diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonGrantsStandaloneActivator.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonGrantsStandaloneActivator.ftl deleted file mode 100644 index e997ace9..00000000 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonGrantsStandaloneActivator.ftl +++ /dev/null @@ -1,344 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#assign standardVisualizationURLRoot ="/visualization"> -<#assign ajaxVisualizationURLRoot ="/visualizationAjax"> -<#assign dataVisualizationURLRoot ="/visualizationData"> - -<#assign organizationURI ="${organizationURI?url}"> -<#assign jsonContent ="${jsonContent}"> -<#assign organizationLabel = "${organizationLabel}"> -<#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI}"> -<#assign subOrganizationTemporalGraphURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_grant_count"> -<#assign subOrganizationTemporalGraphPubURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison"> -<#assign subOrganizationVivoProfileURL = "${urls.base}/individual?"> - - - -<#assign temporalGraphSmallIcon = '${urls.images}/visualization/temporal_vis_small_icon.jpg'> - -<#assign TemporalGraphDownloadFile = '${urls.base}${dataVisualizationURLRoot}?vis=entity_grant_count&uri=${organizationURI}&labelField=label'> - -<#-- Javascript files --> - -<#assign excanvas = '${urls.base}/js/visualization/entitycomparison/jquery_plugins/flot/excanvas.js'> -<#assign flot = 'js/visualization/entitycomparison/jquery_plugins/flot/jquery.flot.js'> -<#assign fliptext = 'js/visualization/entitycomparison/jquery_plugins/fliptext/jquery.mb.flipText.js'> -<#assign jqueryNotify = 'js/jquery_plugins/jquery.notify.min.js'> -<#assign jqueryUI = 'js/jquery-ui/js/jquery-ui-1.8.4.custom.min.js'> -<#assign datatable = 'js/jquery_plugins/jquery.dataTables.min.js'> -<#assign entityComparisonUtils = 'js/visualization/entitycomparison/util.js'> -<#assign entityComparisonConstants = 'js/visualization/entitycomparison/constants.js'> - - -${scripts.add(flot)} -${scripts.add(fliptext)} -${scripts.add(jqueryUI)} -${scripts.add(datatable)} -${scripts.add(entityComparisonUtils)} -${scripts.add(entityComparisonConstants)} -${scripts.add(jqueryNotify)} - -<#-- CSS files --> - -<#assign demoTable = "js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css" /> -<#assign jqueryUIStyle = "js/jquery-ui/css/smoothness/jquery-ui-1.8.4.custom.css" /> -<#assign jqueryNotifyStyle = "css/jquery_plugins/ui.notify.css" /> -<#assign entityComparisonStyle = "css/visualization/entitycomparison/layout.css" /> -<#assign entityComparisonStyleIEHack = "${urls.base}/css/visualization/entitycomparison/layout-ie.css" /> -<#assign vizStyle = "css/visualization/visualization.css" /> - -${stylesheets.add(jqueryUIStyle)} -${stylesheets.add(demoTable)} -${stylesheets.add(entityComparisonStyle)} -${stylesheets.add(vizStyle)} -${stylesheets.add(jqueryNotifyStyle)} - - - -<#-- variables passed from server-side code --> - - - - -
    - -

    - -
    -
    -

    How do you want to compare?

    - -
    - - - -
    -
    - -
    - -

    Who do you want to compare?

    -
    -
    - Save as CSV -
    -<#-- -
    - * The entity types core:Person, foaf:Organization have been excluded as they are too general. -
    ---> -
    - -
    - -

    Comparing Grants of Institutions in

    - -
    -
    -
    -
    Year
    -
    - -
    -

    -

    You have selected 0 of a maximum - 10 schools to compare. - Clear

    - -
    -
    -
    \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl new file mode 100644 index 00000000..027630a8 --- /dev/null +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnGrantsStandalone.ftl @@ -0,0 +1,24 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- The Order of each element in this file is very important. Do not make any changes to it unless making +corresponding changes in the included Templates. --> + +<#assign currentParameter = "grant"> + +<#include "entityComparisonSetup.ftl"> + +<#assign temporalGraphDownloadFileLink = '${temporalGraphDownloadCSVCommonURL}&vis=entity_grant_count'> + +<#-- variables passed from server-side code --> + + +<#assign currentParameterObject = grantParameter> + +<#include "entityComparisonBody.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl new file mode 100644 index 00000000..403138ed --- /dev/null +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonOnPublicationsStandalone.ftl @@ -0,0 +1,24 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- The Order of each element in this file is very important. Do not make any changes to it unless making +corresponding changes in the included Templates. --> + +<#assign currentParameter = "publication"> + +<#include "entityComparisonSetup.ftl"> + +<#assign temporalGraphDownloadFileLink = '${temporalGraphDownloadCSVCommonURL}&vis=entity_comparison'> + +<#-- variables passed from server-side code --> + + +<#assign currentParameterObject = publicationParameter> + +<#include "entityComparisonBody.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl new file mode 100644 index 00000000..36851711 --- /dev/null +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonSetup.ftl @@ -0,0 +1,122 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#assign standardVisualizationURLRoot ="/visualization"> +<#assign ajaxVisualizationURLRoot ="/visualizationAjax"> +<#assign dataVisualizationURLRoot ="/visualizationData"> + +<#assign organizationURI ="${organizationURI?url}"> +<#assign jsonContent ="${jsonContent}"> +<#assign organizationLabel = "${organizationLabel}"> +<#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI}"> + +<#assign subOrganizationVivoProfileURL = "${urls.base}/individual?"> + +<#assign subOrganizationGrantTemporalGraphCommonURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_grant_count"> +<#assign subOrganizationPublicationTemporalGraphCommonURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison"> + +<#assign organizationPublicationTemporalGraphURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison&uri=${organizationURI}"> +<#assign organizationGrantTemporalGraphURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_grant_count&uri=${organizationURI}"> + +<#assign temporalGraphSmallIcon = '${urls.images}/visualization/temporal_vis_small_icon.jpg'> + +<#assign temporalGraphDownloadCSVCommonURL = '${urls.base}${dataVisualizationURLRoot}?uri=${organizationURI}&labelField=label'> + +<#assign publicationParameter = { "name": "publication", + "dropDownText": "by Publications", + "viewLink": "${organizationPublicationTemporalGraphURL}", + "value": "Publications" }> + +<#assign grantParameter = { "name": "grant", + "dropDownText": "by Grants", + "viewLink": "${organizationGrantTemporalGraphURL}", + "value": "Grants" }> + +<#assign parameterOptions = [publicationParameter, grantParameter]> + +<#assign entityCheckboxSelectorDOMClass = "entity-selector-checkbox"> + +<#-- Javascript files --> + +<#-- Currently we are using the developer build version for both flot & excanvas libraries, +this is because IE 9 complains about certain properties. After testing it seems that dev +build version is stable enough. If in next couple of days we feel that there are some issues +we will default to using the stable version unless the request comes from IE 9 in which case +we will use rev 293 (dev build version) of the flot & excanvas files. +--> +<#assign excanvas = '${urls.base}/js/visualization/entitycomparison/jquery_plugins/flot/r293/excanvas.min.js'> +<#assign flot = 'js/visualization/entitycomparison/jquery_plugins/flot/r293/jquery.flot.min.js'> + + +<#assign fliptext = 'js/visualization/entitycomparison/jquery_plugins/fliptext/jquery.mb.flipText.js'> +<#assign jqueryNotify = 'js/jquery_plugins/jquery.notify.min.js'> +<#assign jqueryUI = 'js/jquery-ui/js/jquery-ui-1.8.4.custom.min.js'> +<#assign datatable = 'js/jquery_plugins/jquery.dataTables.min.js'> +<#assign entityComparisonUtils = 'js/visualization/entitycomparison/util.js'> +<#assign entityComparisonConstants = 'js/visualization/entitycomparison/constants.js'> +<#assign guiEventManager = 'js/visualization/entitycomparison/gui-event-manager.js'> + + + +${scripts.add(flot)} +${scripts.add(fliptext)} +${scripts.add(jqueryUI)} +${scripts.add(datatable)} +${scripts.add(entityComparisonUtils)} +${scripts.add(entityComparisonConstants)} +${scripts.add(jqueryNotify)} + +<#-- CSS files --> + +<#assign demoTable = "js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css" /> +<#assign jqueryUIStyle = "js/jquery-ui/css/smoothness/jquery-ui-1.8.4.custom.css" /> +<#assign jqueryNotifyStyle = "css/jquery_plugins/ui.notify.css" /> +<#assign entityComparisonStyle = "css/visualization/entitycomparison/layout.css" /> +<#assign entityComparisonStyleIEHack = "${urls.base}/css/visualization/entitycomparison/layout-ie.css" /> +<#assign entityComparisonStyleIE_6_7_Hack = "${urls.base}/css/visualization/entitycomparison/layout-ie-67.css" /> +<#assign vizStyle = "css/visualization/visualization.css" /> + +${stylesheets.add(jqueryUIStyle)} +${stylesheets.add(demoTable)} +${stylesheets.add(entityComparisonStyle)} +${stylesheets.add(vizStyle)} +${stylesheets.add(jqueryNotifyStyle)} + + + +<#-- variables passed from server-side code --> + + +${scripts.add(guiEventManager)} \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonStandaloneActivator.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonStandaloneActivator.ftl deleted file mode 100644 index 2c53a2e6..00000000 --- a/productMods/templates/freemarker/visualization/entitycomparison/entityComparisonStandaloneActivator.ftl +++ /dev/null @@ -1,341 +0,0 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> - -<#assign standardVisualizationURLRoot ="/visualization"> -<#assign ajaxVisualizationURLRoot ="/visualizationAjax"> -<#assign dataVisualizationURLRoot ="/visualizationData"> - -<#assign organizationURI ="${organizationURI?url}"> -<#assign jsonContent ="${jsonContent}"> -<#assign organizationLabel = "${organizationLabel}"> -<#assign organizationVivoProfileURL = "${urls.base}/individual?uri=${organizationURI}"> -<#assign subOrganizationTemporalGraphURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_comparison"> -<#assign subOrganizationTemporalGraphGrantURL = "${urls.base}${standardVisualizationURLRoot}?vis=entity_grant_count"> -<#assign subOrganizationVivoProfileURL = "${urls.base}/individual?"> - -<#assign temporalGraphSmallIcon = '${urls.images}/visualization/temporal_vis_small_icon.jpg'> - -<#assign TemporalGraphDownloadFile = '${urls.base}${dataVisualizationURLRoot}?vis=entity_comparison&uri=${organizationURI}&labelField=label'> - - -<#-- Javascript files --> - -<#assign excanvas = '${urls.base}/js/visualization/entitycomparison/jquery_plugins/flot/excanvas.js'> -<#assign flot = 'js/visualization/entitycomparison/jquery_plugins/flot/jquery.flot.js'> -<#assign fliptext = 'js/visualization/entitycomparison/jquery_plugins/fliptext/jquery.mb.flipText.js'> -<#assign jqueryNotify = 'js/jquery_plugins/jquery.notify.min.js'> -<#assign jqueryUI = 'js/jquery-ui/js/jquery-ui-1.8.4.custom.min.js'> -<#assign datatable = 'js/jquery_plugins/jquery.dataTables.min.js'> -<#assign entityComparisonUtils = 'js/visualization/entitycomparison/util.js'> -<#assign entityComparisonConstants = 'js/visualization/entitycomparison/constants.js'> - - -${scripts.add(flot)} -${scripts.add(fliptext)} -${scripts.add(jqueryUI)} -${scripts.add(datatable)} -${scripts.add(entityComparisonUtils)} -${scripts.add(entityComparisonConstants)} -${scripts.add(jqueryNotify)} - -<#-- CSS files --> - -<#assign demoTable = "js/visualization/entitycomparison/jquery_plugins/datatable/demo_table.css" /> -<#assign jqueryUIStyle = "js/jquery-ui/css/smoothness/jquery-ui-1.8.4.custom.css" /> -<#assign jqueryNotifyStyle = "css/jquery_plugins/ui.notify.css" /> -<#assign entityComparisonStyle = "css/visualization/entitycomparison/layout.css" /> -<#assign entityComparisonStyleIEHack = "${urls.base}/css/visualization/entitycomparison/layout-ie.css" /> -<#assign vizStyle = "css/visualization/visualization.css" /> - -${stylesheets.add(jqueryUIStyle)} -${stylesheets.add(demoTable)} -${stylesheets.add(entityComparisonStyle)} -${stylesheets.add(vizStyle)} -${stylesheets.add(jqueryNotifyStyle)} - - - -<#-- variables passed from server-side code --> - - - - -
    - -

    - -
    -
    -

    How do you want to compare?

    - -
    - - - -
    -
    - -
    - -

    Who do you want to compare?

    -
    -
    - Save as CSV -
    -<#-- -
    - * The entity types core:Person, foaf:Organization have been excluded as they are too general. -
    ---> -
    - -
    - -

    Comparing Publications of Institutions in

    - -
    -
    -
    -
    Year
    -
    - -
    -

    -

    You have selected 0 of a maximum - 10 schools to compare. - Clear

    - -
    -
    -
    \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityGrantComparisonError.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityGrantComparisonError.ftl new file mode 100644 index 00000000..aad4f1c0 --- /dev/null +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityGrantComparisonError.ftl @@ -0,0 +1,7 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#assign otherVisType = "entity_comparison"> +<#assign textForOtherEntityComparisonType = "publications"> +<#assign textForCurrentEntityComparisonType = "grants"> + +<#include "entityComparisonErrorCommonBody.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/entitycomparison/entityPublicationComparisonError.ftl b/productMods/templates/freemarker/visualization/entitycomparison/entityPublicationComparisonError.ftl new file mode 100644 index 00000000..7d736d38 --- /dev/null +++ b/productMods/templates/freemarker/visualization/entitycomparison/entityPublicationComparisonError.ftl @@ -0,0 +1,7 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#assign otherVisType = "entity_grant_count"> +<#assign textForOtherEntityComparisonType = "grants"> +<#assign textForCurrentEntityComparisonType = "publications"> + +<#include "entityComparisonErrorCommonBody.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/grant/personGrantCountStandaloneActivator.ftl b/productMods/templates/freemarker/visualization/grant/personGrantCountStandaloneActivator.ftl index 8f10ef46..b68156d7 100644 --- a/productMods/templates/freemarker/visualization/grant/personGrantCountStandaloneActivator.ftl +++ b/productMods/templates/freemarker/visualization/grant/personGrantCountStandaloneActivator.ftl @@ -1,7 +1,9 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#assign googleJSAPI = 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D'> +<#assign visualizationHelperJavaScript = 'js/visualization/visualization-helper-functions.js'> ${headScripts.add(googleJSAPI)} +${scripts.add(visualizationHelperJavaScript)} <#include "personGrantSparklineContent.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/grant/personGrantSparklineContent.ftl b/productMods/templates/freemarker/visualization/grant/personGrantSparklineContent.ftl index 674ef639..b71230ad 100644 --- a/productMods/templates/freemarker/visualization/grant/personGrantSparklineContent.ftl +++ b/productMods/templates/freemarker/visualization/grant/personGrantSparklineContent.ftl @@ -17,15 +17,21 @@ +${scripts.add(visualizationHelperJavaScript)} + <#assign pageStyle = "${urls.base}/css/visualization/personlevel/page.css" /> <#assign vizStyle = "${urls.base}/css/visualization/visualization.css" /> @@ -80,6 +84,24 @@ $(document).ready(function(){ setProfileName('no_coauthorships_person', $('#ego_label').text()); } + + + $.ajax({ + url: "${urls.base}/visualizationAjax", + data: ({vis: "utilities", vis_mode: "SHOW_GRANTS_LINK", uri: '${egoURIParam}'}), + dataType: "json", + success:function(data){ + + /* + Collaboratorship links do not show up by default. They should show up only if there any data to + show on that page. + */ + if (data.numOfGrants !== undefined && data.numOfGrants > 0) { + $(".toggle_visualization").show(); + } + + } + }); }); @@ -98,10 +120,10 @@ $(document).ready(function(){
    - diff --git a/productMods/templates/freemarker/visualization/personlevel/coPIPersonLevel.ftl b/productMods/templates/freemarker/visualization/personlevel/coPIPersonLevel.ftl index 7baae342..46dca49d 100644 --- a/productMods/templates/freemarker/visualization/personlevel/coPIPersonLevel.ftl +++ b/productMods/templates/freemarker/visualization/personlevel/coPIPersonLevel.ftl @@ -19,6 +19,7 @@ <#assign googleVisualizationAPI = 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D'> <#assign coInvestigatorPersonLevelJavaScript = '${urls.base}/js/visualization/coPIship/coPIship-person-level.js'> <#assign commonPersonLevelJavaScript = '${urls.base}/js/visualization/personlevel/person-level.js'> +<#assign visualizationHelperJavaScript = 'js/visualization/visualization-helper-functions.js'> @@ -37,6 +38,7 @@ var requiredRevision = 0; var swfLink = "${swfLink}"; var egoURI = "${egoURI}"; +var unEncodedEgoURI = "${egoURIParam}"; var egoCoInvestigationDataFeederURL = "${egoCoInvestigationDataFeederURL}"; var egoCoInvestigatorsListDataFileURL = "${egoCoInvestigatorsListDataFileURL}"; @@ -50,6 +52,8 @@ var visualizationDataRoot = "${dataVisualizationURLRoot}"; +${scripts.add(visualizationHelperJavaScript)} + <#assign pageStyle = "${urls.base}/css/visualization/personlevel/page.css" /> <#assign vizStyle = "${urls.base}/css/visualization/visualization.css" /> @@ -79,6 +83,24 @@ $(document).ready(function(){ setProfileName('no_coinvestigations_person', $('#ego_label').text()); } + + + $.ajax({ + url: "${urls.base}/visualizationAjax", + data: ({vis: "utilities", vis_mode: "SHOW_AUTHORSHIP_LINK", uri: '${egoURIParam}'}), + dataType: "json", + success:function(data){ + + /* + Collaboratorship links do not show up by default. They should show up only if there any data to + show on that page. + */ + if (data.numOfPublications !== undefined && data.numOfPublications > 0) { + $(".toggle_visualization").show(); + } + + } + }); }); @@ -96,10 +118,10 @@ $(document).ready(function(){
    - diff --git a/productMods/templates/freemarker/visualization/publication/personPublicationCountStandaloneActivator.ftl b/productMods/templates/freemarker/visualization/publication/personPublicationCountStandaloneActivator.ftl index 8bb9745e..49a7c345 100644 --- a/productMods/templates/freemarker/visualization/publication/personPublicationCountStandaloneActivator.ftl +++ b/productMods/templates/freemarker/visualization/publication/personPublicationCountStandaloneActivator.ftl @@ -1,7 +1,9 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#assign googleJSAPI = 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22packages%22%3A%5B%22areachart%22%2C%22imagesparkline%22%5D%7D%5D%7D'> +<#assign visualizationHelperJavaScript = 'js/visualization/visualization-helper-functions.js'> ${headScripts.add(googleJSAPI)} +${scripts.add(visualizationHelperJavaScript)} <#include "personPublicationSparklineContent.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl b/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl index 6e3208d4..e5303fca 100644 --- a/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl +++ b/productMods/templates/freemarker/visualization/publication/personPublicationSparklineContent.ftl @@ -18,20 +18,27 @@ function drawPubCountVisualization(providedSparklineImgTD) { + var unknownYearPublicationCounts = ${sparklineVO.unknownYearPublications}; + var onlyUnknownYearPublications = false; + var data = new google.visualization.DataTable(); data.addColumn('string', 'Year'); data.addColumn('number', 'Publications'); data.addRows(${sparklineVO.yearToEntityCountDataTable?size}); + + var knownYearPublicationCounts = 0; <#list sparklineVO.yearToEntityCountDataTable as yearToPublicationCountDataElement> data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 0, '${yearToPublicationCountDataElement.year}'); data.setValue(${yearToPublicationCountDataElement.yearToEntityCounter}, 1, ${yearToPublicationCountDataElement.currentEntitiesCount}); + knownYearPublicationCounts += ${yearToPublicationCountDataElement.currentEntitiesCount}; <#-- Create a view of the data containing only the column pertaining to publication count. --> var sparklineDataView = new google.visualization.DataView(data); sparklineDataView.setColumns([1]); - + + <#if sparklineVO.shortVisMode> <#-- For the short view we only want the last 10 year's view of publication count, hence we filter @@ -47,18 +54,81 @@ <#else> + + var visualizationOptions = { + width: 150, + height: 60, + color: '3399CC', + chartType: 'ls', + chartLabel: 'r' + } + + /* + This means that all the publications have unknown years & we do not need to display + the sparkline. + */ + if (unknownYearPublicationCounts > 0 && knownYearPublicationCounts < 1) { + + onlyUnknownYearPublications = true; + + } else { + + /* + Test if we want to go for the approach when serving visualizations from a secure site.. + If "https:" is not found in location.protocol then we do everything normally. + */ + if (location.protocol.indexOf("https") == -1) { + /* + This condition will make sure that the location protocol (http, https, etc) does not have + for word https in it. + */ + + <#-- Create the vis object and draw it in the div pertaining to sparkline. --> + var sparkline = new google.visualization.ImageSparkLine(providedSparklineImgTD[0]); + sparkline.draw(sparklineDataView, { + width: visualizationOptions.width, + height: visualizationOptions.height, + showAxisLines: false, + showValueLabels: false, + labelPosition: 'none' + }); + + } else { + + <#-- Prepare data for generating google chart URL. --> + + <#-- If we need to serve data for https:, we have to create an array of values to be plotted. --> + var chartValuesForEncoding = new Array(); + + $.each(sparklineDataView.getViewRows(), function(index, value) { + chartValuesForEncoding.push(data.getValue(value, 1)); + }); + + var chartImageURL = constructVisualizationURLForSparkline( + extendedEncodeDataForChartURL(chartValuesForEncoding, + sparklineDataView.getColumnRange(0).max), + visualizationOptions); + + var imageContainer = $(providedSparklineImgTD[0]); + + imageContainer.image(chartImageURL, + function(){ + imageContainer.empty().append(this); + $(this).addClass("google-visualization-sparkline-image"); + }, + function(){ + // For performing any action on failure to + // find the image. + imageContainer.empty(); + } + ); + + } + + } - - <#-- Create the vis object and draw it in the div pertaining to sparkline. --> - var sparkline = new google.visualization.ImageSparkLine(providedSparklineImgTD[0]); - sparkline.draw(sparklineDataView, { - width: 150, - height: 60, - showAxisLines: false, - showValueLabels: false, - labelPosition: 'none' - }); - + var totalPublicationCount = knownYearPublicationCounts + unknownYearPublicationCounts; + <#if sparklineVO.shortVisMode> <#-- We want to display how many publication counts were considered, so this is used to calculate this. --> @@ -69,9 +139,14 @@ renderedShortSparks += data.getValue(value, 1); }); - var totalPubs = parseInt(renderedShortSparks) + parseInt(${sparklineVO.unknownYearPublications}); + /* + In case that there are only unknown publications we want the text to mention these counts, + which would not be mentioned in the other case because the renderedShortSparks only hold counts + of publications which have any date associated with it. + */ + var totalPubs = onlyUnknownYearPublications ? unknownYearPublicationCounts : renderedShortSparks; - if ( totalPubs == 1 ) { + if (totalPubs === 1) { var pubDisplay = "publication"; } else { var pubDisplay = "publications"; @@ -80,16 +155,26 @@ $('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append(" "+ pubDisplay +"
    "); var sparksText = ' within the last 10 years'; - + + if (totalPubs !== totalPublicationCount) { + sparksText += ' (' + totalPublicationCount + ' total)'; + } + <#else> /* * Sparks that will be rendered will always be the one's which has * any year associated with it. Hence. * */ - var renderedSparks = ${sparklineVO.renderedSparks}; - var totalPubs = parseInt(renderedSparks) + parseInt(${sparklineVO.unknownYearPublications}); + var renderedSparks = ${sparklineVO.renderedSparks}; + /* + In case that there are only unknown publications we want the text to mention these counts, + which would not be mentioned in the other case because the renderedSparks only hold counts + of publications which have any date associated with it. + */ + var totalPubs = onlyUnknownYearPublications ? unknownYearPublicationCounts : renderedSparks; + if ( totalPubs == 1 ) { var pubDisplay = "publication"; } else { @@ -99,11 +184,21 @@ $('#${sparklineContainerID} td.sparkline_number').text(totalPubs).css("font-weight", "bold").attr("class", "grey").append(" "+ pubDisplay +"
    "); var sparksText = ' from ${sparklineVO.earliestYearConsidered?c}' - + ' to ${sparklineVO.latestRenderedPublicationYear?c} ' - + '
    (.CSV File) '; + + ' to ${sparklineVO.latestRenderedPublicationYear?c}'; + + if (totalPubs !== totalPublicationCount) { + sparksText += ' (' + totalPublicationCount + ' total)'; + } + + if (totalPublicationCount) { + sparksText += '
    (.CSV File) '; + } + - $('#${sparklineContainerID} td.sparkline_text').html(sparksText); + if (!onlyUnknownYearPublications) { + $('#${sparklineContainerID} td.sparkline_text').html(sparksText); + } } @@ -146,10 +241,10 @@ sparklineImgTD.attr('class', 'sparkline_style'); row.append(sparklineImgTD); - var row2 = $(''); + var row2 = $(''); var sparklineNumberTD = $(''); sparklineNumberTD.attr('class', 'sparkline_number'); - sparklineNumberTD.css('text-align', 'left'); + sparklineNumberTD.css('text-align', 'left'); row2.append(sparklineNumberTD); var row3 = $(''); @@ -178,18 +273,18 @@ <#if displayTable?? && displayTable> -

    - <#assign tableID = "publications_sparkline_data_table" /> - <#assign tableCaption = "Publications per year " /> - <#assign tableActivityColumnName = "Publications" /> - <#assign tableContent = sparklineVO.yearToActivityCount /> - <#assign fileDownloadLink = sparklineVO.downloadDataLink /> - - <#include "yearToActivityCountTable.ftl"> - - Download data as .csv file. -
    -

    +

    + <#assign tableID = "publications_sparkline_data_table" /> + <#assign tableCaption = "Publications per year " /> + <#assign tableActivityColumnName = "Publications" /> + <#assign tableContent = sparklineVO.yearToActivityCount /> + <#assign fileDownloadLink = sparklineVO.downloadDataLink /> + + <#include "yearToActivityCountTable.ftl"> + + Download data as .csv file. +
    +

    diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/StandardVisualizationController.java b/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/StandardVisualizationController.java index 59e18ab1..f7b30fba 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/StandardVisualizationController.java +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/StandardVisualizationController.java @@ -6,6 +6,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.query.DatasetFactory; import com.hp.hpl.jena.query.Syntax; import com.hp.hpl.jena.rdf.model.Model; @@ -81,14 +82,14 @@ public class StandardVisualizationController extends FreemarkerHttpServlet { } - DataSource dataSource = setupJENADataSource(model, vitroRequest); + Dataset dataset = setupJENADataSource(vitroRequest); - if (dataSource != null && visRequestHandler != null) { + if (dataset != null && visRequestHandler != null) { try { return visRequestHandler.generateStandardVisualization(vitroRequest, log, - dataSource); + dataset); } catch (MalformedQueryParametersException e) { return UtilityFunctions.handleMalformedParameters( "Standard Visualization Query Error - Individual Publication Count", @@ -130,16 +131,16 @@ public class StandardVisualizationController extends FreemarkerHttpServlet { return visRequestHandler; } - private DataSource setupJENADataSource(Model model, VitroRequest vreq) { + private Dataset setupJENADataSource(VitroRequest vreq) { log.debug("rdfResultFormat was: " + VisConstants.RDF_RESULT_FORMAT_PARAM); - DataSource dataSource = DatasetFactory.create(); - ModelMaker maker = (ModelMaker) getServletContext().getAttribute("vitroJenaModelMaker"); +// DataSource dataSource = DatasetFactory.create(); +// ModelMaker maker = (ModelMaker) getServletContext().getAttribute("vitroJenaModelMaker"); +// +// dataSource.setDefaultModel(model); - dataSource.setDefaultModel(model); - - return dataSource; + return vreq.getDataset(); } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/VisualizationFrameworkConstants.java b/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/VisualizationFrameworkConstants.java index ff799464..1b089de8 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/VisualizationFrameworkConstants.java +++ b/src/edu/cornell/mannlib/vitro/webapp/controller/visualization/freemarker/VisualizationFrameworkConstants.java @@ -84,6 +84,8 @@ public class VisualizationFrameworkConstants { public static final String PERSON_LEVEL_UTILS_VIS_MODE = "PERSON_LEVEL_URL"; public static final String COPI_UTILS_VIS_MODE = "COPI_URL"; public static final String IMAGE_UTILS_VIS_MODE = "IMAGE_URL"; + public static final String ARE_PUBLICATIONS_AVAILABLE_UTILS_VIS_MODE = "SHOW_AUTHORSHIP_LINK"; + public static final String ARE_GRANTS_AVAILABLE_UTILS_VIS_MODE = "SHOW_GRANTS_LINK"; public static final String UNIVERSITY_COMPARISON_VIS_MODE = "UNIVERSITY"; public static final String SCHOOL_COMPARISON_VIS_MODE = "SCHOOL"; public static final String DEPARTMENT_COMPARISON_VIS_MODE = "DEPARTMENT"; diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java index e842a20a..3cb3815b 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/QueryFieldLabels.java @@ -24,6 +24,7 @@ public class QueryFieldLabels { public static final String DOCUMENT_BLURB = "documentBlurbLit"; public static final String DOCUMENT_DESCRIPTION = "documentDescriptionLit"; public static final String DOCUMENT_PUBLICATION_YEAR = "publicationYearLit"; + public static final String DOCUMENT_PUBLICATION_YEAR_USING_1_1_PROPERTY = "publicationYearOldLit"; public static final String DOCUMENT_PUBLICATION_YEAR_MONTH = "publicationYearMonthLit"; public static final String DOCUMENT_PUBLICATION_DATE = "publicationDateLit"; @@ -114,7 +115,16 @@ public class QueryFieldLabels { public static final String CO_PI_LABEL = "coPILabelLit"; public static final String GRANT_URL = "grantLit"; public static final String GRANT_LABEL = "grantLabelLit"; - public static final String GRANT_START_DATE = "grantStartDateLit"; - public static final String GRANT_END_DATE = "grantEndDateLit"; + + /* + * Role Start/End Date is chosen as the default Start Date for all the queries, + * in whose absence Grant Start/End Date is chosen. + */ + + public static final String ROLE_START_DATE = "grantStartDateLit"; + public static final String ROLE_END_DATE = "grantEndDateLit"; + public static final String GRANT_START_DATE = "grantStartDateForGrantLit"; + public static final String GRANT_END_DATE = "grantEndDateForGrantLit"; + } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java index 95fffb68..2b32ea5d 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/constants/VOConstants.java @@ -2,7 +2,12 @@ package edu.cornell.mannlib.vitro.webapp.visualization.constants; +import java.util.ArrayList; import java.util.Calendar; +import java.util.List; + +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; /** * This contains the constants related to all the value objects. @@ -23,6 +28,16 @@ public class VOConstants { public static final int NUM_CHARS_IN_YEAR_FORMAT = 4; public static final int MINIMUM_PUBLICATION_YEAR = 1800; public static final int CURRENT_YEAR = Calendar.getInstance().get(Calendar.YEAR); + + @SuppressWarnings("serial") + public static final List POSSIBLE_DATE_TIME_FORMATTERS = new ArrayList() {{ + + add(ISODateTimeFormat.dateTimeNoMillis()); + add(ISODateTimeFormat.dateHourMinuteSecond()); + add(ISODateTimeFormat.dateTimeParser()); + + }}; + } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipQueryRunner.java index e81dbd05..6961f87a 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipQueryRunner.java @@ -16,7 +16,7 @@ import org.apache.commons.logging.Log; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; import com.hp.hpl.jena.iri.Violation; -import com.hp.hpl.jena.query.DataSource; +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; @@ -51,7 +51,7 @@ public class CoAuthorshipQueryRunner implements QueryRunner { private String egoURI; - private DataSource dataSource; + private Dataset Dataset; private Log log; @@ -60,10 +60,10 @@ public class CoAuthorshipQueryRunner implements QueryRunner { private UniqueIDGenerator edgeIDGenerator; public CoAuthorshipQueryRunner(String egoURI, - DataSource dataSource, Log log) { + Dataset Dataset, Log log) { this.egoURI = egoURI; - this.dataSource = dataSource; + this.Dataset = Dataset; this.log = log; this.nodeIDGenerator = new UniqueIDGenerator(); @@ -376,32 +376,29 @@ public class CoAuthorshipQueryRunner implements QueryRunner { biboDocument.setDocumentMoniker(documentMonikerNode.toString()); } - RDFNode publicationYearNode = solution.get(QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR); - if (publicationYearNode != null) { - biboDocument.setPublicationYear(publicationYearNode.toString()); - } - - RDFNode publicationYearMonthNode = solution.get(QueryFieldLabels - .DOCUMENT_PUBLICATION_YEAR_MONTH); - if (publicationYearMonthNode != null) { - biboDocument.setPublicationYearMonth(publicationYearMonthNode.toString()); - } - RDFNode publicationDateNode = solution.get(QueryFieldLabels.DOCUMENT_PUBLICATION_DATE); if (publicationDateNode != null) { biboDocument.setPublicationDate(publicationDateNode.toString()); } + + /* + * This is being used so that date in the data from pre-1.2 ontology can be captured. + * */ + RDFNode publicationYearUsing_1_1_PropertyNode = solution.get(QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR_USING_1_1_PROPERTY); + if (publicationYearUsing_1_1_PropertyNode != null) { + biboDocument.setPublicationYear(publicationYearUsing_1_1_PropertyNode.toString()); + } return biboDocument; } private ResultSet executeQuery(String queryText, - DataSource dataSource) { + Dataset Dataset) { QueryExecution queryExecution = null; Query query = QueryFactory.create(queryText, SYNTAX); - queryExecution = QueryExecutionFactory.create(query, dataSource); + queryExecution = QueryExecutionFactory.create(query, Dataset); return queryExecution.execSelect(); } @@ -409,38 +406,35 @@ public class CoAuthorshipQueryRunner implements QueryRunner { // Resource uri1 = ResourceFactory.createResource(queryURI); String sparqlQuery = QueryConstants.getSparqlPrefixQuery() - + "SELECT " - + " (str(<" + queryURI + ">) as ?" + QueryFieldLabels.AUTHOR_URL + ") " - + " (str(?authorLabel) as ?" + QueryFieldLabels.AUTHOR_LABEL + ") " - + " (str(?coAuthorPerson) as ?" + QueryFieldLabels.CO_AUTHOR_URL + ") " - + " (str(?coAuthorPersonLabel) as ?" + QueryFieldLabels.CO_AUTHOR_LABEL + ") " - + " (str(?document) as ?" + QueryFieldLabels.DOCUMENT_URL + ") " - + " (str(?documentLabel) as ?" + QueryFieldLabels.DOCUMENT_LABEL + ") " - + " (str(?documentMoniker) as ?" + QueryFieldLabels.DOCUMENT_MONIKER + ") " - + " (str(?documentBlurb) as ?" + QueryFieldLabels.DOCUMENT_BLURB + ") " - + " (str(?publicationYear) as ?" + QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR + ") " - + " (str(?publicationYearMonth) as ?" - + QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR_MONTH + ") " - + " (str(?publicationDate) as ?" - + QueryFieldLabels.DOCUMENT_PUBLICATION_DATE + ") " - + "WHERE { " + + "SELECT \n" + + " (str(<" + queryURI + ">) as ?" + QueryFieldLabels.AUTHOR_URL + ") \n" + + " (str(?authorLabel) as ?" + QueryFieldLabels.AUTHOR_LABEL + ") \n" + + " (str(?coAuthorPerson) as ?" + QueryFieldLabels.CO_AUTHOR_URL + ") \n" + + " (str(?coAuthorPersonLabel) as ?" + QueryFieldLabels.CO_AUTHOR_LABEL + ") \n" + + " (str(?document) as ?" + QueryFieldLabels.DOCUMENT_URL + ") \n" + + " (str(?documentLabel) as ?" + QueryFieldLabels.DOCUMENT_LABEL + ") \n" + + " (str(?documentMoniker) as ?" + QueryFieldLabels.DOCUMENT_MONIKER + ") \n" + + " (str(?documentBlurb) as ?" + QueryFieldLabels.DOCUMENT_BLURB + ") \n" + + " (str(?publicationDate) as ?" + QueryFieldLabels.DOCUMENT_PUBLICATION_DATE + ") \n" + + " (str(?publicationYearUsing_1_1_property) as ?" + QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR_USING_1_1_PROPERTY + ") \n" + + "WHERE { \n" + "<" + queryURI + "> rdf:type foaf:Person ;" + " rdfs:label ?authorLabel ;" - + " core:authorInAuthorship ?authorshipNode . " + + " core:authorInAuthorship ?authorshipNode . \n" + "?authorshipNode rdf:type core:Authorship ;" - + " core:linkedInformationResource ?document . " - + "?document rdfs:label ?documentLabel . " - + "?document core:informationResourceInAuthorship ?coAuthorshipNode . " - + "?coAuthorshipNode core:linkedAuthor ?coAuthorPerson . " - + "?coAuthorPerson rdfs:label ?coAuthorPersonLabel . " - + "OPTIONAL { ?document core:year ?publicationYear } . " - + "OPTIONAL { ?document core:yearMonth ?publicationYearMonth } . " - + "OPTIONAL { ?document core:date ?publicationDate } . " - + "OPTIONAL { ?document vitro:moniker ?documentMoniker } . " - + "OPTIONAL { ?document vitro:blurb ?documentBlurb } . " - + "OPTIONAL { ?document vitro:description ?documentDescription } " - + "} " - + "ORDER BY ?document ?coAuthorPerson"; + + " core:linkedInformationResource ?document . \n" + + "?document rdfs:label ?documentLabel . \n" + + "?document core:informationResourceInAuthorship ?coAuthorshipNode . \n" + + "?coAuthorshipNode core:linkedAuthor ?coAuthorPerson . \n" + + "?coAuthorPerson rdfs:label ?coAuthorPersonLabel . \n" + + "OPTIONAL { ?document core:dateTimeValue ?dateTimeValue . \n" + + " ?dateTimeValue core:dateTime ?publicationDate } .\n" + + "OPTIONAL { ?document core:year ?publicationYearUsing_1_1_property } .\n" + + "OPTIONAL { ?document vitro:moniker ?documentMoniker } . \n" + + "OPTIONAL { ?document vitro:blurb ?documentBlurb } . \n" + + "OPTIONAL { ?document vitro:description ?documentDescription } \n" + + "} \n" + + "ORDER BY ?document ?coAuthorPerson\n"; // System.out.println("COAUTHORSHIP QUERY - " + sparqlQuery); @@ -468,7 +462,7 @@ public class CoAuthorshipQueryRunner implements QueryRunner { } ResultSet resultSet = executeQuery(generateEgoCoAuthorshipSparqlQuery(this.egoURI), - this.dataSource); + this.Dataset); return createQueryResult(resultSet); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipRequestHandler.java index 7a9348b1..42d7cc9b 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipRequestHandler.java @@ -12,7 +12,7 @@ import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; @@ -40,13 +40,13 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { @Override public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("CoAuthorship does not provide Ajax Response."); } @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { @@ -59,7 +59,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { .VIS_MODE_KEY); QueryRunner queryManager = - new CoAuthorshipQueryRunner(egoURI, dataSource, log); + new CoAuthorshipQueryRunner(egoURI, Dataset, log); CoAuthorshipData authorNodesAndEdges = queryManager.getQueryResult(); @@ -105,7 +105,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { public ResponseValues generateStandardVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) + Dataset Dataset) throws MalformedQueryParametersException { /* @@ -117,7 +117,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { .INDIVIDUAL_URI_KEY); QueryRunner queryManager = - new CoAuthorshipQueryRunner(egoURI, dataSource, log); + new CoAuthorshipQueryRunner(egoURI, Dataset, log); CoAuthorshipData authorNodesAndEdges = queryManager.getQueryResult(); @@ -196,13 +196,13 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { outputFileName = UtilityFunctions.slugify(authorNodesAndEdges .getEgoNode().getNodeName()) - + "_coauthors-per-year" + ".csv"; + + "_co-authors-per-year" + ".csv"; yearToCoauthors = UtilityFunctions.getPublicationYearToCoAuthors(authorNodesAndEdges); } else { - outputFileName = "no_coauthors-per-year" + ".csv"; + outputFileName = "no_co-authors-per-year" + ".csv"; } Map fileData = new HashMap(); @@ -230,12 +230,12 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { if (coAuthorshipData.getNodes() != null && coAuthorshipData.getNodes().size() > 0) { outputFileName = UtilityFunctions.slugify(coAuthorshipData.getEgoNode().getNodeName()) - + "_coauthors" + ".csv"; + + "_co-authors" + ".csv"; coAuthorsToCount = getCoAuthorsList(coAuthorshipData); } else { - outputFileName = "no_coauthors" + ".csv"; + outputFileName = "no_co-authors" + ".csv"; } Map fileData = new HashMap(); @@ -295,10 +295,10 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { if (authorNodesAndEdges.getNodes() != null && authorNodesAndEdges.getNodes().size() > 0) { outputFileName = UtilityFunctions.slugify(authorNodesAndEdges.getEgoNode().getNodeName()) - + "_coauthor-network.graphml" + ".xml"; + + "_co-author-network.graphml" + ".xml"; } else { - outputFileName = "no_coauthor-network.graphml" + ".xml"; + outputFileName = "no_co-author-network.graphml" + ".xml"; } CoAuthorshipGraphMLWriter coAuthorshipGraphMLWriter = diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipVisCodeGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipVisCodeGenerator.java index df04ace4..f3578432 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipVisCodeGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coauthorship/CoAuthorshipVisCodeGenerator.java @@ -11,21 +11,18 @@ import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; -import java.util.Map.Entry; import org.apache.commons.logging.Log; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Node; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.SparklineData; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.YearToEntityCountDataElement; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; -@SuppressWarnings("serial") public class CoAuthorshipVisCodeGenerator { /* @@ -37,22 +34,13 @@ public class CoAuthorshipVisCodeGenerator { * spanning the career of the person & last 10 years at the minimum, in case if * the person started his career in the last 10 yeras. * */ - private static final Map VIS_DIV_NAMES = new HashMap() { { - - put("SHORT_SPARK", "unique_coauthors_short_sparkline_vis"); - put("FULL_SPARK", "unique_coauthors_full_sparkline_vis"); - - } }; - - private static final String VISUALIZATION_STYLE_CLASS = "sparkline_style"; - private static final String DEFAULT_VISCONTAINER_DIV_ID = "unique_coauthors_vis_container"; private Map> yearToUniqueCoauthors; private Log log; - private SparklineData sparklineData; + private SparklineData sparklineParameterVO; private String individualURI; @@ -65,36 +53,22 @@ public class CoAuthorshipVisCodeGenerator { this.individualURI = individualURI; this.yearToUniqueCoauthors = yearToUniqueCoauthors; - this.sparklineData = new SparklineData(); this.log = log; - generateVisualizationCode(visMode, visContainer); + this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer); } /** - * This method is used to generate the visualization code (HMTL, CSS & JavaScript). - * There 2 parts to it - 1. Actual Content Code & 2. Context Code. - * 1. Actual Content code in this case is the sparkline image, text related to - * data and the wrapping tables. This is generated via call to google vis API through - * JavaScript. - * 2. Context code is generally optional but contains code pertaining to tabulated - * data & links to download files etc. + * This method is used to setup parameters for the sparkline value object. These parameters + * will be used in the template to construct the actual html/javascript code. * @param visMode * @param visContainer */ - private void generateVisualizationCode(String visMode, - String visContainer) { - - sparklineData.setSparklineContent(getMainVisualizationCode(visMode, - visContainer)); - - sparklineData.setSparklineContext(getVisualizationContextCode(visMode)); - - } - - private String getMainVisualizationCode(String visMode, + private SparklineData setupSparklineParameters(String visMode, String providedVisContainerID) { + + SparklineData sparklineData = new SparklineData(); int numOfYearsToBeRendered = 0; int currentYear = Calendar.getInstance().get(Calendar.YEAR); @@ -118,8 +92,6 @@ public class CoAuthorshipVisCodeGenerator { String visContainerID = null; - StringBuilder visualizationCode = new StringBuilder(); - if (yearToUniqueCoauthors.size() > 0) { try { minPublishedYear = Integer.parseInt(Collections.min(publishedYears)); @@ -150,32 +122,7 @@ public class CoAuthorshipVisCodeGenerator { sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered); - visualizationCode.append("\n"); - - visualizationCode.append("\n"; - } - - private String getVisualizationContextCode(String visMode) { - - String visualizationContextCode = ""; - if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) { - visualizationContextCode = generateShortVisContext(); - } else { - visualizationContextCode = generateFullVisContext(); - } - - log.debug(visualizationContextCode); - - return visualizationContextCode; - } - - private String generateFullVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String csvDownloadURLHref = ""; - if (yearToUniqueCoauthors.size() > 0) { - if (getCSVDownloadURL() != null) { - - csvDownloadURLHref = "Download data as .csv file.
    "; - sparklineData.setDownloadDataLink(getCSVDownloadURL()); - - } else { - csvDownloadURLHref = ""; - } - - } else { - csvDownloadURLHref = "No data available to export.
    "; - } - - String tableCode = generateDataTable(); - - divContextCode.append("

    " + tableCode + csvDownloadURLHref + "

    "); - - sparklineData.setTable(tableCode); - - - Map yearToUniqueCoauthorsCount = new HashMap(); - for (Map.Entry> currentYear : yearToUniqueCoauthors.entrySet()) { - yearToUniqueCoauthorsCount.put(currentYear.getKey(), currentYear.getValue().size()); - } - - sparklineData.setYearToActivityCount(yearToUniqueCoauthorsCount); - - return divContextCode.toString(); - } - - private String getCSVDownloadURL(){ - - if (yearToUniqueCoauthors.size() > 0) { - - ParamMap CSVDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, - VisualizationFrameworkConstants.COAUTHORSHIP_VIS, - VisualizationFrameworkConstants.VIS_MODE_KEY, - VisualizationFrameworkConstants.COAUTHORS_COUNT_PER_YEAR_VIS_MODE); - - return UrlBuilder.getUrl(VisualizationFrameworkConstants.DATA_VISUALIZATION_SERVICE_URL_PREFIX, - CSVDownloadURLParams); - - } else { - return null; - } - } - - private String generateShortVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String fullTimelineLink; - if (yearToUniqueCoauthors.size() > 0) { - - ParamMap fullTimelineNetworkURLParams = new ParamMap( - VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, + sparklineData.setFullTimelineNetworkLink(UtilityFunctions.getCollaboratorshipNetworkLink(individualURI, VisualizationFrameworkConstants.PERSON_LEVEL_VIS, - VisualizationFrameworkConstants.VIS_MODE_KEY, - VisualizationFrameworkConstants.COAUTHOR_VIS_MODE); - - String fullTimelineNetworkURL = UrlBuilder.getUrl( - VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX, - fullTimelineNetworkURLParams); - - fullTimelineLink = "View full timeline and co-author network."; + VisualizationFrameworkConstants.COAUTHOR_VIS_MODE)); - sparklineData.setFullTimelineNetworkLink(fullTimelineNetworkURL); + sparklineData.setDownloadDataLink(UtilityFunctions + .getCSVDownloadURL( + individualURI, + VisualizationFrameworkConstants.COAUTHORSHIP_VIS, + VisualizationFrameworkConstants.COAUTHORS_COUNT_PER_YEAR_VIS_MODE)); - } else { - fullTimelineLink = "No data available to render full timeline.
    "; + Map yearToUniqueCoauthorsCount = new HashMap(); + + for (Map.Entry> currentYearToCoAuthors : yearToUniqueCoauthors.entrySet()) { + yearToUniqueCoauthorsCount.put(currentYearToCoAuthors.getKey(), + currentYearToCoAuthors.getValue().size()); + } + + sparklineData.setYearToActivityCount(yearToUniqueCoauthorsCount); } - divContextCode.append("

    " + fullTimelineLink + "

    "); - - return divContextCode.toString(); - } - - - private String generateDataTable() { - - StringBuilder dataTable = new StringBuilder(); - - dataTable.append("" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + ""); - - for (Entry> currentEntry : yearToUniqueCoauthors.entrySet()) { - dataTable.append("" - + "" - + "" - + ""); - } - - dataTable.append("\n
    Unique Co-Authors per year
    YearCount
    " + currentEntry.getKey() + "" + currentEntry.getValue().size() + "
    \n"); - - return dataTable.toString(); - } - - public SparklineData getValueObjectContainer() { return sparklineData; } -} + + public SparklineData getValueObjectContainer() { + return this.sparklineParameterVO; + } +} \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java new file mode 100644 index 00000000..fbf869b6 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountConstructQueryRunner.java @@ -0,0 +1,271 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.coprincipalinvestigator; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +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.Syntax; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; + +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; + + +public class CoPIGrantCountConstructQueryRunner { + + protected static final Syntax SYNTAX = Syntax.syntaxARQ; + + private String egoURI; + + private Dataset Dataset; + + private long before, after; + + private Log log = LogFactory.getLog(CoPIGrantCountConstructQueryRunner.class.getName()); + + + private static final String SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING = + "?Role core:roleIn ?Grant . " + + "?Grant rdfs:label ?GrantLabel . " + + "?Grant core:relatedRole ?RelatedRole . "; + + public CoPIGrantCountConstructQueryRunner(String egoURI, Dataset Dataset, Log log){ + this.egoURI = egoURI; + this.Dataset = Dataset; + //this.log = log; + } + + private String generateConstructQueryForInvestigatorLabel(String queryURI) { + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> rdfs:label ?investigatorLabel ." + + "}" + + "WHERE {" + + "<"+queryURI+ "> rdfs:label ?investigatorLabel " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForInvestigatorRoleOfProperty(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING + + "?RelatedRole core:investigatorRoleOf ?coInvestigator ." + + "?coInvestigator rdfs:label ?coInvestigatorLabel . " + + "}" + + "WHERE { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING + + "?RelatedRole core:investigatorRoleOf ?coInvestigator ." + + "?coInvestigator rdfs:label ?coInvestigatorLabel . " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForPrincipalInvestigatorRoleOfProperty(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING + + "?RelatedRole core:principalInvestigatorRoleOf ?coInvestigator ." + + "?coInvestigator rdfs:label ?coInvestigatorLabel . " + + "}" + + "WHERE { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING + + "?RelatedRole core:principalInvestigatorRoleOf ?coInvestigator ." + + "?coInvestigator rdfs:label ?coInvestigatorLabel . " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING + + "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?coInvestigator ." + + "?coInvestigator rdfs:label ?coInvestigatorLabel . " + + "}" + + "WHERE { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + SPARQL_QUERY_COMMON_CONSTRUCT_AND_WHERE_STRING + + "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?coInvestigator ." + + "?coInvestigator rdfs:label ?coInvestigatorLabel . " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofRole(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "} UNION " + + "{" + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofGrant(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "} UNION " + + "{" + + "<"+queryURI+ ">" + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "}"; + + return sparqlQuery; + } + + private Model executeQuery(Set constructQueries, Dataset Dataset) { + + Model constructedModel = ModelFactory.createDefaultModel(); + + + for (String queryString : constructQueries) { + + before = System.currentTimeMillis(); + + log.info("CONSTRUCT query string : " + queryString); + + Query query = null; + + try{ + query = QueryFactory.create(QueryConstants.getSparqlPrefixQuery() + queryString, SYNTAX); + }catch(Throwable th){ + log.error("Could not create CONSTRUCT SPARQL query for query " + + "string. " + th.getMessage()); + log.error(queryString); + } + + QueryExecution qe = QueryExecutionFactory.create( + query, Dataset); + try { + qe.execConstruct(constructedModel); + } finally { + qe.close(); + } + + after = System.currentTimeMillis(); + log.info("Time taken to execute the CONSTRUCT query is in milliseconds: " + (after - before) ); + + } + + return constructedModel; + } + + public Model getConstructedModel() + throws MalformedQueryParametersException { + + if (StringUtils.isNotBlank(this.egoURI)) { + /* + * To test for the validity of the URI submitted. + * */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(this.egoURI); + if (iri.hasViolation(false)) { + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Ego Co-PI Vis Query " + errorMsg); + throw new MalformedQueryParametersException( + "URI provided for an individual is malformed."); + } + } else { + throw new MalformedQueryParametersException("URI parameter is either null or empty."); + } + + Set constructQueries = new HashSet(); + + populateConstructQueries(constructQueries); + + Model model = executeQuery(constructQueries, + this.Dataset); + + return model; + + } + + private void populateConstructQueries(Set constructQueries) { + + constructQueries.add(generateConstructQueryForInvestigatorLabel(this.egoURI)); + constructQueries.add(generateConstructQueryForInvestigatorRoleOfProperty(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForPrincipalInvestigatorRoleOfProperty(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI, "core:hasInvestigatorRole")); + + constructQueries.add(generateConstructQueryForInvestigatorRoleOfProperty(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForPrincipalInvestigatorRoleOfProperty(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI, "core:hasPrincipalInvestigatorRole")); + + constructQueries.add(generateConstructQueryForInvestigatorRoleOfProperty(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForCoPrincipalInvestigatorRoleOfProperty(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForPrincipalInvestigatorRoleOfProperty(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + + } +} \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java index 1ebc15b7..9a6d1258 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountQueryRunner.java @@ -12,6 +12,7 @@ import java.util.Set; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; @@ -24,6 +25,7 @@ import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.query.Syntax; +import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.RDFNode; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; @@ -47,20 +49,45 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { private String egoURI; - private DataSource dataSource; + private Model dataSource; - private Log log; + private Log log = LogFactory.getLog(CoPIGrantCountQueryRunner.class.getName()); private UniqueIDGenerator nodeIDGenerator; private UniqueIDGenerator edgeIDGenerator; + private long before, after; + + private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME = "" + + "OPTIONAL {" + + " ?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "OPTIONAL {" + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "} . " ; + + private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME = "" + + "OPTIONAL {" + + " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "OPTIONAL {" + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "}" ; + + public CoPIGrantCountQueryRunner(String egoURI, - DataSource dataSource, Log log) { + Model dataSource, Log log) { this.egoURI = egoURI; this.dataSource = dataSource; - this.log = log; + // this.log = log; this.nodeIDGenerator = new UniqueIDGenerator(); this.edgeIDGenerator = new UniqueIDGenerator(); @@ -76,8 +103,10 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { + " (str(?PILabel) as ?" + QueryFieldLabels.PI_LABEL + ") " + " (str(?Grant) as ?" + QueryFieldLabels.GRANT_URL + ") " + " (str(?GrantLabel) as ?" + QueryFieldLabels.GRANT_LABEL + ") " - + " (str(?GrantStartDate) as ?" + QueryFieldLabels.GRANT_START_DATE + ") " - + " (str(?GrantEndDate) as ?" + QueryFieldLabels.GRANT_END_DATE + ") " + + " (str(?startDateTimeValue) as ?grantStartDateLit) " + + " (str(?endDateTimeValue) as ?grantEndDateLit) " + + " (str(?startDateTimeValueForGrant) as ?grantStartDateForGrantLit) " + + " (str(?endDateTimeValueForGrant) as ?grantEndDateForGrantLit) " + " (str(?CoPI) as ?" + QueryFieldLabels.CO_PI_URL + ") " + " (str(?CoPILabel) as ?" + QueryFieldLabels.CO_PI_LABEL + ") " + "WHERE " @@ -97,36 +126,37 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { + "?CoPI rdfs:label ?CoPILabel . " - + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - - + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " - - + "} " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + "} " + "UNION " - - + "{ " + + + "{ " - + "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . " + + "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . " + "?Role core:roleIn ?Grant . " - + "?Grant rdfs:label ?GrantLabel ; " - + + "?Grant rdfs:label ?GrantLabel ; " + + "core:relatedRole ?RelatedRole . " - + "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . " + + "?RelatedRole core:investigatorRoleOf ?CoPI . " + "?CoPI rdfs:label ?CoPILabel . " - + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - - + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " - - + "} " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + "UNION " - + + "{ " + "<" + queryURI + "> core:hasCo-PrincipalInvestigatorRole ?Role . " @@ -141,11 +171,59 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { + "?CoPI rdfs:label ?CoPILabel . " - + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - - + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME - + "} " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + + "UNION " + + + + "{ " + + + "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . " + + + "?Role core:roleIn ?Grant . " + + + "?Grant rdfs:label ?GrantLabel ; " + + + "core:relatedRole ?RelatedRole . " + + + "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . " + + + "?CoPI rdfs:label ?CoPILabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + + "UNION " + + + "{ " + + + "<" + queryURI + "> core:hasPrincipalInvestigatorRole ?Role . " + + + "?Role core:roleIn ?Grant . " + + + "?Grant rdfs:label ?GrantLabel ; " + + + "core:relatedRole ?RelatedRole . " + + + "?RelatedRole core:investigatorRoleOf ?CoPI . " + + + "?CoPI rdfs:label ?CoPILabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + "UNION " @@ -163,22 +241,91 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { + "?CoPI rdfs:label ?CoPILabel . " - + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - - + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " - + "} " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + + "UNION " + + + "{ " + + + "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + + "?Role core:roleIn ?Grant . " + + + "?Grant rdfs:label ?GrantLabel ; " + + + "core:relatedRole ?RelatedRole . " + + + "?RelatedRole core:investigatorRoleOf ?CoPI . " + + + "?CoPI rdfs:label ?CoPILabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + + "UNION " + + + "{ " + + + "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + + + "?Role core:roleIn ?Grant . " + + + "?Grant rdfs:label ?GrantLabel ; " + + + "core:relatedRole ?RelatedRole . " + + + "?RelatedRole core:co-PrincipalInvestigatorRoleOf ?CoPI . " + + + "?CoPI rdfs:label ?CoPILabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + + "UNION " + + + "{ " + + + "<" + queryURI + "> core:hasInvestigatorRole ?Role . " + + + "?Role core:roleIn ?Grant . " + + + "?Grant rdfs:label ?GrantLabel ; " + + + "core:relatedRole ?RelatedRole . " + + + "?RelatedRole core:principalInvestigatorRoleOf ?CoPI . " + + + "?CoPI rdfs:label ?CoPILabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + "} "; - log.debug("COPI QUERY - " + sparqlQuery); - + // log.debug("COPI QUERY - " + sparqlQuery); //System.out.println("\n\nCOPI QUERY - " + sparqlQuery + "\n\n"); return sparqlQuery; } - private ResultSet executeQuery(String queryText, DataSource dataSource) { + private ResultSet executeQuery(String queryText, Model dataSource) { QueryExecution queryExecution = null; Query query = QueryFactory.create(queryText, SYNTAX); @@ -206,8 +353,14 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { throw new MalformedQueryParametersException("URI parameter is either null or empty."); } - ResultSet resultSet = executeQuery(generateEgoCoPIquery(this.egoURI), - this.dataSource); + before = System.currentTimeMillis(); + + ResultSet resultSet = executeQuery(generateEgoCoPIquery(this.egoURI), this.dataSource); + + after = System.currentTimeMillis(); + + log.info("Time taken to execute the SELECT queries is in milliseconds: " + (after - before) ); + return createQueryResult(resultSet); } @@ -248,7 +401,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { CoPINode egoNode = null; Set edges = new HashSet(); - + + before = System.currentTimeMillis(); + while (resultSet.hasNext()) { QuerySolution solution = resultSet.nextSolution(); @@ -384,6 +539,9 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { edgeUniqueIdentifierToVO); + after = System.currentTimeMillis(); + log.info("Time taken to iterate through the ResultSet of SELECT queries is in milliseconds: " + (after - before) ); + return new CoPIData(egoNode, nodes, edges); } @@ -502,15 +660,24 @@ public class CoPIGrantCountQueryRunner implements QueryRunner { } - RDFNode grantStartYear = solution.get(QueryFieldLabels.GRANT_START_DATE); + RDFNode grantStartYear = solution.get(QueryFieldLabels.ROLE_START_DATE); if (grantStartYear != null) { grant.setGrantStartDate(grantStartYear.toString()); + }else{ + grantStartYear = solution.get(QueryFieldLabels.GRANT_START_DATE); + if(grantStartYear != null){ + grant.setGrantStartDate(grantStartYear.toString()); + } } - RDFNode grantEndDate = solution.get(QueryFieldLabels - .GRANT_END_DATE); + RDFNode grantEndDate = solution.get(QueryFieldLabels.ROLE_END_DATE); if (grantEndDate != null) { grant.setGrantEndDate(grantEndDate.toString()); + }else{ + grantEndDate = solution.get(QueryFieldLabels.GRANT_END_DATE); + if(grantEndDate != null){ + grant.setGrantEndDate(grantEndDate.toString()); + } } return grant; diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountRequestHandler.java index 8ccbe91c..7e73d080 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIGrantCountRequestHandler.java @@ -11,7 +11,9 @@ import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.rdf.model.Model; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; @@ -34,19 +36,22 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler @Override public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Co-PI Grant Count does not provide Ajax Response."); } @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String egoURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); String visMode = vitroRequest.getParameter(VisualizationFrameworkConstants.VIS_MODE_KEY); - QueryRunner queryManager = new CoPIGrantCountQueryRunner(egoURI, dataSource, log); + CoPIGrantCountConstructQueryRunner constructQueryRunner = new CoPIGrantCountConstructQueryRunner(egoURI, Dataset, log); + Model constructedModel = constructQueryRunner.getConstructedModel(); + + QueryRunner queryManager = new CoPIGrantCountQueryRunner(egoURI, constructedModel, log); CoPIData PINodesAndEdges = queryManager.getQueryResult(); @@ -91,7 +96,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { /* * Support for this has ceased to exist. Standalone mode was created only for demo @@ -99,7 +104,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler * */ /* String egoURI = vitroRequest.getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); - QueryRunner queryManager = new CoPIGrantCountQueryRunner(egoURI, dataSource, log); + QueryRunner queryManager = new CoPIGrantCountQueryRunner(egoURI, Dataset, log); CoPIData PINodesAndEdges = queryManager.getQueryResult(); @@ -213,13 +218,13 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler outputFileName = UtilityFunctions.slugify(piNodesAndEdges .getEgoNode().getNodeName()) - + "_coinvestigators-per-year" + ".csv"; + + "_co-investigators-per-year" + ".csv"; yearToCoPIs = UtilityFunctions.getGrantYearToCoPI(piNodesAndEdges); } else { - outputFileName = "no_coinvestigators-per-year" + ".csv"; + outputFileName = "no_co-investigators-per-year" + ".csv"; } Map fileData = new HashMap(); @@ -247,12 +252,12 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler if (coPIData.getNodes() != null && coPIData.getNodes().size() > 0) { outputFileName = UtilityFunctions.slugify(coPIData.getEgoNode().getNodeName()) - + "_coinvestigators" + ".csv"; + + "_co-investigators" + ".csv"; coPIsToCount = getCoPIsList(coPIData); } else { - outputFileName = "no_coinvestigators" + ".csv"; + outputFileName = "no_co-investigators" + ".csv"; } Map fileData = new HashMap(); @@ -312,10 +317,10 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler if (coPIData.getNodes() != null && coPIData.getNodes().size() > 0) { outputFileName = UtilityFunctions.slugify(coPIData.getEgoNode().getNodeName()) - + "_copi-network.graphml" + ".xml"; + + "_co-investigator-network.graphml" + ".xml"; } else { - outputFileName = "no_copi-network.graphml" + ".xml"; + outputFileName = "no_co-investigator-network.graphml" + ".xml"; } CoPIGraphMLWriter coPIGraphMLWriter = diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIVisCodeGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIVisCodeGenerator.java index bc88321c..502ddd77 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIVisCodeGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/coprincipalinvestigator/CoPIVisCodeGenerator.java @@ -9,20 +9,18 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Set; import org.apache.commons.logging.Log; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.CoPINode; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.SparklineData; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.YearToEntityCountDataElement; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; /** * This class contains code for rendering sparklines and displaying tables for @@ -30,7 +28,6 @@ import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Ye * @author bkoniden * Deepak Konidena */ -@SuppressWarnings("serial") public class CoPIVisCodeGenerator { /* @@ -42,22 +39,13 @@ public class CoPIVisCodeGenerator { * spanning the career of the person & last 10 years at the minimum, in case if * the person started his career in the last 10 years. * */ - private static final Map VIS_DIV_NAMES = new HashMap() { { - - put("SHORT_SPARK", "unique_copis_short_sparkline_vis"); - put("FULL_SPARK", "unique_copis_full_sparkline_vis"); - - } }; - - private static final String VISUALIZATION_STYLE_CLASS = "sparkline_style"; - private static final String DEFAULT_VISCONTAINER_DIV_ID = "unique_coinvestigators_vis_container"; private Map> yearToUniqueCoPIs; private Log log; - private SparklineData sparklineData; + private SparklineData sparklineParameterVO; private String individualURI; @@ -70,37 +58,23 @@ public class CoPIVisCodeGenerator { this.individualURI = individualURI; this.yearToUniqueCoPIs = yearToUniqueCoPIs; - this.sparklineData = new SparklineData(); - + this.log = log; - generateVisualizationCode(visMode, visContainer); + this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer); } /** - * This method is used to generate the visualization code (HMTL, CSS & - * JavaScript). There 2 parts to it - 1. Actual Content Code & 2. Context - * Code. 1. Actual Content code in this case is the sparkline image, text - * related to data and the wrapping tables. This is generated via call to - * google vis API through JavaScript. 2. Context code is generally optional - * but contains code pertaining to tabulated data & links to download files - * etc. - * + * This method is used to setup parameters for the sparkline value object. These parameters + * will be used in the template to construct the actual html/javascript code. * @param visMode * @param visContainer */ - private void generateVisualizationCode(String visMode, String visContainer) { + private SparklineData setupSparklineParameters(String visMode, + String providedVisContainerID) { - sparklineData.setSparklineContent(getMainVisualizationCode(visMode, - visContainer)); - - sparklineData.setSparklineContext(getVisualizationContextCode(visMode)); - - } - - private String getMainVisualizationCode(String visMode, - String providedVisContainerID) { + SparklineData sparklineData = new SparklineData(); int numOfYearsToBeRendered = 0; int currentYear = Calendar.getInstance().get(Calendar.YEAR); @@ -126,8 +100,6 @@ public class CoPIVisCodeGenerator { String visContainerID = null; - StringBuilder visualizationCode = new StringBuilder(); - if (yearToUniqueCoPIs.size() > 0) { try { minGrantYear = Integer.parseInt(Collections @@ -160,26 +132,7 @@ public class CoPIVisCodeGenerator { sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered); - visualizationCode.append("\n"); - - visualizationCode - .append("\n"; - } - - private String getVisualizationContextCode(String visMode) { - - String visualizationContextCode = ""; - if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) { - visualizationContextCode = generateShortVisContext(); - } else { - visualizationContextCode = generateFullVisContext(); - } - - log.debug(visualizationContextCode); - - return visualizationContextCode; - } - - private String generateFullVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String csvDownloadURLHref = ""; if (yearToUniqueCoPIs.size() > 0) { - if (getCSVDownloadURL() != null) { - - csvDownloadURLHref = "Download data as .csv file.
    "; - sparklineData.setDownloadDataLink(getCSVDownloadURL()); - - } else { - csvDownloadURLHref = ""; - } - - } else { - csvDownloadURLHref = "No data available to export.
    "; - } - - String tableCode = generateDataTable(); - - divContextCode.append("

    " + tableCode + csvDownloadURLHref + "

    "); - - sparklineData.setTable(tableCode); - - Map yearToUniqueCoPIsCount = new HashMap(); - for (Map.Entry> currentYear : yearToUniqueCoPIs.entrySet()) { - yearToUniqueCoPIsCount.put(currentYear.getKey(), currentYear.getValue().size()); - } - - sparklineData.setYearToActivityCount(yearToUniqueCoPIsCount); - - return divContextCode.toString(); - } - - private String getCSVDownloadURL() { - - if (yearToUniqueCoPIs.size() > 0) { - - ParamMap CSVDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, - VisualizationFrameworkConstants.CO_PI_VIS, - VisualizationFrameworkConstants.VIS_MODE_KEY, - VisualizationFrameworkConstants.COPIS_COUNT_PER_YEAR_VIS_MODE); - - return UrlBuilder.getUrl(VisualizationFrameworkConstants.DATA_VISUALIZATION_SERVICE_URL_PREFIX, - CSVDownloadURLParams); - - } else { - return null; - } - } - private String generateShortVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String fullTimelineLink; - if (yearToUniqueCoPIs.size() > 0) { - - ParamMap fullTimelineNetworkURLParams = new ParamMap( - VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, + sparklineData.setFullTimelineNetworkLink(UtilityFunctions.getCollaboratorshipNetworkLink(individualURI, VisualizationFrameworkConstants.PERSON_LEVEL_VIS, - VisualizationFrameworkConstants.VIS_MODE_KEY, - VisualizationFrameworkConstants.COPI_VIS_MODE); + VisualizationFrameworkConstants.COPI_VIS_MODE)); + + sparklineData.setDownloadDataLink(UtilityFunctions + .getCSVDownloadURL( + individualURI, + VisualizationFrameworkConstants.CO_PI_VIS, + VisualizationFrameworkConstants.COPIS_COUNT_PER_YEAR_VIS_MODE)); + + Map yearToUniqueCoPIsCount = new HashMap(); + for (Map.Entry> currentYearToUniqueCoPIsCount : yearToUniqueCoPIs.entrySet()) { + yearToUniqueCoPIsCount.put(currentYearToUniqueCoPIsCount.getKey(), + currentYearToUniqueCoPIsCount.getValue().size()); + } - String fullTimelineNetworkURL = UrlBuilder.getUrl( - VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX, - fullTimelineNetworkURLParams); + sparklineData.setYearToActivityCount(yearToUniqueCoPIsCount); - fullTimelineLink = "View full timeline and co-pi network."; - - sparklineData.setFullTimelineNetworkLink(fullTimelineNetworkURL); - - } else { - fullTimelineLink = "No data available to render full timeline.
    "; } - - divContextCode.append("

    " + fullTimelineLink + "

    "); - - return divContextCode.toString(); - } - - private String generateDataTable() { - - StringBuilder dataTable = new StringBuilder(); - - dataTable.append("" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + ""); - - for (Entry> currentEntry : yearToUniqueCoPIs.entrySet()) { - dataTable.append("" - + "" - + "" - + ""); - } - - dataTable.append("\n
    Unique Co-PIs per year
    YearCount
    " + currentEntry.getKey() + "" + currentEntry.getValue().size() + "
    \n"); - - return dataTable.toString(); - } - - public SparklineData getValueObjectContainer() { + return sparklineData; } + + public SparklineData getValueObjectContainer() { + return this.sparklineParameterVO; + } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityComparisonUtilityFunctions.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityComparisonUtilityFunctions.java new file mode 100644 index 00000000..3a9cfd4a --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityComparisonUtilityFunctions.java @@ -0,0 +1,110 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.logging.Log; + +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.QuerySolution; +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.RDFNode; + +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryFieldLabels; +import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.GenericQueryMap; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.GenericQueryRunner; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.QueryRunner; + +public class EntityComparisonUtilityFunctions { + + public static String getHighestLevelOrganizationURI(ResultSet resultSet, + Map fieldLabelToOutputFieldLabel) { + + GenericQueryMap queryResult = new GenericQueryMap(); + + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + + RDFNode organizationNode = solution + .get(fieldLabelToOutputFieldLabel.get("organization")); + + if (organizationNode != null) { + queryResult.addEntry( + fieldLabelToOutputFieldLabel.get("organization"), + organizationNode.toString()); + + return organizationNode.toString(); + + } + + RDFNode organizationLabelNode = solution + .get(fieldLabelToOutputFieldLabel.get("organizationLabel")); + + if (organizationLabelNode != null) { + queryResult.addEntry( + fieldLabelToOutputFieldLabel.get("organizationLabel"), + organizationLabelNode.toString()); + } + + RDFNode numberOfChildrenNode = solution.getLiteral("numOfChildren"); + + if (numberOfChildrenNode != null) { + queryResult.addEntry("numOfChildren", String + .valueOf(numberOfChildrenNode.asLiteral().getInt())); + } + } + + return ""; + } + + public static String getHighestLevelOrganizationURI(Log log, Dataset Dataset) + throws MalformedQueryParametersException { + + Map fieldLabelToOutputFieldLabel = new HashMap(); + fieldLabelToOutputFieldLabel.put("organization", + QueryFieldLabels.ORGANIZATION_URL); + fieldLabelToOutputFieldLabel.put("organizationLabel", + QueryFieldLabels.ORGANIZATION_LABEL); + + String aggregationRules = "(count(?organization) AS ?numOfChildren)"; + + String whereClause = "?organization rdf:type foaf:Organization ; rdfs:label ?organizationLabel . \n" + + "OPTIONAL { ?organization core:hasSubOrganization ?subOrg } . \n" + + "OPTIONAL { ?organization core:subOrganizationWithin ?parent } . \n" + + "FILTER ( !bound(?parent) ). \n"; + + String groupOrderClause = "GROUP BY ?organization ?organizationLabel \n" + + "ORDER BY DESC(?numOfChildren)\n" + "LIMIT 1\n"; + + QueryRunner highestLevelOrganizationQueryHandler = new GenericQueryRunner( + fieldLabelToOutputFieldLabel, aggregationRules, whereClause, + groupOrderClause, Dataset, log); + + String highestLevelOrgURI = EntityComparisonUtilityFunctions + .getHighestLevelOrganizationURI( + highestLevelOrganizationQueryHandler.getQueryResult(), + fieldLabelToOutputFieldLabel); + return highestLevelOrgURI; + } + + public static Map> getSubEntityTypes(Log log, + Dataset Dataset, String subjectOrganization) + throws MalformedQueryParametersException { + + EntitySubOrganizationTypesConstructQueryRunner constructQueryRunnerForSubOrganizationTypes = new EntitySubOrganizationTypesConstructQueryRunner(subjectOrganization, Dataset, log) ; + Model constructedModelForSubOrganizationTypes = constructQueryRunnerForSubOrganizationTypes.getConstructedModel(); + + QueryRunner>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner( + subjectOrganization, constructedModelForSubOrganizationTypes, log); + + Map> subOrganizationTypesResult = queryManagerForsubOrganisationTypes + .getQueryResult(); + + return subOrganizationTypesResult; + } + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountConstructQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountConstructQueryRunner.java new file mode 100644 index 00000000..c62c3c37 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountConstructQueryRunner.java @@ -0,0 +1,288 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison; + +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +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.Syntax; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; + +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; + +public class EntityPublicationCountConstructQueryRunner { + + protected static final Syntax SYNTAX = Syntax.syntaxARQ; + + private String egoURI; + + private Dataset Dataset; + + private Log log = LogFactory.getLog(EntityPublicationCountConstructQueryRunner.class.getName()); + + private long before, after; + + public EntityPublicationCountConstructQueryRunner(String egoURI, Dataset Dataset, Log log){ + this.egoURI = egoURI; + this.Dataset = Dataset; + //this.log = log; + } + + private String generateConstructQueryForOrganizationLabel(String queryURI) { + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> rdfs:label ?organizationLabel ." + + "}" + + "WHERE {" + + "<"+queryURI+ "> rdfs:label ?organizationLabel " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForSubOrganizations(String queryURI){ + + String sparqlQuery = + + "CONSTRUCT { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization rdfs:label ?subOrganizationLabel . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person core:authorInAuthorship ?Resource . " + + "?Person rdfs:label ?PersonLabel . " + + "?Resource core:linkedInformationResource ?Document . " + + "?Document rdf:type bibo:Document . " + + "?Document rdfs:label ?DocumentLabel . " + + "?Document core:dateTimeValue ?dateTimeValue . " + + "?dateTimeValue core:dateTime ?publicationDate . " + + "?Document core:year ?publicationYearUsing_1_1_property " + +"}" + + "WHERE { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization rdfs:label ?subOrganizationLabel . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person core:authorInAuthorship ?Resource . " + + "?Person rdfs:label ?PersonLabel . " + + "?Resource core:linkedInformationResource ?Document . " +// + "?Document rdf:type bibo:Document . " + + "?Document rdfs:label ?DocumentLabel " + + + "{" + + "?Document core:dateTimeValue ?dateTimeValue . " + + "?dateTimeValue core:dateTime ?publicationDate " + + "}" + + "UNION " + + "{" + + "?Document core:year ?publicationYearUsing_1_1_property " + + "}" + + + "}" ; + + + return sparqlQuery; + + } + + private String generateConstructQueryForPersons(String queryURI){ + + String sparqlQuery = + + "CONSTRUCT { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person core:authorInAuthorship ?Resource . " + + "?Person rdfs:label ?PersonLabel . " + + "?Resource core:linkedInformationResource ?Document . " + + "?Document rdf:type bibo:Document . " + + "?Document rdfs:label ?DocumentLabel . " + + "?Document core:dateTimeValue ?dateTimeValue . " + + "?dateTimeValue core:dateTime ?publicationDate . " + + "?Document core:year ?publicationYearUsing_1_1_property ." + +"}" + + "WHERE { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person core:authorInAuthorship ?Resource . " + + "?Person rdfs:label ?PersonLabel . " + + "?Resource core:linkedInformationResource ?Document . " +// + "?Document rdf:type bibo:Document . " + + "?Document rdfs:label ?DocumentLabel " + + + "{" + + "?Document core:dateTimeValue ?dateTimeValue . " + + "?dateTimeValue core:dateTime ?publicationDate " + + "}" + + "UNION " + + "{" + + "?Document core:year ?publicationYearUsing_1_1_property " + + "}" + + + "}" ; + + + return sparqlQuery; + + } + +// private String generateConstructQueryForDocumentDateTimeValueOneLevelDeep(String queryURI){ +// +// String sparqlQuery = +// +// "CONSTRUCT { " +// + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " +// + "?subOrganization core:organizationForPosition ?Position . " +// + "?Position core:positionForPerson ?Person . " +// + "?Person core:authorInAuthorship ?Resource . " +// + "?Resource core:linkedInformationResource ?Document . " +// + "?Document rdf:type bibo:Document . " +// + "?Document core:dateTimeValue ?dateTimeValue . " +// + "?dateTimeValue core:dateTime ?publicationDate . " +// + "?Document core:year ?publicationYearUsing_1_1_property " +// +"}" +// + "WHERE { " +// + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " +// + "?subOrganization core:organizationForPosition ?Position . " +// + "?Position core:positionForPerson ?Person . " +// + "?Person core:authorInAuthorship ?Resource . " +// + "?Resource core:linkedInformationResource ?Document . " +// + "?Document rdf:type bibo:Document . " +// + "{" +// + "?Document core:dateTimeValue ?dateTimeValue . " +// + "?dateTimeValue core:dateTime ?publicationDate " +// + "}" +// + "UNION " +// + "{" +// + "?Document core:year ?publicationYearUsing_1_1_property " +// + "}" +// + "}" ; +// +// +// return sparqlQuery; +// +// } + +// private String generateConstructQueryForDocumentDateTimeValue(String queryURI){ +// +// String sparqlQuery = +// +// "CONSTRUCT { " +// + "<"+queryURI+ "> core:organizationForPosition ?Position . " +// + "?Position core:positionForPerson ?Person . " +// + "?Person core:authorInAuthorship ?Resource . " +// + "?Resource core:linkedInformationResource ?Document . " +// + "?Document rdf:type bibo:Document . " +// + "?Document core:dateTimeValue ?dateTimeValue . " +// + "?dateTimeValue core:dateTime ?publicationDate . " +// + "?Document core:year ?publicationYearUsing_1_1_property " +// +"}" +// + "WHERE { " +// + "<"+queryURI+ "> core:organizationForPosition ?Position . " +// + "?Position core:positionForPerson ?Person . " +// + "?Person core:authorInAuthorship ?Resource . " +// + "?Resource core:linkedInformationResource ?Document . " +// + "?Document rdf:type bibo:Document . " +// + "{" +// + "?Document core:dateTimeValue ?dateTimeValue . " +// + "?dateTimeValue core:dateTime ?publicationDate " +// + "}" +// + "UNION " +// + "{" +// + "?Document core:year ?publicationYearUsing_1_1_property " +// + "}" +// + "}" ; +// +// +// return sparqlQuery; +// +// } + + private Model executeQuery(Set constructQueries, Dataset Dataset) { + + Model constructedModel = ModelFactory.createDefaultModel(); + + for (String queryString : constructQueries) { + before = System.currentTimeMillis(); + log.debug("CONSTRUCT query string : " + queryString); + + Query query = null; + + try{ + query = QueryFactory.create(QueryConstants.getSparqlPrefixQuery() + queryString, SYNTAX); + }catch(Throwable th){ + log.error("Could not create CONSTRUCT SPARQL query for query " + + "string. " + th.getMessage()); + log.error(queryString); + } + + QueryExecution qe = QueryExecutionFactory.create( + query, Dataset); + + try { + qe.execConstruct(constructedModel); + } finally { + qe.close(); + } + + after = System.currentTimeMillis(); + log.debug("Time taken to execute the CONSTRUCT queries is in milliseconds: " + (after - before) ); + } + // constructedModel.write(System.out); + return constructedModel; + } + + public Model getConstructedModel() + throws MalformedQueryParametersException { + + if (StringUtils.isNotBlank(this.egoURI)) { + /* + * To test for the validity of the URI submitted. + * */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(this.egoURI); + if (iri.hasViolation(false)) { + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Entity Pub Count Construct Query " + errorMsg); + throw new MalformedQueryParametersException( + "URI provided for an individual is malformed."); + } + } else { + throw new MalformedQueryParametersException("URI parameter is either null or empty."); + } + + Set constructQueries = new LinkedHashSet(); + + populateConstructQueries(constructQueries); + + Model model = executeQuery(constructQueries, + this.Dataset); + + return model; + + } + + private void populateConstructQueries(Set constructQueries) { + + constructQueries.add(generateConstructQueryForOrganizationLabel(this.egoURI)); + constructQueries.add(generateConstructQueryForSubOrganizations(this.egoURI)); + constructQueries.add(generateConstructQueryForPersons(this.egoURI)); +// constructQueries.add(generateConstructQueryForDocumentDateTimeValueOneLevelDeep(this.egoURI)); +// constructQueries.add(generateConstructQueryForDocumentDateTimeValue(this.egoURI)); + + } +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountQueryRunner.java index 9031049e..95770e7e 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountQueryRunner.java @@ -7,11 +7,11 @@ import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; import com.hp.hpl.jena.iri.Violation; -import com.hp.hpl.jena.query.DataSource; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; @@ -20,6 +20,8 @@ import com.hp.hpl.jena.query.QuerySolution; 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.Model; + import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryFieldLabels; @@ -43,28 +45,25 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { protected static final Syntax SYNTAX = Syntax.syntaxARQ; private String entityURI; - private DataSource dataSource; - private Log log; + private Model dataSource; + private Log log = LogFactory.getLog(EntityPublicationCountQueryRunner.class.getName()); + private long before, after; private static final String SPARQL_QUERY_COMMON_SELECT_CLAUSE = "" + " (str(?Person) as ?personLit) " + " (str(?PersonLabel) as ?personLabelLit) " - + " (str(?SecondaryPositionLabel) as ?SecondaryPositionLabelLit)" + " (str(?Document) as ?documentLit) " + " (str(?DocumentLabel) as ?documentLabelLit) " - + " (str(?publicationYear) as ?publicationYearLit) " - + " (str(?publicationYearMonth) as ?publicationYearMonthLit) " - + " (str(?publicationDate) as ?publicationDateLit) " - + " (str(?StartYear) as ?StartYearLit)"; + + " (str(?publicationDate) as ?" + QueryFieldLabels.DOCUMENT_PUBLICATION_DATE + ") " + + " (str(?publicationYearUsing_1_1_property) as ?" + QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR_USING_1_1_PROPERTY + ") "; private static final String SPARQL_QUERY_COMMON_WHERE_CLAUSE = "" + "?Document rdf:type bibo:Document ;" + " rdfs:label ?DocumentLabel ." - + "OPTIONAL { ?Document core:year ?publicationYear } ." - + "OPTIONAL { ?Document core:yearMonth ?publicationYearMonth } ." - + "OPTIONAL { ?Document core:date ?publicationDate } ." - + "OPTIONAL { ?SecondaryPosition core:startYear ?StartYear } ."; + + "OPTIONAL { ?Document core:dateTimeValue ?dateTimeValue . " + + " ?dateTimeValue core:dateTime ?publicationDate } ." + + "OPTIONAL { ?Document core:year ?publicationYearUsing_1_1_property } ." ; private static String ENTITY_LABEL; private static String ENTITY_URL; @@ -72,11 +71,11 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { private static String SUBENTITY_URL; public EntityPublicationCountQueryRunner(String entityURI, - DataSource dataSource, Log log) { + Model dataSource, Log log) { this.entityURI = entityURI; this.dataSource = dataSource; - this.log = log; +// this.log = log; } @@ -87,6 +86,7 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { Map subentityURLToVO = new HashMap(); Map personURLToVO = new HashMap(); + before = System.currentTimeMillis(); while (resultSet.hasNext()) { @@ -114,26 +114,17 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { biboDocument.setDocumentLabel(documentLabelNode.toString()); } - RDFNode publicationYearNode = solution - .get(QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR); - if (publicationYearNode != null) { - biboDocument.setPublicationYear(publicationYearNode - .toString()); - } - - RDFNode publicationYearMonthNode = solution - .get(QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR_MONTH); - if (publicationYearMonthNode != null) { - biboDocument - .setPublicationYearMonth(publicationYearMonthNode - .toString()); - } - - RDFNode publicationDateNode = solution - .get(QueryFieldLabels.DOCUMENT_PUBLICATION_DATE); + RDFNode publicationDateNode = solution.get(QueryFieldLabels.DOCUMENT_PUBLICATION_DATE); if (publicationDateNode != null) { - biboDocument.setPublicationDate(publicationDateNode - .toString()); + biboDocument.setPublicationDate(publicationDateNode.toString()); + } + + /* + * This is being used so that date in the data from pre-1.2 ontology can be captured. + * */ + RDFNode publicationYearUsing_1_1_PropertyNode = solution.get(QueryFieldLabels.DOCUMENT_PUBLICATION_YEAR_USING_1_1_PROPERTY); + if (publicationYearUsing_1_1_PropertyNode != null) { + biboDocument.setPublicationYear(publicationYearUsing_1_1_PropertyNode.toString()); } } @@ -155,15 +146,18 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { if (subEntityLabelNode != null) { subEntity.setIndividualLabel(subEntityLabelNode.toString()); } + entity.addSubEntity(subEntity); - subEntity.addPublications(biboDocument); + + subEntity.addPublication(biboDocument); } RDFNode personURLNode = solution.get(QueryFieldLabels.PERSON_URL); - if(personURLNode != null){ - SubEntity person ; - if(personURLToVO.containsKey(personURLNode.toString())) { + if (personURLNode != null) { + SubEntity person; + + if (personURLToVO.containsKey(personURLNode.toString())) { person = personURLToVO.get(personURLNode.toString()); } else { person = new SubEntity(personURLNode.toString()); @@ -175,27 +169,50 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { person.setIndividualLabel(personLabelNode.toString()); } -// entity.addSubEntity(person); - person.addPublications(biboDocument); + /* + * This makes sure that either, + * 1. the parent organization is a department-like organization with no organizations + * beneath it, or + * 2. the parent organizations has both sub-organizations and people directly + * attached to that organizations e.g. president of a university. + * */ + if (subEntityURLNode == null) { + + entity.addSubEntity(person); + + } + + person.addPublication(biboDocument); } - entity.addPublications(biboDocument); + entity.addPublication(biboDocument); } - if(subentityURLToVO.size() == 0 && personURLToVO.size() != 0){ - for(SubEntity person : personURLToVO.values()){ - entity.addSubEntity(person); - } - } else if (subentityURLToVO.size() == 0 && personURLToVO.size() == 0){ + /* + if (subentityURLToVO.size() != 0) { + + entity.addSubEntitities(subentityURLToVO.values()); + + } else if (subentityURLToVO.size() == 0 && personURLToVO.size() != 0) { + + entity.addSubEntitities(personURLToVO.values()); + + } else*/ if (subentityURLToVO.size() == 0 && personURLToVO.size() == 0) { + entity = new Entity(this.entityURI, "no-label"); + } //TODO: return non-null value + // log.info("Returning entity that contains the following set of subentities: "+entity.getSubEntities().toString()); + after = System.currentTimeMillis(); + log.info("Time taken to iterate through the ResultSet of SELECT queries is in milliseconds: " + (after - before) ); + return entity; } - private ResultSet executeQuery(String queryURI, DataSource dataSource) { + private ResultSet executeQuery(String queryURI, Model dataSource) { QueryExecution queryExecution = null; Query query = QueryFactory.create( @@ -227,23 +244,20 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { + " (str(?subOrganizationLabel) as ?subOrganizationLabelLit) " + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI + ">) as ?" + ENTITY_URL + ") " - + "WHERE { " + "<" + queryURI + "> rdf:type foaf:Organization ;" - + " rdfs:label ?organizationLabel ." + + "WHERE { " + "<" + queryURI + "> rdfs:label ?organizationLabel ." + "{ " + "<" + queryURI + "> core:hasSubOrganization ?subOrganization ." + "?subOrganization rdfs:label ?subOrganizationLabel ; core:organizationForPosition ?Position . " - + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ." - + " ?Person core:authorInAuthorship ?Resource ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . " + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:authorInAuthorship ?Resource ; rdfs:label ?PersonLabel . " + " ?Resource core:linkedInformationResource ?Document . " - + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ." + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}" + "UNION " + "{ " + "<" + queryURI + "> core:organizationForPosition ?Position ." - + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ." - + " ?Person core:authorInAuthorship ?Resource ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . " + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:authorInAuthorship ?Resource ; rdfs:label ?PersonLabel . " + " ?Resource core:linkedInformationResource ?Document ." - + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel ." + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}" + "}"; @@ -266,7 +280,7 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { if (iri.hasViolation(false)) { String errorMsg = ((Violation) iri.violations(false).next()) .getShortMessage(); - log.error("Entity Pub Count Query Query " + errorMsg); + log.error("Entity Pub Count Query " + errorMsg); throw new MalformedQueryParametersException( "URI provided for an entity is malformed."); } @@ -276,8 +290,14 @@ public class EntityPublicationCountQueryRunner implements QueryRunner { "URL parameter is either null or empty."); } + before = System.currentTimeMillis(); + ResultSet resultSet = executeQuery(this.entityURI, this.dataSource); - + + after = System.currentTimeMillis(); + + log.info("Time taken to execute the SELECT queries is in milliseconds: " + (after - before) ); + return createJavaValueObjects(resultSet); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java index 89c66cc2..71237186 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntityPublicationCountRequestHandler.java @@ -12,16 +12,25 @@ import java.util.Set; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.google.gson.Gson; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.rdf.model.Model; + +import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties; +import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; -import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.DataVisualizationController; +import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; +import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Entity; @@ -34,56 +43,117 @@ import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.Visual public class EntityPublicationCountRequestHandler implements VisualizationRequestHandler { + private Log log = LogFactory.getLog(EntityPublicationCountRequestHandler.class.getName()); + @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String entityURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); - QueryRunner queryManager = new EntityPublicationCountQueryRunner( - entityURI, dataSource, log); + if (StringUtils.isNotBlank(entityURI)){ - Entity entity = queryManager.getQueryResult(); - - if(entity.getEntityLabel().equals("no-label")){ - - return prepareStandaloneErrorResponse(vitroRequest,entityURI); - - } else{ - - QueryRunner>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner( - entityURI, dataSource, log); - - Map> subOrganizationTypesResult = queryManagerForsubOrganisationTypes - .getQueryResult(); - - return prepareStandaloneResponse(vitroRequest, entity, entityURI, - subOrganizationTypesResult); + return getSubjectEntityAndGenerateResponse(vitroRequest, log, + Dataset, entityURI); + } else { + + String staffProvidedHighestLevelOrganization = ConfigurationProperties.getProperty("visualization.topLevelOrg"); + + /* + * First checking if the staff has provided highest level organization in deploy.properties + * if so use to temporal graph vis. + */ + if (StringUtils.isNotBlank(staffProvidedHighestLevelOrganization)) { + + /* + * To test for the validity of the URI submitted. + */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(staffProvidedHighestLevelOrganization); + + if (iri.hasViolation(false)) { + + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Highest Level Organization URI provided is invalid " + errorMsg); + + } else { + + return getSubjectEntityAndGenerateResponse(vitroRequest, + log, Dataset, + staffProvidedHighestLevelOrganization); + } + } + + String highestLevelOrgURI = EntityComparisonUtilityFunctions.getHighestLevelOrganizationURI(log, + Dataset); + + return getSubjectEntityAndGenerateResponse(vitroRequest, log, + Dataset, highestLevelOrgURI); } } + private ResponseValues getSubjectEntityAndGenerateResponse( + VitroRequest vitroRequest, Log log, Dataset Dataset, + String subjectEntityURI) + throws MalformedQueryParametersException { + + EntityPublicationCountConstructQueryRunner constructQueryRunner = new EntityPublicationCountConstructQueryRunner(subjectEntityURI, Dataset, log); + Model constructedModel = constructQueryRunner.getConstructedModel(); + + QueryRunner queryManager = new EntityPublicationCountQueryRunner( + subjectEntityURI, constructedModel, log); + + + Entity entity = queryManager.getQueryResult(); + + + if (entity.getEntityLabel().equals("no-label")) { + + return prepareStandaloneErrorResponse(vitroRequest, subjectEntityURI); + + } else { + + return getSubEntityTypesAndRenderStandaloneResponse( + vitroRequest, log, Dataset, + subjectEntityURI, entity); + } + } + + + private ResponseValues getSubEntityTypesAndRenderStandaloneResponse( + VitroRequest vitroRequest, Log log, Dataset Dataset, + String subjectEntityURI, Entity entity) + throws MalformedQueryParametersException { + + Map> subOrganizationTypesResult = EntityComparisonUtilityFunctions.getSubEntityTypes( + log, Dataset, subjectEntityURI); + + return prepareStandaloneResponse(vitroRequest, entity, subjectEntityURI, + subOrganizationTypesResult); + } + @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String entityURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); + EntityPublicationCountConstructQueryRunner constructQueryRunner = new EntityPublicationCountConstructQueryRunner(entityURI, Dataset, log); + Model constructedModel = constructQueryRunner.getConstructedModel(); + QueryRunner queryManager = new EntityPublicationCountQueryRunner( - entityURI, dataSource, log); + entityURI, constructedModel, log); Entity entity = queryManager.getQueryResult(); - - QueryRunner>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner( - entityURI, dataSource, log); - - Map> subOrganizationTypesResult = queryManagerForsubOrganisationTypes.getQueryResult(); + Map> subOrganizationTypesResult = EntityComparisonUtilityFunctions.getSubEntityTypes( + log, Dataset, entityURI); return prepareDataResponse(entity, entity.getSubEntities(),subOrganizationTypesResult); @@ -92,7 +162,7 @@ public class EntityPublicationCountRequestHandler implements @Override public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Entity Pub Count does not provide Ajax Response."); } @@ -141,16 +211,20 @@ public class EntityPublicationCountRequestHandler implements Entity entity, String entityURI, Map> subOrganizationTypesResult) { Portal portal = vreq.getPortal(); - String standaloneTemplate = "entityComparisonStandaloneActivator.ftl"; + String standaloneTemplate = "entityComparisonOnPublicationsStandalone.ftl"; String jsonContent = ""; jsonContent = writePublicationsOverTimeJSON(vreq, entity.getSubEntities(), subOrganizationTypesResult); + String title = ""; + if (StringUtils.isNotBlank(entity.getEntityLabel())) { + title = entity.getEntityLabel() + " - "; + } Map body = new HashMap(); body.put("portalBean", portal); - body.put("title", "Temporal Graph Visualization"); + body.put("title", title + "Temporal Graph Visualization"); body.put("organizationURI", entityURI); body.put("organizationLabel", entity.getEntityLabel()); body.put("jsonContent", jsonContent); @@ -164,13 +238,23 @@ public class EntityPublicationCountRequestHandler implements VitroRequest vitroRequest, String entityURI) { Portal portal = vitroRequest.getPortal(); - String standaloneTemplate = "entityComparisonErrorActivator.ftl"; - + String standaloneTemplate = "entityPublicationComparisonError.ftl"; Map body = new HashMap(); - body.put("portalBean", portal); - body.put("title", "Temporal Graph Visualization"); - body.put("organizationURI", entityURI); + IndividualDao iDao = vitroRequest.getWebappDaoFactory().getIndividualDao(); + Individual ind = iDao.getIndividualByURI(entityURI); + + String organizationLabel = "Unknown Organization"; + + if (ind != null) { + organizationLabel = ind.getName(); + } + + body.put("organizationLabel", organizationLabel); + body.put("portalBean", portal); + body.put("title", organizationLabel + " - Temporal Graph Visualization"); + body.put("organizationURI", entityURI); + return new TemplateResponseValues(standaloneTemplate, body); } @@ -182,7 +266,10 @@ public class EntityPublicationCountRequestHandler implements * @param subentities * @param subOrganizationTypesResult */ - private String writePublicationsOverTimeJSON(VitroRequest vreq, Set subentities, Map> subOrganizationTypesResult) { + private String writePublicationsOverTimeJSON(VitroRequest vreq, + Set subentities, + Map> + subOrganizationTypesResult) { Gson json = new Gson(); Set subEntitiesJson = new HashSet(); @@ -198,18 +285,21 @@ public class EntityPublicationCountRequestHandler implements .entrySet()) { List currentPubYear = new ArrayList(); - if (pubEntry.getKey().equals( - VOConstants.DEFAULT_PUBLICATION_YEAR)) + if (pubEntry.getKey().equals(VOConstants.DEFAULT_PUBLICATION_YEAR)) { currentPubYear.add(-1); - else + } else { currentPubYear.add(Integer.parseInt(pubEntry.getKey())); + } + currentPubYear.add(pubEntry.getValue()); yearPubCount.add(currentPubYear); } + + //log.info("entityJson.getLabel() : " + entityJson.getLabel() + " subOrganizationTypesResult " + subOrganizationTypesResult.toString()); entityJson.setYearToActivityCount(yearPubCount); entityJson.getOrganizationType().addAll(subOrganizationTypesResult.get(entityJson.getLabel())); - + entityJson.setEntityURI(subentity.getIndividualURI()); boolean isPerson = vreq.getWebappDaoFactory().getIndividualDao().getIndividualByURI(subentity.getIndividualURI()).isVClass("http://xmlns.com/foaf/0.1/Person"); @@ -254,5 +344,5 @@ public class EntityPublicationCountRequestHandler implements return csvFileContent.toString(); } - + } \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesConstructQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesConstructQueryRunner.java new file mode 100644 index 00000000..65ef14ba --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesConstructQueryRunner.java @@ -0,0 +1,188 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison; + +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +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.Syntax; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; + +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; + +public class EntitySubOrganizationTypesConstructQueryRunner { + + protected static final Syntax SYNTAX = Syntax.syntaxARQ; + + private String egoURI; + + private Dataset Dataset; + + private Log log = LogFactory.getLog(EntitySubOrganizationTypesConstructQueryRunner.class.getName()); + + public EntitySubOrganizationTypesConstructQueryRunner(String egoURI, Dataset Dataset, Log log){ + this.egoURI = egoURI; + this.Dataset = Dataset; + //this.log = log; + } + + private String generateConstructQueryForOrganizationLabel(String queryURI) { + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> rdfs:label ?organizationLabel ." + + "}" + + "WHERE {" + + "<"+queryURI+ "> rdfs:label ?organizationLabel " + + "}"; + return sparqlQuery; + } + + private String generateConstructQueryForSubOrganizationTypes(String queryURI){ + + //bdc34: this query was lacking the personLabel, personType, and personTypeLabel in the WHERE clause + //it seems like they are needed since they are referenced in the CONSTRUCT clause. + + String sparqlQuery = + + "CONSTRUCT { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization rdfs:label ?subOrganizationLabel . " + + "?subOrganization rdf:type ?subOrganizationType . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?subOrganizationType rdfs:label ?subOrganizationTypeLabel . " + + "?Position core:positionForPerson ?Person ." + + "?Person rdfs:label ?PersonLabel ." + + "?Person rdf:type ?PersonType . " + + "?PersonType rdfs:label ?PersonTypeLabel " + +"}" + + "WHERE { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization rdfs:label ?subOrganizationLabel . " + + "?subOrganization rdf:type ?subOrganizationType . " + + "?subOrganizationType rdfs:label ?subOrganizationTypeLabel . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person rdfs:label ?PersonLabel ." + + "?Person rdf:type ?PersonType . " + + "?PersonType rdfs:label ?PersonTypeLabel " + + + "}" ; + + + return sparqlQuery; + + } + + private String generateConstructQueryForPersonTypes(String queryURI){ + + String sparqlQuery = + + "CONSTRUCT { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person ." + + "?Person rdfs:label ?PersonLabel ." + + "?Person rdf:type ?PersonType . " + + "?PersonType rdfs:label ?PersonTypeLabel " + +"}" + + "WHERE { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person ." + + "?Person rdfs:label ?PersonLabel ." + + "?Person rdf:type ?PersonType . " + + "?PersonType rdfs:label ?PersonTypeLabel " + + "}" ; + + + return sparqlQuery; + + } + + private Model executeQuery(Set constructQueries, Dataset Dataset) { + + Model constructedModel = ModelFactory.createDefaultModel(); + long before = 0; + + for (String queryString : constructQueries) { + + before = System.currentTimeMillis(); + log.debug("CONSTRUCT query string : " + queryString); + + Query query = null; + + try{ + query = QueryFactory.create(QueryConstants.getSparqlPrefixQuery() + queryString, SYNTAX); + }catch(Throwable th){ + log.error("Could not create CONSTRUCT SPARQL query for query " + + "string. " + th.getMessage()); + log.error(queryString); + } + + QueryExecution qe = QueryExecutionFactory.create( + query, Dataset); + try { + qe.execConstruct(constructedModel); + } finally { + qe.close(); + } + + log.debug("Time to run " + (before - System.currentTimeMillis()) ); + } + + return constructedModel; + } + + public Model getConstructedModel() + throws MalformedQueryParametersException { + + if (StringUtils.isNotBlank(this.egoURI)) { + /* + * To test for the validity of the URI submitted. + * */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(this.egoURI); + if (iri.hasViolation(false)) { + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Ego Co-PI Vis Query " + errorMsg); + throw new MalformedQueryParametersException( + "URI provided for an individual is malformed."); + } + } else { + throw new MalformedQueryParametersException("URI parameter is either null or empty."); + } + + Set constructQueries = new LinkedHashSet(); + + populateConstructQueries(constructQueries); + + Model model = executeQuery(constructQueries, + this.Dataset); + //model.write(System.out); + return model; + + } + + private void populateConstructQueries(Set constructQueries) { + + constructQueries.add(generateConstructQueryForOrganizationLabel(this.egoURI)); + constructQueries.add(generateConstructQueryForSubOrganizationTypes(this.egoURI)); + constructQueries.add(generateConstructQueryForPersonTypes(this.egoURI)); + + + } + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesQueryRunner.java index eb0656ac..9cda75e4 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitycomparison/EntitySubOrganizationTypesQueryRunner.java @@ -6,6 +6,7 @@ import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; @@ -19,6 +20,8 @@ import com.hp.hpl.jena.query.QuerySolution; 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.Model; + import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryFieldLabels; @@ -38,8 +41,8 @@ public class EntitySubOrganizationTypesQueryRunner implements QueryRunner rdf:type foaf:Organization ;" - + " rdfs:label ?organizationLabel . " + + "> rdfs:label ?organizationLabel . " + "{ " + "<"+ queryURI + "> core:hasSubOrganization ?subOrganization . " - + "?subOrganization rdfs:label ?subOrganizationLabel ; rdf:type ?subOrganizationType . " + + "?subOrganization rdfs:label ?subOrganizationLabel ; rdf:type ?subOrganizationType ;" + + " core:organizationForPosition ?Position . " + "?subOrganizationType rdfs:label ?subOrganizationTypeLabel . " + + "?Position core:positionForPerson ?Person ." + "}" + "UNION " + "{ " + "<"+ queryURI + "> core:organizationForPosition ?Position . " - + "?Position rdf:type core:Position ; core:positionForPerson ?Person . " + + "?Position core:positionForPerson ?Person . " + "?Person rdfs:label ?PersonLabel ; rdf:type ?PersonType . " - + "?PersonType rdfs:label ??PersonTypeLabel . " + + "?PersonType rdfs:label ?PersonTypeLabel . " + "}" + "}"; -// System.out.println("\n\nEntity SubOrganizationTypes query is: "+ sparqlQuery); - log.debug("\nThe sparql query is :\n" + sparqlQuery); + // log.info("\n SubOrganizationTypesQuery :" + sparqlQuery); return sparqlQuery; @@ -104,8 +107,9 @@ public class EntitySubOrganizationTypesQueryRunner implements QueryRunner> createJavaValueObjects(ResultSet resultSet) { - Map> subOrganizationLabelToTypes = new HashMap>(); - Map> personLabelToTypes = new HashMap>(); + // Map> subOrganizationLabelToTypes = new HashMap>(); + // Map> personLabelToTypes = new HashMap>(); + Map> subEntityLabelToTypes = new HashMap>(); while(resultSet.hasNext()){ @@ -113,34 +117,50 @@ public class EntitySubOrganizationTypesQueryRunner implements QueryRunner()); - subOrganizationLabelToTypes.get(subOrganizationLabel.toString()).add(subOrganizationType.toString()); + } else { + RDFNode subOrganizationType = solution + .get(QueryFieldLabels.SUBORGANIZATION_TYPE_LABEL); + if (subOrganizationType != null) { + subEntityLabelToTypes.put( + subOrganizationLabel.toString(), + new HashSet()); + subEntityLabelToTypes.get( + subOrganizationLabel.toString()).add( + subOrganizationType.toString()); } } } RDFNode personLabel = solution.get(QueryFieldLabels.PERSON_LABEL); - - if(personLabel != null){ - if(personLabelToTypes.containsKey(personLabel.toString())){ - RDFNode personType = solution.get(QueryFieldLabels.PERSON_TYPE_LABEL); - if(personType != null && ! personType.toString().startsWith("http")){ - personLabelToTypes.get(personLabel.toString()).add(personType.toString()); + + if (personLabel != null) { + if (subEntityLabelToTypes.containsKey(personLabel.toString())) { + RDFNode personType = solution + .get(QueryFieldLabels.PERSON_TYPE_LABEL); + if (personType != null + && !personType.toString().startsWith("http")) { + subEntityLabelToTypes.get(personLabel.toString()).add( + personType.toString()); } - }else{ - RDFNode personType = solution.get(QueryFieldLabels.PERSON_TYPE_LABEL); - if(personType != null && ! personType.toString().startsWith("http")){ - personLabelToTypes.put(personLabel.toString(), new HashSet()); - personLabelToTypes.get(personLabel.toString()).add(personType.toString()); + } else { + RDFNode personType = solution + .get(QueryFieldLabels.PERSON_TYPE_LABEL); + if (personType != null + && !personType.toString().startsWith("http")) { + subEntityLabelToTypes.put(personLabel.toString(), + new HashSet()); + subEntityLabelToTypes.get(personLabel.toString()).add( + personType.toString()); } } } @@ -149,7 +169,10 @@ public class EntitySubOrganizationTypesQueryRunner implements QueryRunner " + subOrganizationLabelToTypes.size()); // System.out.println("\n\nPeople Label Types Size --> " + personLabelToTypes.size()); - return (subOrganizationLabelToTypes.size() != 0 )? subOrganizationLabelToTypes : personLabelToTypes ; +// log.info("Sub Organization Label Types Size : " + subEntityLabelToTypes.size()); + + return subEntityLabelToTypes; + //return (subOrganizationLabelToTypes.size() != 0 )? subOrganizationLabelToTypes : personLabelToTypes ; } public Map> getQueryResult() throws MalformedQueryParametersException { diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountConstructQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountConstructQueryRunner.java new file mode 100644 index 00000000..4fea86a7 --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountConstructQueryRunner.java @@ -0,0 +1,364 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitygrantcount; + +import java.util.LinkedHashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +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.Syntax; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; + +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; + +public class EntityGrantCountConstructQueryRunner { + + protected static final Syntax SYNTAX = Syntax.syntaxARQ; + + private String egoURI; + + private Dataset Dataset; + + private long before, after; + + private Log log = LogFactory.getLog(EntityGrantCountConstructQueryRunner.class.getName()); + + public EntityGrantCountConstructQueryRunner(String egoURI, Dataset Dataset, Log log){ + this.egoURI = egoURI; + this.Dataset = Dataset; + //this.log = log; + } + + private String generateConstructQueryForOrganizationLabel(String queryURI) { + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> rdfs:label ?organizationLabel ." + + "}" + + "WHERE {" + + "<"+queryURI+ "> rdfs:label ?organizationLabel " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofRoleForOneLevelDeep(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "} UNION " + + "{" + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofGrantForOneLevelDeep(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant " + + "} UNION " + + "{" + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant " + + "}" + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofRole(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue " + + "} UNION " + + "{" + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue " + + "}" + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofGrant(String queryURI, String preboundProperty){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant " + + "} UNION " + + "{" + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant " + + "}" + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForSubOrganizations(String queryURI, String preboundProperty){ + + String sparqlQuery = + + "CONSTRUCT { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization rdfs:label ?subOrganizationLabel . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person rdfs:label ?PersonLabel ." + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant rdfs:label ?GrantLabel " + +"}" + + "WHERE { " + + "<"+queryURI+ "> core:hasSubOrganization ?subOrganization . " + + "?subOrganization rdfs:label ?subOrganizationLabel . " + + "?subOrganization core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person rdfs:label ?PersonLabel ." + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant rdfs:label ?GrantLabel " + + "}" ; + + + return sparqlQuery; + + } + + private String generateConstructQueryForPersons(String queryURI, String preboundProperty){ + + String sparqlQuery = + + "CONSTRUCT { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person rdfs:label ?PersonLabel ." + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant rdfs:label ?GrantLabel " + +"}" + + "WHERE { " + + "<"+queryURI+ "> core:organizationForPosition ?Position . " + + "?Position core:positionForPerson ?Person . " + + "?Person rdfs:label ?PersonLabel ." + + "?Person " + preboundProperty + " ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant rdfs:label ?GrantLabel " + + "}" ; + + + return sparqlQuery; + + } + + + + private Model executeQuery(Set constructQueries, Dataset Dataset) { + + Model constructedModel = ModelFactory.createDefaultModel(); + + before = System.currentTimeMillis(); + + for (String queryString : constructQueries) { + + log.debug("CONSTRUCT query string : " + queryString); + + Query query = null; + + try{ + query = QueryFactory.create(QueryConstants.getSparqlPrefixQuery() + queryString, SYNTAX); + // log.info("query: "+ queryString); + }catch(Throwable th){ + log.error("Could not create CONSTRUCT SPARQL query for query " + + "string. " + th.getMessage()); + log.error(queryString); + } + + QueryExecution qe = QueryExecutionFactory.create( + query, Dataset); + try { + qe.execConstruct(constructedModel); + } finally { + qe.close(); + } + + } + + after = System.currentTimeMillis(); + + // log.debug("Statements for constructed model of EntityGrantCount : "+ constructedModel.listStatements().toString()); + log.info("Time taken to execute the CONSTRUCT queries is in milliseconds: " + (after - before) ); + // constructedModel.write(System.out); + return constructedModel; + } + + public Model getConstructedModel() + throws MalformedQueryParametersException { + + if (StringUtils.isNotBlank(this.egoURI)) { + /* + * To test for the validity of the URI submitted. + * */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(this.egoURI); + if (iri.hasViolation(false)) { + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Entity Grant Count Construct Query " + errorMsg); + throw new MalformedQueryParametersException( + "URI provided for an individual is malformed."); + } + } else { + throw new MalformedQueryParametersException("URI parameter is either null or empty."); + } + + Set constructQueries = new LinkedHashSet(); + + populateConstructQueries(constructQueries); + + Model model = executeQuery(constructQueries, + this.Dataset); + + return model; + + } + + private void populateConstructQueries(Set constructQueries) { + + constructQueries.add(generateConstructQueryForOrganizationLabel(this.egoURI)); + + constructQueries.add(generateConstructQueryForSubOrganizations(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForPersons(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRoleForOneLevelDeep(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrantForOneLevelDeep(this.egoURI, "core:hasInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI, "core:hasInvestigatorRole")); + + constructQueries.add(generateConstructQueryForSubOrganizations(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForPersons(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRoleForOneLevelDeep(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrantForOneLevelDeep(this.egoURI, "core:hasPrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI, "core:hasPrincipalInvestigatorRole")); + + constructQueries.add(generateConstructQueryForSubOrganizations(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForPersons(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRoleForOneLevelDeep(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrantForOneLevelDeep(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI, "core:hasCo-PrincipalInvestigatorRole")); + + } + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java index 1f28e627..9d709a91 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountQueryRunner.java @@ -7,6 +7,7 @@ import java.util.Map; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; @@ -19,6 +20,7 @@ import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.query.Syntax; +import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.RDFNode; import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; @@ -43,8 +45,9 @@ public class EntityGrantCountQueryRunner implements QueryRunner { protected static final Syntax SYNTAX = Syntax.syntaxARQ; private String entityURI; - private DataSource dataSource; - private Log log; + private Model dataSource; + private Log log = LogFactory.getLog(EntityGrantCountQueryRunner.class.getName()); + private long before, after; private static final String SPARQL_QUERY_COMMON_SELECT_CLAUSE = "SELECT " @@ -53,18 +56,38 @@ public class EntityGrantCountQueryRunner implements QueryRunner { + " (str(?subOrganizationLabel) as ?subOrganizationLabelLit) " + " (str(?Person) as ?personLit) " + " (str(?PersonLabel) as ?personLabelLit) " - + " (str(?SecondaryPositionLabel) as ?SecondaryPositionLabelLit)" + " (str(?Grant) as ?grantLit) " + " (str(?GrantLabel) as ?grantLabelLit) " - + " (str(?GrantStartDate) as ?grantStartDateLit) " - + " (str(?GrantEndDate) as ?grantEndDateLit) "; + + " (str(?startDateTimeValue) as ?grantStartDateLit) " + + " (str(?endDateTimeValue) as ?grantEndDateLit) " + + " (str(?startDateTimeValueForGrant) as ?grantStartDateForGrantLit) " + + " (str(?endDateTimeValueForGrant) as ?grantEndDateForGrantLit) " ; - private static final String SPARQL_QUERY_COMMON_WHERE_CLAUSE = " " - + " ?SecondaryPosition rdfs:label ?SecondaryPositionLabel . " + private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME = " " + " ?Role core:roleIn ?Grant . " + " ?Grant rdfs:label ?GrantLabel . " - + " OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - + " OPTIONAL { ?Grant core:endDate ?GrantEndDate } ."; + + "OPTIONAL {" + + " ?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "OPTIONAL {" + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "}" ; + + private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME = " " + + " ?Role core:roleIn ?Grant . " + + " ?Grant rdfs:label ?GrantLabel . " + + "OPTIONAL {" + + " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "OPTIONAL {" + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "}" ; private static String ENTITY_LABEL = QueryFieldLabels.ORGANIZATION_LABEL; @@ -74,23 +97,24 @@ public class EntityGrantCountQueryRunner implements QueryRunner { public EntityGrantCountQueryRunner(String entityURI, - DataSource dataSource, Log log) { + Model constructedModel, Log log) { this.entityURI = entityURI; - this.dataSource = dataSource; - this.log = log; + this.dataSource = constructedModel; } private Entity createJavaValueObjects(ResultSet resultSet) { - + Entity entity = null; Map grantURIToVO = new HashMap(); Map subentityURLToVO = new HashMap(); Map personURLToVO = new HashMap(); - + + before = System.currentTimeMillis(); + while (resultSet.hasNext()) { - + // log.info("Checking whether EntityGrantCount produced any resultset against the Constructed Model"); QuerySolution solution = resultSet.nextSolution(); if (entity == null) { @@ -115,14 +139,28 @@ public class EntityGrantCountQueryRunner implements QueryRunner { grant.setGrantLabel(grantLabelNode.toString()); } - RDFNode grantStartDateNode = solution.get(QueryFieldLabels.GRANT_START_DATE); - if(grantStartDateNode != null){ + RDFNode grantStartDateNode = solution + .get(QueryFieldLabels.ROLE_START_DATE); + if (grantStartDateNode != null) { grant.setGrantStartDate(grantStartDateNode.toString()); + } else { + grantStartDateNode = solution + .get(QueryFieldLabels.GRANT_START_DATE); + if (grantStartDateNode != null) { + grant.setGrantStartDate(grantStartDateNode.toString()); + } } - - RDFNode grantEndDateNode = solution.get(QueryFieldLabels.GRANT_END_DATE); - if(grantEndDateNode != null){ + + RDFNode grantEndDateNode = solution + .get(QueryFieldLabels.ROLE_END_DATE); + if (grantEndDateNode != null) { grant.setGrantEndDate(grantEndDateNode.toString()); + } else { + grantEndDateNode = solution + .get(QueryFieldLabels.GRANT_END_DATE); + if (grantEndDateNode != null) { + grant.setGrantEndDate(grantEndDateNode.toString()); + } } } @@ -145,15 +183,15 @@ public class EntityGrantCountQueryRunner implements QueryRunner { subEntity.setIndividualLabel(subEntityLabelNode.toString()); } entity.addSubEntity(subEntity); - subEntity.addGrants(grant); + subEntity.addGrant(grant); } - - + RDFNode personURLNode = solution.get(QueryFieldLabels.PERSON_URL); - - if(personURLNode != null){ - SubEntity person ; - if(personURLToVO.containsKey(personURLNode.toString())) { + + if (personURLNode != null) { + SubEntity person; + + if (personURLToVO.containsKey(personURLNode.toString())) { person = personURLToVO.get(personURLNode.toString()); } else { person = new SubEntity(personURLNode.toString()); @@ -164,32 +202,46 @@ public class EntityGrantCountQueryRunner implements QueryRunner { if (personLabelNode != null) { person.setIndividualLabel(personLabelNode.toString()); } + + /* + * This makes sure that either, + * 1. the parent organization is a department-like organization with no organizations + * beneath it, or + * 2. the parent organizations has both sub-organizations and people directly + * attached to that organizations e.g. president of a university. + * */ + if (subEntityURLNode == null) { + + entity.addSubEntity(person); + + } -// entity.addSubEntity(person); - person.addGrants(grant); + person.addGrant(grant); } - - entity.addGrants(grant); + + entity.addGrant(grant); } - - if(subentityURLToVO.size() == 0 && personURLToVO.size() != 0){ - for(SubEntity person : personURLToVO.values()){ + + /*if (subentityURLToVO.size() == 0 && personURLToVO.size() != 0) { + for (SubEntity person : personURLToVO.values()) { entity.addSubEntity(person); } - } else if (subentityURLToVO.size() == 0 && personURLToVO.size() == 0){ + } else */if (subentityURLToVO.size() == 0 && personURLToVO.size() == 0) { entity = new Entity(this.entityURI, "no-label"); } - + + after = System.currentTimeMillis(); + log.info("Time taken to iterate through the ResultSet of SELECT queries is in milliseconds: " + (after - before) ); return entity; } - private ResultSet executeQuery(String queryURI, DataSource dataSource) { + private ResultSet executeQuery(String queryURI, Model dataSource2) { QueryExecution queryExecution = null; Query query = QueryFactory.create( getSparqlQuery(queryURI), SYNTAX); - queryExecution = QueryExecutionFactory.create(query, dataSource); + queryExecution = QueryExecutionFactory.create(query, dataSource2); return queryExecution.execSelect(); } @@ -198,38 +250,56 @@ public class EntityGrantCountQueryRunner implements QueryRunner { String sparqlQuery = QueryConstants.getSparqlPrefixQuery() + SPARQL_QUERY_COMMON_SELECT_CLAUSE + " (str(<" + queryURI + ">) as ?" + ENTITY_URL + ") " - + "WHERE { " + "<" + queryURI + "> rdf:type foaf:Organization ;" - + " rdfs:label ?organizationLabel ." + + "WHERE { " + "<" + queryURI + "> rdfs:label ?organizationLabel ." + "{ " + "<" + queryURI + "> core:hasSubOrganization ?subOrganization ." + " ?subOrganization rdfs:label ?subOrganizationLabel ; core:organizationForPosition ?Position . " - + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ." - + " ?Person core:hasCo-PrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . " - + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}" + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:hasCo-PrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ." + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + "}" + "UNION " + "{ " + "<" + queryURI + "> core:hasSubOrganization ?subOrganization . " + " ?subOrganization rdfs:label ?subOrganizationLabel ; core:organizationForPosition ?Position . " - + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ." - + " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . " - + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}" + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel . " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + "}" + + "UNION " + + "{ " + + "<" + queryURI + "> core:hasSubOrganization ?subOrganization . " + + " ?subOrganization rdfs:label ?subOrganizationLabel ; core:organizationForPosition ?Position . " + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:hasInvestigatorRole ?Role ; rdfs:label ?PersonLabel . " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + "}" + "UNION " + "{ " + "<" + queryURI + "> core:organizationForPosition ?Position . " - + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ." - + " ?Person core:hasCo-PrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . " - + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}" + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:hasCo-PrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel . " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + "}" + "UNION " + "{ " + "<" + queryURI + "> core:organizationForPosition ?Position . " - + " ?Position rdf:type core:Position ; core:positionForPerson ?Person ." - + " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel ; core:personInPosition ?SecondaryPosition . " - + SPARQL_QUERY_COMMON_WHERE_CLAUSE + "}" + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:hasPrincipalInvestigatorRole ?Role ; rdfs:label ?PersonLabel . " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + "}" + + "UNION " + + "{ " + + "<" + queryURI + "> core:organizationForPosition ?Position . " + + " ?Position core:positionForPerson ?Person ." + + " ?Person core:hasInvestigatorRole ?Role ; rdfs:label ?PersonLabel . " + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + "}" + " } "; //System.out.println("\n\nEntity Grant Count query is: "+ sparqlQuery); - log.debug("\nThe sparql query is :\n" + sparqlQuery); + // log.info("\nThe sparql query is :\n" + sparqlQuery); return sparqlQuery; @@ -256,9 +326,15 @@ public class EntityGrantCountQueryRunner implements QueryRunner { throw new MalformedQueryParametersException( "URL parameter is either null or empty."); } - + + before = System.currentTimeMillis(); + ResultSet resultSet = executeQuery(this.entityURI, this.dataSource); - + + after = System.currentTimeMillis(); + + log.info("Time taken to execute the SELECT queries is in milliseconds: " + (after - before) ); + return createJavaValueObjects(resultSet); } } \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java index 924d3e20..eb2b8b5b 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/entitygrantcount/EntityGrantCountRequestHandler.java @@ -12,23 +12,31 @@ import java.util.Set; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import com.google.gson.Gson; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.rdf.model.Model; +import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties; +import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; -import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.DataVisualizationController; +import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; +import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison.EntityComparisonUtilityFunctions; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Entity; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.JsonObject; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.SubEntity; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.QueryRunner; -import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.entitycomparison.EntitySubOrganizationTypesQueryRunner; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.VisualizationRequestHandler; @@ -36,55 +44,79 @@ import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.Visual public class EntityGrantCountRequestHandler implements VisualizationRequestHandler { + private Log log = LogFactory.getLog(EntityGrantCountRequestHandler.class.getName()); + @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String entityURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); - QueryRunner queryManager = new EntityGrantCountQueryRunner( - entityURI, dataSource, log); - - Entity entity = queryManager.getQueryResult(); - - if(entity.getEntityLabel().equals("no-label")){ - - return prepareStandaloneErrorResponse(vitroRequest,entityURI); - - } else{ + if (StringUtils.isNotBlank(entityURI)){ - QueryRunner>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner( - entityURI, dataSource, log); - - Map> subOrganizationTypesResult = queryManagerForsubOrganisationTypes - .getQueryResult(); - - return prepareStandaloneResponse(vitroRequest, entity, entityURI, - subOrganizationTypesResult); + return getSubjectEntityAndGenerateResponse(vitroRequest, log, + Dataset, entityURI); + + } else { + + String staffProvidedHighestLevelOrganization = ConfigurationProperties.getProperty("visualization.topLevelOrg"); + + /* + * First checking if the staff has provided highest level organization in deploy.properties + * if so use to temporal graph vis. + */ + if (StringUtils.isNotBlank(staffProvidedHighestLevelOrganization)) { + + /* + * To test for the validity of the URI submitted. + */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(staffProvidedHighestLevelOrganization); + + if (iri.hasViolation(false)) { + + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Highest Level Organization URI provided is invalid " + errorMsg); + + } else { + + return getSubjectEntityAndGenerateResponse(vitroRequest, + log, Dataset, + staffProvidedHighestLevelOrganization); + } + } + + String highestLevelOrgURI = EntityComparisonUtilityFunctions.getHighestLevelOrganizationURI(log, + Dataset); + + return getSubjectEntityAndGenerateResponse(vitroRequest, log, + Dataset, highestLevelOrgURI); } + } - + @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String entityURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); + EntityGrantCountConstructQueryRunner constructQueryRunner = new EntityGrantCountConstructQueryRunner(entityURI, Dataset, log); + Model constructedModel = constructQueryRunner.getConstructedModel(); + QueryRunner queryManager = new EntityGrantCountQueryRunner( - entityURI, dataSource, log); + entityURI, constructedModel, log); Entity entity = queryManager.getQueryResult(); - QueryRunner>> queryManagerForsubOrganisationTypes = new EntitySubOrganizationTypesQueryRunner( - entityURI, dataSource, log); - - Map> subOrganizationTypesResult = queryManagerForsubOrganisationTypes.getQueryResult(); + Map> subOrganizationTypesResult = EntityComparisonUtilityFunctions.getSubEntityTypes( + log, Dataset, entityURI); return prepareDataResponse(entity, entity.getSubEntities(),subOrganizationTypesResult); @@ -92,10 +124,47 @@ public class EntityGrantCountRequestHandler implements @Override public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Entity Grant Count does not provide Ajax Response."); } + private ResponseValues getSubjectEntityAndGenerateResponse( + VitroRequest vitroRequest, Log log, Dataset Dataset, + String subjectEntityURI) + throws MalformedQueryParametersException { + + EntityGrantCountConstructQueryRunner constructQueryRunner = new EntityGrantCountConstructQueryRunner(subjectEntityURI, Dataset, log); + Model constructedModel = constructQueryRunner.getConstructedModel(); + + QueryRunner queryManager = new EntityGrantCountQueryRunner( + subjectEntityURI, constructedModel, log); + + Entity entity = queryManager.getQueryResult(); + + if (entity.getEntityLabel().equals("no-label")) { + + return prepareStandaloneErrorResponse(vitroRequest, subjectEntityURI); + + } else { + + return getSubEntityTypesAndRenderStandaloneResponse( + vitroRequest, log, Dataset, + subjectEntityURI, entity); + } + } + + private ResponseValues getSubEntityTypesAndRenderStandaloneResponse( + VitroRequest vitroRequest, Log log, Dataset Dataset, + String subjectOrganization, Entity entity) + throws MalformedQueryParametersException { + + Map> subOrganizationTypesResult = EntityComparisonUtilityFunctions.getSubEntityTypes( + log, Dataset, subjectOrganization); + + return prepareStandaloneResponse(vitroRequest, entity, subjectOrganization, + subOrganizationTypesResult); + } + /** * Provides response when json file containing the grant count over the * years is requested. @@ -141,16 +210,21 @@ public class EntityGrantCountRequestHandler implements Entity entity, String entityURI, Map> subOrganizationTypesResult) { Portal portal = vreq.getPortal(); - String standaloneTemplate = "entityComparisonGrantsStandaloneActivator.ftl"; + String standaloneTemplate = "entityComparisonOnGrantsStandalone.ftl"; String jsonContent = ""; jsonContent = writeGrantsOverTimeJSON(vreq, entity.getSubEntities(), subOrganizationTypesResult); + String title = ""; + if (StringUtils.isNotBlank(entity.getEntityLabel())) { + title = entity.getEntityLabel() + " - "; + } + Map body = new HashMap(); body.put("portalBean", portal); - body.put("title", "Temporal Graph Visualization"); + body.put("title", title + "Temporal Graph Visualization"); body.put("organizationURI", entityURI); body.put("organizationLabel", entity.getEntityLabel()); body.put("jsonContent", jsonContent); @@ -163,15 +237,26 @@ public class EntityGrantCountRequestHandler implements VitroRequest vitroRequest, String entityURI) { Portal portal = vitroRequest.getPortal(); - String standaloneTemplate = "entityComparisonErrorActivator.ftl"; - + String standaloneTemplate = "entityGrantComparisonError.ftl"; Map body = new HashMap(); + + IndividualDao iDao = vitroRequest.getWebappDaoFactory().getIndividualDao(); + Individual ind = iDao.getIndividualByURI(entityURI); + + String organizationLabel = "Unknown Organization"; + + if (ind != null) { + organizationLabel = ind.getName(); + } + + body.put("organizationLabel", organizationLabel); + + body.put("portalBean", portal); - body.put("title", "Temporal Graph Visualization"); + body.put("title", organizationLabel + " - Temporal Graph Visualization"); body.put("organizationURI", entityURI); return new TemplateResponseValues(standaloneTemplate, body); - } @@ -198,14 +283,18 @@ public class EntityGrantCountRequestHandler implements List currentGrantYear = new ArrayList(); if (grantEntry.getKey().equals( - VOConstants.DEFAULT_GRANT_YEAR)) + VOConstants.DEFAULT_GRANT_YEAR)) { currentGrantYear.add(-1); - else + } else { currentGrantYear.add(Integer.parseInt(grantEntry.getKey())); + } + currentGrantYear.add(grantEntry.getValue()); yearGrantCount.add(currentGrantYear); } + // log.info("entityJson.getLabel() : " + entityJson.getLabel() + " subOrganizationTypesResult " + subOrganizationTypesResult.toString()); + entityJson.setYearToActivityCount(yearGrantCount); entityJson.getOrganizationType().addAll(subOrganizationTypesResult.get(entityJson.getLabel())); diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountConstructQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountConstructQueryRunner.java new file mode 100644 index 00000000..5443dd4d --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountConstructQueryRunner.java @@ -0,0 +1,206 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.persongrantcount; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.iri.IRI; +import com.hp.hpl.jena.iri.IRIFactory; +import com.hp.hpl.jena.iri.Violation; +import com.hp.hpl.jena.query.DataSource; +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.Syntax; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; + +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; + +public class PersonGrantCountConstructQueryRunner { + + protected static final Syntax SYNTAX = Syntax.syntaxARQ; + + private String egoURI; + + private DataSource dataSource; + + private Log log = LogFactory.getLog(PersonGrantCountConstructQueryRunner.class.getName()); + + public PersonGrantCountConstructQueryRunner(String egoURI, DataSource dataSource, Log log){ + this.egoURI = egoURI; + this.dataSource = dataSource; + //this.log = log; + } + + private String generateConstructQueryForInvestigatorLabel(String queryURI) { + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> rdfs:label ?investigatorLabel ." + + "}" + + "WHERE {" + + "<"+queryURI+ "> rdfs:label ?investigatorLabel " + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForInvestigatorGrants(String queryURI){ + + String sparqlQuery = "" + + "CONSTRUCT { " + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant rdfs:label ?GrantLabel " + + "} " + + "WHERE { " + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant rdfs:label ?GrantLabel " + + "} "; + + return sparqlQuery; + + } + + private String generateConstructQueryForDateTimeValueofRole(String queryURI){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "} UNION " + + "{" + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "}"; + + return sparqlQuery; + } + + private String generateConstructQueryForDateTimeValueofGrant(String queryURI){ + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "WHERE { " + + "{" + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "} UNION " + + "{" + + "<"+queryURI+ "> ?preboundProperty ?Role . " + + "?Role core:roleIn ?Grant ." + + "?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "}"; + + return sparqlQuery; + } + + private Model executeQuery(Set constructQueries, DataSource dataSource) { + + Model constructedModel = ModelFactory.createDefaultModel(); + + for (String queryString : constructQueries) { + + log.debug("CONSTRUCT query string : " + queryString); + + Query query = null; + + try{ + query = QueryFactory.create(QueryConstants.getSparqlPrefixQuery() + queryString, SYNTAX); + }catch(Throwable th){ + log.error("Could not create CONSTRUCT SPARQL query for query " + + "string. " + th.getMessage()); + log.error(queryString); + } + + QueryExecution qe = QueryExecutionFactory.create( + query, dataSource); + try { + qe.execConstruct(constructedModel); + } finally { + qe.close(); + } + + } + + return constructedModel; + } + + public Model getConstructedModel() + throws MalformedQueryParametersException { + + if (StringUtils.isNotBlank(this.egoURI)) { + /* + * To test for the validity of the URI submitted. + * */ + IRIFactory iRIFactory = IRIFactory.jenaImplementation(); + IRI iri = iRIFactory.create(this.egoURI); + if (iri.hasViolation(false)) { + String errorMsg = ((Violation) iri.violations(false).next()).getShortMessage(); + log.error("Person Grant Count Construct Query " + errorMsg); + throw new MalformedQueryParametersException( + "URI provided for an individual is malformed."); + } + } else { + throw new MalformedQueryParametersException("URI parameter is either null or empty."); + } + + Set constructQueries = new HashSet(); + + populateConstructQueries(constructQueries); + + Model model = executeQuery(constructQueries, + this.dataSource); + + return model; + + } + + private void populateConstructQueries(Set constructQueries) { + + constructQueries.add(generateConstructQueryForInvestigatorLabel(this.egoURI)); + constructQueries.add(generateConstructQueryForInvestigatorGrants(this.egoURI)); + constructQueries.add(generateConstructQueryForDateTimeValueofRole(this.egoURI)); + constructQueries.add(generateConstructQueryForDateTimeValueofGrant(this.egoURI)); + + + } + +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java index 31e7f382..166cc35b 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountQueryRunner.java @@ -11,7 +11,7 @@ import org.apache.commons.logging.Log; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; import com.hp.hpl.jena.iri.Violation; -import com.hp.hpl.jena.query.DataSource; +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; @@ -40,7 +40,7 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ protected static final Syntax SYNTAX = Syntax.syntaxARQ; private String personURI; - private DataSource dataSource; + private Dataset Dataset; private Individual principalInvestigator; public Individual getPrincipalInvestigator(){ @@ -50,16 +50,43 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ private Log log; private static final String SPARQL_QUERY_COMMON_SELECT_CLAUSE = "" - + "SELECT (str(?PILabel) as ?PILabelLit) " - + "(str(?Grant) as ?grantLit)" - + "(str(?GrantLabel) as ?grantLabelLit)" - + "(str(?GrantStartDate) as ?grantStartDateLit)" - + "(str(?GrantEndDate) as ?grantEndDateLit)" ; + + " SELECT (str(?PILabel) as ?PILabelLit) " + + " (str(?Grant) as ?grantLit)" + + " (str(?GrantLabel) as ?grantLabelLit)" + + " (str(?startDateTimeValue) as ?grantStartDateLit) " + + " (str(?endDateTimeValue) as ?grantEndDateLit) " + + " (str(?startDateTimeValueForGrant) as ?grantStartDateForGrantLit) " + + " (str(?endDateTimeValueForGrant) as ?grantEndDateForGrantLit) "; - public PersonGrantCountQueryRunner(String personURI, DataSource dataSource, Log log){ + + + private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME = "" + + "OPTIONAL {" + + " ?Role core:dateTimeInterval ?dateTimeIntervalValue . " + + "?dateTimeIntervalValue core:start ?startDate . " + + "?startDate core:dateTime ?startDateTimeValue . " + + "OPTIONAL {" + + "?dateTimeIntervalValue core:end ?endDate . " + + "?endDate core:dateTime ?endDateTimeValue . " + + "}" + + "} . " ; + + private static final String SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME = "" + + "OPTIONAL {" + + " ?Grant core:dateTimeInterval ?dateTimeIntervalValueForGrant . " + + "?dateTimeIntervalValueForGrant core:start ?startDateForGrant . " + + "?startDateForGrant core:dateTime ?startDateTimeValueForGrant . " + + "OPTIONAL {" + + "?dateTimeIntervalValueForGrant core:end ?endDateForGrant . " + + "?endDateForGrant core:dateTime ?endDateTimeValueForGrant . " + + "}" + + "}" ; + + + public PersonGrantCountQueryRunner(String personURI, Dataset Dataset, Log log){ this.personURI = personURI; - this.dataSource = dataSource; + this.Dataset = Dataset; this.log = log; } @@ -76,14 +103,24 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ grant.setIndividualLabel(grantLabelNode.toString()); } - RDFNode grantStartDateNode = solution.get(QueryFieldLabels.GRANT_START_DATE); + RDFNode grantStartDateNode = solution.get(QueryFieldLabels.ROLE_START_DATE); if(grantStartDateNode != null){ grant.setGrantStartDate(grantStartDateNode.toString()); + }else { + grantStartDateNode = solution.get(QueryFieldLabels.GRANT_START_DATE); + if(grantStartDateNode != null){ + grant.setGrantStartDate(grantStartDateNode.toString()); + } } - RDFNode grantEndDateNode = solution.get(QueryFieldLabels.GRANT_END_DATE); + RDFNode grantEndDateNode = solution.get(QueryFieldLabels.ROLE_END_DATE); if(grantEndDateNode != null){ grant.setGrantEndDate(grantEndDateNode.toString()); + }else { + grantEndDateNode = solution.get(QueryFieldLabels.GRANT_END_DATE); + if(grantEndDateNode != null){ + grant.setGrantEndDate(grantEndDateNode.toString()); + } } /* @@ -105,12 +142,12 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ return PIGrant; } - private ResultSet executeQuery(String queryURI, DataSource dataSource){ + private ResultSet executeQuery(String queryURI, Dataset Dataset){ QueryExecution queryExecution = null; Query query = QueryFactory.create(getSparqlQuery(queryURI), SYNTAX); - queryExecution = QueryExecutionFactory.create(query,dataSource); + queryExecution = QueryExecutionFactory.create(query,Dataset); return queryExecution.execSelect(); } @@ -135,11 +172,12 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ + "?Role core:roleIn ?Grant . " + "?Grant rdfs:label ?GrantLabel . " - - + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - - + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " - + "} " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + "} " + "UNION " @@ -150,18 +188,35 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ + "?Role core:roleIn ?Grant . " + "?Grant rdfs:label ?GrantLabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + + + "UNION " + + + "{ " + + + "<" + queryURI + "> core:hasInvestigatorRole ?Role . " - + "OPTIONAL { ?Grant core:startDate ?GrantStartDate } . " - - + "OPTIONAL { ?Grant core:endDate ?GrantEndDate } . " - - - + "} " + + "?Role core:roleIn ?Grant . " + + "?Grant rdfs:label ?GrantLabel . " + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_ROLE_DATE_TIME + + + SPARQL_QUERY_COMMON_OPTIONAL_BLOCK_FOR_GRANT_DATE_TIME + + + + "} " + "} "; log.debug("SPARQL query for person grant count -> \n"+ sparqlQuery); + //System.out.println("SPARQL query for person grant count -> \n"+ sparqlQuery); return sparqlQuery; } @@ -186,7 +241,7 @@ public class PersonGrantCountQueryRunner implements QueryRunner>{ throw new MalformedQueryParametersException("URL parameter is either null or empty."); } - ResultSet resultSet = executeQuery(this.personURI, this.dataSource); + ResultSet resultSet = executeQuery(this.personURI, this.Dataset); return createJavaValueObjects(resultSet); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountRequestHandler.java index 21d06df4..e1e871ac 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountRequestHandler.java @@ -11,7 +11,7 @@ import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; @@ -47,14 +47,14 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String personURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); - QueryRunner> queryManager = new PersonGrantCountQueryRunner(personURI, dataSource, log ); + QueryRunner> queryManager = new PersonGrantCountQueryRunner(personURI, Dataset, log ); Set piGrants = queryManager.getQueryResult(); @@ -77,7 +77,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl @Override public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { String personURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); @@ -88,7 +88,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl String visContainer = vitroRequest .getParameter(VisualizationFrameworkConstants.VIS_CONTAINER_KEY); - QueryRunner> queryManager = new PersonGrantCountQueryRunner(personURI, dataSource, log ); + QueryRunner> queryManager = new PersonGrantCountQueryRunner(personURI, Dataset, log ); Set piGrants = queryManager.getQueryResult(); @@ -127,7 +127,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String personURI = vitroRequest @@ -139,7 +139,7 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl String visContainer = vitroRequest .getParameter(VisualizationFrameworkConstants.VIS_CONTAINER_KEY); - QueryRunner> queryManager = new PersonGrantCountQueryRunner(personURI, dataSource, log ); + QueryRunner> queryManager = new PersonGrantCountQueryRunner(personURI, Dataset, log ); Set piGrants = queryManager.getQueryResult(); diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountVisCodeGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountVisCodeGenerator.java index 77a0bc44..9736b5a8 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountVisCodeGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/persongrantcount/PersonGrantCountVisCodeGenerator.java @@ -5,27 +5,23 @@ package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.persongrantcou import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Set; import org.apache.commons.logging.Log; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Grant; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.SparklineData; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.YearToEntityCountDataElement; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; -@SuppressWarnings("serial") public class PersonGrantCountVisCodeGenerator { /* @@ -38,22 +34,13 @@ public class PersonGrantCountVisCodeGenerator { * the person started his career in the last 10 yeras. * */ - private static final Map VIS_DIV_NAMES = new HashMap() { { - - put("SHORT_SPARK", "grant_count_short_sparkline_vis"); - put("FULL_SPARK", "grant_count_full_sparkline_vis"); - - } }; - - private static final String VISUALIZATION_STYLE_CLASS = "sparkline_style"; - private static final String DEFAULT_VIS_CONTAINER_DIV_ID = "grant_count_vis_container"; private Map yearToGrantCount; private Log log; - private SparklineData sparklineData; + private SparklineData sparklineParameterVO; private String individualURI; @@ -65,43 +52,28 @@ public class PersonGrantCountVisCodeGenerator { this.individualURI = individualURIParam; this.yearToGrantCount = yearToGrantCount; - this.sparklineData = new SparklineData(); - - sparklineData.setYearToActivityCount(yearToGrantCount); - + this.log = log; + + this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer, piGrants); - generateVisualizationCode(visMode, visContainer, piGrants); } /** - * This method is used to generate the visualization code (HMTL, CSS & JavaScript). - * There 2 parts to it - 1. Actual Content Code & 2. Context Code. - * 1. Actual Content code in this case is the sparkline image, text related to - * data and the wrapping tables. This is generated via call to google vis API through - * JavaScript. - * 2. Context code is generally optional but contains code pertaining to tabulated - * data & links to download files etc. + * This method is used to setup parameters for the sparkline value object. These parameters + * will be used in the template to construct the actual html/javascript code. * @param visMode * @param visContainer - * @param piGrants + * @param authorDocuments + * @return */ - private void generateVisualizationCode(String visMode, - String visContainer, + private SparklineData setupSparklineParameters(String visMode, + String providedVisContainerID, Set piGrants) { - sparklineData.setSparklineContent(getMainVisualizationCode(piGrants, - visMode, - visContainer)); - - - sparklineData.setSparklineContext(getVisualizationContextCode(visMode)); - - } - - private String getMainVisualizationCode(Set piGrants, - String visMode, String providedVisContainerID) { - + SparklineData sparklineData = new SparklineData(); + sparklineData.setYearToActivityCount(yearToGrantCount); + int numOfYearsToBeRendered = 0; int currentYear = Calendar.getInstance().get(Calendar.YEAR); int shortSparkMinYear = currentYear @@ -112,8 +84,7 @@ public class PersonGrantCountVisCodeGenerator { * the vis was rendered we dont want to be influenced by the * "DEFAULT_GRANT_YEAR". */ - Set grantYears = new HashSet(yearToGrantCount - .keySet()); + Set grantYears = new HashSet(yearToGrantCount.keySet()); grantYears.remove(VOConstants.DEFAULT_GRANT_YEAR); /* @@ -126,8 +97,6 @@ public class PersonGrantCountVisCodeGenerator { String visContainerID = null; - StringBuilder visualizationCode = new StringBuilder(); - if (yearToGrantCount.size() > 0) { try { minGrantYear = Integer.parseInt(Collections @@ -160,26 +129,6 @@ public class PersonGrantCountVisCodeGenerator { sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered); - visualizationCode.append("\n"); - - visualizationCode.append("\n"; - } - - - private String getVisualizationContextCode(String visMode) { - - String visualizationContextCode = ""; - if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) { - visualizationContextCode = generateShortVisContext(); - } else { - visualizationContextCode = generateFullVisContext(); } - log.debug(visualizationContextCode); - - return visualizationContextCode; - } - - private String generateFullVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String csvDownloadURLHref = ""; - if (yearToGrantCount.size() > 0) { - if (getCSVDownloadURL() != null) { - - csvDownloadURLHref = "Download data as .csv file.
    "; - sparklineData.setDownloadDataLink(getCSVDownloadURL()); - - } else { - csvDownloadURLHref = ""; - } - } else { - csvDownloadURLHref = "No data available to export.
    "; + sparklineData.setFullTimelineNetworkLink(UtilityFunctions.getCollaboratorshipNetworkLink(individualURI, + VisualizationFrameworkConstants.PERSON_LEVEL_VIS, + VisualizationFrameworkConstants.COPI_VIS_MODE)); + + sparklineData.setDownloadDataLink(UtilityFunctions + .getCSVDownloadURL( + individualURI, + VisualizationFrameworkConstants.PERSON_GRANT_COUNT_VIS, + "")); + } - String tableCode = generateDataTable(); - - divContextCode.append("

    " + tableCode + csvDownloadURLHref + "

    "); - - sparklineData.setTable(tableCode); - - return divContextCode.toString(); - } - - - private String getCSVDownloadURL() { - - if (yearToGrantCount.size() > 0) { - - ParamMap CSVDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, - VisualizationFrameworkConstants.PERSON_GRANT_COUNT_VIS); - - return UrlBuilder.getUrl(VisualizationFrameworkConstants.DATA_VISUALIZATION_SERVICE_URL_PREFIX, - CSVDownloadURLParams); - - } else { - return null; - } - } - - - private String generateShortVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String fullTimelineLink; - if (yearToGrantCount.size() > 0) { - - // add another parameter for vis_mode - ParamMap fullTimelineNetworkURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, - VisualizationFrameworkConstants.PERSON_LEVEL_VIS); - - String fullTimelineNetworkURL = UrlBuilder.getUrl( - VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX, - fullTimelineNetworkURLParams); - - fullTimelineLink = "View all VIVO " - + "grants and corresponding co-pi network."; - - sparklineData.setFullTimelineNetworkLink(fullTimelineNetworkURL); - - - - } else { - fullTimelineLink = "No data available to render full timeline.
    "; - } - - divContextCode.append("" + fullTimelineLink + ""); - return divContextCode.toString(); - } - - private String generateDataTable() { - - String csvDownloadURLHref = ""; - - if (getCSVDownloadURL() != null) { - csvDownloadURLHref = "(.CSV File)"; - } else { - csvDownloadURLHref = ""; - } - - StringBuilder dataTable = new StringBuilder(); - - dataTable.append("" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + ""); - - for (Entry currentEntry : yearToGrantCount.entrySet()) { - dataTable.append("" - + "" - + "" - + ""); - } - - dataTable.append("\n
    Grants per year " + csvDownloadURLHref + "
    YearGrants
    " + currentEntry.getKey() + "" + currentEntry.getValue() + "
    \n"); - - return dataTable.toString(); + return sparklineData; } public SparklineData getValueObjectContainer() { - return sparklineData; + return this.sparklineParameterVO; } -} +} \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personlevel/PersonLevelRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personlevel/PersonLevelRequestHandler.java index 663665f8..d8773fe8 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personlevel/PersonLevelRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personlevel/PersonLevelRequestHandler.java @@ -12,7 +12,8 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.rdf.model.Model; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; @@ -22,6 +23,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.Visu import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.coauthorship.CoAuthorshipQueryRunner; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.coauthorship.CoAuthorshipVisCodeGenerator; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.coprincipalinvestigator.CoPIGrantCountConstructQueryRunner; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.coprincipalinvestigator.CoPIGrantCountQueryRunner; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.coprincipalinvestigator.CoPIVisCodeGenerator; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.persongrantcount.PersonGrantCountQueryRunner; @@ -58,13 +60,13 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler { @Override public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Person Level does not provide Ajax Response."); } @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Person Level does not provide Data Response."); } @@ -72,7 +74,7 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler { @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String egoURI = vitroRequest.getParameter( @@ -82,11 +84,14 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler { VisualizationFrameworkConstants.VIS_MODE_KEY); - if (VisualizationFrameworkConstants.COPI_VIS_MODE.equalsIgnoreCase(visMode)) { + if (VisualizationFrameworkConstants.COPI_VIS_MODE.equalsIgnoreCase(visMode)){ - QueryRunner coPIQueryManager = new CoPIGrantCountQueryRunner(egoURI, dataSource, log); - - QueryRunner> grantQueryManager = new PersonGrantCountQueryRunner(egoURI, dataSource, log); + CoPIGrantCountConstructQueryRunner constructQueryRunner = new CoPIGrantCountConstructQueryRunner(egoURI, Dataset, log); + Model constructedModel = constructQueryRunner.getConstructedModel(); + + QueryRunner coPIQueryManager = new CoPIGrantCountQueryRunner(egoURI, constructedModel, log); + + QueryRunner> grantQueryManager = new PersonGrantCountQueryRunner(egoURI, Dataset, log); CoPIData coPIData = coPIQueryManager.getQueryResult(); @@ -141,9 +146,9 @@ public class PersonLevelRequestHandler implements VisualizationRequestHandler { } else { - QueryRunner coAuthorshipQueryManager = new CoAuthorshipQueryRunner(egoURI, dataSource, log); + QueryRunner coAuthorshipQueryManager = new CoAuthorshipQueryRunner(egoURI, Dataset, log); - QueryRunner> publicationQueryManager = new PersonPublicationCountQueryRunner(egoURI, dataSource, log); + QueryRunner> publicationQueryManager = new PersonPublicationCountQueryRunner(egoURI, Dataset, log); CoAuthorshipData coAuthorshipData = coAuthorshipQueryManager.getQueryResult(); diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountConstructQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountConstructQueryRunner.java new file mode 100644 index 00000000..b2b42a6e --- /dev/null +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountConstructQueryRunner.java @@ -0,0 +1,41 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.personpubcount; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.Syntax; + +public class PersonPublicationCountConstructQueryRunner { + + protected static final Syntax SYNTAX = Syntax.syntaxARQ; + + private String egoURI; + + private Dataset Dataset; + + private Log log = LogFactory.getLog(PersonPublicationCountConstructQueryRunner.class.getName()); + + private long before, after; + + public PersonPublicationCountConstructQueryRunner(String egoURI, Dataset Dataset, Log log){ + this.egoURI = egoURI; + this.Dataset = Dataset; + //this.log = log; + } + + private String generateConstructQueryForAuthorLabel(String queryURI) { + + String sparqlQuery = + "CONSTRUCT { " + + "<"+queryURI+ "> rdfs:label ?authorLabel ." + + "}" + + "WHERE {" + + "<"+queryURI+ "> rdfs:label ?authorLabel ." + + "}"; + + return sparqlQuery; + } +} diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountQueryRunner.java index 957a0ec0..21e965b7 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountQueryRunner.java @@ -11,7 +11,7 @@ import org.apache.commons.logging.Log; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; import com.hp.hpl.jena.iri.Violation; -import com.hp.hpl.jena.query.DataSource; +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; @@ -41,7 +41,7 @@ public class PersonPublicationCountQueryRunner implements QueryRunner) as ?authPersonLit) " - + "WHERE { " - + "<" + queryURI + "> rdf:type foaf:Person ;" - + " rdfs:label ?authorLabel ;" - + " core:authorInAuthorship ?authorshipNode . " + + "(str(<" + queryURI + ">) as ?authPersonLit)\n " + + "WHERE { \n" + + "<" + queryURI + "> rdf:type foaf:Person ;\n" + + " rdfs:label ?authorLabel \n;" + + " core:authorInAuthorship ?authorshipNode . \n" + " ?authorshipNode rdf:type core:Authorship ;" - + " core:linkedInformationResource ?document . " + + " core:linkedInformationResource ?document . \n" + SPARQL_QUERY_COMMON_WHERE_CLAUSE - + "}"; + + "}\n"; +// System.out.println(sparqlQuery); + return sparqlQuery; } @@ -195,7 +192,7 @@ public class PersonPublicationCountQueryRunner implements QueryRunner> queryManager = new PersonPublicationCountQueryRunner( personURI, - dataSource, + Dataset, log); Set authorDocuments = queryManager.getQueryResult(); @@ -108,14 +108,14 @@ VisualizationRequestHandler { @Override public Map generateDataVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException { + Dataset Dataset) throws MalformedQueryParametersException { String personURI = vitroRequest .getParameter(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY); QueryRunner> queryManager = new PersonPublicationCountQueryRunner( personURI, - dataSource, + Dataset, log); Set authorDocuments = queryManager.getQueryResult(); @@ -137,7 +137,7 @@ VisualizationRequestHandler { @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { String personURI = vitroRequest.getParameter( @@ -151,7 +151,7 @@ VisualizationRequestHandler { QueryRunner> queryManager = new PersonPublicationCountQueryRunner( personURI, - dataSource, + Dataset, log); Set authorDocuments = queryManager.getQueryResult(); diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountVisCodeGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountVisCodeGenerator.java index 86699cd0..f8019d34 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountVisCodeGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/personpubcount/PersonPublicationCountVisCodeGenerator.java @@ -5,27 +5,23 @@ package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.personpubcount import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; -import java.util.Map.Entry; import org.apache.commons.logging.Log; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.BiboDocument; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.SparklineData; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.YearToEntityCountDataElement; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; -@SuppressWarnings("serial") public class PersonPublicationCountVisCodeGenerator { /* @@ -37,24 +33,16 @@ public class PersonPublicationCountVisCodeGenerator { * spanning the career of the person & last 10 years at the minimum, in case if * the person started his career in the last 10 yeras. * */ - private static final Map VIS_DIV_NAMES = new HashMap() { { - put("SHORT_SPARK", "pub_count_short_sparkline_vis"); - put("FULL_SPARK", "pub_count_full_sparkline_vis"); - - } }; - - private static final String VISUALIZATION_STYLE_CLASS = "sparkline_style"; - private static final String DEFAULT_VIS_CONTAINER_DIV_ID = "pub_count_vis_container"; private Map yearToPublicationCount; private Log log; - private SparklineData sparklineData; - private String individualURI; + + private SparklineData sparklineParameterVO; public PersonPublicationCountVisCodeGenerator(String individualURIParam, String visMode, @@ -66,44 +54,28 @@ public class PersonPublicationCountVisCodeGenerator { this.individualURI = individualURIParam; this.yearToPublicationCount = yearToPublicationCount; - this.sparklineData = new SparklineData(); - - sparklineData.setYearToActivityCount(yearToPublicationCount); - - + this.log = log; - generateVisualizationCode(visMode, visContainer, authorDocuments); + this.sparklineParameterVO = setupSparklineParameters(visMode, visContainer, authorDocuments); + } /** - * This method is used to generate the visualization code (HMTL, CSS & JavaScript). - * There 2 parts to it - 1. Actual Content Code & 2. Context Code. - * 1. Actual Content code in this case is the sparkline image, text related to - * data and the wrapping tables. This is generated via call to google vis API through - * JavaScript. - * 2. Context code is generally optional but contains code pertaining to tabulated - * data & links to download files etc. + * This method is used to setup parameters for the sparkline value object. These parameters + * will be used in the template to construct the actual html/javascript code. * @param visMode * @param visContainer * @param authorDocuments + * @return */ - private void generateVisualizationCode(String visMode, - String visContainer, - Set authorDocuments) { + private SparklineData setupSparklineParameters(String visMode, + String providedVisContainerID, + Set authorDocuments) { + + SparklineData sparklineData = new SparklineData(); + sparklineData.setYearToActivityCount(yearToPublicationCount); - sparklineData.setSparklineContent(getMainVisualizationCode(authorDocuments, - visMode, - visContainer)); - - - sparklineData.setSparklineContext(getVisualizationContextCode(visMode)); - - } - - private String getMainVisualizationCode(Set authorDocuments, - String visMode, - String providedVisContainerID) { int numOfYearsToBeRendered = 0; int currentYear = Calendar.getInstance().get(Calendar.YEAR); @@ -127,8 +99,6 @@ public class PersonPublicationCountVisCodeGenerator { String visContainerID = null; - StringBuilder visualizationCode = new StringBuilder(); - if (yearToPublicationCount.size() > 0) { try { minPublishedYear = Integer.parseInt(Collections.min(publishedYears)); @@ -159,37 +129,6 @@ public class PersonPublicationCountVisCodeGenerator { sparklineData.setNumOfYearsToBeRendered(numOfYearsToBeRendered); - visualizationCode.append("\n"); - - visualizationCode.append("\n"; + return sparklineData; } - private String getVisualizationContextCode(String visMode) { - - String visualizationContextCode = ""; - if (VisualizationFrameworkConstants.SHORT_SPARKLINE_VIS_MODE.equalsIgnoreCase(visMode)) { - visualizationContextCode = generateShortVisContext(); - } else { - visualizationContextCode = generateFullVisContext(); - } - - log.debug(visualizationContextCode); - - return visualizationContextCode; - } - - private String generateFullVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String csvDownloadURLHref = ""; - - if (yearToPublicationCount.size() > 0) { - - if (getCSVDownloadURL() != null) { - - csvDownloadURLHref = "Download data as .csv file.
    "; - sparklineData.setDownloadDataLink(getCSVDownloadURL()); - - } else { - csvDownloadURLHref = ""; - } - } else { - csvDownloadURLHref = "No data available to export.
    "; - } - - String tableCode = generateDataTable(); - - divContextCode.append("

    " + tableCode + csvDownloadURLHref + "

    "); - - sparklineData.setTable(tableCode); - - return divContextCode.toString(); - } - - private String getCSVDownloadURL() { - - if (yearToPublicationCount.size() > 0) { - - ParamMap CSVDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, - VisualizationFrameworkConstants.PERSON_PUBLICATION_COUNT_VIS); - - return UrlBuilder.getUrl(VisualizationFrameworkConstants.DATA_VISUALIZATION_SERVICE_URL_PREFIX, - CSVDownloadURLParams); - - } else { - return null; - } - } - - private String generateShortVisContext() { - - StringBuilder divContextCode = new StringBuilder(); - - String fullTimelineLink; - if (yearToPublicationCount.size() > 0) { - - ParamMap fullTimelineNetworkURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, - individualURI, - VisualizationFrameworkConstants.VIS_TYPE_KEY, - VisualizationFrameworkConstants.PERSON_LEVEL_VIS); - - String fullTimelineNetworkURL = UrlBuilder.getUrl( - VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX, - fullTimelineNetworkURLParams); - - - fullTimelineLink = "View all VIVO " - + "publications and corresponding co-author network."; - - sparklineData.setFullTimelineNetworkLink(fullTimelineNetworkURL); - - } else { - fullTimelineLink = "No data available to render full timeline.
    "; - } - - divContextCode.append("" + fullTimelineLink + ""); - return divContextCode.toString(); - } - - private String generateDataTable() { - - String csvDownloadURLHref = ""; - - if (getCSVDownloadURL() != null) { - csvDownloadURLHref = "(.CSV File)"; - } else { - csvDownloadURLHref = ""; - } - - StringBuilder dataTable = new StringBuilder(); - - dataTable.append("" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + ""); - - for (Entry currentEntry : yearToPublicationCount.entrySet()) { - dataTable.append("" - + "" - + "" - + ""); - } - - dataTable.append("\n
    Publications per year " + csvDownloadURLHref + "
    YearPublications
    " + currentEntry.getKey() + "" + currentEntry.getValue() + "
    \n"); - - return dataTable.toString(); - } - public SparklineData getValueObjectContainer() { - return sparklineData; + return this.sparklineParameterVO; } -} +} \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/utilities/UtilitiesRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/utilities/UtilitiesRequestHandler.java index a2b35707..726aa2fa 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/utilities/UtilitiesRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/utilities/UtilitiesRequestHandler.java @@ -12,7 +12,7 @@ import com.google.gson.Gson; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; import com.hp.hpl.jena.iri.Violation; -import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.rdf.model.RDFNode; @@ -46,7 +46,7 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { public Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) + Dataset Dataset) throws MalformedQueryParametersException { String individualURI = vitroRequest.getParameter( @@ -70,7 +70,7 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { QueryRunner profileQueryHandler = new AllPropertiesQueryRunner(individualURI, filterRule, - dataSource, + Dataset, log); GenericQueryMap profilePropertiesToValues = @@ -105,11 +105,63 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { "", whereClause, "", - dataSource, log); + Dataset, log); return getThumbnailInformation(imageQueryHandler.getQueryResult(), fieldLabelToOutputFieldLabel); + } else if (VisualizationFrameworkConstants.ARE_PUBLICATIONS_AVAILABLE_UTILS_VIS_MODE + .equalsIgnoreCase(visMode)) { + + Map fieldLabelToOutputFieldLabel = new HashMap(); + + String aggregationRules = "(count(DISTINCT ?document) AS ?numOfPublications)"; + + String whereClause = "<" + individualURI + "> rdf:type foaf:Person ; core:authorInAuthorship ?authorshipNode . \n" + + "?authorshipNode rdf:type core:Authorship ; core:linkedInformationResource ?document ."; + + String groupOrderClause = "GROUP BY ?" + QueryFieldLabels.AUTHOR_URL + " \n"; + + QueryRunner numberOfPublicationsQueryHandler = + new GenericQueryRunner(fieldLabelToOutputFieldLabel, + aggregationRules, + whereClause, + groupOrderClause, + Dataset, log); + + Gson publicationsInformation = new Gson(); + + return publicationsInformation.toJson(getNumberOfPublicationsForIndividual( + numberOfPublicationsQueryHandler.getQueryResult())); + + } else if (VisualizationFrameworkConstants.ARE_GRANTS_AVAILABLE_UTILS_VIS_MODE + .equalsIgnoreCase(visMode)) { + + Map fieldLabelToOutputFieldLabel = new HashMap(); + + String aggregationRules = "(count(DISTINCT ?Grant) AS ?numOfGrants)"; + + String whereClause = "{ <" + individualURI + "> rdf:type foaf:Person ; core:hasCo-PrincipalInvestigatorRole ?Role . \n" + + "?Role core:roleIn ?Grant . }" + + "UNION \n" + + "{ <" + individualURI + "> rdf:type foaf:Person ; core:hasPrincipalInvestigatorRole ?Role . \n" + + "?Role core:roleIn ?Grant . }" + + "UNION \n" + + "{ <" + individualURI + "> rdf:type foaf:Person ; core:hasInvestigatorRole ?Role . \n" + + "?Role core:roleIn ?Grant . }"; + + QueryRunner numberOfGrantsQueryHandler = + new GenericQueryRunner(fieldLabelToOutputFieldLabel, + aggregationRules, + whereClause, + "", + Dataset, log); + + Gson grantsInformation = new Gson(); + + return grantsInformation.toJson(getNumberOfGrantsForIndividual( + numberOfGrantsQueryHandler.getQueryResult())); + } else if (VisualizationFrameworkConstants.COAUTHOR_UTILS_VIS_MODE .equalsIgnoreCase(visMode)) { @@ -216,24 +268,12 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { aggregationRules, whereClause, groupOrderClause, - dataSource, log); + Dataset, log); return getHighestLevelOrganizationTemporalGraphVisURL( highestLevelOrganizationQueryHandler.getQueryResult(), fieldLabelToOutputFieldLabel); - /* - - GenericQueryMap highestLevelOrganizationToValues = getHighestLevelOrganizationInformation( - highestLevelOrganizationQueryHandler.getQueryResult(), - fieldLabelToOutputFieldLabel); - - Gson highestLevelOrganizationInformation = new Gson(); - - return highestLevelOrganizationInformation.toJson(highestLevelOrganizationToValues); - - */ - } else { ParamMap individualProfileURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, @@ -288,10 +328,47 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { } } -// return queryResult; return ""; } + private GenericQueryMap getNumberOfGrantsForIndividual (ResultSet resultSet) { + + GenericQueryMap queryResult = new GenericQueryMap(); + + + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + + RDFNode numberOfGrantsNode = solution.getLiteral("numOfGrants"); + + if (numberOfGrantsNode != null) { + queryResult.addEntry("numOfGrants", String.valueOf(numberOfGrantsNode.asLiteral().getInt())); + } + } + + return queryResult; + } + + + private GenericQueryMap getNumberOfPublicationsForIndividual (ResultSet resultSet) { + + GenericQueryMap queryResult = new GenericQueryMap(); + + + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + + RDFNode numberOfPublicationsNode = solution.getLiteral("numOfPublications"); + + if (numberOfPublicationsNode != null) { + queryResult.addEntry("numOfPublications", String.valueOf(numberOfPublicationsNode.asLiteral().getInt())); + } + } + + return queryResult; + } + + private String getThumbnailInformation(ResultSet resultSet, Map fieldLabelToOutputFieldLabel) { @@ -318,14 +395,14 @@ public class UtilitiesRequestHandler implements VisualizationRequestHandler { @Override public Map generateDataVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Utilities does not provide Data Response."); } @Override public ResponseValues generateStandardVisualization( - VitroRequest vitroRequest, Log log, DataSource dataSource) + VitroRequest vitroRequest, Log log, Dataset Dataset) throws MalformedQueryParametersException { throw new UnsupportedOperationException("Utilities does not provide Standard Response."); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/BiboDocument.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/BiboDocument.java index 24cf27b8..c6726439 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/BiboDocument.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/BiboDocument.java @@ -5,7 +5,12 @@ package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; /** * @author cdtank @@ -17,7 +22,6 @@ public class BiboDocument extends Individual { private String documentBlurb; private String documentDescription; private String publicationYear; - private String publicationYearMonth; private String publicationDate; private String parsedPublicationYear = VOConstants.DEFAULT_PUBLICATION_YEAR; @@ -98,47 +102,42 @@ public class BiboDocument extends Individual { } /** - * This method will be called when there is no usable core:year value found - * for the bibo:Document. It will first check & parse core:yearMonth failing - * which it will try core:date + * This method will be called to get the final/inferred year for the publication. + * The 3 choices, in order, are, + * 1. parsed year from xs:DateTime object saved in core:dateTimeValue + * 2. core:year which was property used in vivo 1.1 ontology + * 3. Default Publication Year * @return */ public String getParsedPublicationYear() { - /* - * We are assuming that core:yearMonth has "YYYY-MM" format. This is based - * off of http://www.w3.org/TR/xmlschema-2/#gYearMonth , which is what - * core:yearMonth points to internally. - * */ - if (publicationYearMonth != null - && publicationYearMonth.length() >= VOConstants.NUM_CHARS_IN_YEAR_FORMAT - && isValidPublicationYear(publicationYearMonth.substring( - 0, - VOConstants.NUM_CHARS_IN_YEAR_FORMAT))) { + if (publicationDate != null) { - return publicationYearMonth.substring(0, VOConstants.NUM_CHARS_IN_YEAR_FORMAT); + DateTime validParsedDateTimeObject = UtilityFunctions.getValidParsedDateTimeObject(publicationDate); + if (validParsedDateTimeObject != null) { + return String.valueOf(validParsedDateTimeObject.getYear()); + } else { + return publicationYear != null ? publicationYear : VOConstants.DEFAULT_PUBLICATION_YEAR; + } + + } else { + + /* + * If all else fails return default unknown year identifier if publicationYear is + * not mentioned. + * */ + return publicationYear != null ? publicationYear : VOConstants.DEFAULT_PUBLICATION_YEAR; } - - if (publicationDate != null - && publicationDate.length() >= VOConstants.NUM_CHARS_IN_YEAR_FORMAT - && isValidPublicationYear(publicationDate - .substring(0, - VOConstants.NUM_CHARS_IN_YEAR_FORMAT))) { - - return publicationDate.substring(0, VOConstants.NUM_CHARS_IN_YEAR_FORMAT); - } - - /* - * If all else fails return default unknown year identifier - * */ - return VOConstants.DEFAULT_PUBLICATION_YEAR; } /* * This publicationYear value is directly from the data supported by the ontology. * If this is empty only then use the parsedPublicationYear. + * + * @Deprecated Use getParsedPublicationYear() instead. * */ + @Deprecated public String getPublicationYear() { if (publicationYear != null && isValidPublicationYear(publicationYear)) { return publicationYear; @@ -152,14 +151,6 @@ public class BiboDocument extends Individual { this.publicationYear = publicationYear; } - public String getPublicationYearMonth() { - return publicationYearMonth; - } - - public void setPublicationYearMonth(String publicationYearMonth) { - this.publicationYearMonth = publicationYearMonth; - } - public String getPublicationDate() { return publicationDate; } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Entity.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Entity.java index d442b79f..3726a16d 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Entity.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Entity.java @@ -1,6 +1,7 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects; +import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.LinkedHashSet; @@ -40,7 +41,7 @@ public class Entity extends Individual{ return children; } - public void addPublications(BiboDocument biboDocument) { + public void addPublication(BiboDocument biboDocument) { this.publications.add(biboDocument); } @@ -48,8 +49,13 @@ public class Entity extends Individual{ this.children.add(subEntity); } + + public void addSubEntitities(Collection subEntities) { + this.children.addAll(subEntities); + + } - public void addGrants(Grant grant) { + public void addGrant(Grant grant) { this.grants.add(grant); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Grant.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Grant.java index 55c96503..0043bd3a 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Grant.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/Grant.java @@ -1,7 +1,10 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ package edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects; +import org.joda.time.DateTime; + import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.visutils.UtilityFunctions; /** * @author bkoniden @@ -11,11 +14,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; public class Grant extends Individual { - private String grantStartYear; - private String grantStartYearMonth; private String grantStartDate; - private String grantEndYear; - private String grantEndYearMonth; private String grantEndDate; public Grant(String grantURL, String grantLabel){ @@ -37,59 +36,49 @@ public class Grant extends Individual { public void setGrantLabel(String grantLabel) { this.setIndividualLabel(grantLabel); } + + /** - * This method will be called when there is no usable core:year value found - * for the bibo:Document. It will first check & parse core:yearMonth failing - * which it will try core:date + * This method will be called to get the inferred start year for the grant. + * The 3 choices, in order, are, + * 1. parsed year from xs:DateTime object saved in core:dateTimeValue + * 2. core:year which was property used in vivo 1.1 ontology + * 3. Default Grant Start Year * @return */ public String getParsedGrantStartYear() { - - /* - * We are assuming that core:yearMonth has "YYYY-MM-DD" format. This is based - * off of http://www.w3.org/TR/xmlschema-2/#gYearMonth , which is what - * core:yearMonth points to internally. - * */ - if (grantStartYearMonth != null - && grantStartYearMonth.length() >= VOConstants.NUM_CHARS_IN_YEAR_FORMAT - && isValidPublicationYear(grantStartYearMonth.substring( - 0, - VOConstants.NUM_CHARS_IN_YEAR_FORMAT))) { - - return grantStartYearMonth.substring(0, VOConstants.NUM_CHARS_IN_YEAR_FORMAT); - + + if (grantStartDate != null) { + + DateTime validParsedDateTimeObject = UtilityFunctions + .getValidParsedDateTimeObject(grantStartDate); + + if (validParsedDateTimeObject != null) { + return String.valueOf(validParsedDateTimeObject.getYear()); + } else { + return VOConstants.DEFAULT_GRANT_YEAR; + } + } else { + return VOConstants.DEFAULT_GRANT_YEAR; } - - if (grantStartDate != null - && grantStartDate.length() >= VOConstants.NUM_CHARS_IN_YEAR_FORMAT - && isValidPublicationYear(grantStartDate - .substring(0, - VOConstants.NUM_CHARS_IN_YEAR_FORMAT))) { - - return grantStartDate.substring(0, VOConstants.NUM_CHARS_IN_YEAR_FORMAT); + + } + + @Override + public boolean equals(Object other){ + boolean result = false; + if (other instanceof Grant){ + Grant grant = (Grant) other; + result = (this.getIndividualLabel().equals(grant.getIndividualLabel()) + && this.getIndividualURI().equals(grant.getIndividualURI())); } - - /* - * If all else fails return default unknown year identifier - * */ - return VOConstants.DEFAULT_GRANT_YEAR; + return result; } - public String getGrantStartYear() { - return grantStartYear; - } - - public void setGrantStartYear(String grantStartYear) { - this.grantStartYear = grantStartYear; - } - - public String getGrantStartYearMonth() { - return grantStartYearMonth; - } - - public void setGrantStartYearMonth(String grantStartYearMonth) { - this.grantStartYearMonth = grantStartYearMonth; - } + @Override + public int hashCode(){ + return(41*(getIndividualLabel().hashCode() + 41*(getIndividualURI().hashCode()))); + } public String getGrantStartDate() { return grantStartDate; @@ -99,21 +88,6 @@ public class Grant extends Individual { this.grantStartDate = grantStartDate; } - public String getGrantEndYear() { - return grantEndYear; - } - - public void setGrantEndYear(String grantEndYear) { - this.grantEndYear = grantEndYear; - } - - public String getGrantEndYearMonth() { - return grantEndYearMonth; - } - - public void setGrantEndYearMonth(String grantEndYearMonth) { - this.grantEndYearMonth = grantEndYearMonth; - } public String getGrantEndDate() { return grantEndDate; @@ -135,4 +109,42 @@ public class Grant extends Individual { return false; } +// /** +// * This method will be called when there is no usable core:year value found +// * for the core:Grant. It will first check & parse core:yearMonth failing +// * which it will try core:date +// * @return +// */ +// public String getParsedGrantStartYear() { +// +// /* +// * We are assuming that core:yearMonth has "YYYY-MM-DD" format. This is based +// * off of http://www.w3.org/TR/xmlschema-2/#gYearMonth , which is what +// * core:yearMonth points to internally. +// * */ +// if (grantStartYearMonth != null +// && grantStartYearMonth.length() >= VOConstants.NUM_CHARS_IN_YEAR_FORMAT +// && isValidPublicationYear(grantStartYearMonth.substring( +// 0, +// VOConstants.NUM_CHARS_IN_YEAR_FORMAT))) { +// +// return grantStartYearMonth.substring(0, VOConstants.NUM_CHARS_IN_YEAR_FORMAT); +// +// } +// +// if (grantStartDate != null +// && grantStartDate.length() >= VOConstants.NUM_CHARS_IN_YEAR_FORMAT +// && isValidPublicationYear(grantStartDate +// .substring(0, +// VOConstants.NUM_CHARS_IN_YEAR_FORMAT))) { +// +// return grantStartDate.substring(0, VOConstants.NUM_CHARS_IN_YEAR_FORMAT); +// } +// +// /* +// * If all else fails return default unknown year identifier +// * */ +// return VOConstants.DEFAULT_GRANT_YEAR; +// } + } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SparklineData.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SparklineData.java index 0ca5b5a3..89830407 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SparklineData.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SparklineData.java @@ -7,14 +7,6 @@ import java.util.Map; public class SparklineData { - /* - * For now sparklineNumPublicationsText & sparklinePublicationRangeText is left - * as empty but later on we would want to leverage the granularity that this - * provides. - * */ - private String sparklineNumPublicationsText = ""; - private String sparklinePublicationRangeText = ""; - private Integer earliestYearConsidered; private Integer earliestRenderedPublicationYear; private Integer latestRenderedPublicationYear; @@ -25,41 +17,30 @@ public class SparklineData { private Integer unknownYearPublications; private Integer unknownYearGrants; + private Integer totalCollaborationshipCount; private Map yearToActivityCount; - private String table = ""; - private String downloadDataLink = ""; private String fullTimelineNetworkLink = ""; private String visContainerDivID = "pub_count_vis_container"; - private String sparklineContent; - private String sparklineContext; private boolean isShortVisMode = true; private List yearToEntityCountDataTable; private int numOfYearsToBeRendered; - - public String getSparklineNumPublicationsText() { - return sparklineNumPublicationsText; + + public void setTotalCollaborationshipCount( + Integer totalCollaborationshipCount) { + this.totalCollaborationshipCount = totalCollaborationshipCount; } - - public void setSparklineNumPublicationsText(String sparklineNumPublicationsText) { - this.sparklineNumPublicationsText = sparklineNumPublicationsText; + + public Integer getTotalCollaborationshipCount() { + return totalCollaborationshipCount; } - - public String getSparklinePublicationRangeText() { - return sparklinePublicationRangeText; - } - - public void setSparklinePublicationRangeText( - String sparklinePublicationRangeText) { - this.sparklinePublicationRangeText = sparklinePublicationRangeText; - } - + public Integer getEarliestRenderedGrantYear() { return earliestRenderedGrantYear; } @@ -151,14 +132,6 @@ public class SparklineData { return renderedSparks; } - public String getTable() { - return table; - } - - public void setTable(String table) { - this.table = table; - } - public String getDownloadDataLink() { return downloadDataLink; } @@ -183,14 +156,6 @@ public class SparklineData { return visContainerDivID; } - public String getSparklineContent() { - return sparklineContent; - } - - public void setSparklineContent(String shortSparklineContent) { - this.sparklineContent = shortSparklineContent; - } - public void setShortVisMode(boolean isShortVisMode) { this.isShortVisMode = isShortVisMode; } @@ -199,11 +164,4 @@ public class SparklineData { return isShortVisMode; } - public String getSparklineContext() { - return sparklineContext; - } - - public void setSparklineContext(String shortSparklineContext) { - this.sparklineContext = shortSparklineContext; - } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SubEntity.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SubEntity.java index 29557e22..4dad26fa 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SubEntity.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/valueobjects/SubEntity.java @@ -57,13 +57,18 @@ public class SubEntity extends Individual { public int hashCode(){ return(41*(getIndividualLabel().hashCode() + 41*(getIndividualURI().hashCode()))); } - - public void addPublications(BiboDocument biboDocument) { + + @Override + public String toString(){ + return this.getIndividualLabel(); + } + + public void addPublication(BiboDocument biboDocument) { this.publications.add(biboDocument); } - public void addGrants(Grant grant) { + public void addGrant(Grant grant) { this.grants.add(grant); } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/AllPropertiesQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/AllPropertiesQueryRunner.java index 523c1084..91efb108 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/AllPropertiesQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/AllPropertiesQueryRunner.java @@ -8,7 +8,7 @@ import org.apache.commons.logging.Log; import com.hp.hpl.jena.iri.IRI; import com.hp.hpl.jena.iri.IRIFactory; import com.hp.hpl.jena.iri.Violation; -import com.hp.hpl.jena.query.DataSource; +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; @@ -36,18 +36,18 @@ public class AllPropertiesQueryRunner implements QueryRunner { protected static final Syntax SYNTAX = Syntax.syntaxARQ; private String filterRule, individualURI; - private DataSource dataSource; + private Dataset Dataset; private Log log; public AllPropertiesQueryRunner(String individualURI, String filterRule, - DataSource dataSource, + Dataset Dataset, Log log) { this.individualURI = individualURI; this.filterRule = filterRule; - this.dataSource = dataSource; + this.Dataset = Dataset; this.log = log; } @@ -74,12 +74,12 @@ public class AllPropertiesQueryRunner implements QueryRunner { } private ResultSet executeQuery(String queryText, - DataSource dataSource) { + Dataset Dataset) { QueryExecution queryExecution = null; Query query = QueryFactory.create(queryText, SYNTAX); - queryExecution = QueryExecutionFactory.create(query, dataSource); + queryExecution = QueryExecutionFactory.create(query, Dataset); return queryExecution.execSelect(); } @@ -127,7 +127,7 @@ public class AllPropertiesQueryRunner implements QueryRunner { ResultSet resultSet = executeQuery(generateGenericSparqlQuery( this.individualURI, this.filterRule), - this.dataSource); + this.Dataset); return createJavaValueObjects(resultSet); } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/GenericQueryRunner.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/GenericQueryRunner.java index ba89016a..df90f178 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/GenericQueryRunner.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/GenericQueryRunner.java @@ -6,7 +6,7 @@ import java.util.Map; import org.apache.commons.logging.Log; -import com.hp.hpl.jena.query.DataSource; +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; @@ -30,7 +30,7 @@ public class GenericQueryRunner implements QueryRunner { protected static final Syntax SYNTAX = Syntax.syntaxARQ; private String whereClause; - private DataSource dataSource; + private Dataset Dataset; private Log log; @@ -44,23 +44,23 @@ public class GenericQueryRunner implements QueryRunner { String aggregationRules, String whereClause, String groupOrderClause, - DataSource dataSource, Log log) { + Dataset Dataset, Log log) { this.fieldLabelToOutputFieldLabel = fieldLabelToOutputFieldLabel; this.aggregationRules = aggregationRules; this.whereClause = whereClause; this.groupOrderClause = groupOrderClause; - this.dataSource = dataSource; + this.Dataset = Dataset; this.log = log; } private ResultSet executeQuery(String queryText, - DataSource dataSource) { + Dataset Dataset) { QueryExecution queryExecution = null; Query query = QueryFactory.create(queryText, SYNTAX); - queryExecution = QueryExecutionFactory.create(query, dataSource); + queryExecution = QueryExecutionFactory.create(query, Dataset); return queryExecution.execSelect(); } @@ -96,7 +96,7 @@ public class GenericQueryRunner implements QueryRunner { throws MalformedQueryParametersException { ResultSet resultSet = executeQuery(generateGenericSparqlQuery(), - this.dataSource); + this.Dataset); return resultSet; } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/UtilityFunctions.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/UtilityFunctions.java index 55851059..dd52e479 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/UtilityFunctions.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/UtilityFunctions.java @@ -16,19 +16,24 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormatter; import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.controller.Controllers; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.ParamMap; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.visualization.freemarker.VisualizationFrameworkConstants; +import edu.cornell.mannlib.vitro.webapp.visualization.constants.VOConstants; import edu.cornell.mannlib.vitro.webapp.visualization.constants.VisConstants; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.BiboDocument; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.CoAuthorshipData; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.CoPIData; -import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Grant; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.CoPINode; +import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Grant; import edu.cornell.mannlib.vitro.webapp.visualization.freemarker.valueobjects.Node; public class UtilityFunctions { @@ -53,14 +58,11 @@ public class UtilityFunctions { * 1. We will be using getPub... multiple times & this will save us duplication of code * 2. If we change the logic of validity of a pub year we would not have to make * changes all throughout the codebase. - * 3. We are asking for a publication year & we should get a proper one or NOT at all. + * 3. We are asking for a publicationDate which is captured using the vivo 1.2 ontology + * & if not saved then we are being nice & checking if date is saved using core:year if so + * we use that else we return UNKOWN_YEAR. * */ - String publicationYear; - if (curr.getPublicationYear() != null) { - publicationYear = curr.getPublicationYear(); - } else { - publicationYear = curr.getParsedPublicationYear(); - } + String publicationYear = curr.getParsedPublicationYear(); if (yearToPublicationCount.containsKey(publicationYear)) { yearToPublicationCount.put(publicationYear, @@ -235,12 +237,7 @@ public class UtilityFunctions { * changes all throughout the codebase. * 3. We are asking for a grant year & we should get a proper one or NOT at all. * */ - String grantYear; - if (curr.getGrantStartYear() != null) { - grantYear = curr.getGrantStartYear(); - } else { - grantYear = curr.getParsedGrantStartYear(); - } + String grantYear = curr.getParsedGrantStartYear(); if (yearToGrantCount.containsKey(grantYear)) { yearToGrantCount.put(grantYear, @@ -256,5 +253,72 @@ public class UtilityFunctions { return yearToGrantCount; } + + public static DateTime getValidParsedDateTimeObject(String unparsedDateTime) { + + for (DateTimeFormatter currentFormatter : VOConstants.POSSIBLE_DATE_TIME_FORMATTERS) { + + try { + + DateTime dateTime = currentFormatter.parseDateTime(unparsedDateTime); + return dateTime; + + } catch (Exception e2) { + /* + * The current date-time formatter did not pass the muster. + * */ + } + } + + /* + * This means that none of the date time formatters worked. + * */ + return null; + } + + public static String getCSVDownloadURL(String individualURI, String visType, String visMode) { + + ParamMap CSVDownloadURLParams = null; + + if (StringUtils.isBlank(visMode)) { + + CSVDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, + individualURI, + VisualizationFrameworkConstants.VIS_TYPE_KEY, + visType); + + } else { + + CSVDownloadURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, + individualURI, + VisualizationFrameworkConstants.VIS_TYPE_KEY, + visType, + VisualizationFrameworkConstants.VIS_MODE_KEY, + visMode); + + } + + String csvDownloadLink = UrlBuilder.getUrl(VisualizationFrameworkConstants.DATA_VISUALIZATION_SERVICE_URL_PREFIX, + CSVDownloadURLParams); + + return csvDownloadLink != null ? csvDownloadLink : "" ; + + } + + public static String getCollaboratorshipNetworkLink(String individualURI, String visType, String visMode) { + + ParamMap collaboratorshipNetworkURLParams = new ParamMap(VisualizationFrameworkConstants.INDIVIDUAL_URI_KEY, + individualURI, + VisualizationFrameworkConstants.VIS_TYPE_KEY, + visType, + VisualizationFrameworkConstants.VIS_MODE_KEY, + visMode); + + String collaboratorshipNetworkURL = UrlBuilder.getUrl( + VisualizationFrameworkConstants.FREEMARKERIZED_VISUALIZATION_URL_PREFIX, + collaboratorshipNetworkURLParams); + + return collaboratorshipNetworkURL != null ? collaboratorshipNetworkURL : "" ; + } } diff --git a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/VisualizationRequestHandler.java b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/VisualizationRequestHandler.java index 6cf42c03..dd387299 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/VisualizationRequestHandler.java +++ b/src/edu/cornell/mannlib/vitro/webapp/visualization/freemarker/visutils/VisualizationRequestHandler.java @@ -6,6 +6,7 @@ import java.util.Map; import org.apache.commons.logging.Log; import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; @@ -25,14 +26,14 @@ public interface VisualizationRequestHandler{ ResponseValues generateStandardVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException; + Dataset dataSource) throws MalformedQueryParametersException; Object generateAjaxVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException; + Dataset dataSource) throws MalformedQueryParametersException; Map generateDataVisualization(VitroRequest vitroRequest, Log log, - DataSource dataSource) throws MalformedQueryParametersException; + Dataset dataSource) throws MalformedQueryParametersException; } diff --git a/themes/vivo-basic/css/individual.css b/themes/vivo-basic/css/individual.css index 7f98eedb..00a06ac4 100644 --- a/themes/vivo-basic/css/individual.css +++ b/themes/vivo-basic/css/individual.css @@ -652,4 +652,11 @@ Dark Green (links): #118855 * html #personWrap #content div.propsItem { border-color: #f0ede4; border-top: 0; +} +img.individual-photo { + border: 7px solid #ededed; +} +.edit-mainImage, +.delete-mainImage { + top: 150px; } \ No newline at end of file diff --git a/themes/vivo-basic/css/screen.css b/themes/vivo-basic/css/screen.css index 53974950..a600a214 100644 --- a/themes/vivo-basic/css/screen.css +++ b/themes/vivo-basic/css/screen.css @@ -826,4 +826,26 @@ margin-bottom:250px; /* This css rules will override the one in individual.css */ .green { color:#000 !important; +} + +/* styles for vivo-basic deprecated alert */ +#deprecated { + margin-bottom: 1em; + padding: 0.6em 1.2em; + min-width: 662px; + border: 3px solid #edc113; + background-color: #F8F8C8; + color: #000; + text-align: left; + font-size: 1.1em; +} +#deprecated p { + margin: 1.1em 0 0 0; + text-align: left; +} +#deprecated h1 { + font-size: 1.4em; +} +#deprecated ul { + margin-bottom: 0; } \ No newline at end of file diff --git a/themes/vivo-basic/templates/identity.ftl b/themes/vivo-basic/templates/identity.ftl index 82feddfc..ea6deed4 100644 --- a/themes/vivo-basic/templates/identity.ftl +++ b/themes/vivo-basic/templates/identity.ftl @@ -2,6 +2,8 @@ <#import "lib-list.ftl" as l> +<#include "vivo-basic-deprecation.ftl"> +