Skip to content

Custom Checks in Headers Config

Cole Herman edited this page Jun 22, 2026 · 11 revisions

There's 4 ways to check values under a header.

Checking values under a header:

1. string

A string check lets you specify exactly what a value should be for every cell in a column (under a header). For example, if I know that the license for a particular collection will always be "http://creativecommons.org/licenses/by-nc-nd/4.0/", then I can write a check to make sure it's that.

Under the license header, I would write this:

license:
  - string: http://creativecommons.org/licenses/by-nc-nd/4.0/
    which: all

The license is referring to the header I'm checking values for, the string shows what it should be, and the which specifies which values to apply it to (you can assume this will always be all1).

2. regex

A regex check lets you check that values for a field that can change have an acceptable format. For example, the identifier might always start with "PH395_UP" followed by some characters. We can do a regex check to make sure the values fit that, even without knowing the specific values in a given identifier. It follows the same format, looking like:

identifier:
  - regex: ^PH395_UP\S*$
    which: all

In this case, '\S*' is a regex part indicating there can be any number of non-whitespace characters at the end.

To check what your regex is doing, you could test it on regex101. For a tutorial, you could check regexone.

3. check_filenames_assets

This checks that filenames in your spreadsheet actually match the file names in your assets folder.

It looks like this:

file:
  - check_filenames_assets: ['file']

The value where 'file' is is the spreadsheet header under which you list the file names that should exist in assets.

4. identifier_file_match

This checks that the identifier for each work matches the file name. It's matching the identifier column values to the file column values, and you specify whatever file extension you have in the args.

It looks like:

file:
  - identifier_file_match: ['.tif']

You should replace .tif with whatever your files actually end with.

5. validate_controlled_vocab

This checks values in a field against valid vocabulary formats (according to the MAP) for a given controlled vocabulary.

It looks like:

creator:
  - validate_controlled_vocab: ['creator']
    which: all

So far there is only validation for creator and subject controlled vocabularies, but more are on the way. You don't have to specify any extra information here besides the column and, optionally, complex or regular works because we check automatically against all MAP vocabularies associated with a controlled vocabulary.

You can write as many checks as you need. In theory, you could fully customize every header with its own check to have 100% coverage of your data and ensure it never has errors.


1 'Which' indicates whether the check should be applied to all rows (all), complex-object parent rows, or complex-object child rows (item). This doesn't work as of 3/12/2026, so don't use anything except all.

Clone this wiki locally