For each application that Orbital interfaces with, be it CKAN, ePrints or anything else, it is abstracted through a ‘bridge_application’ library. Orbital is built predominately in PHP. Using CKAN as an example, we have a Ckan.php file in the folder ‘bridge_applications’ containing all the functions needed to interface with CKAN. If one of the functions it contains is needed, it is called on the page where the result of the function is used.
If a dataset is read, it can be stored as a variable, as the function returns an object. It can be output to the page in Orbital to show what the dataset contains, or saved to a variable to used with another function.
Example:
$this->load->library(‘../bridge_applications/ckan’);
$datasets = $this->ckan->read_datasets();
$datasets is set to the result of the ckan function. What it is set to depends on the datasets in CKAN. In this example, it returns:
array(1) { [0]=> object(Dataset_Object)#362 (6) { ["_title":protected]=> string(11) "********" ["_uri_slug":protected]=> string(38) "********" ["_creators":protected]=> array(1) { [0]=> string(17) "********" } ["_subjects":protected]=> array(0) { } ["_date":protected]=> int(1358507313) ["_keywords":protected]=> array(3) { [0]=> object(stdClass)#95 (6) { ["vocabulary_id"]=> NULL ["display_name"]=> string(12) "********" ["name"]=> string(12) "********" ["revision_timestamp"]=> string(26) "2013-01-18T11:16:59.137985" ["state"]=> string(6) "active" ["id"]=> string(36) "********" } } } }
*Some results are starred out.
As this example only includes one dataset, the result is an array with the dataset as its only entrant.
This is converted to the standard format used in Orbital. This standard format is used so that every application Orbital links to has a standard input for data to be sent to. so any application can theoretically talk to any other application through Orbital.
The SWORD library, used for SWORD endpoint data entry into ePrints, takes this standard format as input and formats it to the appropriate format before sending it to the ePrints endpoint. The theory here is the same as before; it is a php library for a bridge application. It takes the data and uses the endpoint to create a record via SWORD.
Example:
$this->sword->create_sword($dataset);
The dataset taken from CKAN is fed into the SWORD library and sent to ePrints to create a new ePrint from the dataset. This is done by using simpleXML to build an XML SWORD compliant object that can be sent via a http curl request to the ePrints SWORD endpoint. The result of this is a new entry in ePrints, via SWORD, from the data retrieved from CKAN.
The code is hosted on GitHub and can be found here:
https://github.com/lncd/Orbital-Bridge/tree/develop/src/application/bridge_applications