ONS Statistics Prototype

This is a prototype application that explores ideas for publishing statistical data on the web. The application was built by the Open Data Institute on behalf of the Office of National Statistics. Some background on the project has been publised on the ONS Digital Publishing blog.

Links are provided below to additional documentation on both the prototype and some wider thinking around a suitable application architecture.

The Dataset

The application has been built around a single ONS dataset. Specifically the February 2014 release of the Producer Price Index.

The dataset and some additional metadata about its structure and release history have been converted into JSON which has then been loaded into MongoDB. While organised as JSON documents, the data uses the basic model described in the DataCube vocabulary.

The Prototype

The prototype application is a simple web application which is backed by a data API that interacts with MongoDB.

The following links provide some starting points for navigating the prototype.


Slices are views onto a dataset. A slice extracts observations from a dataset based on specific values for the dimensions. A simple example of a slice is a time series. For example in the Producer Price Index a slice might show the monthly price index for Computer, electronic and optical products (K387) from January 1996-January 2014.

Slices are dynamically generated from the data and can use knowledge of the dimensions in order to support more flexible queries. By default slices show the most fine-grained data points. In the example dataset these are monthly figures. But slices can also be generated that show:


Observations are individual measurements in a dataset. By giving every data point a URL it becomes possible to link to and navigate through a dataset in many different ways. It also becomes possible to provide all of the necessary context required to interpret a data point.

For example this observation shows the December 2013 price index for alcoholic beverages.

The observation page includes context that shows how the index has changed in the last month and year. In the above example there are also clear indicators that the data is still provisional and is based on limited coverage of the industry sector. The same page also provides additional notes and commentary from the release of the dataset.

ONS statistical releases often include "reference tables" that summarise the figures in the main dataset associated with the release. These reference tables can also be treated as individual datasets that contain observations.

This allows analysis to be linked directly to supporting data:

"The output price index for goods produced by UK manufacturers (factory gate prices), rose 0.9% in the year to January 2014"

The Code

The application and all supporting code is written in Ruby and has been published on github:

Additional Documentation