-
Notifications
You must be signed in to change notification settings - Fork 7
FAqT Service for CKAN Datasets
timrdf edited this page Jan 2, 2013
·
14 revisions
- Getting Started
- CKAN - an introduction to using CKAN.
- FAqT Service - how to create one.
This page describes how to use the ckanclient within a FAqT Service to talk to a varying number of CKAN instances.
The following services implement how to communicate to a CKAN instance for every resource processed:
- by-ckan-installation.py parses the URI to get the base:
print 'processing ' + input.subject
base = input.subject.replace('/$','')
api = base
ckan = ckanclient.CkanClient(input.subject+'/api')
- lift-ckan.py uses the default ckanclient, but will change it if the dataset is attributed to a CKAN instance:
ckan = self.ckan
if len(input.prov_wasAttributedTo) > 0:
agent = input.prov_wasAttributedTo.first
print 'CKAN: ' + agent.subject
if ns.DATAFAQS['CKAN'] in agent.rdf_type:
ckan = ckanclient.CkanClient(input.prov_wasAttributedTo.first.subject+'/api')