GA4GH · Metaschema Processor

It's a compiler for your schema types

You author schemas the DRY way — types that inherit from a base. The processor compiles that source into self-contained JSON Schemas a plain validator can run, flattening the inheritance so nothing has to resolve a hierarchy at runtime.

The build pipeline

Source

What you write

# *-source.yaml — DRY, with a base type
Variation:
  abstract: true
  properties: [id, type,
               digest, expressions]
Allele:
  inherits: Variation
  properties: [location, state]

Like classes with extends — declare inheritance once, don't repeat base members.

Compile

What the processor does

id, typeinlined ← base
digest, expressionsinlined ← base
location, stateAllele

Inlines base members first (order preserved), resolves every $ref, and injects boilerplate like type: object.

Artifacts

What ships

id · type · digest · expressionsbase
location · stateown
◆ self-contained · no hierarchy to resolve
.jsonJSON Schema per type — the "bytecode" a validator runs
.rstReference docs per type — generated, human-readable

The type-system guarantees it enforces

GUARANTEE 01

Base members come first

Inlining preserves declaration order: inherited fields lead, the subtype's own fields follow.

stable field order
GUARANTEE 02

Subtypes stay substitutable

A subtype may narrow or annotate a field, but can't change an inherited name, type, const or default.

liskov substitution
GUARANTEE 03

Concrete types are sealed

Concrete schemas reject unknown fields — additionalProperties: false, or unevaluatedProperties: false when composed; abstract bases stay open.

closed / open
GUARANTEE 04

Abstract types don't instantiate

An abstract base compiles to its own schema, but nothing is built as one — subtypes reference it directly.

abstract base

The invariant that makes it safe

Declare inheritance once — and the compiler guarantees every subtype's data still validates against its base type's schema.

Concretely: → *-source.yaml (JSON Schema 2020‑12 + GKS conventions) compiles to standalone per-class JSON Schema + reStructuredText docs. "base type" = an abstract class · "substitutable" = a parent schema always validates a subclass instance (Liskov).