[ckan-dev] MIN_TAG_LENGTH

Ian Ward ian at excess.org
Fri Oct 30 13:45:44 UTC 2015


Hello Harald,

You can customize the validation on tags on your CKAN site to allow
different characters and minimum lengths with an IDatasetForm plugin.
Stefan mentions that this would make it harder to harvest your
datasets to other CKAN instances. If that's a concern for you you
could also store your tags in an extra field with a custom schema
instead of ussing the core tags field. So, you do have a couple
options.

I'd definitely avoid monkey patching, since CKAN's plugins already let
you do what you're looking for.

Ian

On Fri, Oct 30, 2015 at 9:29 AM, Stefan Oderbolz
<stefan.oderbolz at liip.ch> wrote:
> Hi Harald,
>
>> What is the reason that not MIN_TAG_LENGTH = 1?
>
>
> I don't know why this exists, my guess is that it has to do with the Solr
> search, as all the tags are indexed and could create wrong search results.
> Why not use something like chemical-formula-c?
> Please consider the use case that someone else wants to harvest your data,
> they might have to change this MIN_TAG_LENGTH. And depending on the context
> "c" could mean different things.
>
>
>>
>> What is the proper way to override this constant?
>
>
> You could monkey-patch it, but I would advice against it.
>
>>
>> Related: Why can't tags contain non-aphanumeric characters other than
>> [_-.]? ( "Si(OH)4" would be nice.)
>
>
> This is mainly because the tag is used as a URL slug. Nowadays there is not
> strictly a limitation to alphanummeric characters in URLs, but it's still
> better not to use them I guess. But you could use a tag vocabulary and
> change the display_name of the tag.
>
> - Stefan
>
> --
> Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
> Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>



More information about the ckan-dev mailing list