[ckan-dev] Core Field "type"

Sean Hammond sean.hammond at okfn.org
Mon Nov 12 12:58:15 UTC 2012


> The core field "type" appears in the schema [1] and you can also write a
> string to it an read it back. However, I couldn't find an official
> meaning. We are considering exploiting this field for differentiating
> packages with data, docs and apps, that we all want to jam into the same
> ckan instance. Does this clash with the intention of the field?

Which schema are you talking about? default_package_schema?  Someone
else might know better, but I believe package types are used for the
IDatasetForm plugin interface:

http://docs.ckan.org/en/latest/writing-extensions.html?highlight=idatasetform#ckan.plugins.interfaces.IDatasetForm

Different IDatasetForm plugins can register themselves as handlers for
different package types. So you can have different types of dataset with
different forms, schemas, etc.

As far as I know that's all it's used for but I could be missing
something.

So your intention does sound like it fits with the intended use of this
field.

But especially for apps, you might also be interested to know about
CKAN's "Related Items" feature. You can add links to apps, articles,
papers, visualizations, etc. that are related to a dataset. The URLs for
the web interface are:

/dataset/{NAME}/related/new     Add a related item to a dataset
/dataset/{NAME}/related         See a dataset's related items
/apps                           Browse related items on the site

You can also add related items that do not belong to a particular
dataset using the action API.

You can mark some related items as "featured" and access these from your
templates. That's what we've done to show featured related items on the
front page of the new version of publicdata.eu:

http://pdeu.staging.ckanhosted.com/




More information about the ckan-dev mailing list