This page describes the format of the content model definitions in the config/content_models.yml file.
A content model consists of a model name and three sections
(required
, recommended
, and optional
). Each of the three sections
contains an array of zero or more field definitions.
Using the "Item" model as an example:
Item:
required:
- name: 'object_type'
uri: 'http://purl.org/dc/terms/type'
label: 'Object Type'
type: :ControlledURIRef
- ...
recommended:
- ...
optional:
- ...
If a section has no field definitions, an empty array can be indicated, as in the "recommended" and "optional" sections for the "Page" model:
Page:
required:
- name: 'page'
uri: 'http://purl.org/spar/fabio/hasSequenceIdentifier'
label: 'Page Number'
type: :TypedLiteral
recommended: []
optional: []
Each field definition has the following required attributes:
name
- The name of the attribute, used as an identifieruri
- A URI describing the type of the attributelabel
- A human-readable name for the attribute, displayed in the GUItype
- The React component used to display the field in the GUI
A field definition may also have the following optional attributes:
repeatable
- Set asrepeatable: true
to indicate that a field can have multiple values. If not set, the field may only have one value.vocab
- used for fields that have a controlled vocabulary, where the value is the identifier for vocabulary on the vocabulary serverterms
- used with the "vocab" attribute to limit the vocabulary terms that are displayed in the GUI. Terms in the array (specified by the "label" attribute) will be displayed. If this attribute is not provided, all terms from the vocabulary are displayed.edit_only
- Set asedit_only: true
to indicate that the field should only be displayed in the metadata edit form, not on the item detail page.