Tool (class and UI) to simplify search on DIGIR server
JavaScript PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ex
ext
.htaccess
DigirQuery.php
DigirQueryTest.php
README
SimpleDigir.php
SimpleDigirTest.php
data.js
digir.js
index.php
service.php

README

SimpleDigir

This is a PHP library, php webservice wrapper and simple interface for performing searchs on DIGIR services.

DIGIR is a (old, bad and ugly) protocol for interchange of biological data in the Darwin Core format, and it's widely adopted. A nice list of Digir servers can be found at http://bigdig.ecoforge.net/wiki/ProviderStatus .

This library provides a wrapper for easily performing search on a digir server.

Usage:

<?php
$records = SimpleDigir::create($urlOfTheServer)->setResource('GBIF')->filter("ScientificName","like","Quercus%")->getResult();
foreach($records as $record) {
    echo $record->Species ;
}
?>

You can also list the resources of a digir server:

<?php
$recs = SimpleDigir::create($url)->setResource("*")->getResults();
foreach($recs as $rec) {
    echo $rec->code. " : " .$rec->name;
}
?>

Also there is a small query interface (very fragile).
<?php
$resources = DigirQuery::create("SELECT * from 'http://url.of/digi.php'")->getResults();
$records = DigirQuery::create("SELECT * from 'http://url.of/digi.php'.'name_of_resource'")->getResults();
$records = DigirQuery::create("SELECT * from 'http://url.of/digir.php'.'name_of_resouece' WHERE ScientificName like 'Quercus%'")->getResult();
?>

There is a simple interface on index.php build using Sencha (extJs), you can test it in http://diogok.net/digir and the service.php can receive a query by post and return it as json.