Skip to content

NCIEVS/nci-report-writer2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nci-report-writer2

SPARQL-based Report Writer query and reporting tool.

Overview

The ReportWriter SPARQL application is a prototype for creating reports using a SPARQL endpoint. This version was written in Java and was tested against a Stardog triple store.

This repository has several parts:

  1. core: This is a Java code that generates a report based on a YAML configuration template. This is library code that is used by the program and web applications.

  2. database: Contains schema definitions and content files for creating an empty MySQL ReportWriter database. There is a simple README file contained in this directory, that outlines the steps for building an new database.

  3. examples: Contains sample templates in YAML format.

  4. program: Command line to produce a report based on a report template. Uses the core jar file to produce the reports.

  5. web: This is a Web application that can be used to build new report templates, run existing reports, and view completed reports. The web application uses the core jar file to generate the reports.

Building with Gradle

All the projects in this repository, require that environment variables be set for your environment, before building jar files. These environment variables override default variables set in the application.yml file. The developers of this code normally create a config directory under our home directory. Then, as an example we create a reportWriter.sh program where we set the environment variables. Below is an example, but most of the content should be replaced with content appropriate for your environment:

export LOGGING_LEVEL_ORG_SPRINGFRAMEWORK="ERROR"
export LOGGING_LEVEL_GOV_NIH_NCI_EVS_RW="INFO"
export STARDOG_USERNAME="STARDOG_USERNAME"
export STARDOG_PASSWORD="STARDOG_PASSWORD"
export STARDOG_URL="http://localhost:5820/NCIT2"
export STARDOG_QUERY_URL="http://localhost:5820/NCIT2/query"
export STARDOG_GRAPH_NAME="http://NCI_T"
export STARDOG_OWL_FILENAME="Thesaurus.owl"
export STARDOG_READ_TIMEOUT="10000"
export STARDOG_CONNECT_TIMEOUT="10000"
export RW_BIN_DIRECTORY="/tmp/bin"
export RW_TEMPLATE_DIRECTORY="/tmp/templates"
export RW_OUTPUT_DIRECTORY="/tmp/output"
export RW_API_DATASOURCE_URL="jdbc:mysql://localhost/reportwriter"
export RW_API_DATASOURCE_USERNAME="MYSQL_USERNAME"
export RW_API_DATASOURCE_PASSWORD="MYSQL_PASSWORD"

In the Linux enviroment, we would then run 'source ~/config/reportWriter.sh', before attempting to build or run applications.

Building the core

The JAR file for this core can be generated using gradlew commands in the core directory. The JAR file generated by running these commands will be located in the build/libs directory and will be installed in your local Maven repository.

source ~/config/reportWriter.sh
cd core
gradlew clean build install

In the core/build/libs directory the reportwriter-core-1.0.0.RELEASE.jar file should now exist. This same file has also been installed in your local Maven repository.

Building the program

The JAR file for this program can be generated using gradlew commands in the program directory. The JAR file generated by running this command will be located in the build/libs directory.

source ~/config/reportWriter.sh
cd program
gradlew clean build

In the program/build/libs directory the reportwriter-program-1.0.0.RELEASE.jar file should now exist. You can use this jar to generate reports from the command line.

java -jar reportwriter-program-1.0.0.RELEASE.jar

Building the web

The SpringBoot JAR file for this web can be generated using gradlew commands in the web directory. The JAR file generated by running this command will be located in the build/libs directory.

source ~/config/reportWriter.sh
cd web
gradlew clean build

In the web/build/libs directory the reportwriter-web-1.0.0.RELEASE.jar file should now exist. You can use this jar to start the web application using an embedded Tomcat server.

java -jar web-1.0.0.RELEASE.jar

Examples

In the reportwriter-examples directory, there are sample shell scripts for running a report in the bin directory, and sample report templates are located in the templates directory.

The runReportWriter.sh script in the bin directory is an example of setting the environment variables to run against a locally installed version of Stardog.