CREATE SCHEMA IF NOT EXISTS annotation; CREATE SCHEMA IF NOT EXISTS clinical; CREATE SCHEMA IF NOT EXISTS ontology; CREATE SCHEMA IF NOT EXISTS provenance; CREATE SCHEMA IF NOT EXISTS raw; CREATE SCHEMA IF NOT EXISTS reference; CREATE SCHEMA IF NOT EXISTS resource; CREATE OR REPLACE VIEW provenance.release AS SELECT * FROM read_parquet('./provenance/release.parquet'); COMMENT ON VIEW provenance.release IS 'One row per (biocOnIce release, source, artifact): what this release was built from, file by file. This is what makes a release reproducible — resolve it here to each source''s own version, then query each table at that release. Durable by design: unlike Iceberg snapshot summaries it does not expire.'; COMMENT ON COLUMN provenance.release."release" IS 'biocOnIce release, YYYY.MM with zero-padded corrections YYYY.MM.NN. Zero-padded because ''2026.10.10'' sorts before ''2026.10.2'' and release ordering would otherwise invert.'; COMMENT ON COLUMN provenance.release."source" IS 'The provider, e.g. ensembl, ncbi_gene, obo. Which of its files or species a row describes is `artifact`.'; COMMENT ON COLUMN provenance.release."source_version" IS 'The upstream version in the SOURCE''S OWN vocabulary, never normalised: ''116'' for Ensembl, ''2026-08-06'' for a source that publishes no version. NULL only where nothing at all is knowable.'; COMMENT ON COLUMN provenance.release."version_method" IS 'How the version was determined: release_number, http_last_modified, etag, ftp_index_probe, retrieval_date, unavailable. ''unavailable'' is a legitimate value — a source that publishes no version is recorded as such, never given a fabricated one.'; COMMENT ON COLUMN provenance.release."retrieved_at" IS 'UTC timestamp at which the source was fetched.'; COMMENT ON COLUMN provenance.release."url" IS 'Canonical URL fetched.'; COMMENT ON COLUMN provenance.release."checksum" IS 'SHA-256 (hex) of the file as retrieved — the zip, where the source ships one — or the sha256 the source publishes for it (BEDbase). NULL where the URL was read directly with no local copy: see etag and last_modified.'; COMMENT ON COLUMN provenance.release."row_count" IS 'Rows landed from this artifact, as a cheap integrity check.'; CREATE OR REPLACE VIEW raw.ncbi__gene2ensembl AS SELECT * FROM read_parquet('./raw/ncbi__gene2ensembl.parquet'); COMMENT ON VIEW raw.ncbi__gene2ensembl IS 'NCBI gene2ensembl landed verbatim and whole: every organism NCBI knows, not only the ones we derive annotation for. NCBI''s ''-'' placeholder is read as NULL. Regenerated nightly upstream, so it has no release: the retrieval date is the version, per NLM''s own citation form.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."gene_id" IS 'NCBI Entrez GeneID.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."ensembl_gene_id" IS 'Ensembl stable gene id NCBI maps this Entrez gene to.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."rna_accession" IS 'RefSeq RNA accession.version.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."ensembl_rna_id" IS 'Ensembl transcript id.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."protein_accession" IS 'RefSeq protein accession.version.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."ensembl_protein_id" IS 'Ensembl protein id.'; COMMENT ON COLUMN raw.ncbi__gene2ensembl."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.ncbi__gene_info AS SELECT * FROM read_parquet('./raw/ncbi__gene_info.parquet'); COMMENT ON VIEW raw.ncbi__gene_info IS 'NCBI gene_info landed verbatim and whole — 71.5M records across 53,800 taxa, not only the ones we derive annotation for, since a third species should not cost a re-fetch. NCBI''s ''-'' placeholder is read as NULL. Pipe-separated fields are kept as published, unsplit: splitting is interpretation and belongs in transform. Regenerated nightly upstream, so the retrieval date is the version.'; COMMENT ON COLUMN raw.ncbi__gene_info."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ncbi__gene_info."gene_id" IS 'NCBI Entrez GeneID.'; COMMENT ON COLUMN raw.ncbi__gene_info."symbol" IS 'Default symbol. The nomenclature authority''s symbol where there is one, otherwise NCBI''s own; symbol_authority says which.'; COMMENT ON COLUMN raw.ncbi__gene_info."locus_tag" IS 'Submitter-assigned locus tag, e.g. b0001. Mostly prokaryotic.'; COMMENT ON COLUMN raw.ncbi__gene_info."synonyms" IS 'Alternate symbols, pipe-separated in one string as NCBI publishes them. Split at ''|'' to get ALIAS rows.'; COMMENT ON COLUMN raw.ncbi__gene_info."dbxrefs" IS 'Cross-references, pipe-separated ''Authority:id'' pairs, e.g. ''MIM:191170|HGNC:HGNC:11998|Ensembl:ENSG00000141510''. Split at the FIRST colon only: HGNC''s own ids embed one.'; COMMENT ON COLUMN raw.ncbi__gene_info."chromosome" IS 'Chromosome as NCBI names it, e.g. 17. May be a pipe-separated list for genes placed on more than one, or ''Un'' for unplaced.'; COMMENT ON COLUMN raw.ncbi__gene_info."map_location" IS 'Cytogenetic band, e.g. 17p13.1. Not a coordinate; for coordinates use annotation.exon.'; COMMENT ON COLUMN raw.ncbi__gene_info."description" IS 'Descriptive gene name, e.g. ''tumor protein p53''. This is the column OrgDb serves as GENENAME.'; COMMENT ON COLUMN raw.ncbi__gene_info."type_of_gene" IS 'NCBI gene type, e.g. protein-coding, ncRNA, pseudo. NCBI''s vocabulary, hyphenated — not Ensembl''s biotype vocabulary.'; COMMENT ON COLUMN raw.ncbi__gene_info."symbol_authority" IS 'Symbol as assigned by the nomenclature authority (HGNC, MGI), NULL where none has named the gene.'; COMMENT ON COLUMN raw.ncbi__gene_info."full_name_authority" IS 'Full name from the nomenclature authority, NULL where none.'; COMMENT ON COLUMN raw.ncbi__gene_info."nomenclature_status" IS '''O'' official, ''I'' interim, NULL where the gene is unnamed.'; COMMENT ON COLUMN raw.ncbi__gene_info."other_designations" IS 'Further names, pipe-separated. Free text, not symbols: not treated as ALIAS.'; COMMENT ON COLUMN raw.ncbi__gene_info."modification_date" IS 'Date this Gene record last changed, YYYYMMDD. Per-record, so it is not a version for the file as a whole.'; COMMENT ON COLUMN raw.ncbi__gene_info."feature_type" IS 'Feature type for records that are not genes, e.g. ''biological region''. NULL for ordinary genes.'; COMMENT ON COLUMN raw.ncbi__gene_info."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.ncbi__gene_history AS SELECT * FROM read_parquet('./raw/ncbi__gene_history.parquet'); COMMENT ON VIEW raw.ncbi__gene_history IS 'NCBI gene_history landed verbatim and whole: the tombstone list for every Entrez GeneID ever withdrawn. Landed but NOT YET INTERPRETED — nothing derives from it, because whether supersession (''merged into'') is modelled as a table, a typed retirement reason, or not at all is still open (issue #15, item 4). It is here so that question can be settled against real data rather than guessed at.'; COMMENT ON COLUMN raw.ncbi__gene_history."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ncbi__gene_history."gene_id" IS 'Entrez GeneID that discontinued_gene_id was merged INTO. NULL (NCBI''s ''-'') means the id was retired outright with no successor, which is the majority of this table.'; COMMENT ON COLUMN raw.ncbi__gene_history."discontinued_gene_id" IS 'The Entrez GeneID that no longer exists. This is what a stale identifier in an old analysis looks up as.'; COMMENT ON COLUMN raw.ncbi__gene_history."discontinued_symbol" IS 'Symbol the discontinued id carried when it was withdrawn.'; COMMENT ON COLUMN raw.ncbi__gene_history."discontinue_date" IS 'Date of withdrawal, YYYYMMDD. NCBI''s own clock, not a biocOnIce release.'; COMMENT ON COLUMN raw.ncbi__gene_history."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.bugsigdb__full_dump AS SELECT * FROM read_parquet('./raw/bugsigdb__full_dump.parquet'); COMMENT ON VIEW raw.bugsigdb__full_dump IS 'BugSigDB''s full_dump.csv landed verbatim: one row per curated microbial signature, flattened across study, experiment and signature. Every column is a string and nothing is split, per the raw contract — in particular the two member-list columns keep their '';'' and ''|'' nesting. BugSigDB''s ''NA'' placeholder is read as NULL, the same treatment NCBI''s ''-'' gets. Landed from a release TAG rather than the hourly devel export, so it is immutable and citable (each release has a Zenodo DOI). Licence CC BY 4.0, declared both in .zenodo.json and in the file''s own banner line.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."bsdb_id" IS 'BugSigDB signature id, e.g. ''bsdb:83/1/1''. Compound: study/experiment/signature. Unique per row (7,425 of 7,425 distinct at v1.3.1), so it is the natural key even though raw declares none.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."study" IS 'Wiki page name of the study, e.g. ''Study 83''.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."study_design" IS 'e.g. case-control, cross-sectional observational, laboratory experiment, prospective cohort.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."pmid" IS 'PubMed id of the source publication.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."doi" IS 'DOI of the source publication.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."url" IS 'Publication URL as curated.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."authors_list" IS 'Author list of the publication, free text.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."title" IS 'Title of the publication.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."journal" IS 'Journal name.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."year" IS 'Publication year. String, not an integer, because raw is landed unparsed.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."keywords" IS 'Curator keywords; frequently absent.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."experiment" IS 'Wiki page name of the experiment within the study, e.g. ''Experiment 1''. One study has many experiments; one experiment has many signatures.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."location_of_subjects" IS 'Geographic origin of subjects.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."host_species" IS 'Host organism, e.g. Homo sapiens. Not the microbes — those are the signature.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."body_site" IS 'Sampled body site as curated text.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."uberon_id" IS 'UBERON CURIE for body_site, e.g. UBERON:0001988.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."condition" IS 'Studied condition as curated text.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."efo_id" IS 'EFO CURIE for condition, e.g. EFO:0001073.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."group_0_name" IS 'Name of the control/reference group.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."group_1_name" IS 'Name of the group the signature describes.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."group_1_definition" IS 'Free-text inclusion criteria for group 1.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."group_0_sample_size" IS 'Subjects in group 0. String: not always numeric.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."group_1_sample_size" IS 'Subjects in group 1. String: not always numeric.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."antibiotics_exclusion" IS 'Antibiotic washout required for inclusion, e.g. ''3 months''.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."sequencing_type" IS 'Assay: 16S, WMS (whole metagenome shotgun), ''ITS / ITS2'', PCR.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."variable_region_16s" IS '16S hypervariable region, upstream column ''16S variable region''. Digits are CONCATENATED region numbers, not a number: ''34'' means V3-V4, ''4'' means V4, ''12'' means V1-V2. Do not cast this to an integer.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."sequencing_platform" IS 'Instrument/platform reported.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."data_transformation" IS 'e.g. relative abundances, raw counts, centered log-ratio.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."statistical_test" IS 'Test used for differential abundance.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."significance_threshold" IS 'Alpha, e.g. ''0.05''. String, unparsed.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."mht_correction" IS 'Whether multiple-hypothesis correction was applied: ''TRUE''/''FALSE'' as strings, since raw is unparsed.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."lda_score_above" IS 'LEfSe LDA score cutoff where one was used.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."matched_on" IS 'Comma-separated variables the groups were matched on, e.g. ''age,sex''.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."confounders_controlled_for" IS 'Comma-separated confounders adjusted for.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."pielou" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."shannon" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."chao1" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."simpson" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."inverse_simpson" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."richness" IS 'Direction this alpha-diversity metric moved in group 1: ''increased'', ''decreased'' or ''unchanged''. NOT a diversity value — there is no number here to plot. NULL where the study did not report the metric, which is the majority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."signature_page_name" IS 'Wiki page name of the signature within its experiment, e.g. ''Signature 1''.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."source_in_paper" IS 'Where in the publication the signature was read from, e.g. ''Table 2'', ''Figure 3''. Upstream column name is ''Source''; renamed here because `source` elsewhere in this catalog means the asserting authority.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."curated_date" IS 'Date of curation as published, e.g. ''10 January 2021''. Human-readable, not ISO 8601 — parsing it is a transform concern.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."curator" IS 'Wiki username of the curator.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."revision_editor" IS 'Wiki username of the last editor.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."description" IS 'Curator''s description of the signature.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."abundance_in_group_1" IS 'Direction of the signature: ''increased'' or ''decreased'' in group 1 relative to group 0. This is what makes a signature signed — the same taxa increased and decreased are different signatures.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."metaphlan_taxon_names" IS 'Signature members as MetaPhlAn lineages. TWO levels of nesting, kept verbatim: '';'' separates members, ''|'' separates ranks within one member''s lineage, with k__/p__/c__/o__/f__/g__/s__ rank prefixes. Splitting on ''|'' alone silently turns one taxon into seven.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."ncbi_taxonomy_ids" IS 'Signature members as NCBI taxon ids, same two-level nesting as metaphlan_taxon_names: '';'' between members, ''|'' up each member''s lineage from kingdom to the curated rank. The LAST element of each ''|'' group is the taxon actually reported; the rest are its lineage.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."state" IS 'Curation state. Only ''Complete'' appears: the export filters incomplete records upstream, so this is not a usable filter here.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."reviewer" IS 'Wiki username of the reviewer.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."export_timestamp" IS 'The export''s own self-declared timestamp, taken from the banner line of the CSV, e.g. ''2026-04-24_00:41_UTC''. In-band provenance: it is the only version marker when landing from the hourly devel export, which carries no tag.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."bugsigdb_version" IS 'The BugSigDBExports release tag this file came from, e.g. ''v1.3.1''. Raw is replaced wholesale per value of this column.'; COMMENT ON COLUMN raw.bugsigdb__full_dump."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.ensembl__gtf AS SELECT * FROM read_parquet('./raw/ensembl__gtf.parquet'); COMMENT ON VIEW raw.ensembl__gtf IS 'Ensembl GTF landed verbatim, one row per feature line. Deliberately has no merge key and no validity interval: a GTF line has no natural identity, and an Ensembl release is immutable, so this table is replaced wholesale per (taxon_id, genome_id, ensembl_release) and is idempotent under re-ingest. History here is the accumulation of releases, not a validity interval.'; COMMENT ON COLUMN raw.ensembl__gtf."seqname" IS 'GTF column 1, the sequence name.'; COMMENT ON COLUMN raw.ensembl__gtf."source" IS 'GTF column 2, the annotation source.'; COMMENT ON COLUMN raw.ensembl__gtf."feature" IS 'GTF column 3: gene, transcript, exon, CDS, five_prime_utr, three_prime_utr, start_codon, stop_codon, Selenocysteine.'; COMMENT ON COLUMN raw.ensembl__gtf."start" IS 'GTF column 4, 1-based inclusive.'; COMMENT ON COLUMN raw.ensembl__gtf."end" IS 'GTF column 5, 1-based inclusive.'; COMMENT ON COLUMN raw.ensembl__gtf."score" IS 'GTF column 6, ''.'' throughout Ensembl GTFs.'; COMMENT ON COLUMN raw.ensembl__gtf."strand" IS 'GTF column 7, ''+'' or ''-''.'; COMMENT ON COLUMN raw.ensembl__gtf."frame" IS 'GTF column 8. On a CDS row this is the reading-frame phase; ''.'' elsewhere.'; COMMENT ON COLUMN raw.ensembl__gtf."attribute" IS 'GTF column 9 verbatim, unparsed: the semicolon-separated key "value" list carrying gene_id, transcript_id, exon_number, tag and the rest. Kept whole so attributes nobody has needed yet can be extracted later without re-fetching the source.'; COMMENT ON COLUMN raw.ensembl__gtf."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ensembl__gtf."ensembl_release" IS 'Ensembl release this file came from, e.g. 116.'; COMMENT ON COLUMN raw.ensembl__gtf."landed_in" IS 'The biocOnIce release whose ingest landed these rows. Not a validity interval: raw is replaced per source version, not versioned.'; CREATE OR REPLACE VIEW reference.genome AS SELECT * FROM read_parquet('./reference/genome.parquet'); COMMENT ON VIEW reference.genome IS 'Genome assemblies. One row per assembly per organism per source: two providers may describe the same assembly, and neither may retire the other''s row. A taxon can have many (Ensembl 116: 359 assemblies over 276 taxa); is_canonical names the default one.'; COMMENT ON COLUMN reference.genome."genome_id" IS 'Assembly accession, e.g. GCA_000001405.29. Stable across releases. Ensembl publishes no accession for 13 old assemblies (turTru1, TETRAODON 8.0, ...); those carry the assembly name here instead.'; COMMENT ON COLUMN reference.genome."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN reference.genome."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).'; COMMENT ON COLUMN reference.genome."assembly_name" IS 'Provider''s assembly name, e.g. GRCh38.p14.'; COMMENT ON COLUMN reference.genome."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN reference.genome."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.gene AS SELECT * FROM read_parquet('./annotation/gene.parquet'); COMMENT ON VIEW annotation.gene IS 'Genes, stacked across annotation providers: one row per gene per organism per source per assembly, in the provider''s own id space. Join to annotation.transcript on (gene_id, taxon_id, source, genome_id). A taxon with several assemblies loaded (mouse strains, pig breeds) has one set of rows per assembly — see genome_id. Descriptions and cytogenetic bands are not here: they come from NCBI, keyed by Entrez id, in annotation.ncbi__gene.'; COMMENT ON COLUMN annotation.gene."gene_id" IS 'The provider''s stable gene id without version, e.g. ENSG00000141510 under source ENSEMBL. Part of the merge key; an upstream version bump updates this row rather than creating a new one.'; COMMENT ON COLUMN annotation.gene."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.gene."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).'; COMMENT ON COLUMN annotation.gene."version" IS 'Upstream record version at this release, e.g. 21. Changes over time.'; COMMENT ON COLUMN annotation.gene."symbol" IS 'Official gene symbol, e.g. TP53. NULL for genes with no assigned name.'; COMMENT ON COLUMN annotation.gene."gene_type" IS 'Gene biotype in the provider''s vocabulary, e.g. protein_coding, lncRNA for Ensembl.'; COMMENT ON COLUMN annotation.gene."curation_source" IS 'The provider''s own annotation-source tag, e.g. ensembl_havana from GTF column 2. Curation provenance within the provider — the asserting provider itself is `source`.'; COMMENT ON COLUMN annotation.gene."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.gene."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.ncbi__gene AS SELECT * FROM read_parquet('./annotation/ncbi__gene.parquet'); COMMENT ON VIEW annotation.ncbi__gene IS 'Genes as NCBI Gene defines them, keyed by Entrez GeneID. Separate from annotation.gene rather than extra columns on it, because gene_info is keyed by Entrez id and the Entrez-to-Ensembl mapping is many-to-many in both directions: writing a description onto an Ensembl-keyed row would mean silently picking one of several Entrez records for the genes where they disagree. Reach it from an Ensembl gene through annotation.identifier_mapping (ENSEMBL <-> ENTREZ), which keeps the fan-out visible instead of resolving it at write time. Synonyms and dbXrefs from the same source land in annotation.identifier_mapping. Note that ''gene'' here is NCBI''s sense of the word: most rows are gene_type ''biological-region'' — regulatory features, 128,261 of human''s 193,809 records against 20,595 protein-coding. They are kept rather than filtered, because gene_type distinguishes them and OrgDb''s ENTREZID key space includes them; filter on gene_type if you want genes in the narrower sense.'; COMMENT ON COLUMN annotation.ncbi__gene."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157. The central key of OrgDb, which is why this table exists keyed on it rather than on an Ensembl id.'; COMMENT ON COLUMN annotation.ncbi__gene."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.ncbi__gene."symbol" IS 'NCBI''s default symbol, e.g. TP53. May disagree with the symbol Ensembl carries in annotation.gene; neither is corrected to match the other.'; COMMENT ON COLUMN annotation.ncbi__gene."description" IS 'Descriptive gene name, e.g. ''tumor protein p53''. This is OrgDb''s GENENAME.'; COMMENT ON COLUMN annotation.ncbi__gene."gene_type" IS 'NCBI gene type, e.g. protein-coding, ncRNA, pseudo. OrgDb''s GENETYPE. NCBI''s hyphenated vocabulary, deliberately not mapped onto Ensembl''s biotype names in annotation.gene.gene_type.'; COMMENT ON COLUMN annotation.ncbi__gene."chromosome" IS 'Chromosome as NCBI names it. Pipe-separated where NCBI places the gene on more than one, kept as published.'; COMMENT ON COLUMN annotation.ncbi__gene."map_location" IS 'Cytogenetic band, e.g. 17p13.1. OrgDb''s MAP. Not a coordinate.'; COMMENT ON COLUMN annotation.ncbi__gene."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.ncbi__gene."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.transcript AS SELECT * FROM read_parquet('./annotation/transcript.parquet'); COMMENT ON VIEW annotation.transcript IS 'Transcripts, stacked across annotation providers. One row per transcript per source per assembly; a gene has many.'; COMMENT ON COLUMN annotation.transcript."transcript_id" IS 'The provider''s stable transcript id without version, e.g. ENST00000269305 under source ENSEMBL.'; COMMENT ON COLUMN annotation.transcript."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.transcript."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).'; COMMENT ON COLUMN annotation.transcript."gene_id" IS 'Stable gene id of the parent gene, in the same provider''s id space. Joins to annotation.gene on (gene_id, taxon_id, source, genome_id).'; COMMENT ON COLUMN annotation.transcript."version" IS 'Upstream record version at this release.'; COMMENT ON COLUMN annotation.transcript."biotype" IS 'Transcript biotype, e.g. protein_coding, retained_intron.'; COMMENT ON COLUMN annotation.transcript."canonical" IS 'True if Ensembl tags this as the canonical transcript of its gene.'; COMMENT ON COLUMN annotation.transcript."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.transcript."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.exon AS SELECT * FROM read_parquet('./annotation/exon.parquet'); COMMENT ON VIEW annotation.exon IS 'Exons in transcript context, carrying coding bounds, stacked across annotation providers. Stands in for TxDb''s exon, cds and splicing tables: a row is already keyed by exon and transcript, so it is the splicing junction, and a coding segment always falls within an exon of the same transcript. UTRs are derived from cds bounds, not stored.'; COMMENT ON COLUMN annotation.exon."exon_id" IS 'The provider''s stable exon id without version, e.g. ENSE00002064269 under source ENSEMBL. NOT unique on its own: one exon is shared by every transcript containing it, so the key is (exon_id, transcript_id, taxon_id, source, genome_id).'; COMMENT ON COLUMN annotation.exon."transcript_id" IS 'Transcript this row places the exon in. Joins to annotation.transcript on (transcript_id, taxon_id, source, genome_id).'; COMMENT ON COLUMN annotation.exon."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.exon."source" IS 'The asserting annotation provider, from the controlled writer vocabulary: ''ENSEMBL'' now; ''REFSEQ'', ''GENCODE'' when they land. Part of the business key and of every writer''s merge scope, so providers stack in one table and none can retire another''s rows (ADR-0004).'; COMMENT ON COLUMN annotation.exon."sequence_name" IS 'Sequence the exon lies on, as named by Ensembl, e.g. 17 — not chr17.'; COMMENT ON COLUMN annotation.exon."start" IS 'Start coordinate, 1-based and inclusive (Ensembl/GTF convention, NOT the 0-based half-open convention of BED and UCSC).'; COMMENT ON COLUMN annotation.exon."end" IS 'End coordinate, 1-based and inclusive.'; COMMENT ON COLUMN annotation.exon."strand" IS '''+'' or ''-''.'; COMMENT ON COLUMN annotation.exon."rank" IS 'Ordinal of this exon within the transcript, 5'' to 3'', starting at 1. Order exons by rank, not by coordinate: on the minus strand the two disagree and coordinate order is reversed.'; COMMENT ON COLUMN annotation.exon."cds_start" IS 'Start of the coding segment within this exon, 1-based inclusive. NULL where the exon is not translated.'; COMMENT ON COLUMN annotation.exon."cds_end" IS 'End of the coding segment, 1-based inclusive.'; COMMENT ON COLUMN annotation.exon."cds_phase" IS 'Reading frame of the coding segment: bases to remove from its start to reach the first complete codon. Not recoverable from coordinates.'; COMMENT ON COLUMN annotation.exon."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.exon."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.identifier_mapping AS SELECT * FROM read_parquet('./annotation/identifier_mapping.parquet'); COMMENT ON VIEW annotation.identifier_mapping IS 'Cross-references between identifier authorities. Mappings are many-to-many in both directions. The whole tuple is the key: a mapping has no attributes that can change, so it is only ever asserted or withdrawn, never updated. Carries no assembly: source = ''ENSEMBL'' rows are written for a taxon''s canonical assembly only (reference.genome.is_canonical), so alternate-strain gene ids such as MGP_129S1SvImJ_G… have no rows here — their symbols are on annotation.gene.'; COMMENT ON COLUMN annotation.identifier_mapping."source_namespace" IS 'Authority of the source identifier, e.g. ENSEMBL.'; COMMENT ON COLUMN annotation.identifier_mapping."source_id" IS 'Identifier in source_namespace.'; COMMENT ON COLUMN annotation.identifier_mapping."target_namespace" IS 'Authority of the target identifier, e.g. SYMBOL.'; COMMENT ON COLUMN annotation.identifier_mapping."target_id" IS 'Identifier in target_namespace.'; COMMENT ON COLUMN annotation.identifier_mapping."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.identifier_mapping."source" IS 'Who asserts this mapping, e.g. ENSEMBL, NCBI. Part of the business key, so that one source cannot retire another''s cross-references.'; COMMENT ON COLUMN annotation.identifier_mapping."confidence" IS 'Asserter''s confidence where one is published; NULL where none is.'; COMMENT ON COLUMN annotation.identifier_mapping."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.identifier_mapping."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.ncbi__gene2pubmed AS SELECT * FROM read_parquet('./raw/ncbi__gene2pubmed.parquet'); COMMENT ON VIEW raw.ncbi__gene2pubmed IS 'NCBI gene2pubmed landed verbatim and whole — every organism, ~40M rows, not only the taxa we derive annotation for, since a third species should not cost a re-fetch. Regenerated nightly upstream, so it has no release: the retrieval date is the version.'; COMMENT ON COLUMN raw.ncbi__gene2pubmed."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ncbi__gene2pubmed."gene_id" IS 'NCBI Entrez GeneID.'; COMMENT ON COLUMN raw.ncbi__gene2pubmed."pubmed_id" IS 'PubMed id (PMID) of a publication NCBI links to this gene.'; COMMENT ON COLUMN raw.ncbi__gene2pubmed."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW annotation.ncbi__gene_pubmed AS SELECT * FROM read_parquet('./annotation/ncbi__gene_pubmed.parquet'); COMMENT ON VIEW annotation.ncbi__gene_pubmed IS 'Gene-to-publication links as NCBI Gene curates them, keyed by Entrez GeneID. One row per (gene, publication): a gene has many publications and a publication many genes. The whole tuple is the key — a link has no attributes that can change, so it is only ever asserted or withdrawn, never updated.'; COMMENT ON COLUMN annotation.ncbi__gene_pubmed."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157. Part of the merge key.'; COMMENT ON COLUMN annotation.ncbi__gene_pubmed."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.ncbi__gene_pubmed."pubmed_id" IS 'PubMed id (PMID) of a publication discussing this gene. This is the column OrgDb serves as PMID.'; COMMENT ON COLUMN annotation.ncbi__gene_pubmed."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.ncbi__gene_pubmed."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.ncbi__gene2accession AS SELECT * FROM read_parquet('./raw/ncbi__gene2accession.parquet'); COMMENT ON VIEW raw.ncbi__gene2accession IS 'NCBI gene2accession landed verbatim and whole: every organism and every accession status, a superset of gene2refseq and by far the largest raw table here (~1e9 rows upstream), so it lands streamed in batches. NCBI''s ''-'' placeholder is read as NULL. Positions are strings, unparsed: raw is landed uninterpreted. Regenerated nightly upstream, so the retrieval date is the version.'; COMMENT ON COLUMN raw.ncbi__gene2accession."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ncbi__gene2accession."gene_id" IS 'NCBI Entrez GeneID. Upstream column ''GeneID''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."status" IS 'RefSeq status: REVIEWED, VALIDATED, PROVISIONAL, PREDICTED, INFERRED, MODEL, or the literal string ''NA''. NULL (NCBI''s ''-'') marks a GenBank/INSDC submission, not a RefSeq record.'; COMMENT ON COLUMN raw.ncbi__gene2accession."rna_nucleotide_accession_version" IS 'RNA accession.version, e.g. NM_000546.6, version kept as published. Upstream column ''RNA_nucleotide_accession.version''; upstream''s dots become underscores here because a dot is not a valid column name.'; COMMENT ON COLUMN raw.ncbi__gene2accession."rna_nucleotide_gi" IS 'GI number of the RNA record. Upstream column ''RNA_nucleotide_gi''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."protein_accession_version" IS 'Protein accession.version, e.g. NP_000537.3. Upstream column ''protein_accession.version''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."protein_gi" IS 'GI number of the protein record. Upstream column ''protein_gi''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."genomic_nucleotide_accession_version" IS 'Genomic accession.version the gene is placed on — RefSeq (NC_/NT_/NW_) or GenBank, distinguished by the underscore only RefSeq accessions carry. Upstream column ''genomic_nucleotide_accession.version''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."genomic_nucleotide_gi" IS 'GI number of the genomic record. Upstream column ''genomic_nucleotide_gi''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."start_position_on_the_genomic_accession" IS 'Start of the gene on the genomic accession, 0-based as NCBI publishes this file. String, unparsed, per the raw contract.'; COMMENT ON COLUMN raw.ncbi__gene2accession."end_position_on_the_genomic_accession" IS 'End of the gene on the genomic accession. String, unparsed.'; COMMENT ON COLUMN raw.ncbi__gene2accession."orientation" IS '''+'', ''-'', or ''?'' where the orientation is not known.'; COMMENT ON COLUMN raw.ncbi__gene2accession."assembly" IS 'Assembly the genomic accession belongs to, e.g. ''Reference GRCh38.p14 Primary Assembly''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."mature_peptide_accession_version" IS 'Mature peptide accession.version, rarely present. Upstream column ''mature_peptide_accession.version''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."mature_peptide_gi" IS 'GI number of the mature peptide record. Upstream column ''mature_peptide_gi''.'; COMMENT ON COLUMN raw.ncbi__gene2accession."symbol" IS 'Default symbol at the time of the dump. Upstream column ''Symbol''. gene_info''s symbol is authoritative; this one is a convenience copy.'; COMMENT ON COLUMN raw.ncbi__gene2accession."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.ncbi__gene2go AS SELECT * FROM read_parquet('./raw/ncbi__gene2go.parquet'); COMMENT ON VIEW raw.ncbi__gene2go IS 'NCBI gene2go landed verbatim and whole: every organism NCBI annotates, not only the ones we derive annotation for. NCBI''s ''-'' placeholder is read as NULL; pipe-separated fields are kept as published, unsplit. Regenerated nightly upstream, so the retrieval date is the version.'; COMMENT ON COLUMN raw.ncbi__gene2go."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN raw.ncbi__gene2go."gene_id" IS 'NCBI Entrez GeneID.'; COMMENT ON COLUMN raw.ncbi__gene2go."go_id" IS 'GO term id, e.g. GO:0000122. Already CURIE-prefixed by NCBI.'; COMMENT ON COLUMN raw.ncbi__gene2go."evidence" IS 'GO evidence code, e.g. IEA, IDA, TAS. NULL (NCBI''s ''-'') where none is recorded.'; COMMENT ON COLUMN raw.ncbi__gene2go."qualifier" IS 'GO relation qualifier, e.g. involved_in, located_in, enables; ''NOT'' prefixes a negated annotation. Pipe-separated where several apply, kept as published. NULL (NCBI''s ''-'') where none.'; COMMENT ON COLUMN raw.ncbi__gene2go."go_term" IS 'The GO term''s name at retrieval time, e.g. ''nucleus''. A convenience denormalised by NCBI — the ontology, not this file, is the authority for names.'; COMMENT ON COLUMN raw.ncbi__gene2go."pubmed" IS 'PubMed ids supporting the annotation, pipe-separated in one string as NCBI publishes them. NULL (NCBI''s ''-'') where uncited.'; COMMENT ON COLUMN raw.ncbi__gene2go."category" IS 'GO aspect: Function, Process or Component. NCBI''s spelling of the three GO namespaces.'; COMMENT ON COLUMN raw.ncbi__gene2go."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW annotation.ncbi__gene_go AS SELECT * FROM read_parquet('./annotation/ncbi__gene_go.parquet'); COMMENT ON VIEW annotation.ncbi__gene_go IS 'Direct GO annotations per Entrez gene, from NCBI gene2go: OrgDb''s GO table. One row per (gene, term, evidence code, qualifier) per organism. Supporting PMIDs are not carried — they live unsplit in raw.ncbi__gene2go. The GOALL closure over ancestor terms is deliberately absent: it depends on a GO DAG snapshot, which is its own source.'; COMMENT ON COLUMN annotation.ncbi__gene_go."gene_id" IS 'NCBI Entrez GeneID, e.g. 7157. OrgDb''s ENTREZID; reach an Ensembl gene through annotation.identifier_mapping.'; COMMENT ON COLUMN annotation.ncbi__gene_go."taxon_id" IS 'NCBI taxonomy id of the organism, e.g. 9606 for human. Part of the merge key.'; COMMENT ON COLUMN annotation.ncbi__gene_go."go_id" IS 'GO term id, e.g. GO:0000122. DIRECT annotation only — ancestor terms (OrgDb''s GOALL) need the GO DAG and are not here.'; COMMENT ON COLUMN annotation.ncbi__gene_go."evidence" IS 'GO evidence code, e.g. IEA, IDA, TAS. OrgDb''s EVIDENCE. Part of the merge key — the same term asserted under two codes is two annotations. Empty string where NCBI published ''-'', never NULL: a NULL key never joins to itself and would churn on every merge.'; COMMENT ON COLUMN annotation.ncbi__gene_go."qualifier" IS 'GO relation qualifier, e.g. involved_in, located_in; ''NOT'' prefixes a negated annotation — dropping it would invert the claim, which is why this is part of the merge key. Pipe-separated where several apply. Empty string where NCBI published ''-'', never NULL, for the same join reason as evidence.'; COMMENT ON COLUMN annotation.ncbi__gene_go."go_term" IS 'The GO term''s name as NCBI carried it at retrieval, e.g. ''nucleus''. Denormalised convenience; the ontology is the authority.'; COMMENT ON COLUMN annotation.ncbi__gene_go."category" IS 'GO aspect: Function, Process or Component. OrgDb''s ONTOLOGY column, under NCBI''s spelling rather than BP/CC/MF.'; COMMENT ON COLUMN annotation.ncbi__gene_go."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.ncbi__gene_go."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.icite__metadata AS SELECT * FROM read_parquet('./raw/icite__metadata.parquet'); COMMENT ON VIEW raw.icite__metadata IS 'The NIH iCite database snapshot landed verbatim, every column as text — the citation lists included. Holds the LATEST snapshot only, a deliberate narrowing of the raw layer''s per-version rule: one snapshot is ~40M rows dominated by PMID lists, older snapshots stay immutable on Figshare, and every snapshot''s metrics are kept in annotation.icite__metrics. CC BY 4.0; cite iCite.'; COMMENT ON COLUMN raw.icite__metadata."pmid" IS 'PubMed id, as text as upstream prints it.'; COMMENT ON COLUMN raw.icite__metadata."doi" IS 'DOI if iCite has one; blank upstream reads as blank here.'; COMMENT ON COLUMN raw.icite__metadata."year" IS 'Publication year.'; COMMENT ON COLUMN raw.icite__metadata."title" IS 'Article title.'; COMMENT ON COLUMN raw.icite__metadata."authors" IS 'Author names, one comma-separated string.'; COMMENT ON COLUMN raw.icite__metadata."journal" IS 'Journal name, ISO abbreviation.'; COMMENT ON COLUMN raw.icite__metadata."is_research_article" IS '''Yes''/''No'': publication types consistent with primary research.'; COMMENT ON COLUMN raw.icite__metadata."relative_citation_ratio" IS 'RCR: field- and time-normalised citation rate, NIH R01 papers = 1.0.'; COMMENT ON COLUMN raw.icite__metadata."nih_percentile" IS 'RCR percentile among NIH-funded papers.'; COMMENT ON COLUMN raw.icite__metadata."human" IS 'Translation module: human fraction, 0-1.'; COMMENT ON COLUMN raw.icite__metadata."animal" IS 'Translation module: animal fraction, 0-1.'; COMMENT ON COLUMN raw.icite__metadata."molecular_cellular" IS 'Translation module: molecular/cellular fraction, 0-1.'; COMMENT ON COLUMN raw.icite__metadata."apt" IS 'Approximate Potential to Translate: predicted probability of citation by a clinical article.'; COMMENT ON COLUMN raw.icite__metadata."is_clinical" IS '''Yes''/''No'': the article itself is clinical.'; COMMENT ON COLUMN raw.icite__metadata."citation_count" IS 'Citations received, per the NIH Open Citation Collection.'; COMMENT ON COLUMN raw.icite__metadata."citations_per_year" IS 'citation_count over years since publication.'; COMMENT ON COLUMN raw.icite__metadata."expected_citations_per_year" IS 'Field-expected citations per year, the RCR denominator.'; COMMENT ON COLUMN raw.icite__metadata."field_citation_rate" IS 'Citation rate of the paper''s co-citation network.'; COMMENT ON COLUMN raw.icite__metadata."provisional" IS '''Yes''/''No'': RCR is provisional (paper under two years old).'; COMMENT ON COLUMN raw.icite__metadata."x_coord" IS 'Translation triangle x coordinate.'; COMMENT ON COLUMN raw.icite__metadata."y_coord" IS 'Translation triangle y coordinate.'; COMMENT ON COLUMN raw.icite__metadata."cited_by_clin" IS 'Space-separated PMIDs of clinical articles citing this one.'; COMMENT ON COLUMN raw.icite__metadata."cited_by" IS 'Space-separated PMIDs citing this one.'; COMMENT ON COLUMN raw.icite__metadata."references" IS 'Space-separated PMIDs this one cites.'; COMMENT ON COLUMN raw.icite__metadata."last_modified" IS 'Upstream last-modified timestamp of the record.'; COMMENT ON COLUMN raw.icite__metadata."snapshot" IS 'iCite snapshot label, e.g. ''2026-08'': the monthly Figshare release these values were read from.'; COMMENT ON COLUMN raw.icite__metadata."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW annotation.icite__publication AS SELECT * FROM read_parquet('./annotation/icite__publication.parquet'); COMMENT ON VIEW annotation.icite__publication IS 'One row per PubMed record as iCite describes it: what the paper is, not how it is cited — those numbers move monthly and live in annotation.icite__metrics. Joins to annotation.ncbi__gene_pubmed on pmid. Source: NIH iCite, CC BY 4.0.'; COMMENT ON COLUMN annotation.icite__publication."pmid" IS 'PubMed id (PMID) of the paper. Part of the merge key.'; COMMENT ON COLUMN annotation.icite__publication."doi" IS 'DOI, normalised: lower-case, no resolver prefix, always ''10./''. NULL when iCite has none or its value is not a DOI (6,414 rows in the 2026-08 snapshot); the original text is in raw.icite__metadata.doi. Not unique: 16,521 DOIs map to more than one PMID.'; COMMENT ON COLUMN annotation.icite__publication."title" IS 'Article title, whitespace-trimmed.'; COMMENT ON COLUMN annotation.icite__publication."authors" IS 'Author names as one string, as iCite prints them.'; COMMENT ON COLUMN annotation.icite__publication."journal" IS 'Journal name, ISO abbreviation.'; COMMENT ON COLUMN annotation.icite__publication."year" IS 'Publication year.'; COMMENT ON COLUMN annotation.icite__publication."is_research_article" IS 'Publication types consistent with primary research, per iCite.'; COMMENT ON COLUMN annotation.icite__publication."is_clinical" IS 'The article itself is a clinical article, per iCite.'; COMMENT ON COLUMN annotation.icite__publication."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.icite__publication."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.icite__metrics AS SELECT * FROM read_parquet('./annotation/icite__metrics.parquet'); COMMENT ON VIEW annotation.icite__metrics IS 'iCite''s citation metrics for one paper as of one monthly snapshot. Keyed by (pmid, snapshot) so a snapshot''s numbers are facts that never change — the alternative, metrics as Type 2 attributes, would open ~40M version rows a month. For the current view take the latest snapshot; to see a paper''s trajectory, order by snapshot. Source: NIH iCite, CC BY 4.0.'; COMMENT ON COLUMN annotation.icite__metrics."pmid" IS 'PubMed id (PMID) of the paper. Part of the merge key.'; COMMENT ON COLUMN annotation.icite__metrics."snapshot" IS 'iCite snapshot label, e.g. ''2026-08'': the monthly Figshare release these values were read from. Part of the merge key.'; COMMENT ON COLUMN annotation.icite__metrics."relative_citation_ratio" IS 'RCR: field- and time-normalised citation rate; NIH R01-funded papers average 1.0.'; COMMENT ON COLUMN annotation.icite__metrics."nih_percentile" IS 'RCR percentile among NIH-funded papers.'; COMMENT ON COLUMN annotation.icite__metrics."citation_count" IS 'Citations received per the NIH Open Citation Collection.'; COMMENT ON COLUMN annotation.icite__metrics."citations_per_year" IS 'citation_count over years since publication.'; COMMENT ON COLUMN annotation.icite__metrics."expected_citations_per_year" IS 'Field-expected citations per year, the RCR denominator.'; COMMENT ON COLUMN annotation.icite__metrics."field_citation_rate" IS 'Citation rate of the paper''s co-citation network.'; COMMENT ON COLUMN annotation.icite__metrics."human" IS 'Translation module: human fraction, 0-1.'; COMMENT ON COLUMN annotation.icite__metrics."animal" IS 'Translation module: animal fraction, 0-1.'; COMMENT ON COLUMN annotation.icite__metrics."molecular_cellular" IS 'Translation module: molecular/cellular fraction, 0-1.'; COMMENT ON COLUMN annotation.icite__metrics."apt" IS 'Approximate Potential to Translate: predicted probability of citation by a clinical article.'; COMMENT ON COLUMN annotation.icite__metrics."provisional" IS 'RCR is provisional (paper under two years old).'; COMMENT ON COLUMN annotation.icite__metrics."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.icite__metrics."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.cellxgene__dataset AS SELECT * FROM read_parquet('./raw/cellxgene__dataset.parquet'); COMMENT ON VIEW raw.cellxgene__dataset IS 'The CELLxGENE Discover PUBLIC dataset listing landed verbatim: one row per dataset version. Scalar fields are typed directly; multi-valued and nested fields are kept as their JSON text, unexploded, per the raw contract. Holds the LATEST crawl only, a deliberate narrowing of the raw layer''s per-version rule (same reason as raw.icite__metadata): the listing has no archived versions of its own to accumulate. Licence CC BY 4.0.'; COMMENT ON COLUMN raw.cellxgene__dataset."dataset_id" IS 'CELLxGENE dataset id. Stable across revisions; a revision keeps this id and gets a new dataset_version_id.'; COMMENT ON COLUMN raw.cellxgene__dataset."dataset_version_id" IS 'Id of this specific version of the dataset. What resource.cellxgene__dataset is keyed on.'; COMMENT ON COLUMN raw.cellxgene__dataset."collection_id" IS 'Id of the collection this dataset belongs to.'; COMMENT ON COLUMN raw.cellxgene__dataset."collection_version_id" IS 'Id of this version of the collection.'; COMMENT ON COLUMN raw.cellxgene__dataset."collection_name" IS 'Collection title, e.g. a study or atlas name.'; COMMENT ON COLUMN raw.cellxgene__dataset."collection_doi" IS 'DOI of the collection''s publication, where one exists.'; COMMENT ON COLUMN raw.cellxgene__dataset."collection_doi_label" IS 'Human-readable citation for collection_doi, as CZI formats it.'; COMMENT ON COLUMN raw.cellxgene__dataset."title" IS 'Dataset title.'; COMMENT ON COLUMN raw.cellxgene__dataset."citation" IS 'CZI''s own suggested citation string for this dataset version.'; COMMENT ON COLUMN raw.cellxgene__dataset."schema_version" IS 'CELLxGENE schema version the dataset''s H5AD conforms to, e.g. ''7.1.0''.'; COMMENT ON COLUMN raw.cellxgene__dataset."cell_count" IS 'Total cells in the dataset.'; COMMENT ON COLUMN raw.cellxgene__dataset."primary_cell_count" IS 'Cells flagged is_primary_data = true, CZI''s own de-duplication rule (a cell profiled in two datasets is primary in exactly one). <= cell_count.'; COMMENT ON COLUMN raw.cellxgene__dataset."mean_genes_per_cell" IS 'Mean genes detected per cell.'; COMMENT ON COLUMN raw.cellxgene__dataset."published_at" IS 'ISO 8601 timestamp the dataset was first published, as CZI publishes it. Unparsed.'; COMMENT ON COLUMN raw.cellxgene__dataset."revised_at" IS 'ISO 8601 timestamp of the latest revision; NULL if never revised. Unparsed.'; COMMENT ON COLUMN raw.cellxgene__dataset."explorer_url" IS 'CELLxGENE Explorer URL for interactive browsing.'; COMMENT ON COLUMN raw.cellxgene__dataset."processing_status" IS 'CZI''s own pipeline status, e.g. ''SUCCESS''.'; COMMENT ON COLUMN raw.cellxgene__dataset."tombstone" IS 'CZI''s tombstone flag. Always false in this table in practice: a tombstoned dataset is excluded from the PUBLIC listing outright rather than kept with this set, so retirement here is via ordinary set-difference against the next crawl, not this column.'; COMMENT ON COLUMN raw.cellxgene__dataset."visibility" IS 'CZI''s visibility tag. Always ''PUBLIC'': the listing is fetched pre-filtered to it.'; COMMENT ON COLUMN raw.cellxgene__dataset."is_pre_analysis" IS 'CZI flag: dataset predates a schema change that added fields later versions carry.'; COMMENT ON COLUMN raw.cellxgene__dataset."revision_of_collection" IS 'Collection id this collection supersedes, where this is a revision. NULL otherwise.'; COMMENT ON COLUMN raw.cellxgene__dataset."revision_of_dataset" IS 'Dataset id this dataset version supersedes, where this is a revision. NULL otherwise.'; COMMENT ON COLUMN raw.cellxgene__dataset."x_approximate_distribution" IS 'Distribution family CZI assumes for X, e.g. ''COUNT'', for tools that need it.'; COMMENT ON COLUMN raw.cellxgene__dataset."organism" IS '[{label, ontology_term_id}, ...] as JSON text, unexploded -- exploding is interpretation, done in transform. NCBITaxon terms. Every dataset observed 2026-09-18 carries exactly one.'; COMMENT ON COLUMN raw.cellxgene__dataset."assay" IS '[{label, ontology_term_id}, ...] as JSON text. EFO terms.'; COMMENT ON COLUMN raw.cellxgene__dataset."tissue" IS '[{label, ontology_term_id, tissue_type}, ...] as JSON text. UBERON (or CL for cell culture) terms.'; COMMENT ON COLUMN raw.cellxgene__dataset."disease" IS '[{label, ontology_term_id}, ...] as JSON text. MONDO terms, or PATO:0000461 for ''normal''.'; COMMENT ON COLUMN raw.cellxgene__dataset."cell_type" IS '[{label, ontology_term_id}, ...] as JSON text. CL terms, or ''unknown''.'; COMMENT ON COLUMN raw.cellxgene__dataset."development_stage" IS '[{label, ontology_term_id}, ...] as JSON text. HsapDv/MmusDv/UBERON terms depending on organism.'; COMMENT ON COLUMN raw.cellxgene__dataset."self_reported_ethnicity" IS '[{label, ontology_term_id}, ...] as JSON text. HANCESTRO terms, or ''unknown''/''na''.'; COMMENT ON COLUMN raw.cellxgene__dataset."sex" IS '[{label, ontology_term_id}, ...] as JSON text. PATO terms, or ''unknown''.'; COMMENT ON COLUMN raw.cellxgene__dataset."donor_id" IS '[donor id, ...] as JSON text: plain curator-assigned strings, no ontology term.'; COMMENT ON COLUMN raw.cellxgene__dataset."suspension_type" IS '[suspension type, ...] as JSON text, e.g. ''cell'', ''nucleus'', ''na''. Plain strings, no ontology term.'; COMMENT ON COLUMN raw.cellxgene__dataset."is_primary_data" IS '[bool, ...] as JSON text: which is_primary_data values occur among this dataset''s cells.'; COMMENT ON COLUMN raw.cellxgene__dataset."assets" IS '[{filesize, filetype, url}, ...] as JSON text. filetype is ''H5AD'' for every dataset observed 2026-09-18, plus ''ATAC_FRAGMENT''/''ATAC_INDEX'' for 21 ATAC datasets. No SpatialData/OME-Zarr filetype has been observed; resource.cellxgene__dataset.spatialdata_uri stays NULL until one is.'; COMMENT ON COLUMN raw.cellxgene__dataset."spatial" IS '{has_fullres, is_single} as JSON text where the dataset is spatial; NULL (JSON null) otherwise. Presence, not content, is what resource.cellxgene__dataset.is_spatial reads.'; COMMENT ON COLUMN raw.cellxgene__dataset."batch_condition" IS '[column name, ...] as JSON text: obs columns CZI suggests batching on, where curated. Often NULL.'; COMMENT ON COLUMN raw.cellxgene__dataset."perturbation_types" IS '[perturbation type, ...] as JSON text, e.g. ''chemical''. NULL where not a perturbation dataset.'; COMMENT ON COLUMN raw.cellxgene__dataset."genetic_perturbation_strategy" IS '[strategy, ...] as JSON text. NULL in every dataset observed 2026-09-18.'; COMMENT ON COLUMN raw.cellxgene__dataset."retrieval_date" IS 'UTC date this crawl of the listing was taken, YYYY-MM-DD. The source''s own version: the Discover API publishes a live current-state listing, not archived per-release dumps.'; COMMENT ON COLUMN raw.cellxgene__dataset."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW resource.cellxgene__dataset AS SELECT * FROM read_parquet('./resource/cellxgene__dataset.parquet'); COMMENT ON VIEW resource.cellxgene__dataset IS 'One row per CELLxGENE dataset version: what the dataset is, where its H5AD and Census cells live, never the expression matrix itself. A dataset that disappears from the next crawl (tombstoned, or superseded by a revision under a new dataset_version_id) is closed by the ordinary merge set-difference rule; the revision''s new dataset_version_id opens a new row (issue #84 acceptance criterion 5). annotation.cellxgene__gene (Census var, keyed by feature_id and census_release) and annotation.cellxgene__cell (Census obs, issue #85) are companions, not here: var ships only inside the TileDB-SOMA store and tiledbsoma is not an allowed dependency, so that table is deferred until Census publishes var in a DuckDB-readable form.'; COMMENT ON COLUMN resource.cellxgene__dataset."dataset_id" IS 'CELLxGENE dataset id. Stable across revisions; several rows here can share one, each a different dataset_version_id.'; COMMENT ON COLUMN resource.cellxgene__dataset."dataset_version_id" IS 'Id of this specific dataset version. The business key: a revision or a tombstoned dataset closes this row (valid_to set) rather than updating it in place.'; COMMENT ON COLUMN resource.cellxgene__dataset."collection_id" IS 'Id of the collection this dataset belongs to.'; COMMENT ON COLUMN resource.cellxgene__dataset."collection_name" IS 'Collection title, e.g. a study or atlas name.'; COMMENT ON COLUMN resource.cellxgene__dataset."collection_doi" IS 'DOI of the collection''s publication, where one exists.'; COMMENT ON COLUMN resource.cellxgene__dataset."title" IS 'Dataset title.'; COMMENT ON COLUMN resource.cellxgene__dataset."taxon_id" IS 'NCBI taxon id, parsed from the listing''s organism ontology_term_id (always ''NCBITaxon:'' in data observed 2026-09-18). A dataset whose organism does not parse this way, or that carries more than one organism, fails the ingest loudly rather than dropping or guessing (issue #84 acceptance criterion 3).'; COMMENT ON COLUMN resource.cellxgene__dataset."organism_label" IS 'Organism common/scientific name as CZI labels it, e.g. ''Homo sapiens''.'; COMMENT ON COLUMN resource.cellxgene__dataset."assay_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). EFO terms.'; COMMENT ON COLUMN resource.cellxgene__dataset."tissue_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). UBERON (or CL) terms.'; COMMENT ON COLUMN resource.cellxgene__dataset."disease_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). MONDO terms, or PATO:0000461 for ''normal''.'; COMMENT ON COLUMN resource.cellxgene__dataset."cell_type_term_ids" IS 'Ontology term ids of every value the listing gives, sorted, as a list — a convenience for list_contains() filters. The joinable form is resource.resource_relationship, one row per (dataset version, relationship, term). CL terms, or ''unknown''.'; COMMENT ON COLUMN resource.cellxgene__dataset."cell_count" IS 'Total cells in the dataset.'; COMMENT ON COLUMN resource.cellxgene__dataset."primary_cell_count" IS 'Cells flagged is_primary_data = true. <= cell_count.'; COMMENT ON COLUMN resource.cellxgene__dataset."mean_genes_per_cell" IS 'Mean genes detected per cell.'; COMMENT ON COLUMN resource.cellxgene__dataset."schema_version" IS 'CELLxGENE schema version the dataset''s H5AD conforms to, e.g. ''7.1.0''.'; COMMENT ON COLUMN resource.cellxgene__dataset."license" IS 'Always ''CC BY 4.0'': CELLxGENE Discover''s uniform licence for public data.'; COMMENT ON COLUMN resource.cellxgene__dataset."h5ad_uri" IS 'Public HTTPS URL of the dataset''s H5AD, from the listing''s assets. Referenced, never landed (SPEC.md Large Data Integration). Required: every row has one, or the ingest fails (issue #84 acceptance criterion 2).'; COMMENT ON COLUMN resource.cellxgene__dataset."census_release" IS 'Census build (e.g. ''2025-11-08'') this dataset''s cells are reachable through, via annotation.cellxgene__cell (issue #85) keyed the same way. Defaults to the Census release manifest''s ''stable'' LTS alias at ingest time.'; COMMENT ON COLUMN resource.cellxgene__dataset."published_at" IS 'ISO 8601 timestamp the dataset was first published. Unparsed.'; COMMENT ON COLUMN resource.cellxgene__dataset."revised_at" IS 'ISO 8601 timestamp of the latest revision; NULL if never revised. Unparsed.'; COMMENT ON COLUMN resource.cellxgene__dataset."tombstone" IS 'CZI''s tombstone flag, carried through from raw. Always false in practice here: a tombstoned dataset is excluded from the PUBLIC listing outright, so its row is closed by ordinary retirement (valid_to set) rather than by this flag flipping true.'; COMMENT ON COLUMN resource.cellxgene__dataset."is_spatial" IS 'True for a spatial dataset (the listing''s spatial object is non-null: Visium, Slide-seq and similar). Issue #84 acceptance criterion 9.'; COMMENT ON COLUMN resource.cellxgene__dataset."spatial_platform" IS 'Spatial platform name, derived from the assay ontology term via a controlled mapping (SPATIAL_PLATFORMS in cellxgene.py) -- never free text. NULL for a non-spatial dataset; for a spatial one, an assay term absent from the mapping fails the ingest loudly rather than becoming NULL (issue #84 acceptance criterion 11).'; COMMENT ON COLUMN resource.cellxgene__dataset."spatialdata_uri" IS 'URI of the scverse SpatialData (OME-Zarr) store, where the source publishes one. Images and transcript-level point clouds live there, referenced, never landed. NULL where absent -- as of 2026-09-18 that is every dataset (issue #84 acceptance criterion 10).'; COMMENT ON COLUMN resource.cellxgene__dataset."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN resource.cellxgene__dataset."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.obo__cl AS SELECT * FROM read_parquet('./raw/obo__cl.parquet'); COMMENT ON VIEW raw.obo__cl IS 'CL landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the CL namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.'; COMMENT ON COLUMN raw.obo__cl."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__cl."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__cl."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__cl."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__cl."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__cl."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__cl."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__cl."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__cl."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__uberon AS SELECT * FROM read_parquet('./raw/obo__uberon.parquet'); COMMENT ON VIEW raw.obo__uberon IS 'UBERON landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the UBERON namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-3.0.'; COMMENT ON COLUMN raw.obo__uberon."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__uberon."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__uberon."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__uberon."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__uberon."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__uberon."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__uberon."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__uberon."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__uberon."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__mondo AS SELECT * FROM read_parquet('./raw/obo__mondo.parquet'); COMMENT ON VIEW raw.obo__mondo IS 'MONDO landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the MONDO namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.'; COMMENT ON COLUMN raw.obo__mondo."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__mondo."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__mondo."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__mondo."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__mondo."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__mondo."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__mondo."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__mondo."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__mondo."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__efo AS SELECT * FROM read_parquet('./raw/obo__efo.parquet'); COMMENT ON VIEW raw.obo__efo IS 'EFO landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the EFO namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence Apache-2.0.'; COMMENT ON COLUMN raw.obo__efo."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__efo."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__efo."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__efo."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__efo."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__efo."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__efo."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__efo."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__efo."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__hsapdv AS SELECT * FROM read_parquet('./raw/obo__hsapdv.parquet'); COMMENT ON VIEW raw.obo__hsapdv IS 'HSAPDV landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the HSAPDV namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.'; COMMENT ON COLUMN raw.obo__hsapdv."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__hsapdv."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__hsapdv."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__hsapdv."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__hsapdv."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__hsapdv."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__hsapdv."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__hsapdv."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__hsapdv."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__mmusdv AS SELECT * FROM read_parquet('./raw/obo__mmusdv.parquet'); COMMENT ON VIEW raw.obo__mmusdv IS 'MMUSDV landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the MMUSDV namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.'; COMMENT ON COLUMN raw.obo__mmusdv."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__mmusdv."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__mmusdv."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__mmusdv."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__mmusdv."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__mmusdv."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__mmusdv."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__mmusdv."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__mmusdv."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__go AS SELECT * FROM read_parquet('./raw/obo__go.parquet'); COMMENT ON VIEW raw.obo__go IS 'GO landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the GO namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC-BY-4.0.'; COMMENT ON COLUMN raw.obo__go."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__go."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__go."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__go."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__go."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__go."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__go."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__go."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__go."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.obo__doid AS SELECT * FROM read_parquet('./raw/obo__doid.parquet'); COMMENT ON VIEW raw.obo__doid IS 'DOID landed verbatim from its OBO Graphs JSON release: one row per node and one row per edge, the WHOLE file — every imported class or property from another ontology included, not filtered to the DOID namespace. Filtering at land time would make raw a function of what ontology.term happens to derive today (ADR-0002); ontology.term''s node count matches this table''s node-row count exactly for that reason. Licence CC0-1.0.'; COMMENT ON COLUMN raw.obo__doid."kind" IS '''node'' or ''edge'': which half of the OBO Graphs JSON this row came from.'; COMMENT ON COLUMN raw.obo__doid."id" IS 'Node IRI. NULL on an edge row.'; COMMENT ON COLUMN raw.obo__doid."lbl" IS 'Node label (rdfs:label). NULL on an edge row, and on the node rows the file itself leaves unlabeled (imported classes mostly).'; COMMENT ON COLUMN raw.obo__doid."sub" IS 'Edge subject IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__doid."pred" IS 'Edge predicate: ''is_a'' verbatim (the only relation OBO Graphs JSON ever states unqualified), otherwise the relation''s own IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__doid."obj" IS 'Edge object IRI. NULL on a node row.'; COMMENT ON COLUMN raw.obo__doid."meta" IS 'The node''s or edge''s ''meta'' object — definition, synonyms, xrefs, basicPropertyValues, deprecated flag — serialized back to JSON text verbatim. Kept whole and unparsed, like the GTF attribute column: interpreting it is a transform concern. NULL where the file carries no meta for that node or edge.'; COMMENT ON COLUMN raw.obo__doid."release_version" IS 'This ontology''s own version, read from graphs[0].meta.version in the file (a version IRI or a date, whichever the ontology publishes). Raw is replaced wholesale per value of this column, so more than one release can coexist, the same as raw.ensembl__gtf per ensembl_release.'; COMMENT ON COLUMN raw.obo__doid."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW ontology.term AS SELECT * FROM read_parquet('./ontology/term.parquet'); COMMENT ON VIEW ontology.term IS 'Ontology terms, stacked across ontologies: one current row per (ontology, term_id), Type 2 on any attribute change. Includes every node the release file carries, imported classes included — see raw.obo__.'; COMMENT ON COLUMN ontology.term."ontology" IS 'Short ontology name: cl, uberon, mondo, efo, hsapdv, mmusdv, go, doid. Part of the merge key, so one ontology''s re-ingest never retires another''s terms.'; COMMENT ON COLUMN ontology.term."term_id" IS 'CURIE, e.g. CL:0000624. Converted from the node''s IRI where it follows the OBO PURL convention (.../_); kept as the full IRI verbatim otherwise, which happens for terms imported from a namespace that does not follow that convention.'; COMMENT ON COLUMN ontology.term."name" IS 'rdfs:label. NULL for the handful of imported nodes the file itself leaves unlabeled.'; COMMENT ON COLUMN ontology.term."definition" IS 'Textual definition (IAO:0000115), where the ontology gives one.'; COMMENT ON COLUMN ontology.term."namespace" IS 'OBO namespace/aspect (oboInOwl:hasOBONamespace) — this is GO''s biological_process / molecular_function / cellular_component. NULL where the file does not tag it, which most CL/UBERON/MONDO terms do not.'; COMMENT ON COLUMN ontology.term."synonyms" IS 'Every oboInOwl synonym (exact, narrow, broad and related alike — the distinction between them is not kept), ''|''-joined into one string. NULL where the term has none.'; COMMENT ON COLUMN ontology.term."obsolete" IS 'True if the ontology marks this term deprecated. Obsolete terms are kept, never dropped — see replaced_by.'; COMMENT ON COLUMN ontology.term."replaced_by" IS 'CURIE of the successor term (IAO:0100001 ''term replaced by''), where the ontology names exactly one. NULL for a current term, or for an obsolete term the ontology leaves without a single successor — some only list ''consider'' candidates, which are not a replacement and are not carried here.'; COMMENT ON COLUMN ontology.term."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN ontology.term."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW ontology.relationship AS SELECT * FROM read_parquet('./ontology/relationship.parquet'); COMMENT ON VIEW ontology.relationship IS 'Edges between ontology terms: one row per (ontology, subject_id, predicate, object_id). The is_a closure (e.g. CL:0000624 -> CL:0000084 -> CL:0000000) is a recursive CTE over predicate = ''is_a'' here, not precomputed. An edge''s endpoints are not required to resolve to a row in ontology.term — no foreign key is enforced, matching every other table in this catalog.'; COMMENT ON COLUMN ontology.relationship."ontology" IS 'Short ontology name, same vocabulary as ontology.term.ontology. Part of the merge key.'; COMMENT ON COLUMN ontology.relationship."subject_id" IS 'CURIE of the subject term, same normalisation as ontology.term.term_id.'; COMMENT ON COLUMN ontology.relationship."predicate" IS '''is_a'' verbatim; a short name for the handful of BFO/RO relations common to every OBO ontology (part_of, has_part, develops_from, regulates, negatively_regulates, positively_regulates); the relation''s own CURIE for anything else. Nothing is invented: an unmapped relation is exactly the CURIE the file states, never guessed at.'; COMMENT ON COLUMN ontology.relationship."object_id" IS 'CURIE of the object term, same normalisation as ontology.term.term_id.'; COMMENT ON COLUMN ontology.relationship."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN ontology.relationship."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.bedbase__bed AS SELECT * FROM read_parquet('./raw/bedbase__bed.parquet'); COMMENT ON VIEW raw.bedbase__bed IS 'BEDbase''s monthly `bedbase_metadata` Parquet snapshot (the index is api.bedbase.org/v1/exports) landed whole, one row per BED file record: its `bed` table joined with `bed_metadata`. The sample-level columns keep the `annotation_` prefix they had when this table was landed from the listing API. Per-file DETAIL (URIs, checksums, stats) is not in the snapshot and not here (issue #115). Replaced wholesale each ingest; the manifest records the snapshot''s date and sha256.'; COMMENT ON COLUMN raw.bedbase__bed."id" IS 'BEDbase''s own id for this BED file record, e.g. ''0000120fe8c5334bb0ce759dfcf06c3b''. Stable; carried downstream as resource_id.'; COMMENT ON COLUMN raw.bedbase__bed."name" IS 'Record name/title as BEDbase prints it.'; COMMENT ON COLUMN raw.bedbase__bed."description" IS 'Record description as BEDbase prints it. Frequently blank.'; COMMENT ON COLUMN raw.bedbase__bed."genome_alias" IS 'Free-text genome label as submitted, e.g. ''hg38''. NOT a reliable key: BEDbase''s 118 genome labels include mismatched and compound strings — an Arabidopsis (taxon 3702) record was found tagged ''hg18'' (verified live 2026-09-17). genome_digest is the key; this is a display label only.'; COMMENT ON COLUMN raw.bedbase__bed."genome_digest" IS 'Sequence-collection digest identifying the exact assembly. NULL for a meaningful share of records (~5% in a 500-record sample verified live 2026-09-17) where BEDbase could not resolve one. The reliable genome key when present; genome_alias never is.'; COMMENT ON COLUMN raw.bedbase__bed."bed_compliance" IS 'BED-standard compliance class BEDbase assigned, e.g. ''bed6+4''.'; COMMENT ON COLUMN raw.bedbase__bed."data_format" IS 'Upstream data format BEDbase detected, e.g. ''encode_narrowpeak_rs''.'; COMMENT ON COLUMN raw.bedbase__bed."compliant_columns" IS 'Columns conforming to the declared bed_compliance''s core spec.'; COMMENT ON COLUMN raw.bedbase__bed."non_compliant_columns" IS 'Columns beyond bed_compliance''s core spec.'; COMMENT ON COLUMN raw.bedbase__bed."is_universe" IS 'True for BEDbase''s small curated ''universe'' region sets, false for an ordinary submitted BED file.'; COMMENT ON COLUMN raw.bedbase__bed."license_id" IS 'Licence as a DUO (Data Use Ontology) code, e.g. ''DUO:0000042'' (general research use). Carried on every row: we reference these files, we do not redistribute them, so landing the licence is what makes that honest.'; COMMENT ON COLUMN raw.bedbase__bed."processed" IS 'Whether BEDbase''s bedstat/bedboss pipeline finished processing this record; false records may lack stats even at the full-detail endpoint.'; COMMENT ON COLUMN raw.bedbase__bed."submission_date" IS 'Timestamp this record was submitted, as the ISO 8601 UTC text BEDbase''s API prints, e.g. ''2025-05-22T12:02:50.145308Z''.'; COMMENT ON COLUMN raw.bedbase__bed."last_update_date" IS 'Timestamp this record last changed, same text form as submission_date.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_organism" IS 'annotation.organism as BEDbase prints it, e.g. ''Homo sapiens''. Free text; annotation_species_id is the reliable taxon join.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_species_id" IS 'annotation.species_id as BEDbase prints it — usually a single NCBI taxon id as text, e.g. ''9606'', but not always: a co-infection study was found carrying ''9606, 11676'' (verified live 2026-09-17). resource.bedbase__bedfile.taxon_id is a TRY_CAST of this column, NULL where it does not parse as one integer.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_genotype" IS 'annotation.genotype as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_phenotype" IS 'annotation.phenotype as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_description" IS 'annotation.description from the listing API — distinct from the record''s own top-level `description` above. NULL since landing moved to the Parquet snapshot, which prints one `description` only.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_cell_type" IS 'annotation.cell_type as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_cell_line" IS 'annotation.cell_line as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_tissue" IS 'annotation.tissue as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_library_source" IS 'annotation.library_source as published, e.g. ''genomic''.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_assay" IS 'Assay type, e.g. ''ATAC-seq'', ''DNase-seq'', ''PRO-cap''.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_antibody" IS 'annotation.antibody as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_target" IS 'annotation.target as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_treatment" IS 'annotation.treatment as published.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_global_sample_id" IS 'GEO/ENCODE sample ids, pipe-separated in one string as BEDbase''s list is joined, e.g. ''geo:gsm4837486''. Pipe-joined per the unsplit-list convention elsewhere in this catalog (ncbi__gene_info.synonyms); a join key into Milestone 3''s experimental metadata.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_global_experiment_id" IS 'GEO/ENCODE experiment ids, pipe-separated, e.g. ''geo:gse159673''. Same convention as annotation_global_sample_id.'; COMMENT ON COLUMN raw.bedbase__bed."annotation_original_file_name" IS 'Original filename as submitted upstream, e.g. ''GSM4837486_Plasma_B2_T1.ATACseq.narrowPeak.gz''.'; COMMENT ON COLUMN raw.bedbase__bed."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; COMMENT ON COLUMN raw.bedbase__bed."header" IS 'The BED file''s own header lines, where it had any. NULL for most.'; COMMENT ON COLUMN raw.bedbase__bed."indexed" IS 'BEDbase''s `indexed` flag: whether the record is in its search index.'; COMMENT ON COLUMN raw.bedbase__bed."file_indexed" IS 'BEDbase''s `file_indexed` flag, as published.'; CREATE OR REPLACE VIEW raw.bedbase__bedset AS SELECT * FROM read_parquet('./raw/bedbase__bedset.parquet'); COMMENT ON VIEW raw.bedbase__bedset IS 'BEDbase''s monthly `bedbase_bedsets` Parquet snapshot landed whole, one row per bedset. Replaced wholesale each ingest; the manifest records the snapshot''s date and sha256.'; COMMENT ON COLUMN raw.bedbase__bedset."id" IS 'BEDbase''s own id for this bedset, e.g. ''gse33600'' — often a GEO series accession, but not guaranteed to be one.'; COMMENT ON COLUMN raw.bedbase__bedset."name" IS 'Bedset name as BEDbase prints it.'; COMMENT ON COLUMN raw.bedbase__bedset."md5sum" IS 'BEDbase''s own MD5 digest of the bedset''s metadata — not a digest of any file.'; COMMENT ON COLUMN raw.bedbase__bedset."submission_date" IS 'ISO 8601 UTC text as BEDbase''s API prints it, e.g. ''2025-06-05T12:03:43.962219Z''.'; COMMENT ON COLUMN raw.bedbase__bedset."last_update_date" IS 'ISO 8601 UTC text, same form as submission_date.'; COMMENT ON COLUMN raw.bedbase__bedset."description" IS 'Bedset description, Markdown text as BEDbase prints it.'; COMMENT ON COLUMN raw.bedbase__bedset."bedfile_count" IS 'Member BED files, per BEDbase''s own count. Membership itself is raw.bedbase__bedset_membership.'; COMMENT ON COLUMN raw.bedbase__bedset."author" IS 'Curator/submitter name as published.'; COMMENT ON COLUMN raw.bedbase__bedset."bedset_source" IS 'BEDbase''s own ''source'' field on a bedset, e.g. ''gse33600'' (frequently identical to `id`). Renamed from upstream''s `source` here and on resource.bedbase__bedset because `source` elsewhere in this catalog names the asserting annotation provider — the same rename BugSigDB''s `source_in_paper` makes, and for the same reason.'; COMMENT ON COLUMN raw.bedbase__bedset."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; COMMENT ON COLUMN raw.bedbase__bedset."summary" IS 'Plain-text summary of the bedset, usually the GEO series summary.'; COMMENT ON COLUMN raw.bedbase__bedset."bedset_means" IS 'JSON object, as published: the mean of each bedstat statistic over the member files, e.g. ''{"number_of_regions": 4363.0, ...}''.'; COMMENT ON COLUMN raw.bedbase__bedset."bedset_standard_deviation" IS 'JSON object, as published: the standard deviation of each bedstat statistic over the member files.'; COMMENT ON COLUMN raw.bedbase__bedset."bedset_stats" IS 'BEDbase''s `bedset_stats`, as published. NULL on every row of the 2026-09-01 snapshot.'; COMMENT ON COLUMN raw.bedbase__bedset."processed" IS 'Whether BEDbase''s pipeline finished processing this bedset.'; CREATE OR REPLACE VIEW raw.bedbase__bedset_membership AS SELECT * FROM read_parquet('./raw/bedbase__bedset_membership.parquet'); COMMENT ON VIEW raw.bedbase__bedset_membership IS 'BEDbase''s monthly `bedbase_bedset_membership` Parquet snapshot landed whole: one row per (bedset, member BED file). The joinable, versioned form is resource.resource_relationship, relationship = ''member_of_bedset''.'; COMMENT ON COLUMN raw.bedbase__bedset_membership."bedset_id" IS 'raw.bedbase__bedset.id.'; COMMENT ON COLUMN raw.bedbase__bedset_membership."bedfile_id" IS 'raw.bedbase__bed.id. A file can belong to several bedsets.'; COMMENT ON COLUMN raw.bedbase__bedset_membership."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW resource.bedbase__bedfile AS SELECT * FROM read_parquet('./resource/bedbase__bedfile.parquet'); COMMENT ON VIEW resource.bedbase__bedfile IS 'One row per BEDbase BED file, Type 2 by resource_id: title, genome, organism/assay-level annotation and licence, from BEDbase''s monthly Parquet snapshot. Objects are REFERENCED here, never ingested: size, checksum and the http/s3/bigbed URIs live at /v1/bed/{id}/metadata?full=true, one request per record (663,721 of them), deferred to a follow-up (issue #115) and to be added by schema evolution when they land — a column that is always NULL advertises a capability this table does not yet have. Key genomes on genome_digest, never genome_alias — see that column''s doc. license_id (a DUO code) is carried on every row because we reference these files rather than redistribute them.'; COMMENT ON COLUMN resource.bedbase__bedfile."resource_id" IS 'BEDbase''s bed id (raw.bedbase__bed.id). Business key — one live row per file, Type 2 on any attribute change.'; COMMENT ON COLUMN resource.bedbase__bedfile."title" IS 'Record name/title, from raw.bedbase__bed.name.'; COMMENT ON COLUMN resource.bedbase__bedfile."description" IS 'Record description, from raw.bedbase__bed.description.'; COMMENT ON COLUMN resource.bedbase__bedfile."genome_digest" IS 'Sequence-collection digest of the assembly this file''s regions are called against — the reliable genome key; NULL where BEDbase could not resolve one. Joins to reference.genome once we compute sequence-collection digests for our own assemblies (currently keyed by INSDC accession only).'; COMMENT ON COLUMN resource.bedbase__bedfile."genome_alias" IS 'Free-text genome label, display only — never a join key. See raw.bedbase__bed.genome_alias for how messy this gets.'; COMMENT ON COLUMN resource.bedbase__bedfile."taxon_id" IS 'NCBI taxon id, a TRY_CAST of raw.bedbase__bed.annotation_species_id; NULL where that text does not parse as a single integer (a co-infection study carrying more than one id as free text is the known case — see that column''s doc).'; COMMENT ON COLUMN resource.bedbase__bedfile."organism" IS 'Free-text organism name as BEDbase prints it; taxon_id is the reliable join.'; COMMENT ON COLUMN resource.bedbase__bedfile."assay" IS 'Assay type, e.g. ''ATAC-seq'', ''DNase-seq''.'; COMMENT ON COLUMN resource.bedbase__bedfile."target" IS 'ChIP/CUT&RUN target, where applicable.'; COMMENT ON COLUMN resource.bedbase__bedfile."antibody" IS 'Antibody used, where applicable.'; COMMENT ON COLUMN resource.bedbase__bedfile."cell_type" IS 'Cell type sampled.'; COMMENT ON COLUMN resource.bedbase__bedfile."cell_line" IS 'Cell line sampled, where applicable.'; COMMENT ON COLUMN resource.bedbase__bedfile."tissue" IS 'Tissue sampled.'; COMMENT ON COLUMN resource.bedbase__bedfile."treatment" IS 'Treatment applied to the sample, free text.'; COMMENT ON COLUMN resource.bedbase__bedfile."sample_id" IS 'GEO/ENCODE sample ids, sorted list, e.g. [''geo:gsm4837486'']. The joinable form is resource.resource_relationship (derived_from_sample); a join key into Milestone 3''s experimental metadata.'; COMMENT ON COLUMN resource.bedbase__bedfile."experiment_id" IS 'GEO/ENCODE experiment ids, sorted list, e.g. [''geo:gse159673'']. Joinable form: resource.resource_relationship (derived_from_experiment).'; COMMENT ON COLUMN resource.bedbase__bedfile."compliance" IS 'BED-standard compliance class, e.g. ''bed6+4''.'; COMMENT ON COLUMN resource.bedbase__bedfile."format" IS 'Upstream data format BEDbase detected.'; COMMENT ON COLUMN resource.bedbase__bedfile."license_id" IS 'Licence as a DUO code, carried on every row — we reference this file, we do not redistribute it, and this is what makes that honest. See raw.bedbase__bed.license_id.'; COMMENT ON COLUMN resource.bedbase__bedfile."provider" IS 'Constant ''BEDbase'': the catalog this resource entry was read from, per SPEC''s Resource Metadata Layer.'; COMMENT ON COLUMN resource.bedbase__bedfile."submitted" IS 'Submission timestamp, ISO 8601 text as published.'; COMMENT ON COLUMN resource.bedbase__bedfile."updated" IS 'Last-update timestamp, ISO 8601 text as published.'; COMMENT ON COLUMN resource.bedbase__bedfile."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN resource.bedbase__bedfile."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW resource.bedbase__bedset AS SELECT * FROM read_parquet('./resource/bedbase__bedset.parquet'); COMMENT ON VIEW resource.bedbase__bedset IS 'One row per BEDbase bedset, Type 2 by resource_id, from BEDbase''s monthly Parquet snapshot. Membership (which BED files belong to a bedset) is resource.resource_relationship: resource_id = the BED file, relationship = ''member_of_bedset'', target_id = this table''s resource_id.'; COMMENT ON COLUMN resource.bedbase__bedset."resource_id" IS 'BEDbase''s bedset id (raw.bedbase__bedset.id). Business key — one live row per bedset, Type 2 on any attribute change.'; COMMENT ON COLUMN resource.bedbase__bedset."title" IS 'Bedset name, from raw.bedbase__bedset.name.'; COMMENT ON COLUMN resource.bedbase__bedset."description" IS 'Bedset description, Markdown text as published.'; COMMENT ON COLUMN resource.bedbase__bedset."bedfile_count" IS 'Member BED files, per BEDbase''s own count.'; COMMENT ON COLUMN resource.bedbase__bedset."author" IS 'Curator/submitter name as published.'; COMMENT ON COLUMN resource.bedbase__bedset."bedset_source" IS 'BEDbase''s own ''source'' field on this bedset — see raw.bedbase__bedset.bedset_source for the rename.'; COMMENT ON COLUMN resource.bedbase__bedset."provider" IS 'Constant ''BEDbase'': the catalog this resource entry was read from, per SPEC''s Resource Metadata Layer.'; COMMENT ON COLUMN resource.bedbase__bedset."submitted" IS 'Submission timestamp, ISO 8601 text as published.'; COMMENT ON COLUMN resource.bedbase__bedset."updated" IS 'Last-update timestamp, ISO 8601 text as published.'; COMMENT ON COLUMN resource.bedbase__bedset."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN resource.bedbase__bedset."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW annotation.icite__citation AS SELECT * FROM read_parquet('./annotation/icite__citation.parquet'); COMMENT ON VIEW annotation.icite__citation IS 'The PubMed citation graph as iCite publishes it: one row per (citing, cited) pair: the NIH Open Citation Collection exactly, via the references lists in raw.icite__metadata (928,458,585 edges in the 2026-08 snapshot, equal to the OCC file). An edge has no attributes, so it is only ever asserted or withdrawn: valid_from is the release it appeared in, valid_to the release it vanished. ''Who cites X'' is WHERE cited_pmid = X AND valid_to IS NULL. Source: NIH iCite / NIH-OCC, CC BY 4.0.'; COMMENT ON COLUMN annotation.icite__citation."citing_pmid" IS 'PubMed id of the paper that cites. Part of the merge key.'; COMMENT ON COLUMN annotation.icite__citation."cited_pmid" IS 'PubMed id of the paper cited. Part of the merge key.'; COMMENT ON COLUMN annotation.icite__citation."shard" IS 'cited_pmid modulo 16: the unit this table is merged and partitioned in, so ~930M edges never sit in memory at once. Implementation detail, safe to ignore; it exists so the table''s write path is honest.'; COMMENT ON COLUMN annotation.icite__citation."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.icite__citation."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.pubtator3__gene AS SELECT * FROM read_parquet('./raw/pubtator3__gene.parquet'); COMMENT ON VIEW raw.pubtator3__gene IS 'PubTator3''s gene2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.'; COMMENT ON COLUMN raw.pubtator3__gene."pmid" IS 'PubMed id, as text as upstream prints it.'; COMMENT ON COLUMN raw.pubtator3__gene."type" IS 'Entity type. ''Gene'' on every row of this file.'; COMMENT ON COLUMN raw.pubtator3__gene."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.'; COMMENT ON COLUMN raw.pubtator3__gene."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.'; COMMENT ON COLUMN raw.pubtator3__gene."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).'; COMMENT ON COLUMN raw.pubtator3__gene."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.pubtator3__disease AS SELECT * FROM read_parquet('./raw/pubtator3__disease.parquet'); COMMENT ON VIEW raw.pubtator3__disease IS 'PubTator3''s disease2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.'; COMMENT ON COLUMN raw.pubtator3__disease."pmid" IS 'PubMed id, as text as upstream prints it.'; COMMENT ON COLUMN raw.pubtator3__disease."type" IS 'Entity type. ''Disease'' on every row of this file.'; COMMENT ON COLUMN raw.pubtator3__disease."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.'; COMMENT ON COLUMN raw.pubtator3__disease."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.'; COMMENT ON COLUMN raw.pubtator3__disease."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).'; COMMENT ON COLUMN raw.pubtator3__disease."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.pubtator3__chemical AS SELECT * FROM read_parquet('./raw/pubtator3__chemical.parquet'); COMMENT ON VIEW raw.pubtator3__chemical IS 'PubTator3''s chemical2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.'; COMMENT ON COLUMN raw.pubtator3__chemical."pmid" IS 'PubMed id, as text as upstream prints it.'; COMMENT ON COLUMN raw.pubtator3__chemical."type" IS 'Entity type. ''Chemical'' on every row of this file.'; COMMENT ON COLUMN raw.pubtator3__chemical."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.'; COMMENT ON COLUMN raw.pubtator3__chemical."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.'; COMMENT ON COLUMN raw.pubtator3__chemical."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).'; COMMENT ON COLUMN raw.pubtator3__chemical."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.pubtator3__species AS SELECT * FROM read_parquet('./raw/pubtator3__species.parquet'); COMMENT ON VIEW raw.pubtator3__species IS 'PubTator3''s species2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.'; COMMENT ON COLUMN raw.pubtator3__species."pmid" IS 'PubMed id, as text as upstream prints it.'; COMMENT ON COLUMN raw.pubtator3__species."type" IS 'Entity type. ''Species'' on every row of this file.'; COMMENT ON COLUMN raw.pubtator3__species."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.'; COMMENT ON COLUMN raw.pubtator3__species."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.'; COMMENT ON COLUMN raw.pubtator3__species."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).'; COMMENT ON COLUMN raw.pubtator3__species."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW raw.pubtator3__mutation AS SELECT * FROM read_parquet('./raw/pubtator3__mutation.parquet'); COMMENT ON VIEW raw.pubtator3__mutation IS 'PubTator3''s mutation2pubtator3.gz landed verbatim and whole: one row per (PMID, concept) the dump carries, five headerless tab-separated columns. Holds the LATEST dump only — upstream regenerates the file in place about monthly and archives none. Query annotation.pubtator3__mention instead; read this for the mention strings, which are deliberately not derived. NCBI public domain (US Government Work, per the directory README); cite Wei et al. 2024, PubTator 3.0.'; COMMENT ON COLUMN raw.pubtator3__mutation."pmid" IS 'PubMed id, as text as upstream prints it.'; COMMENT ON COLUMN raw.pubtator3__mutation."type" IS 'Entity type. ''Mutation'' on every row of this file.'; COMMENT ON COLUMN raw.pubtator3__mutation."concept_id" IS 'Normalised identifier, verbatim: an NCBI Gene id, ''MESH:D…'', an NCBI Taxonomy id, an rs id or a structured ''tmVar:…;HGVS:…'' string. '';''-joined where one mention resolves to several ids. A literal ''-'' is upstream''s own value for ''recognised but not normalised'' (10.7M chemical rows) and is kept as text, not read as NULL.'; COMMENT ON COLUMN raw.pubtator3__mutation."mentions" IS 'The surface strings found in the paper for this concept, ''|''-joined, as the tagger saw them (case variants, stray punctuation and quotes included). NULL where upstream leaves it empty: rows asserted by a curated resource with no text hit.'; COMMENT ON COLUMN raw.pubtator3__mutation."resource" IS 'Who asserts the row, ''|''-joined in no stable order: ''PubTator3'' for a text-mined hit, otherwise the curated source it was taken from (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, RGD, …).'; COMMENT ON COLUMN raw.pubtator3__mutation."landed_in" IS 'The biocOnIce release whose ingest landed these rows.'; CREATE OR REPLACE VIEW annotation.pubtator3__mention AS SELECT * FROM read_parquet('./annotation/pubtator3__mention.parquet'); COMMENT ON VIEW annotation.pubtator3__mention IS 'Which genes, diseases, chemicals, species and variants each PubMed paper mentions, per PubTator3 (NCBI''s text mining over all of PubMed and PMC open access) and the curated sources it folds in: one row per (paper, concept, asserting resource). Machine annotation — expect false positives, far broader than ncbi__gene_pubmed. No attributes, so a row is only ever asserted or withdrawn. Not derived: rows PubTator3 could not normalise (concept id ''-''), and the mention strings, which churn between dumps; both stay in raw.pubtator3__*. ''Papers about TP53'' is WHERE concept_type = ''Gene'' AND concept_id = ''7157'' AND valid_to IS NULL. NCBI public domain.'; COMMENT ON COLUMN annotation.pubtator3__mention."pmid" IS 'PubMed id of the paper; joins to annotation.icite__publication.pmid and both ends of annotation.icite__citation. Part of the merge key.'; COMMENT ON COLUMN annotation.pubtator3__mention."concept_type" IS '''Gene'', ''Disease'', ''Chemical'', ''Species'' or ''Mutation'', as upstream spells it. In the key because id spaces overlap: ''9606'' is a taxon under Species and a gene under Gene. Part of the merge key.'; COMMENT ON COLUMN annotation.pubtator3__mention."concept_id" IS 'One identifier per row. Gene: NCBI Gene id (joins to annotation.ncbi__gene.gene_id). Species: NCBI Taxonomy id. Disease and Chemical: ''MESH:D…''/''MESH:C…'' (a few OMIM). Mutation: an rs id, or tmVar''s structured string kept whole — its ''VariantGroup:n'' part numbers variants within one paper and is not an identifier. Upstream''s '';''-joined multi-id values are split, except under Mutation where '';'' is part of the id. Part of the merge key.'; COMMENT ON COLUMN annotation.pubtator3__mention."resource" IS 'Who asserts the link, one per row: ''PubTator3'' for a text-mined hit, otherwise a curated source (MESH, gene2pubmed, generifs_basic, CTD, BioGRID, ClinVar, dbSNP, …). Filter resource <> ''PubTator3'' for curated links only. Part of the merge key.'; COMMENT ON COLUMN annotation.pubtator3__mention."shard" IS 'pmid modulo 16: the unit this table is merged and partitioned in, so ~460M rows never sit in one merge. Implementation detail, safe to ignore.'; COMMENT ON COLUMN annotation.pubtator3__mention."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN annotation.pubtator3__mention."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW resource.resource_relationship AS SELECT * FROM read_parquet('./resource/resource_relationship.parquet'); COMMENT ON VIEW resource.resource_relationship IS 'SPEC.md''s resource_relationship: one row per (resource, relationship, target). The joinable form of every multi-valued field on a resource catalog row — the ''which datasets have cell type X in tissue Y'' question is a join here, and an ontology rollup is a join through ontology.relationship. A relationship has no attributes, so a row is only ever asserted or withdrawn.'; COMMENT ON COLUMN resource.resource_relationship."resource_id" IS 'The resource this row is about: resource.cellxgene__dataset.dataset_version_id, resource.bedbase__bedfile.resource_id, ... Part of the merge key.'; COMMENT ON COLUMN resource.resource_relationship."relationship" IS 'What the target is to the resource: has_assay, has_tissue, has_disease, has_cell_type (CELLxGENE; eQTL Catalogue the last two; targets are ontology term ids); derived_from_sample, derived_from_experiment (BEDbase, targets are ''geo:gsm…''-style accessions); member_of_bedset (BEDbase, target is resource.bedbase__bedset.resource_id); part_of_dataset, has_biosample, has_target_gene (ENCODE, targets are ''encode:ENCSR…'', an ontology term id, ''ncbigene:''). Part of the merge key.'; COMMENT ON COLUMN resource.resource_relationship."target_id" IS 'The related thing, as a CURIE or accession: joins to ontology.term.term_id when it is an ontology term, and through ontology.relationship for rollups. Part of the merge key.'; COMMENT ON COLUMN resource.resource_relationship."source" IS 'The writer that asserted this row (''cellxgene'', ''bedbase'', ''eqtlcatalogue'', ''encode''): its merge scope, so one catalog''s re-ingest never retires another''s rows (ADR-0004). Part of the merge key.'; COMMENT ON COLUMN resource.resource_relationship."valid_from" IS 'The biocOnIce release from which this version of the record is valid. A row is one *version*: any change to any attribute closes the previous row and opens a new one, so the value here is not necessarily when the record first existed. It is when biocOnIce first carried this version, not when the source created it — the 51,794 taxa added in 2026.09 existed at NCBI for years.'; COMMENT ON COLUMN resource.resource_relationship."valid_to" IS 'The biocOnIce release at which this version stopped being current, exclusive. NULL means this is the current version — it does not mean unknown. Queries wanting current data must filter on valid_to IS NULL; queries wanting release R want valid_from <= R AND (valid_to IS NULL OR valid_to > R). Like valid_from, this is a biocOnIce release, not the date the source changed the record.'; CREATE OR REPLACE VIEW raw.encode__experiment AS SELECT * FROM read_parquet('./raw/encode__experiment.parquet'); COMMENT ON VIEW raw.encode__experiment IS 'The ENCODE portal''s Experiment inventory landed verbatim from report.tsv: one row per experiment, every status, every assay and organism. All text; list-valued fields are '',''-joined as the portal writes them. The columns are the explicit field list encode.EXPERIMENT_FIELDS, a declared subset of the Experiment object. Holds the LATEST crawl only, as raw.cellxgene__dataset does. ENCODE data are free of use restrictions; the ENCODE Consortium asks to be cited: https://www.encodeproject.org/help/citing-encode/'; COMMENT ON COLUMN raw.encode__experiment."accession" IS 'ENCODE experiment accession, e.g. ''ENCSR000AKS''. Experiments share the ENCSR prefix with every other dataset type (annotations, references, series).'; COMMENT ON COLUMN raw.encode__experiment."uuid" IS 'The portal''s internal UUID for the object.'; COMMENT ON COLUMN raw.encode__experiment."status" IS '''released'', ''archived'' or ''revoked'' — everything an anonymous request can see. Landed whole: not filtered to released.'; COMMENT ON COLUMN raw.encode__experiment."date_created" IS 'ISO 8601 timestamp the object was created on the portal.'; COMMENT ON COLUMN raw.encode__experiment."date_submitted" IS 'YYYY-MM-DD the lab submitted the experiment. NULL where never recorded.'; COMMENT ON COLUMN raw.encode__experiment."date_released" IS 'YYYY-MM-DD of public release.'; COMMENT ON COLUMN raw.encode__experiment."description" IS 'Submitter''s free-text description. Whitespace runs are collapsed to one space by the portal''s TSV writer; quote characters are literal.'; COMMENT ON COLUMN raw.encode__experiment."assay_term_id" IS 'Assay ontology id, e.g. ''OBI:0000716'' (ChIP-seq); ''NTR:…'' is an ENCODE new-term-request placeholder, not a published term.'; COMMENT ON COLUMN raw.encode__experiment."assay_term_name" IS 'Assay ontology label, e.g. ''ChIP-seq''.'; COMMENT ON COLUMN raw.encode__experiment."assay_title" IS 'ENCODE''s display refinement of the assay, e.g. ''TF ChIP-seq'', ''Histone ChIP-seq''.'; COMMENT ON COLUMN raw.encode__experiment."assay_slims" IS 'Assay category slims, '',''-joined, e.g. ''DNA binding''.'; COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_term_id" IS 'Biosample type as an ontology CURIE: UBERON (tissue), CL (cell type), EFO or CLO (cell line), or an ''NTR:'' placeholder.'; COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_term_name" IS 'Label of biosample_ontology_term_id, e.g. ''K562'', ''liver''.'; COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_classification" IS '''tissue'', ''cell line'', ''primary cell'', ''in vitro differentiated cells'', ''organoid'', ''whole organisms'', ...'; COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_organ_slims" IS 'Organ slims of the biosample term, '',''-joined.'; COMMENT ON COLUMN raw.encode__experiment."biosample_ontology_cell_slims" IS 'Cell slims of the biosample term, '',''-joined.'; COMMENT ON COLUMN raw.encode__experiment."biosample_summary" IS 'ENCODE''s generated one-line biosample description, including organism, treatments and modifications.'; COMMENT ON COLUMN raw.encode__experiment."replicates_library_biosample_organism_scientific_name" IS 'Organism of the replicates'' biosamples, e.g. ''Homo sapiens''; '',''-joined if replicates differ. NULL for the experiments with no replicate.'; COMMENT ON COLUMN raw.encode__experiment."replicates_library_biosample_organism_taxon_id" IS 'NCBI taxonomy id of the same, as text; '',''-joined if replicates differ.'; COMMENT ON COLUMN raw.encode__experiment."target_name" IS 'Target as ENCODE names it, ''