Home /Modules/tutorial/13-metadata-class.md

13-metadata-class.md

tutorial/13-metadata-class.md · 150 line(s) · markdown

Lesson 13 — The Metadata Class standard

Series: index · prev: 12 — Putting it together

The earlier lessons built behavior. This one is about a different kind of class: one whose job is to state who made a thing, under what authority, and with what intent. SLeeLa calls this the Metadata Class standard, or the metapattern. It is defined normatively in SLEELA.syntax §15 and is a working rule in every shipping library family.

A metadata class carries no runtime logic. It is a statement of record — the provenance and standing of a unit of work — so a GUI, loader, or catalog can read it and, where appropriate, override it.

Who is expected to write one

The standard sets an expectation by class of intellect, not a compiler gate:

The higher the standing of the code, the more complete its self-description. That is the "pace" the metapattern sets.

The record — eleven catalogued attributes

Each field has a matching get/set pair. Keep the comment header verbatim so the block stays greppable across the tree. This is the real block from lib/codecs/SLCodecMidi.sleela:

  < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
  << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
     or catalog can read and (where appropriate) override each codec's record.
     Values are faithful to the codec's real origin where publicly known. >>
  String metaVersion = "1.0.0";
  int metaId = 17;
  String metaAuthor = "MIDI Manufacturers Association";
  String metaDate = "2026-09-28";
  String metaCopyright = "Open specification";
  String metaTrademark = "MIDI";
  String metaCorporation = "MIDI Manufacturers Association";
  String metaOrigin = "International";
  String metaBirthDate = "1983";
  int metaScienceRating = 10;
  String metaNationalSchedule = "MMA MIDI 1.0 / SMF";

The comment header uses the angle-bracket style (< / <<) that is the go-forward house style (see SLEELA.syntax §1.1). The existing lib/codecs/* sources still carry the legacy // header; new metadata classes use the form shown here. Keep the header text verbatim.

FieldMeaning
metaVersionRecord version (MAJOR.MINOR.PATCH).
metaIdStable registry id.
metaAuthorOriginating author or body.
metaDateRecord date (YYYY-MM-DD).
metaCopyrightCopyright / licensing posture.
metaTrademarkTrademark, or "none".
metaCorporationStewarding corporation or organization.
metaOriginJurisdictional origin (see below).
metaBirthDateWhen the subject came into being.
metaScienceRatingMaturity/robustness, 1..10.
metaNationalScheduleGoverning standard/specification.

Framing for a mode of business

Four dimensions a legal, administrative, or executive reviewer reads:

A worked example

A small executive-grade metadata class for a fictional data format. Note the accessors and the honest, citable values:

#sleela 2.1
< A metadata class: record only, no runtime behavior. >
class AcmeArchiveMeta {
  int id() { return 1; }
  String name() { return "ACME Archive"; }

  < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
  << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
     or catalog can read and (where appropriate) override each record.
     Values are faithful to the subject's real origin where publicly known. >>
  String metaVersion = "1.0.0";
  int metaId = 1;
  String metaAuthor = "ACME Standards Group";
  String metaDate = "2026-10-23";
  String metaCopyright = "Open specification";
  String metaTrademark = "none";
  String metaCorporation = "ACME Corporation";
  String metaOrigin = "International";
  String metaBirthDate = "2026";
  int metaScienceRating = 7;
  String metaNationalSchedule = "ACME-STD-0001";

  String getMetaVersion() { return metaVersion; }
  void setMetaVersion(String v) { metaVersion = v; }
  String getAuthor() { return metaAuthor; }
  void setAuthor(String v) { metaAuthor = v; }
  String getOrigin() { return metaOrigin; }
  void setOrigin(String v) { metaOrigin = v; }
  String getNationalSchedule() { return metaNationalSchedule; }
  void setNationalSchedule(String v) { metaNationalSchedule = v; }
  int getScienceRating() { return metaScienceRating; }
  void setScienceRating(int v) { metaScienceRating = v; }
  < ... remaining get/set pairs follow the same shape. >
}

A catalog can now read getNationalSchedule() for the legal schedule, getOrigin() for the scope, and getAuthor()/getMetaVersion() for provenance — and a privileged caller can setNationalSchedule(...) when a record is revised.

The one hard rule

Values are faithful to the subject's real origin where publicly known. Unknown values use "none" or "unknown", never a guess presented as fact. Overriding a legality or schedule field is a privileged act and should be logged by the caller; the metadata class itself does not police it. Honesty of the record is what lets the higher classes of SLeeLa rely on it to set the pace.

Where to look next