This repo contains two services for the common statistical processing architecture.
- Linear Rule Checking (LRC), for checking records for validity
- Linear Error Localization (LEL), for finding erronuous values in records, given a set of restrictions.
Both services can be run as command-line tools (CLI) or via a Web API- REST interface.
A generic REST interface for CSPA services is described in proposal_rest_interface.pdf. Both services implement the proposed interface.
There are (at least) three options for installing the services:
- By running a prebuild docker image (edwindj/cspa-rest).
- By downloading the repo and installing software on Windows or Linux
- By using Vagrant, which will create an Ubuntu virtualbox VM.
- install docker
- Run
$ sudo docker run -d -p8080:8080 edwindj/cspa-rest
This will start a docker container with both services running that exposes port 8080 to the OS.
The docker image is automatically build from the vagrant/Dockerfile
.
(for ubuntu 14.04 you can also use vagrant/bootstrap.sh to do the install)
- Install R and run
R -e "install.packages('docopt','editrules', 'jsonlite','rspa')"
This will install R packages on which the services depend. The command-line interface should work after this installation.
For the REST interface:
- install node.js and npm, see (http://nodejs.org)
- download this repo
- Then goto the "cspa_rest/" directory and run
$ npm install
This will install nodejs dependencies for cspa_rest. (The dependencies are given in file "./packages.json")
- Run the server:
$ npm start
or (on Ubuntu)
$ nodejs server.js
Alternatively you can install a VM image that contains all the software and a running CSPA service that can be tested on localhost:8080
.
To install you will need to install vagrant and virtualbox.
$ cd vagrant
$ vagrant up
To test the service run:
$ ./LRC/example/post.sh
- Start service
- Goto LRC/example (or LEL/example, or LEC/example)
- execute
post.sh
, this willPOST
thejob.json
file and create a job (id = 0
) in the service - http://localhost:8080/LRC/job will show a list of current jobs
- http://localhost:8080/LRC/job/{id} will show job information