-
Notifications
You must be signed in to change notification settings - Fork 17
Metadata templates
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.
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.
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
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 fieldsSpecimen number
andFamily
, theObject label
could be{Specimen number}-{Genus}
. For an Inselect document with three crops with aSpecimen number
of1
,2
and3
and each with aFamily
ofColeoptera
, the saved crops would be called1-Coleoptera.jpg
,2-Coleoptera.jpg
and3-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}
.
- The special label
-
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 ofName
-
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 eithertrue
orfalse
. Iftrue
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
andChoices with data
are mutually exclusive. -
Parser
Optional. One of the following-
date
A string in the formYYYY-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 - seelatitude
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
andParser
are mutually exclusive.
-