Skip to content
llivermore edited this page Jul 7, 2015 · 11 revisions

Inselect supports user-defined templates using YAML - a format that is relatively easy to understand and edit.

Some example templates for current NHM projects are available in a GitHub repository.

You can get the latest release of all these templates from GitHub - simply download the latest zip file and extract it to somewhere convenient. In Inselect - 'Edit' / 'Select template’ allows you to pick a .inselect_template file. ‘Edit' / 'Default template’ selects the built-in ‘Simple Darwin core terms’ template that was used in previous release of Inselect.

Contributing template files

For the same reasons as making our software open-source, we think that there is great benefit in having the template files public and easily accessible and we propose to add templates for your workflows, should you require them, to the GitHub repository. Having all the template files in this repository makes it possible for a future release of Inselect to connect to the GitHub repository and directly fetch the current versions of templates, which will make it easier to disseminate changes in templates and to keep computers in sync.

Core Template Data Overview

There are five top level keys:

  • Name - the name of the template as it will appear in Inselect
  • Object label - the naming convention of cropped files (which can refer to field values)
  • Thumbnail width pixels
  • Cropped file suffix
  • Fields - data entry fields for the Inselect user

Detailed Information

Fields allow a user to record data about an image in the Objects view. They can consist of the following:

  • Name Required.

  • Object label Optional. A string that defines how Inselect will assemble the file names of cropped object images and of the names shown on Object view grid. Text between curly braces ({ and }) will be substituted with the value of that field for that crop. For example, if a template contains the fields Specimen number and Family, the Object label could be {Specimen number}-{Genus}. For an Inselect document with three crops with a Specimen number of 1, 2 and 3 and each with a Family of Coleoptera, the saved crops would be called 1-Coleoptera.jpg, 2-Coleoptera.jpg and 3-Coleoptera.jpg.

    • The special label {ItemNumber} will be substituted with the numerical index of that crop.
    • For fields with a Choices with data, the hidden data value can be accessed by appending -value to the field name.
    • Defaults to {ItemNumber}.
  • Thumbnail width pixels Optional. A number between 1024 and 16384 inclusive. Defaults to 4096.

  • Cropped file suffix Optional. One of .bmp, .jpeg, .jpg, .png, .tif, .tiff. Defaults to .jpg.

  • Fields A list of mappings for which the following can be used.

    • Name Required.

    • Label Optional. Will be displayed in the UI instead of Name

    • URI Optional. Should be a valid URL. Used for defining a specific syntax or a namespace (e.g. Darwin Core classes)

    • Mandatory Optional. Should be either true or false. If true the user must enter a value for this field.

    • Choices Optional. A list of unique strings from which the user can choose.

    • Choices with data Optional. A list of unique strings from which the user can choose, together with hidden data values. Choices and Choices with data are mutually exclusive.

    • Parser Optional. One of the following

      • date A string in the form YYYY-M[M]-D[D].

      • float A floating point number.

      • float_ge0 A floating point number is greater than or equal to zero.

      • float_gt0 A floating point number that is greater than zero.

      • four_digit_int A positive integer with exactly four digits.

      • int An integer.

      • int_ge0 An integer that is greater than or equal to zero.

      • int_gt0 An integer that is greater than zero.

      • latitude A latitude in one of a number of formats:

        • -41.38
        • -41.38°
        • 41.38° S
        • 41 22.8 S
        • 41 22 48 S
        • 41:22:00 S
        • 41:22:48.03
        • 41 22' 48" S
        • 41 22' 48'' S
        • 41°22'48"S
        • 41°22′48″S
      • longitude A longitude - see latitude for a list of acceptable formats.

      • one_or_two_digit_int A positive integer with either one or two digits.

      • sparse_date A string in one of the forms:

        • YYYY
        • YYYY-M[M]
        • YYYY-M[M]-D[D]
    • Regex parser Optional. A regular expression. Values that do not match the regular expression are considered to be invalid. Regex parser and Parser are mutually exclusive.

Clone this wiki locally