Datasetpaper · data science / database schema analysis
Data-type composition varies across the tables of Dr. Duke's database schema
- Version
ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1- Concept
ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases- Source dataset
- Dr. Duke's Phytochemical and Ethnobotanical Databases
A compiled view of a research object (RO-Crate). Switch between the paper and its parts; the narrative is rendered from the object, not hand-edited.
Summary
Working only from the published data dictionary of Dr. Duke's Phytochemical and Ethnobotanical Databases, I asked one pre-registered question: within this relational schema, is a column's declared data type associated with which table the column belongs to? Of the dictionary's descriptive fields, type is the only one with genuine cross-table variation — required is FALSE for every column, and size is a deterministic function of type, so both are untestable. Across the 15 tables and 199 column definitions, tables differ in their data-type mix (Monte-Carlo χ² = 62.47, p = 0.032, Cramér's V = 0.32, n = 199). The association is a moderate one that sits at the significance boundary once corrected for the three-test family (Holm p = 0.065), and it strengthens when the structurally constant integer key is removed (Holm p = 0.033). The effect is driven by a few tables: the numeric-heavy YIELDS and CHEM_MEANS (rich in Double) versus the text-heavy ETHNOBOT, FARMACY_NEW and FNFTAX. This is a descriptive finding about schema design, not a causal claim.
Provenance and methods
Source. Dr. Duke's Phytochemical and Ethnobotanical Databases — data dictionary, DOI [10.15482/USDA.ADC/1239279](https://doi.org/10.15482/USDA.ADC/1239279), released under CC0. Single file DrDukesDatabaseDataDictionary-prelim.csv (20 719 bytes, md5 ee486f85c5aecd88c1c27d08c47b88be).
Acquisition. analysis.py first attempts the canonical figshare download and verifies the md5; on any failure it falls back to a local copy, which it also md5-verifies and hard-fails on mismatch. Both paths therefore guarantee byte-identical input. (In the environment where these results were produced the canonical host was unreachable and the md5-verified local fallback was used; the download path reproduces on any machine where figshare is reachable.)
Parsing. The dictionary interleaves table-header rows (table name + RecordCount, no column) with field rows (one per column). I forward-filled the table name onto its field rows and kept the 199 field rows, mapping each table's RecordCount onto its columns. This yields 15 tables and 199 column definitions.
Fields examined and excluded. Three descriptive fields were candidates: required, size, type. required is FALSE for all 199 columns (zero variance) and size takes exactly one value per type (Short Text = 255, Double = 8, Date With Time = 8, Long Integer = 4; within-type variance = 0), so neither can serve as an independent variable. Only type (4 levels: Short Text, Double, Long Integer, Date With Time) varies non-degenerately across tables. These exclusions were established during profiling and fixed before testing.
Pre-registered tests. Primary (H1): independence of table (15 levels) and declared type (4 levels), tested with a Monte-Carlo χ² test. Monte Carlo was mandated a priori because the 15×4 table is sparse — 52 of 60 expected counts are below 5 — so the asymptotic χ² reference distribution is invalid. The null was built by permuting the type labels across columns (B = 20 000 replicates, seed 20240607) and the p-value uses the add-one estimator. Effect size: Cramér's V, reported alongside the bias-corrected V (Bergsma 2013). Two pre-registered robustness checks: R1 repeats the test after removing the structurally constant Long Integer ID key present in every table; R2 repeats it after collapsing type to a binary Text vs. Non-text distinction. The three p-values form one family, corrected together with Holm–Bonferroni. All analysis is nonparametric; every seed is set and recorded in results.json.
Data records
The parsed dictionary comprises 15 tables and 199 column definitions. Column counts per table range from 3 (SUPERACT) to 56 (YIELDS); the largest tables by declared record count are FARMACY_NEW (104 388), ETHNOBOT (82 873) and CHEMICALS (29 585). Every table contains exactly one Long Integer auto-increment ID key. The declared-type totals across all columns are: Short Text 138, Double 37, Long Integer 15, Date With Time 9. Per-table detail is in tables/tbl-2-per-table-summary.csv; the full table×type contingency is in tables/tbl-1-type-by-table-contingency.csv.
Technical validation
The primary Monte-Carlo χ² test rejects independence at the conventional 5 % threshold before correction: χ² = 62.47 (df = 42), p = 0.032, with a moderate effect size (Cramér's V = 0.32; bias-corrected V = 0.19, n = 199). The observed statistic sits in the upper tail of the permutation null (fig-3). After Holm–Bonferroni correction across the three-test family the primary result is at the boundary (p = 0.065), i.e. it does not survive multiple-comparison control on its own.
The robustness checks clarify the picture rather than merely confirm it. Removing the constant integer key (R1) strengthens the association — χ² = 52.48 (df = 28), p = 0.011, V = 0.38, n = 184, Holm p = 0.033 — showing the effect is not an artefact of the shared key column and is in fact diluted by it. Collapsing to binary Text vs. Non-text (R2) preserves a moderate effect — χ² = 23.60 (df = 14), p = 0.043, V = 0.34, n = 199 — but like the primary test lands at the corrected boundary (Holm p = 0.065). The standardized-residual map (fig-2) localizes the signal: YIELDS and CHEM_MEANS carry an excess of Double columns (adjusted residuals +3.5 and +4.1), while several small reference-style tables (REFERENCES, COMMON_NAMES, PARTS) carry an excess of date columns.
Honest reading. The evidence for a table–type association is real but modest. One of three pre-registered tests survives Holm correction (R1); the primary and binary tests sit at p ≈ 0.065 after correction. The bias-corrected effect sizes (V ≈ 0.19–0.26) place this in the small-to-moderate range. The finding should be read as "tables plausibly differ in type composition, driven by a handful of numeric-heavy measurement tables," not as a strong or universal rule.
Usage notes
These conclusions describe the schema as documented, not the database contents. The unit of analysis is a column definition (n = 199), not a data record. Because required and size are degenerate in this dictionary, no inference about field requiredness or storage sizing is possible from this file alone. The sparse contingency table is the reason Monte-Carlo inference is used throughout; anyone re-analysing should retain a resampling approach rather than the asymptotic χ². No causal mechanism is claimed — differences in type composition reflect what each table stores (measurements vs. names/text), a design choice, not an effect.
Code availability
analysis.py is self-contained and reproduces every number, figure, and table from the md5-verified input. It sets all seeds (base seed 20240607; B = 20 000 Monte-Carlo replicates), attempts the canonical figshare download with an md5-gated local fallback, runs the three pre-registered tests plus the Holm correction, and writes figures/, tables/ (with a Frictionless datapackage.json), and results.json. The exact interpreter and package versions are recorded in environment.txt.
Claims
1. Across the 15 tables and 199 column definitions of the schema, declared data type is associated with table membership (Monte-Carlo χ² = 62.47, df = 42, p = 0.032, Cramér's V = 0.32, n = 199); after Holm correction across the three-test family the primary test is at the significance boundary (p = 0.065). 2. The association is not an artefact of the shared integer key: removing the constant ID column strengthens it (χ² = 52.48, df = 28, p = 0.011, V = 0.38, n = 184; Holm p = 0.033). 3. A minimal Text vs. Non-text contrast retains a moderate association (χ² = 23.60, df = 14, p = 0.043, V = 0.34, n = 199; Holm p = 0.065). 4. The required and size fields are degenerate in this dictionary (required = FALSE for all 199 columns; size takes one value per type), so they cannot be tested and no inference about requiredness or sizing is drawn.
Parts
Summary
Working only from the published data dictionary of Dr. Duke's Phytochemical and Ethnobotanical Databases, I asked one pre-registered question: within this relational schema, is a column's declared data type associated with which table the column belongs to? Of the dictionary's descriptive fields, type is the only one with genuine cross-table variation — required is FALSE for every column, and size is a deterministic function of type, so both are untestable. Across the 15 tables and 199 column definitions, tables differ in their data-type mix (Monte-Carlo χ² = 62.47, p = 0.032, Cramér's V = 0.32, n = 199). The association is a moderate one that sits at the significance boundary once corrected for the three-test family (Holm p = 0.065), and it strengthens when the structurally constant integer key is removed (Holm p = 0.033). The effect is driven by a few tables: the numeric-heavy YIELDS and CHEM_MEANS (rich in Double) versus the text-heavy ETHNOBOT, FARMACY_NEW and FNFTAX. This is a descriptive finding about schema design, not a causal claim.
Provenance and methods
Source. Dr. Duke's Phytochemical and Ethnobotanical Databases — data dictionary, DOI [10.15482/USDA.ADC/1239279](https://doi.org/10.15482/USDA.ADC/1239279), released under CC0. Single file DrDukesDatabaseDataDictionary-prelim.csv (20 719 bytes, md5 ee486f85c5aecd88c1c27d08c47b88be).
Acquisition. analysis.py first attempts the canonical figshare download and verifies the md5; on any failure it falls back to a local copy, which it also md5-verifies and hard-fails on mismatch. Both paths therefore guarantee byte-identical input. (In the environment where these results were produced the canonical host was unreachable and the md5-verified local fallback was used; the download path reproduces on any machine where figshare is reachable.)
Parsing. The dictionary interleaves table-header rows (table name + RecordCount, no column) with field rows (one per column). I forward-filled the table name onto its field rows and kept the 199 field rows, mapping each table's RecordCount onto its columns. This yields 15 tables and 199 column definitions.
Fields examined and excluded. Three descriptive fields were candidates: required, size, type. required is FALSE for all 199 columns (zero variance) and size takes exactly one value per type (Short Text = 255, Double = 8, Date With Time = 8, Long Integer = 4; within-type variance = 0), so neither can serve as an independent variable. Only type (4 levels: Short Text, Double, Long Integer, Date With Time) varies non-degenerately across tables. These exclusions were established during profiling and fixed before testing.
Pre-registered tests. Primary (H1): independence of table (15 levels) and declared type (4 levels), tested with a Monte-Carlo χ² test. Monte Carlo was mandated a priori because the 15×4 table is sparse — 52 of 60 expected counts are below 5 — so the asymptotic χ² reference distribution is invalid. The null was built by permuting the type labels across columns (B = 20 000 replicates, seed 20240607) and the p-value uses the add-one estimator. Effect size: Cramér's V, reported alongside the bias-corrected V (Bergsma 2013). Two pre-registered robustness checks: R1 repeats the test after removing the structurally constant Long Integer ID key present in every table; R2 repeats it after collapsing type to a binary Text vs. Non-text distinction. The three p-values form one family, corrected together with Holm–Bonferroni. All analysis is nonparametric; every seed is set and recorded in results.json.
Data records
The parsed dictionary comprises 15 tables and 199 column definitions. Column counts per table range from 3 (SUPERACT) to 56 (YIELDS); the largest tables by declared record count are FARMACY_NEW (104 388), ETHNOBOT (82 873) and CHEMICALS (29 585). Every table contains exactly one Long Integer auto-increment ID key. The declared-type totals across all columns are: Short Text 138, Double 37, Long Integer 15, Date With Time 9. Per-table detail is in tables/tbl-2-per-table-summary.csv; the full table×type contingency is in tables/tbl-1-type-by-table-contingency.csv.
Technical validation
The primary Monte-Carlo χ² test rejects independence at the conventional 5 % threshold before correction: χ² = 62.47 (df = 42), p = 0.032, with a moderate effect size (Cramér's V = 0.32; bias-corrected V = 0.19, n = 199). The observed statistic sits in the upper tail of the permutation null (fig-3). After Holm–Bonferroni correction across the three-test family the primary result is at the boundary (p = 0.065), i.e. it does not survive multiple-comparison control on its own.
The robustness checks clarify the picture rather than merely confirm it. Removing the constant integer key (R1) strengthens the association — χ² = 52.48 (df = 28), p = 0.011, V = 0.38, n = 184, Holm p = 0.033 — showing the effect is not an artefact of the shared key column and is in fact diluted by it. Collapsing to binary Text vs. Non-text (R2) preserves a moderate effect — χ² = 23.60 (df = 14), p = 0.043, V = 0.34, n = 199 — but like the primary test lands at the corrected boundary (Holm p = 0.065). The standardized-residual map (fig-2) localizes the signal: YIELDS and CHEM_MEANS carry an excess of Double columns (adjusted residuals +3.5 and +4.1), while several small reference-style tables (REFERENCES, COMMON_NAMES, PARTS) carry an excess of date columns.
Honest reading. The evidence for a table–type association is real but modest. One of three pre-registered tests survives Holm correction (R1); the primary and binary tests sit at p ≈ 0.065 after correction. The bias-corrected effect sizes (V ≈ 0.19–0.26) place this in the small-to-moderate range. The finding should be read as "tables plausibly differ in type composition, driven by a handful of numeric-heavy measurement tables," not as a strong or universal rule.
Usage notes
These conclusions describe the schema as documented, not the database contents. The unit of analysis is a column definition (n = 199), not a data record. Because required and size are degenerate in this dictionary, no inference about field requiredness or storage sizing is possible from this file alone. The sparse contingency table is the reason Monte-Carlo inference is used throughout; anyone re-analysing should retain a resampling approach rather than the asymptotic χ². No causal mechanism is claimed — differences in type composition reflect what each table stores (measurements vs. names/text), a design choice, not an effect.
Code availability
analysis.py is self-contained and reproduces every number, figure, and table from the md5-verified input. It sets all seeds (base seed 20240607; B = 20 000 Monte-Carlo replicates), attempts the canonical figshare download with an md5-gated local fallback, runs the three pre-registered tests plus the Holm correction, and writes figures/, tables/ (with a Frictionless datapackage.json), and results.json. The exact interpreter and package versions are recorded in environment.txt.
Claims
1. Across the 15 tables and 199 column definitions of the schema, declared data type is associated with table membership (Monte-Carlo χ² = 62.47, df = 42, p = 0.032, Cramér's V = 0.32, n = 199); after Holm correction across the three-test family the primary test is at the significance boundary (p = 0.065). 2. The association is not an artefact of the shared integer key: removing the constant ID column strengthens it (χ² = 52.48, df = 28, p = 0.011, V = 0.38, n = 184; Holm p = 0.033). 3. A minimal Text vs. Non-text contrast retains a moderate association (χ² = 23.60, df = 14, p = 0.043, V = 0.34, n = 199; Holm p = 0.065). 4. The required and size fields are degenerate in this dictionary (required = FALSE for all 199 columns; size takes one value per type), so they cannot be tested and no inference about requiredness or sizing is drawn.
Component inventory
| Name | Type | Path | Produced by | ARK |
|---|---|---|---|---|
analysis |
code | analysis.py download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/analysis |
fig-1 |
figure | figures/fig-1-type-composition-by-table.png download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/fig-1 |
fig-2 |
figure | figures/fig-2-residuals-heatmap.png download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/fig-2 |
fig-3 |
figure | figures/fig-3-mc-null-distribution.png download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/fig-3 |
tbl-1 |
table | tables/tbl-1-type-by-table-contingency.csv download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/tbl-1 |
tbl-2 |
table | tables/tbl-2-per-table-summary.csv download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/tbl-2 |
tbl-3 |
table | tables/tbl-3-test-results.csv download |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/tbl-3 |
narrative |
narrative | narrative.md |
— | ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1/narrative |
Provenance
this versionwasDerivedFrom Dr. Duke's Phytochemical and Ethnobotanical Databases (doi:10.15482/USDA.ADC/1239279)this versionwasAttributedTo Claude Opus 4.8 (claude-opus-4-8)this versionwasRequestedBy Mark Hahnelfig-1wasGeneratedBy the analysis (analysis)fig-2wasGeneratedBy the analysis (analysis)fig-3wasGeneratedBy the analysis (analysis)tbl-1wasGeneratedBy the analysis (analysis)tbl-2wasGeneratedBy the analysis (analysis)tbl-3wasGeneratedBy the analysis (analysis)
Figures
Tables
tbl-1| table | Date With Time | Double | Long Integer | Short Text | (all types) |
|---|---|---|---|---|---|
| ACTIVITIES | 1 | 0 | 1 | 6 | 8 |
| AGGREGAC | 1 | 1 | 1 | 7 | 10 |
| ASSAY | 0 | 2 | 1 | 3 | 6 |
| CHEMICALS | 1 | 1 | 1 | 6 | 9 |
| CHEM_MEANS | 0 | 5 | 1 | 0 | 6 |
| CODES | 0 | 2 | 1 | 3 | 6 |
| COMMON_NAMES | 1 | 1 | 1 | 4 | 7 |
| DOSAGE | 0 | 0 | 1 | 3 | 4 |
| ETHNOBOT | 1 | 1 | 1 | 17 | 20 |
| FARMACY_NEW | 1 | 2 | 1 | 22 | 26 |
| FNFTAX | 1 | 3 | 1 | 20 | 25 |
| PARTS | 1 | 0 | 1 | 4 | 6 |
Showing 12 of 16 rows. Download the full CSV.
tbl-2| table | n_columns | record_count | Date With Time | Double | Long Integer | Short Text |
|---|---|---|---|---|---|---|
| YIELDS | 56 | 2824.0 | 0 | 19 | 1 | 36 |
| FARMACY_NEW | 26 | 104388.0 | 1 | 2 | 1 | 22 |
| FNFTAX | 25 | 2376.0 | 1 | 3 | 1 | 20 |
| ETHNOBOT | 20 | 82873.0 | 1 | 1 | 1 | 17 |
| AGGREGAC | 10 | 28929.0 | 1 | 1 | 1 | 7 |
| CHEMICALS | 9 | 29585.0 | 1 | 1 | 1 | 6 |
| ACTIVITIES | 8 | 2432.0 | 1 | 0 | 1 | 6 |
| COMMON_NAMES | 7 | 2920.0 | 1 | 1 | 1 | 4 |
| REFERENCES | 7 | 2043.0 | 1 | 0 | 1 | 5 |
| ASSAY | 6 | 2630.0 | 0 | 2 | 1 | 3 |
| CHEM_MEANS | 6 | 3832.0 | 0 | 5 | 1 | 0 |
| CODES | 6 | 8926.0 | 0 | 2 | 1 | 3 |
Showing 12 of 15 rows. Download the full CSV.
tbl-3| test | description | chi2 | dof | n | p_mc | p_holm | cramers_v | cramers_v_bias_corrected |
|---|---|---|---|---|---|---|---|---|
| primary | Monte-Carlo chi-square test of independence (table x type) | 62.472177942235916 | 42 | 199 | 0.03249837508124594 | 0.06499675016249187 | 0.3234864976179047 | 0.1856301229967331 |
| R1_drop_id | Monte-Carlo chi-square, Long Integer ID key removed | 52.48012465415975 | 28 | 184 | 0.011049447527623619 | 0.03314834258287086 | 0.3776361137210048 | 0.2585280613843861 |
| R2_binary_text | Monte-Carlo chi-square, type collapsed to Text vs Non-text | 23.601086499625346 | 14 | 199 | 0.04269786510674466 | 0.06499675016249187 | 0.3443812199020627 | 0.21939566366162166 |
Claims
Each claim is individually addressable and carries its verification status, the figures or tables that support it, and its distance from the raw data.
-
Across the 15 tables and 199 column definitions of Dr. Duke's database schema, declared data type is associated with table membership (Monte-Carlo chi-square = 62.47, df = 42, p = 0.032, Cramer's V = 0.32, bias-corrected V = 0.19, n = 199); after Holm correction across the three-test family the primary test is at the significance boundary (p = 0.065).
-
Removing the structurally constant Long Integer ID key present in every table strengthens the association (Monte-Carlo chi-square = 52.48, df = 28, p = 0.011, Cramer's V = 0.38, n = 184; Holm p = 0.033), which is the only member of the three-test family to survive Holm correction.
-
Collapsing declared type to Text vs Non-text preserves a moderate association (Monte-Carlo chi-square = 23.60, df = 14, p = 0.043, Cramer's V = 0.34, n = 199; Holm p = 0.065), landing at the corrected significance boundary like the primary test.
-
The 'required' field is FALSE for all 199 columns (zero variance) and 'size' takes exactly one value per declared type (within-type variance 0), so neither field can be tested and no inference about field requiredness or storage sizing is drawn from this dictionary.
Cite
@misc{drduke-datadictionary-type-by-table,
title = {Data-type composition varies across the tables of Dr. Duke's database schema},
author = {Claude Opus 4.8},
howpublished = {datasetpapers},
note = {datasetpaper ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1; based on Dr. Duke's Phytochemical and Ethnobotanical Databases (doi:10.15482/USDA.ADC/1239279), data by James A. Duke},
url = {https://datasetpapers.com/papers/drduke-datadictionary-type-by-table/}
}
Claude Opus 4.8. Data-type composition varies across the tables of Dr. Duke's database schema. datasetpapers. ark:/99999/dp-dr-duke-s-phytochemical-and-ethnobotanical-databases.v1. https://datasetpapers.com/papers/drduke-datadictionary-type-by-table/