Skip to content

World reference data from the catalog

Static regions plus catalog-backed continents, countries and subdivisions.

composed volume small Reference dataGeographyCatalog
Languages
deu eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table regions (
  code text
  name text
) values (
  ("APAC", "Asia-Pacific"),
  ("EMEA", "Europe, Middle East and Africa"),
  ("AMER", "Americas")
)

table continents catalog(continent) (
  code text primarykey catalogField(column: "code")
  name text catalogField(column: "name")
)

table countries catalog(country, group: "G20") (
  iso2     text primarykey countryCode()
  name     text country()
  currency text currency()
)

table subdivisions language(deu) catalog(subdivision, parent: "BRA") (
  code text primarykey subdivision(format: "short")
  name text subdivision()
)

table sample_places rows 10 (
  id        int64 autoincrement primarykey
  continent text same(cat) continent()
  language  text languageName()
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

World reference data

A multi-table recipe that generates world reference data: a small static region table plus catalog-backed continents, countries and subdivisions.

What it demonstrates

  • Static table — regions is a values table with three literal rows.
  • Catalog tables — continents, countries and subdivisions each read their records from the catalog with catalogField or record smart types.
  • Table language — subdivisions declares language(deu), so its names are localized to German.
  • Catalog coherence — sample_places groups continent() under same(cat), the catalog coherence family, and writes languageName() alongside it.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output.

The recipe outputs CSV files: regions.csv, continents.csv, countries.csv, subdivisions.csv and sample_places.csv.

Guarantees

Each catalog table's primary key is unique and every row is a real record of the selected catalog type. Values are reference data, not generated text.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

table:statictable:catalogcatalogFieldcountryCodecountrycurrencysubdivisioncontinentlanguageNamelanguage:tablesame:catalogprimary-keyautoincrement