Skip to content

FAqT Service for CKAN Datasets

timrdf edited this page Jan 2, 2013 · 14 revisions

What is first

What we will cover

This page describes how to use the ckanclient within a FAqT Service to talk to a varying number of CKAN instances.

Let's get to it!

The following services implement how to communicate to a CKAN instance for every resource processed:

      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') 

What is next

Clone this wiki locally