-
Notifications
You must be signed in to change notification settings - Fork 0
Metadata grammar
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.
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.
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.
Copyright 2023-2026 © Leon Starr under MIT Open Source License