Encoding of Sz Metadata
A single metadata (“metadatum”) is represented by a triple: a symbol representing the type, a symbol representing the key, and either a string or a list that represent the value.
The key symbol must be “quoted”, i.e. for the key “title”: (quote title). This property may be relaxed in future versions of the Zettelstore.
The symbol depends on the metadata key type. The value also depends somehow on the key type: a set of values is represented as a list, all other values are represented by a string, even if it is a number.
The following table maps key types to symbols and to the type of the value representation.
Key Type | Symbol | Value |
Credential | CREDENTIAL | string |
EString | EMPTY-STRING | string |
Identifier | ZID | string |
IdentifierSet | ZID-SET | list |
Number | NUMBER | string |
String | STRING | string |
TagSet | TAG-SET | list |
Timestamp | TIMESTAMP | string |
URL | URL | string |
Word | WORD | string |
WordSet | WORD-SET | list |
Zettelmarkup | ZETTELMARKUP | string |
If the value is represented as a list, its first element is the symbol list, and all other elements are strings with the appropriate values.
ListValue = (list String1 String2 … Stringn ).
Examples:
- The title of this zettel is represented as: (EMPTY-STRING (quote title) "Encoding of Sz Metadata")
- The tags of this zettel are represented as: (TAG-SET (quote tags) (list "#api" "#manual" "#reference" "#zettelstore"))