Nason commited on
Commit
d2e9c1f
·
verified ·
1 Parent(s): c7d6d85

Clarify dataset units, query setup and snapshot caveats

Browse files
Files changed (1) hide show
  1. README.md +20 -6
README.md CHANGED
@@ -25,6 +25,8 @@ Built with [onet-database](https://github.com/ian-nason/onet-database). Publishe
25
 
26
  ## Quick Start
27
 
 
 
28
  ### DuckDB CLI
29
 
30
  ```sql
@@ -43,7 +45,9 @@ ORDER BY data_value DESC, onet_soc_code
43
  LIMIT 15;
44
  ```
45
 
46
- The database is 11 MB. DuckDB fetches byte ranges as needed; transfer volume depends on the query. The examples use this immutable artifact URL:
 
 
47
 
48
  ```
49
  https://huggingface.co/datasets/Nason/onet-database/resolve/d0e84bacef02d4477423edbf7468cc3ec8fb79c2/onet.duckdb
@@ -51,6 +55,8 @@ https://huggingface.co/datasets/Nason/onet-database/resolve/d0e84bacef02d4477423
51
 
52
  ### Python (duckdb)
53
 
 
 
54
  ```python
55
  import duckdb
56
  con = duckdb.connect(config={"memory_limit": "128MiB", "threads": "1", "max_temp_directory_size": "0B"})
@@ -66,7 +72,9 @@ con.sql("""
66
  con.close()
67
  ```
68
 
69
- ### R (DBI + duckdb)
 
 
70
 
71
  ```r
72
  library(DBI)
@@ -82,13 +90,16 @@ In the tested R DuckDB 1.5.5 configuration, BIGINT and DECIMAL results are expos
82
 
83
  ### datapond package
84
 
85
- These examples use the public default catalog and the package's normal discovery and connection API:
 
 
86
 
87
  ```python
88
  import datapond
89
  print(datapond.list())
90
  datapond.describe('onet', table='work_context')
91
  con = datapond.connect('onet')
 
92
  con.sql('SELECT onet_soc_code, title FROM occupation_data ORDER BY onet_soc_code LIMIT 5').show()
93
  con.close()
94
  ```
@@ -97,6 +108,7 @@ con.close()
97
  library(datapond)
98
  dp_list()
99
  con <- dp_connect('onet')
 
100
  dp_describe(con, table = 'work_context')
101
  DBI::dbGetQuery(con, "SELECT onet_soc_code, title FROM occupation_data ORDER BY onet_soc_code LIMIT 5")
102
  dp_disconnect(con)
@@ -120,13 +132,15 @@ DBI::dbGetQuery(con, "SELECT onet_soc_code, title FROM occupation_data ORDER BY
120
  dp_disconnect(con)
121
  ```
122
 
123
- Verify the recorded artifact SHA-256 after downloading. In tested Python 0.1.1, the optional Hugging Face download path follows the default branch rather than the pinned URL; see [consumer verification](https://github.com/ian-nason/onet-database/blob/main/docs/CONSUMERS.md) for the tested configuration.
124
 
125
  Default-catalog discovery and representative remote queries were verified after the registry merge. Earlier full-download checks used an isolated candidate registry. See [consumer verification](https://github.com/ian-nason/onet-database/blob/main/docs/CONSUMERS.md) for exact client versions, paths, resource limits and download behavior. The direct URL examples above work independently of the catalog. The SQL examples below use the `onet` catalog alias from the direct-URL quick start.
126
 
127
 
128
  ## Tables
129
 
 
 
130
  | Table | Description | Rows | Columns |
131
  |---|---|---:|---:|
132
  | `work_context` | Work-context scale means and separate response-category percentages; never pool scales/categories | 305,389 | 16 |
@@ -196,11 +210,11 @@ The full set is in [examples.sql](https://github.com/ian-nason/onet-database/blo
196
  ## Researcher Caveats
197
 
198
  1. **Scales are not interchangeable.** `IM` is importance (1 to 5), `LV` is level (0 to 7), `CX` is a 1 to 5 mean, `CT` a 1 to 3 mean, and `CXP`/`CTP` are category percentages (0 to 100). Never pool `data_value` across scales; use `scales_reference`, `level_scale_anchors` and `work_context_categories` for meaning.
199
- 2. **Suppression and relevance flags.** `recommend_suppress='Y'` marks low precision; values are retained exactly. For rankings require an explicit `'N'`, which also excludes rows where the flag is missing. `not_relevant='Y'` is a separate flag; a missing value is not an explicit `'N'`.
200
  3. **Uncertainty is per rating.** `n` is the rating sample size, not employment. Standard errors and confidence bounds come from the analyst, incumbent, occupational-expert or transition methods documented by O*NET; do not pool ratings as if independent. See the official [analyst](https://www.onetcenter.org/dictionary/31.0/csv/appendix_analyst.html) and [incumbent/expert](https://www.onetcenter.org/dictionary/31.0/csv/appendix_incumbent.html) notes.
201
  4. **One snapshot, not a panel.** `update_date` keeps the source `MM/YYYY` string; selected ratings span December 2005 to August 2026 and skills span June 2010 to August 2026. Parsing with `strptime(update_date, '%m/%Y')` is for ordering only.
202
  5. **O*NET-SOC codes are ten characters.** Several detailed occupations share a six-digit SOC parent, so a crosswalk is not necessarily one-to-one. No SOC, NAICS, QCEW or ATUS crosswalk is included.
203
- 6. **Grain multiplies.** An occupation has many titles, skills and context rows. Select or aggregate each table to one row per occupation before joining, as the comparison example does.
204
  7. **Percentages describe ratings.** Category percentages sum to about 100 after source rounding and are not worker counts. Exposure scores describe reported work context, not infection incidence or individual risk.
205
 
206
  ## Data Source and Version
 
25
 
26
  ## Quick Start
27
 
28
+ Choose one route: the [datapond package](#datapond-package) finds the database by catalog ID; the direct [Python](#python-duckdb), [R](#r-with-dbi-and-duckdb) and SQL examples use a fixed artifact URL. These are alternatives, not steps that must all be run. The SQL block requires a DuckDB SQL client.
29
+
30
  ### DuckDB CLI
31
 
32
  ```sql
 
45
  LIMIT 15;
46
  ```
47
 
48
+ The database file is 10.8 MiB. DuckDB fetches byte ranges as needed; transfer volume depends on the query. File size is disk storage, not a RAM estimate. Remote queries still run on your machine and can transfer much of the file. A filter or `LIMIT` after a join or aggregate does not guarantee a small scan. The 128 MiB setting limits DuckDB's buffer pool, not the whole Python/R process; with spill disabled, a larger query can fail at that limit. Download only if you have room for the file, temporary download bytes and any existing copy.
49
+
50
+ The examples use this immutable artifact URL:
51
 
52
  ```
53
  https://huggingface.co/datasets/Nason/onet-database/resolve/d0e84bacef02d4477423edbf7468cc3ec8fb79c2/onet.duckdb
 
55
 
56
  ### Python (duckdb)
57
 
58
+ Install the Python dependency once in the environment that runs your query: `python -m pip install duckdb`.
59
+
60
  ```python
61
  import duckdb
62
  con = duckdb.connect(config={"memory_limit": "128MiB", "threads": "1", "max_temp_directory_size": "0B"})
 
72
  con.close()
73
  ```
74
 
75
+ ### R with DBI and duckdb
76
+
77
+ Install the R dependencies once: `install.packages(c("DBI", "duckdb"))`.
78
 
79
  ```r
80
  library(DBI)
 
90
 
91
  ### datapond package
92
 
93
+ Install or upgrade the Python client with `python -m pip install --upgrade datapond`, or install the released R client from [CRAN](https://cran.r-project.org/package=datapond) with `install.packages("datapond")`. Remote examples are tested with Python datapond 0.1.5 (DuckDB 1.5.4) and CRAN R datapond 0.1.0 (DuckDB 1.5.5); older DuckDB reader versions are not verified here. R 0.1.1 is a separate development version, not the CRAN release.
94
+
95
+ The examples below use the public default catalog. For limits set before attachment, use the direct DuckDB examples above; package examples here set limits immediately after connecting:
96
 
97
  ```python
98
  import datapond
99
  print(datapond.list())
100
  datapond.describe('onet', table='work_context')
101
  con = datapond.connect('onet')
102
+ con.execute("SET memory_limit='128MiB'; SET threads=1; SET max_temp_directory_size='0B'")
103
  con.sql('SELECT onet_soc_code, title FROM occupation_data ORDER BY onet_soc_code LIMIT 5').show()
104
  con.close()
105
  ```
 
108
  library(datapond)
109
  dp_list()
110
  con <- dp_connect('onet')
111
+ DBI::dbExecute(con, "SET memory_limit='128MiB'; SET threads=1; SET max_temp_directory_size='0B'")
112
  dp_describe(con, table = 'work_context')
113
  DBI::dbGetQuery(con, "SELECT onet_soc_code, title FROM occupation_data ORDER BY onet_soc_code LIMIT 5")
114
  dp_disconnect(con)
 
132
  dp_disconnect(con)
133
  ```
134
 
135
+ Verify the recorded artifact SHA-256 after downloading. In Python datapond 0.1.5 as well as 0.1.1, the optional `huggingface_hub` download path follows the repository default branch rather than the pinned URL. For an exact-version copy, download the immutable URL shown above and verify its checksum; see [consumer verification](https://github.com/ian-nason/onet-database/blob/main/docs/CONSUMERS.md) for the tested configuration.
136
 
137
  Default-catalog discovery and representative remote queries were verified after the registry merge. Earlier full-download checks used an isolated candidate registry. See [consumer verification](https://github.com/ian-nason/onet-database/blob/main/docs/CONSUMERS.md) for exact client versions, paths, resource limits and download behavior. The direct URL examples above work independently of the catalog. The SQL examples below use the `onet` catalog alias from the direct-URL quick start.
138
 
139
 
140
  ## Tables
141
 
142
+ A rating row describes one occupation, one element and one scale; work-context distributions also have a response category. Occupation records, alternate titles and reference tables have different units, listed below. Rating update months vary within this single release.
143
+
144
  | Table | Description | Rows | Columns |
145
  |---|---|---:|---:|
146
  | `work_context` | Work-context scale means and separate response-category percentages; never pool scales/categories | 305,389 | 16 |
 
210
  ## Researcher Caveats
211
 
212
  1. **Scales are not interchangeable.** `IM` is importance (1 to 5), `LV` is level (0 to 7), `CX` is a 1 to 5 mean, `CT` a 1 to 3 mean, and `CXP`/`CTP` are category percentages (0 to 100). Never pool `data_value` across scales; use `scales_reference`, `level_scale_anchors` and `work_context_categories` for meaning.
213
+ 2. **Suppression and relevance flags.** `recommend_suppress='Y'` marks low precision; values are retained exactly. For rankings, require an explicit `'N'`, which also excludes rows where the flag is missing. `not_relevant='Y'` is a separate flag; a missing value is not an explicit `'N'`.
214
  3. **Uncertainty is per rating.** `n` is the rating sample size, not employment. Standard errors and confidence bounds come from the analyst, incumbent, occupational-expert or transition methods documented by O*NET; do not pool ratings as if independent. See the official [analyst](https://www.onetcenter.org/dictionary/31.0/csv/appendix_analyst.html) and [incumbent/expert](https://www.onetcenter.org/dictionary/31.0/csv/appendix_incumbent.html) notes.
215
  4. **One snapshot, not a panel.** `update_date` keeps the source `MM/YYYY` string; selected ratings span December 2005 to August 2026 and skills span June 2010 to August 2026. Parsing with `strptime(update_date, '%m/%Y')` is for ordering only.
216
  5. **O*NET-SOC codes are ten characters.** Several detailed occupations share a six-digit SOC parent, so a crosswalk is not necessarily one-to-one. No SOC, NAICS, QCEW or ATUS crosswalk is included.
217
+ 6. **Joins can multiply rows.** An occupation has many titles, skills and context rows. Select or aggregate each table to one row per occupation before joining, as the comparison example does.
218
  7. **Percentages describe ratings.** Category percentages sum to about 100 after source rounding and are not worker counts. Exposure scores describe reported work context, not infection incidence or individual risk.
219
 
220
  ## Data Source and Version