[ckan-dev] Linking Dataset by Resource Search in the API

Ian Ward ian at excess.org
Fri Dec 5 20:24:56 UTC 2014


On Fri, Dec 5, 2014 at 2:50 PM, Alec Bennett <apbennett at alaska.edu> wrote:
> Hello all,
> I'm working on an issue where we're trying to display some basic info
> from a Dataset and create a link back to the CKAN pages for that
> Dataset based on a page displaying Resource information (from an API
> search).  I can search for the Resource I want and display it just
> fine via the API, but I can't seem to find a way to associate a search
> for a Resource back to a Dataset to get the metadata I'm wanting.
>
> Is there a common field shared, like a foreign key, or is there a
> better method to do what I'm trying to do?

I believe this is now fixed on master, and will be fixed on the
upcoming 2.3 release. Resources used to return a resource group id,
which is an internal id that doesn't help API users at all (there's
nothing you can query via the API with a resource group id). Now
resource_show returns the ids for the datasets they belong to instead.

Ian



More information about the ckan-dev mailing list