Beginnings of a CKAN SWORD Extension

CKAN

CKAN will be extended to allow applications to input into CKAN using SWORD. It has been decided that this extension will benefit not only Orbital, but several other projects for storing data via SWORD input in the wider CKAN community.

The setup process is outlined in the CKAN Documentation. This has been followed to setup the CKAN source install, which is needed to be able to create the CKAN SWORD extension.

 

CKAN Problems

I have been active in the IRC channel with other CKAN members and got their feedback on creating a CKAN source instance. This was mostly done to overcome a number of errors during the setup. This happened several times, such as with the version being run having a feature depreciated and so not being able to find a file. Or such as the database not being initialised due to a missing component. The install has not yet been completed due to these issues, but an instance of Solr has been implemented.

 

Versions

The documentaion at step 4 instructs to install CKAN source code. The first says how to install the latest code:

pip install --ignore-installed -e git+https://github.com/okfn/ckan.git#egg=ckan
OR for a specific version e.g. for v1.5.1:
pip install --ignore-installed -e git+https://github.com/okfn/ckan.git@ckan-1.7#egg=ckan
The first problem arose here. Of course, the initial thing to think about was the latest code., this would mean that CKAN would be up to date and compatible. However, later in the documentation this is not so. After speaking in the IRC channel it turns out that the requires folder is no longer included in the install in the latest version, but 1.7.1 (Not 1.5.1 as labelled) does have the folder. So this is the version that should be installed.

 

Solr

The Solr instance was easy to follow and implement and connect to over localhost. However, when the schema.xml file was replaced with CKANs, it no longer worked only to throw an error that it could not find teh file when it existed.

The problem turned out to be that the location of thee schema.xml of CKAN was not in the directory specified in the documentation. It was, however, in the install so the correct directory was found and the file moved across. Solr did indeed work, and the problem of the file not existing was that a blank file was created due to the CKAN schema being moved not existing. The documented location of the file is as follows:

~/ckan/ckan/config/solr/schema-1.4.xml
The actual location of the file is thus:
~/pyenv/src/ckan/ckan/config/solr/schema-1.4.xml
Now, the discrepancy between the two locations is not much , as the home directory is just replaced with the pyenv/srv directory. This, when following instructions, is not known as the schema.xml could be in either directory.

Database
Section 9 - Create database tables states to use the following command to initialise the database tables:
paster --plugin=ckan db init
This produced an error, which said that a Ganshi module was missing. After installing the required module, a series of other errors appeared.
pyutilib was the second module missing. After installing this a string of other dependancies were also required.
Migrate.versioning.api was the next, followed by Big Integer. This one was not solved as a dependancy installed did not have the required programming for handling the BigInteger.
Working CKAN Instance
After all these error, a CKAN instance has finally been initialised. It’s unclear to me what what done differently, but it is now working. An Ubuntu image has been saved so the instance will not be lost.
This blog post will be followed up by an account of everything I type and click in order to get CKAN running. Creating a new virtual instance and starting from scratch will be the starting point of the documentation

One Reply to “Beginnings of a CKAN SWORD Extension”

Leave a Reply

Your email address will not be published. Required fields are marked *