Zugriff auf Ressourcen per Web-Schnittstelle mit umfangreichen Suchmöglichkeiten. Weiterführende Information in der zentralen CKAN Data API und DataStore Dokumentation.
Die Daten-Schnittstelle (Data-API) kann über folgende Schnittstellenbefehle der CKAN Action API erreicht werden.
Erstellen | https://ckan.hoda.jp/de/api/3/action/datastore_create |
---|---|
Aktualisieren / Einfügen | https://ckan.hoda.jp/de/api/3/action/datastore_upsert |
Abfrage | https://ckan.hoda.jp/de/api/3/action/datastore_search |
Abfrage (mit SQL) | https://ckan.hoda.jp/de/api/3/action/datastore_search_sql |
https://ckan.hoda.jp/de/api/3/action/datastore_search?resource_id=99d77b20-e21d-4ad4-ae3d-925d18749742&limit=5
https://ckan.hoda.jp/de/api/3/action/datastore_search?resource_id=99d77b20-e21d-4ad4-ae3d-925d18749742&q=jones
https://ckan.hoda.jp/de/api/3/action/datastore_search_sql?sql=SELECT * from "99d77b20-e21d-4ad4-ae3d-925d18749742" WHERE title LIKE 'jones'
Eine einfache AJAX (JSONP) Abfrage des Data API mit jQuery.
var data = { resource_id: '99d77b20-e21d-4ad4-ae3d-925d18749742', // the resource id limit: 5, // get 5 results q: 'jones' // query for 'jones' }; $.ajax({ url: 'https://ckan.hoda.jp/de/api/3/action/datastore_search', data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.result.total) } });
import urllib url = 'https://ckan.hoda.jp/de/api/3/action/datastore_search?resource_id=99d77b20-e21d-4ad4-ae3d-925d18749742&limit=5&q=title:jones' fileobj = urllib.urlopen(url) print fileobj.read()