data.world Mondrian Demonstration
This docker image demonstrates the use of Mondrian for performing online analytical processing (OLAP) queries of files in data.world datasets. It uses a REST API wrapper for Mondrian and the data.world JDBC driver to do the heavy lifting.
One nice benefit of this approach is that the REST API returns results in a format conducive to visualization by Vega-Lite. The demo includes a static html page that presents data from the 2016 US presidential election, which resides in a publicly available data.world dataset:
The files involved in construction of the image are:
Dockerfile: The dockerfile for the image, derived from the stock Tomcat 8 image
files/application.properties: Spring properties file to configure the REST API (the REST API is implemented as a Spring Boot application)
files/index.html: Simple Bootstrap 4 html page that provides a visualization demo (available in the container at http://[host]/demo)
files/launch-tomcat-with-token.sh: shell script used as the
CMDthat is run in containers; sets the data.world API token on the REST API's connection configuration to authenticate data.world JDBC calls
files/mondrian-connections.json: REST API connection configuration
files/PresidentialElectionResults2016.xml: Mondrian Schema that defines the OLAP cubes on top of the sample dataset file
Building the image
Build the image from inside the folder containing the Dockerfile and files subdirectory with:
docker build -t data.world-mondrian-demo .
The image is also publicly available on DockerHub.
Running a container
To run in detatched mode and listen on host port 80 (leave off the
scottcame/ prefix if you've built it locally):
docker run -d -p 80:80 --name dw-mondrian-demo -e DW_TOKEN=[api token goes here] scottcame/data.world-mondrian-demo
Note that you need to supply your data.world API token as a container environment variable. To obtain a token, first sign up for a data.world account (if you don't already have one) and then visit https://data.world/settings/advanced.
Then (assuming the container is running on localhost), the following are available: