-
Notifications
You must be signed in to change notification settings - Fork 16
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:
-
NameRequired. -
Object labelOptional. 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 numberandFamily, theObject labelcould be{Specimen number}-{Genus}. For an Inselect document with three crops with aSpecimen numberof1,2and3and each with aFamilyofColeoptera, the saved crops would be called1-Coleoptera.jpg,2-Coleoptera.jpgand3-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-valueto the field name. - Defaults to
{ItemNumber}.
- The special label
-
Thumbnail width pixelsOptional. A number between 1024 and 16384 inclusive. Defaults to 4096. -
Cropped file suffixOptional. One of.bmp,.jpeg,.jpg,.png,.tif,.tiff. Defaults to.jpg. -
FieldsA list of mappings for which the following can be used.-
NameRequired. -
LabelOptional. Will be displayed in the UI instead ofName -
URIOptional. Should be a valid URL. Used for defining a specific syntax or a namespace (e.g. Darwin Core classes) -
MandatoryOptional. Should be eithertrueorfalse. Iftruethe user must enter a value for this field. -
ChoicesOptional. A list of unique strings from which the user can choose. -
Choices with dataOptional. A list of unique strings from which the user can choose, together with hidden data values.ChoicesandChoices with dataare mutually exclusive. -
ParserOptional. One of the following-
dateA string in the formYYYY-M[M]-D[D]. -
floatA floating point number. -
float_ge0A floating point number is greater than or equal to zero. -
float_gt0A floating point number that is greater than zero. -
four_digit_intA positive integer with exactly four digits. -
intAn integer. -
int_ge0An integer that is greater than or equal to zero. -
int_gt0An integer that is greater than zero. -
latitudeA 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
-
longitudeA longitude - seelatitudefor a list of acceptable formats. -
one_or_two_digit_intA positive integer with either one or two digits. -
sparse_dateA string in one of the forms:YYYYYYYY-M[M]YYYY-M[M]-D[D]
-
-
Regex parserOptional. A regular expression. Values that do not match the regular expression are considered to be invalid.Regex parserandParserare mutually exclusive.
-