[ckan-dev] JSON Metadata Schema file for CKAN?

Ian Ward ian at excess.org
Mon Jul 7 22:07:58 UTC 2014


On Mon, Jul 7, 2014 at 4:25 PM, Aaron Couch <acinternets at gmail.com> wrote:
> hi Ian:
>
> Thanks for the quick response. That link looks helpful, but it is missing a
> lot of the fields that are in many CKAN implementations. For example:
> http://demo.ckan.org/api/3/action/package_show?id=adur_district_spending

Yes, that's right. ckanext-scheming is about customizing the fields
that users see in the form, validation and when viewing datasets on
the web page, so just those fields were included in the file I linked
to.

> Is there a place, maybe in CKAN core or a next repo, that has a full or
> fuller list of fields that I could create a JSON schema from?  This is the
> closest I could find in the code:
> https://github.com/ckan/ckan/blob/3f886918bcd09ae29fda216841f9d318c9ff6c87/ckan/logic/schema.py#L132

Yes, the ckan.logic.schema is the place to find the default lists of
validators and converters for each dataset and resource field. As
you've seen any CKAN instance can override those validators and add
their own fields, though. And when no custom schema is applied users
can also add arbitrary string values to resources and as many extras
as they like to the dataset.

Extensions like the datastore depend on being able to add extra
strings to hold their custom information.

Are you asking for a way to query a particular CKAN instance to find
out what fields it supports and what validation rules are applied?
There isn't anything like that at the moment, but that's part of what
I hope ckanext-scheming's data structure will provide: a data
structure that describes the most important information for every
field for each dataset type supported by a CKAN instance.

If you're asking for a description of every field that you see now in
datasets like the one you've linked, that's something that we really
need. I was hoping to add descriptions of the fields to the
package_create and resource_create API documentation, including the
read-only values that are generated by CKAN and mixed in with the user
data returned. Hopefully soon.

Ian



More information about the ckan-dev mailing list