As of the 1st of February 2015 this wiki has been deprecated.
This archive is now a read only site.
There is also a copy of the history that has been converted into a git repository at: https://github.com/IATI/IATI-Wiki-Archive.
Please do not rely on any of the information found here.

Research for Development Widgets

The Research for Development-IATI widget makes use of linked data from IATI and Research for Development to provide a widget that displays research relating to a particular DFID project.

Access a demonstration install here.

Detailed Description

Data from IATI and Research for Development is periodically converted into RDF Linked Data and loaded into a triple store on the Kasabi platform. A node.js and javascript application (source) deployed to Heroku can take any DFID Aries code (found in IATI identifiers as xxxx in GB-1-xxxxxx) and check for related research publications which are then presented in a configurable widget.

The widget can display research with or without a border, to allow easier embedding into third party websites.

Documentation

Front end

The demonstration application at http://r4d.herokuapp.com/ provides sample javascript code for embedding the widget. It currently only accepts DFID Aries codes.

Only some ARIES codes have attached research projects. When research is not found linked to an identifier the widget will not display.

Note that some IATI identifiers are for components of DFID projects (e.g. 100234-101) rather than the overall project (100234) to which research records are linked. If you have one of these identifiers, you may wish to strip off the end component.

Running locally

To run the front-end locally you will need to:

redis-server /usr/local/etc/redis.conf 
  • Run node
node web.js

Back end

The data can be loaded into any triple store with a SPARQL interface. We are using 4Store.

You can follow the instructions here to get a working install of 4Store.

Then set-up a separate database:

4s-backend-setup r4d #Only run this the first time you set up the store

And launch a backend and http server (and add these lines to /etc/rc.local to launch on startup):

4s-backend r4d
4s-httpd r4d -p 8088

You will then need to add the following lines to the Apache configuration:

ProxyPass /r4d/status http://localhost:8088/status
ProxyPassReverse /r4d/status http://localhost:8088/status
ProxyPass /r4d/sparql http://localhost:8088/sparql
ProxyPassReverse /r4d/sparql http://localhost:8088/sparql

This makes it easy to run an R4D triple store alongside any others.

The data is currently loaded to this triple store using a set of Python scripts.

Data import

R4D Data

Get a copy of the script from https://github.com/aidinfolabs/R4D-4Store-Sync

git clone https://github.com/aidinfolabs/R4D-4Store-Sync.git

Run the script whenever you want to update the stored data. It performs a full refresh of the triples stored.

python update.py
IATI Data

This section needs to be updated to work with the new 4Store backend.

Either see the instructions here or a pre-configured server is available via the Turnkey Linux Backup Management service. Contact Tim Davies for access.

Example build on a clean Turnkey Linux core image
apt-get install python-setuptools gcc xsltproc libxml2-dev libxslt-dev python-dev
easy_install pytassium
easy_install ckan
easy_install ckanclient
easy_install lxml
easy_install argparse

apt-get install default-jre
mkdir ~/software
cd ~/software/
mkdir Jena
cd Jena

Then get the latest version of Jena from http://sourceforge.net/projects/jena/files/Jena/ and download it

unzip *zip*
mv Jena*/* .
rmdir Jena-*

Add the following lines to ~/.bashrc and run them

export JENAROOT="/root/software/Jena"
export PATH="$JENAROOT/bin:$PATH"
export CLASSPATH=".:$JENAROOT/lib/*.jar:$TDBROOT/lib/*.jar:$JOSEKIROOT/lib/*.jar"
alias rdfcat="~/software/Jena/bin/rdfcat"

For some reason I also needed to run

chmod +x $JENAROOT/bin/make_classpath

before I could run rdfcat successfully.

git clone https://github.com/practicalparticipation/International-Development-Linked-Data-Tools-.git
mv International* scripts
cd ~/scripts
git clone https://github.com/aidinfolabs/IATI-XSLT.git
cd ~
mkdir -p r4d/data/archive
mkdir -p iati/data/codelists

I could then run


QR Code
QR Code Research for Development Widgets (generated for current page)