Metadata

Syntax

Every node can have unlimited user-defined metadata.

Metadata is assigned using double-colon-separated key/value(s) pairs, with the value(s) (to the right of the colon) containing an optional timestamp.

purpose::This node describes Metadata in Urtext <Sun., Jun. 18, 2023, 05:16 AM EDT>
audience::Urtext user

Nodes can be searched and sorted by their metadata using Dynamic Definitions. Metadata entries “remember” their location, allowing them to double as contextual bookmarks.

Metadata keys must not contain whitespace, though dash and underscore characters are allowed. Values may include whitespace. Terminate metadata entries using either a new line or a semicolon. Using the semicolon option, several entries may be strung together on a single line:

one_key::some value; another_key::some_other_value <Thu., Sep. 10, 2020, 05:37 PM>;

Case Sensitivity

For comparison, filtering, and sorting purposes, metadata values are not case-sensitive by default. The exceptions are the following (see below):

Case sensitive values for additional keys can be added using the case_sensitive key in project_settings. The above will not be overriden.

System Keys

System keys are metadata keys Urtext generates automatically. They begin with a single underscore character, with only one exception, the title key.

There are a few reserved keys that Urtext uses:

  • title : Overrides the default node title or node title syntax. If not added manually, title will be set automatically to the node’s title.
  • _inline_timestamp : Assigned as an implicit key to any inline timestamp.
  • _newest_timestamp : Assigned to the most recent dated timestamp in the node.
  • _oldest_timestamp : Assigned to the oldest dated timestamp in the node.
  • _contents : Assigned to the text contents of the node.

For uses of these keys, see Dynamic Definitions.

Propagating Metadata to Children and Descendants

The * character assigns metadata to children:

To assign the metadata to all children (but not the node containing the metadata):

*keyname::This keyname and value will be assigned to all direct children

To include also the node containing the metadata:
To propagate the metadata to all descendants (but not the node containing the metadata):

To include also the node containing the metadata:

+*keyname::This keyname and value will be assigned to its
containing node and all direct children

To propagate metadata to all descendants, including those included as Node Pointers, use two asterisks:

**keyname::This keyname and value will be assigned to all descendants, including any included as node pointers.

Again to include the containing node, add a plus sign + first:

+**keyname::This keyname and value will be assigned to the containing node and all descendants, including any included as node pointers.

Hash Key

The hash character (#) adds a single metadata value without using a key name or metadata assigner (::). Its purpose is to provide a shorthand for key names used very often, or to make the full metadata syntax unnecessary in cases where no more than one key name is needed.

By default, the hash character is assigned the key name “keyword”. It can be modified using the hash_key key in project_settings. Whitespaces are not permitted when using the hash character and will end the entry, though underscore characters may be substituted.

#some_value

The above is equivalent to keyword::some_value

Timestamps can be added to the hash metadata by using a dash and inserting the timestamp:

#some_value<Wed., Jan. 02, 2024, 08:37 AM EST>
The plus and asterisk symbols may also be used on hash metadata just as on the full metadata syntax:
+**#some_value<Wed., Jan. 02, 2024, 08:37 AM EST>
No semicolon is needed to terminate hash metadata entries. A single whitespace terminates the entry.

Nodes as Metadata Values

Metadata values can be nodes, which in turn may contain metadata with other nodes as values, nested arbitrarily deep. There are two ways to accomplish this:

Node Link as Metadata Value

Provide a link to an (existing) node as the value for a metadata key:

comments::| A node containing comments >

Bracket Node as Metadata Value

Insert a bracket node directly as the value for a metadata key

comments::{ A node containing comments }

Browsing Metadata

[ added soon ]