3.1. Definition of metadata types
A metadata type is defined within the <MetadataType> element. This element must be the only child of the <Name> element, which contains the internal name of the metadata type. The internal name is also used to reference the metadata type from the serialization configuration. It must not contain any spaces.

3.1.1. Multilingualism

Furthermore the <MetadataType> element can contain any number of <language> elements as a child. These <language> elements translate the internal name of the metadata type into the respective language specified in the name attribute. Therefore, it makes sense to define at least one <language> element per metadata type so that its value can be displayed and used in the user interface. There can only be one <language> element per language and <MetadataType> element.
Example for the definition of the main title "TitleDocMain":
1
<MetadataType>
2
<Name>TitleDocMain</Name>
3
<language name="de">HauptTitel</language>
4
<language name="en">Main title</language>
5
</MetadataType>
Copied!
The order of the <language> elements does not matter, since they are called internally via the API using the values in the attribute name. If no language is defined, the API returns a NULL value and the application should use the internal name of the metadata type.

3.1.2. Persons

If the defined field is not a metadata but a person, an attribute type with the value person must be added to the <MetadataType> element.
Example for the definition of a person:
1
<MetadataType type="person">
2
<Name>Author</Name>
3
<language name="en">Author</language>
4
<language name="de">Autor</language>
5
</MetadataType>
Copied!

3.1.3. Corporate bodies

Corporate bodies are defined in a very similar way. For this purpose, the attribute type is assigned the value corporate.
Example for the definition of a corporate body:
1
<MetadataType normdata="true" type="corporate">
2
<Name>IssuingBody</Name>
3
<language name="de">Herausgebendes Organ</language>
4
<language name="en">Issuing body</language>
5
</MetadataType>
Copied!

3.1.4. Identifiers

If the anchor is to be saved in a separate file, a metadata is required that allows a reference between the anchor file and the file of the underlying structural unit. Therefore, in this case, the metadata type to be used for this purpose must have an attribute type with the value identifier.
Example for the definition of an identifier for the above referencing:
1
<MetadataType type="identifier">
2
<Name>CatalogIDDigital</Name>
3
<language name="de">PPN (digital)</language>
4
<language name="en">PPN</language>
5
</MetadataType>
Copied!

3.1.5. Internal metadata types

Metadata types that begin with an underscore _ are so-called internal metadata types. You can assign values to these metadata types when you create activities, for example, by means of an OPAC import defined in the rules set or by a definition in Goobi's projects.xml project configuration file. These internal metadata types are not returned with the structure type return lists - for example, DocStruct.getAllVisibleMetadata(). For example, they are not visible to users in the Goobi Metadata Editor and cannot be created as new metadata.
Example for the definition of an internal metadata type:
1
<MetadataType>
2
<Name>_uccID</Name>
3
<language name="en">UCC ID</language>
4
<language name="de">UCC ID</language>
5
</MetadataType>
Copied!

3.1.6. Authority data

Example for the definition of a metadata with authority data:
Metadata with the attribute normdata="true" has additional fields to describe a standard record by a URL, an identifier and the name of the database.
1
<MetadataType normdata="true">
2
<Name>Classification</Name>
3
<language name="en">Classification</language>
4
<language name="de">Klassifizierung </language>
5
</MetadataType>
Copied!
For definitions of persons, the attribute namepart can be set in addition to the normdata attribute described above. This enables additional fields to be activated in which further information such as life data or form of attachment can be entered.
Example for the definition of a person with additional fields:
1
<MetadataType type="person" namepart="true">
2
<Name>Author</Name>
3
<language name="en">Author</language>
4
<language name="de">Autor</language>
5
</MetadataType>
Copied!

3.1.7. Validation using regular expressions

For metadata types, validation rules can be defined as regular expressions. These validation rules can then be displayed and applied within a user interface. In the case of Goobi workflow, for example, this ensures that metadata can be validated correctly before a task with write permission on the metadata is completed by a user.
In addition, it is possible to create individual error messages that are displayed to the user in the event of a violation of the regular expression. Here, the placeholder {} can be used to use the entered value as part of the error message. If no individual error message exists for the user's currently selected language, a standard message is displayed instead.
Example of a validation rule for a metadata type:
1
<MetadataType>
2
<Name>DocLanguage</Name>
3
<language name="de">Sprache</language>
4
<language name="en">Language</language>
5
<language name="es">Idioma</language>
6
<validationExpression>[a-z]{3}</validationExpression>
7
<validationErrorMessage name="de">Der Wert muss einem dreistelligen iso 639 code entsprechen. Gefunden wurde jedoch '{}'.</validationErrorMessage>
8
<validationErrorMessage name="en">The value '{}' does not correspond to a three-letter iso 639 code.</validationErrorMessage>
9
</MetadataType>
Copied!
Last modified 8mo ago