A simple example of an SEIRS epidemiological model using the FAIR Data Pipeline.
First, install Java (JDK v.11 or later), and gradle (v.6.5 or later) on your system. Then install the FAIR data registry if it is not already installed - see here for instructions. The javaDataPipeline API is registered on Maven Central, so gradle will automatically resolve it as a dependency.
If you don't already have the registry initialised and the fair
command line tool configured, then you need to install that next - see here.
Download and install the javaSimpleModel code. In some suitable directory, clone the git repo:
git clone https://github.com/FAIRDataPipeline/javaSimpleModel.git
cd javaSimpleModel
At this point you can configure fair
to run in this repo. Either run:
fair init
And fill in your own details.
Finally you can run the example!
This is easy. The user configuration script for running the Java SEIRS model can be found inside this repo - src/main/resources/seirs-config.yaml - and for this self-contained example, it includes all of the information to register the input data that the model needs, so that you don't have to be connected to a registry that already knows about it. The code can be executed by first ensuring that all of the input data is available in the local registry (using fair pull
) and then running the code (using fair run
). So:
fair pull src/main/resources/seirs-config.yaml
fair run src/main/resources/seirs-config.yaml
That's it! If you go to the local registry in your browser now (by default at http://localhost:8000), you should see the input and output data recorded in the registry.
In the resources folder you will find two other example config files, one of which can create a new data product with parameters for the SEIRS model (in FAIR Data Pipeline TOML parameter file format), the other runs the same SEIRS model again using the TOML parameter Data Product.