The tables every browser lab and the playground run on. The page builds them in your browser from four published files, so every learner starts from the same rows, and a reload starts fresh.
Six tables describe the animals: taxa, species, countries, species_countries, sources and species_sources, read from /v1/species.parquet and /v1/countries.parquet. Two more hold the lab's sample of open GBIF records: datasets and occurrences, read from the lab data. A record is one observation of an animal at a place and time; the course counts records, and never presents them as where an animal lives.
The diagram
An entity–relationship diagram (ERD) draws each table as a box with its columns, and each foreign key as a line to the table it points at. PK marks the primary key, FK a foreign key, UK a unique key. The ends of a line say how many rows meet there: || exactly one, |o zero or one, o{ zero or more, |{ one or more. The end with the crow's foot is the table that holds the foreign key.
Eight tables: taxa, species, countries, species_countries, sources and species_sources from schema v1, plus datasets and occurrences, the sample of GBIF records. Each line joins a foreign key to the table it points at. Open the diagram alone to zoom in.
The relationships, in words
Each taxa row points at zero or one taxa row (another row of the same table); a taxa row has zero or more taxa rows: “parent of”.
Each species row points at exactly one taxa row; a taxa row has zero or more species rows: “genus of”.
Each species_countries row points at exactly one species row; a species row has zero or more species_countries rows: “recorded in”.
Each species_countries row points at exactly one countries row; a countries row has zero or more species_countries rows: “has records of”.
Each species_sources row points at exactly one species row; a species row has zero or more species_sources rows: “fields from”.
Each species_sources row points at exactly one sources row; a sources row has one or more species_sources rows: “supplies”.
Each occurrences row points at exactly one species row; a species row has zero or more occurrences rows: “recorded as”.
Each occurrences row points at exactly one datasets row; a datasets row has zero or more occurrences rows: “publishes”.
Each occurrences row points at zero or one countries row; a countries row has zero or more occurrences rows: “contains”.
A record's country is optional. country_code_gbif keeps GBIF's code as delivered, and country_code holds it only when it is a row of countries, so GBIF's ZZ (unknown) and XZ (high seas) never break the foreign key.
The view species_taxonomy
species_taxonomy (species_id, class, order_name, family, genus) gives each species its genus, family, order and class in one row, by walking taxa from the genus up through each parent_name. A view is a stored query, not a table: it holds no rows of its own, and reading it runs the query. That is why it isn't drawn.
The data dictionary
Every column: its type, its keys, what it means, and where its values come from.
taxa
Column
Type
Key
Meaning
Source
name
VARCHAR
PK
Agalychnis, Phyllomedusidae, Anura, Amphibia
critwire /v1/species.parquet: taxonomy from Catalogue of Life, else critwire base
taxon_rank
VARCHAR
class, order, family or genus
critwire /v1/species.parquet: taxonomy from Catalogue of Life, else critwire base
parent_name
VARCHAR
FK
the taxon one rank up; NULL for a class
critwire /v1/species.parquet: taxonomy from Catalogue of Life, else critwire base
species
Column
Type
Key
Meaning
Source
id
INTEGER
PK
critwire's own id, never reused
critwire /v1/species.parquet; each field's source is in species_sources
slug
VARCHAR
UK
red-eyed-tree-frog
critwire /v1/species.parquet; each field's source is in species_sources
scientific_name
VARCHAR
UK
Agalychnis callidryas
critwire /v1/species.parquet; each field's source is in species_sources
common_name
VARCHAR
Red-eyed Tree Frog
critwire /v1/species.parquet; each field's source is in species_sources
genus
VARCHAR
FK
a taxa row of rank genus
critwire /v1/species.parquet; each field's source is in species_sources
range_status
VARCHAR
ok, no-open-records or identity-unsettled
critwire /v1/species.parquet; each field's source is in species_sources
photo_url
VARCHAR
NULL when there is no photo
critwire /v1/species.parquet; each field's source is in species_sources
photo_credit
VARCHAR
who took the photo
critwire /v1/species.parquet; each field's source is in species_sources
photo_license
VARCHAR
CC BY-SA 4.0, CC BY 2.0, CC0, Public domain
critwire /v1/species.parquet; each field's source is in species_sources
photo_page
VARCHAR
the photo's Wikimedia Commons page
critwire /v1/species.parquet; each field's source is in species_sources
iucn_id
INTEGER
UK
IUCN Red List taxon id
critwire /v1/species.parquet; each field's source is in species_sources
gbif_id
BIGINT
UK
GBIF backbone taxon key
critwire /v1/species.parquet; each field's source is in species_sources
col_id
VARCHAR
UK
Catalogue of Life id
critwire /v1/species.parquet; each field's source is in species_sources
wikidata_id
VARCHAR
UK
Wikidata item
critwire /v1/species.parquet; each field's source is in species_sources
inaturalist_id
INTEGER
UK
iNaturalist taxon id
critwire /v1/species.parquet; each field's source is in species_sources
ncbi_id
INTEGER
UK
NCBI Taxonomy id
critwire /v1/species.parquet; each field's source is in species_sources
countries
Column
Type
Key
Meaning
Source
code
VARCHAR
PK
ISO 3166-1 alpha-2, plus XK
critwire /v1/countries.parquet
name
VARCHAR
UK
Brazil
critwire /v1/countries.parquet
continent
VARCHAR
South America
critwire /v1/countries.parquet
region
VARCHAR
Americas
critwire /v1/countries.parquet
subregion
VARCHAR
South America
critwire /v1/countries.parquet
species_countries
Column
Type
Key
Meaning
Source
species_id
INTEGER
PK, FK
the animal
critwire /v1/species.parquet, range.countriesWithOpenRecords (GBIF, CC0 and CC BY records)
country_code
VARCHAR
PK, FK
recorded there in open records
critwire /v1/species.parquet, range.countriesWithOpenRecords (GBIF, CC0 and CC BY records)
sources
Column
Type
Key
Meaning
Source
name
VARCHAR
PK
Wikidata, Catalogue of Life, critwire base
critwire /v1/species.parquet, sources[]
license
VARCHAR
the license of what critwire took
critwire /v1/species.parquet, sources[]
retrieved
DATE
when critwire took it; NULL for critwire base
critwire /v1/species.parquet, sources[]
species_sources
Column
Type
Key
Meaning
Source
species_id
INTEGER
PK, FK
the animal
critwire /v1/species.parquet, sources[]
field
VARCHAR
PK
a path in the record, such as ids.col
critwire /v1/species.parquet, sources[]
source_name
VARCHAR
FK
who supplied that field
critwire /v1/species.parquet, sources[]
datasets
Column
Type
Key
Meaning
Source
dataset_key
VARCHAR
PK
GBIF's dataset id
GBIF registry: the download's datasets (datasets.csv)
title
VARCHAR
the dataset's own title
GBIF registry: the download's datasets (datasets.csv)
publisher
VARCHAR
the organization that published it
GBIF registry: the download's datasets (datasets.csv)
doi
VARCHAR
the dataset's DOI; NULL when it has none
GBIF registry: the download's datasets (datasets.csv)
license
VARCHAR
the license the dataset declares
GBIF registry: the download's datasets (datasets.csv)
occurrences
Column
Type
Key
Meaning
Source
id
BIGINT
PK
GBIF's record id
GBIF occurrence download, sampled (cited in the credits)
species_id
INTEGER
FK
the animal recorded
GBIF occurrence download, sampled (cited in the credits)
dataset_key
VARCHAR
FK
the dataset to credit
GBIF occurrence download, sampled (cited in the credits)
license
VARCHAR
CC0 1.0 or CC BY 4.0, the stricter of record and dataset
GBIF record and dataset licenses
basis_of_record
VARCHAR
HUMAN_OBSERVATION, PRESERVED_SPECIMEN, ...
GBIF occurrence download, sampled (cited in the credits)
longitude
DOUBLE
degrees east, WGS 84
GBIF occurrence download, sampled (cited in the credits)
latitude
DOUBLE
degrees north, WGS 84
GBIF occurrence download, sampled (cited in the credits)
coordinate_uncertainty_m
DOUBLE
metres; NULL when not given
GBIF occurrence download, sampled (cited in the credits)
country_code_gbif
VARCHAR
GBIF's code as delivered; ZZ unknown, XZ high seas
GBIF occurrence download, sampled (cited in the credits)
country_code
VARCHAR
FK
that code when it is a countries row, else NULL
country_code_gbif, when a countries row
year
INTEGER
NULL when the record has none
GBIF occurrence download, sampled (cited in the credits)
month
INTEGER
1 to 12; NULL when the record has none
GBIF occurrence download, sampled (cited in the credits)