rudolf is an HTTP API that wraps a SPARQL endpoint to expose OpenBudgets.eu RDF-schema - compatible datasets, according to OpenSpending's babbage API specification. rudolf's name was chosen to remind the letters contained in the RDF acronym.
rudolf is based on Laravel 5.2. In order to install rudolf, you first have to setup a web server that supports the execution of PHP7 scripts. rudolf may also work with PHP >5.5.9, but it has not been yet tested with versions of PHP other than version 7.
The PHP extension php_mbstring
is also required. You can install this by running sudo apt-get install php-mbstring
in your debian-based operating system.
To support friendly URL's please make sure you have enabled mod_rewrite
in your PHP installation.
After setting up your environment, you can install rudolf:
-
Clone this repository:
git clone https://github.com/larjohn/rudolf.git
-
Get into the newly created directory:
cd rudolf
-
Run composer to install dependencies:
composer install --no-scripts
After installing rudolf, change the configuration file located at config/sparql.php
and set the appropriate endpoint URI.
The structure of the datasets is dynamically discovered from the SPARQL endpoint the very first time a cube model is requested. The same goes for member values. They are then stored to the local cache.
Some operations may take long time in order to finish. There are some commands available to make life easier and avoid browser HTTP timeout:
model:clear {cubename}
: Clears a cube modelmodel:load {cubename}
: Loads a cube modelsearch:load
: Loads the whole search endpoint model
To run a command, cd
to rudolf's root folder and enter
php artisan {command} {parameters}
For instance:
php artisan model:load global
loads the global cube
More commands are on the way! In the meantime, you can always use cache:clear
.
Documentation for the API can be found in the official OpenSpending pages.
Current version:
- v0.1: Initial version - partial support of the babbage API
Next versions
- v0.2: Code cleanup, support hierarchical dimensions
- v0.3: Support cosmopolitan API equivalents
If you are unable to acccess the API endpoint (e.g., rudolf/public/api/3/cubes path on your installation returns Not Found page), please check the following:
-
Your website directory (e.g.
\var\www\
is writable by www-data). Usels -l
to check the permission. -
You may need to change your apache configuration in
/etc/apache2/sites-available/000-default.conf
. Within<VirtualHost>
tag, provide the following lines:<Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
-
Restart Apache.
The rudolf API is open-source software licensed under the MIT license. It is funded by by the OpenBudgets.eu Horizon 2020 project (Grant Agreement 645833).