Skip to content

Cards & schema

A card is the unit of meaning in Lemma: a typed, schema-validated specification of one scientific principle. Cards live in cards/<domain>/<id>.json and every card validates against schema/card.v0.1.json.

A real card

This is a shipping principle card from the corpus, verbatim:

{
"kind": "principle",
"id": "density-of-states",
"version": "1.3.0",
"name": "Electronic density of states",
"domain": "physics-condensed-matter",
"principles": [
"Bloch theorem",
"k-point Brillouin-zone sampling",
"spectral function"
],
"formulaTeX": "g(\\varepsilon) = \\sum_{n,\\mathbf{k}} w_{\\mathbf{k}} \\, \\delta(\\varepsilon - \\varepsilon_{n\\mathbf{k}})",
"conventions": [
"g(epsilon) >= 0",
"spin factor 2 absorbed (non-magnetic)"
],
"expectedLimits": [
"metallic systems: g(epsilon_F) > 0",
"smooth under k-mesh refinement (Methfessel-Paxton or Gaussian smearing)"
],
"references": [
"Ashcroft & Mermin, Solid State Physics, ch.8",
"Methfessel & Paxton 1989"
]
}

The fields

A principle card requires kind, id, version, name, principles, formulaTeX, conventions, expectedLimits, and references. domain and validationEnvelopes are optional.

FieldMeaning
kindThe structural discriminator: principle, ops, hypothesis, or unidentified. The kind is structural, not subject-area.
idStable, lowercase, hyphen-separated (^[a-z][a-z0-9-]*$). Part of the URL once published; never reused.
versionSemver. MAJOR for a breaking convention change, MINOR for added limits, PATCH for refs/typos.
nameHuman-readable name.
domainSubject area, hyphenated — e.g. physics-condensed-matter, chemistry-thermodynamics, numerical-methods. Must match the folder path.
principlesThe named principles the card rests on.
formulaTeXThe canonical equation in LaTeX (KaTeX-renderable).
conventionsSign / normalisation / unit conventions the output must follow.
expectedLimitsAsymptotic and boundary cases the output must respect.
referencesPrimary-source citations (not blog posts).
validationEnvelopes (optional)Numerical bounds the engine asserts at runtime — an object of { key: [min, max] } tuples in conventional units (e.g. { "gEarth_m_per_s2": [9.79, 9.83] }).

Licensing

The schema is MIT; the cards corpus is CC-BY 4.0. Anyone can read, fork the schema, and contribute a card — attribution is the only requirement.

One schema, many domains

kind is the structural discriminator — PrincipleCard covers physics, chemistry, biology, climate, mathematics, and engineering because the verification operations are universal. The subject area lives in domain. A card in optics, fluid dynamics, climate, or pure mathematics has the same shape.