Skip to content

Metadata grammar

Leon Starr edited this page Jul 23, 2026 · 11 revisions

This example metadata section is taken from an older version of the Elevator Management domain's class model.

metadata
    Title : Elevator Management Class Model
    Author : Leon Starr
    Document ID : mint.elevator3.td.1
    Version : 3.4.0
    Creation date : June 21, 2018
    Modification date : December 8, 2022
    Organization : Model Integration, LLC / www.modelint.com
    Copyright notice > MIT
    Organization logo > mint

Now let's see how the grammar excerpt below defines the overall structure.

// Metadata
metadata = metadata_header data_item*
metadata_header = "metadata" EOL* // Metadata header
data_item = INDENT item_name SP* (resource_item / text_item) EOL* // Metadata item
item_name = iword (delim word)* // Meta data item starts with initial cap
resource_item = '>' SP* word (delim word)* // Resource is a name
text_item = ':' SP* r'.*' // Field content can be any text

The metadata section starts with an unindented header which is just the keyword metadata.

This header is followed by any number of data items, each indented and naming either an item or a resource.

Item

Document ID : mint.elevator3.td.1

The name of an item is followed by a colon and a text_item which is any string you want to supply. The single white space on each side of the colon is for readability, but not required by the grammar.

Resource

    Copyright notice > MIT

Here the name of the item is followed by a > symbol and a resource_item. The grammar itself does not resolve the resource to a file name, but the information is passed along to whatever Blueprint module uses it.

For example, the flatland module passes the name MIT to the tablet-svg module which resolves it to a file name in the users ~/.config/mi-tablet/images directory using the dictionary defined in the ~/.config/mi-tablet/images.yaml file.

Unlike an item, the text desriving a resource_item is not an arbitrary string.

Clone this wiki locally