File size: 22,073 Bytes
ca6062b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8df2449
 
ac318fd
 
 
 
 
74ad8af
 
 
 
 
 
ac318fd
74ad8af
 
 
 
 
 
 
 
 
 
 
ac318fd
 
98547ac
ac318fd
 
 
98547ac
 
 
74ad8af
 
 
 
 
ac318fd
 
 
 
 
 
 
74ad8af
 
ac318fd
74ad8af
 
 
 
ac318fd
8df2449
 
 
ac318fd
8df2449
 
 
 
 
1e7ce92
8df2449
 
 
 
 
1e7ce92
8df2449
 
 
 
 
 
 
 
1e7ce92
8df2449
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98547ac
 
 
8df2449
 
74ad8af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8df2449
 
ac318fd
 
 
 
 
 
1e7ce92
 
 
ac318fd
 
 
 
 
c70f771
 
 
c914ca8
 
 
 
 
c70f771
 
 
 
 
 
1e7ce92
 
c70f771
 
1e7ce92
c70f771
 
1e7ce92
 
c70f771
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ca6062b
c32e6c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ca6062b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
---
license: cc-by-sa-4.0
tags:
- chemistry
- reactions
- cheminformatics
pretty_name: The Open Reaction Database
configs:
- config_name: default
  default: true
  data_files:
  - data/00/ord_dataset-00005539a1e04c809a9a78647bea649c.parquet
  - data/03/ord_dataset-0316886541d9435489859c2ad7edc863.parquet
  - data/0c/ord_dataset-0c75d67751634f0594b24b9f498b77c2.parquet
  - data/10/ord_dataset-10b940e7982c4622b1e1ac879394aba6.parquet
  - data/17/ord_dataset-172039a759a440219a68af62d203b79b.parquet
  - data/1d/ord_dataset-1d3a1a6fb70d46c084602d0688967afc.parquet
  - data/1e/ord_dataset-1ec2807f02fa4beda27d2a81b86eb843.parquet
  - data/20/ord_dataset-2038a3c967db4a32a8fbce288437e929.parquet
  - data/2b/ord_dataset-2be11f57f3304e678ea8469baf6dd1bc.parquet
  - data/2b/ord_dataset-2be30f5d8dcd471aa6ad410bdee05902.parquet
  - data/31/ord_dataset-31989f1b2b9d4885b1dd2d9982da4517.parquet
  - data/35/ord_dataset-35a5a513f1dd44a3a97c88da99f81a00.parquet
  - data/3b/ord_dataset-3b5db90e337942ea886b8f5bc5e3aa72.parquet
  - data/3b/ord_dataset-3b8a2ef300e145468579027f206a3ac8.parquet
  - data/46/ord_dataset-46ff9a32d9e04016b9380b1b1ef949c3.parquet
  - data/47/ord_dataset-47eaacc46c3a4487bbdf99adb1a15e41.parquet
  - data/4d/ord_dataset-4d431564f3ef4e9c91d8da5836f4eae6.parquet
  - data/52/ord_dataset-52bd3b0ec72c443aab113bcea09bf3f4.parquet
  - data/54/ord_dataset-5415f83da68e4797856ddd330dda5c61.parquet
  - data/55/ord_dataset-5540e162c09f4c04905ddc8ba9c931c6.parquet
  - data/55/ord_dataset-55de08a995554f558c25fc43eac62359.parquet
  - data/5c/ord_dataset-5c9a10329a8a48968d18879a48bb8ab2.parquet
  - data/5e/ord_dataset-5e8318f0dda04b398c14f4c3adfeb32c.parquet
  - data/5e/ord_dataset-5eb7f2689f4a42eba63ad9e37e49a5cd.parquet
  - data/67/ord_dataset-675eddcaa6674ce3ae61e79bbc1e1c08.parquet
  - data/68/ord_dataset-68cb8b4b2b384e3d85b5b1efae58b203.parquet
  - data/6a/ord_dataset-6a0bfcdf53a64c07987822162ae591e2.parquet
  - data/7a/ord_dataset-7acd6ad2bf4d4cff841cad008ab726d5.parquet
  - data/7d/ord_dataset-7d8f5fd922d4497d91cb81489b052746.parquet
  - data/80/ord_dataset-805ad863feef48579d95d86a728035f4.parquet
  - data/89/ord_dataset-89b083710e2d441aa0040c361d63359f.parquet
  - data/8d/ord_dataset-8d1e28ec1f6b4ee8ad372e0b5ed7a62e.parquet
  - data/99/ord_dataset-99c23cf435dc42f1af884053bc8b11c7.parquet
  - data/9b/ord_dataset-9b8aa9a7835143ef8ce3f70abfab7545.parquet
  - data/a1/ord_dataset-a12fa15d036d489c971b0b514caeae52.parquet
  - data/ac/ord_dataset-ac78456835404910b3a4c840248b6ac9.parquet
  - data/b4/ord_dataset-b440f8c90b6343189093770060fc4098.parquet
  - data/bc/ord_dataset-bc349c19b4384756a2aee8aa525b6c2a.parquet
  - data/c5/ord_dataset-c5b00523487a4211a194160edf45e9ab.parquet
  - data/c7/ord_dataset-c703268ea43a4c7e802c6048b6166b34.parquet
  - data/cb/ord_dataset-cbcc4048add7468e850b6ec42549c70d.parquet
  - data/ce/ord_dataset-ce5045aceb214cfc8bfd0ef3031e2737.parquet
  - data/d2/ord_dataset-d26118acda314269becc35db5c22dc59.parquet
  - data/d3/ord_dataset-d319c2a22ecf4ce59db1a18ae71d529c.parquet
  - data/d9/ord_dataset-d92976309c3a48a3a64a4cf5e7048086.parquet
  - data/dc/ord_dataset-dc0249930af34d17a3c76881a762aebf.parquet
  - data/ee/ord_dataset-eeba974d3c284aed86d1c1d442260a1e.parquet
  - data/fc/ord_dataset-fc83743b978f4deea7d6856deacbfe53.parquet
  - data/fe/ord_dataset-feaf1b793c6d408aaec1cac7cc3ceadc.parquet
- config_name: uspto-grants
  data_files:
  - data/11/ord_dataset-1158e351757f315b93cbcbe7bc55f38e.parquet
- config_name: uspto-mit
  data_files:
  - split: train
    path: data/e7/ord_dataset-e7830cd6b11158b43994ccfb5ee9acb3.parquet
  - split: validation
    path: data/54/ord_dataset-5481550056a14935b76e031fb94b88be.parquet
  - split: test
    path: data/48/ord_dataset-488402f6ec0d441ca2f7d6fabea7c220.parquet
- config_name: ord_dataset-00005539a1e04c809a9a78647bea649c
  data_files:
  - data/00/ord_dataset-00005539a1e04c809a9a78647bea649c.parquet
- config_name: ord_dataset-0316886541d9435489859c2ad7edc863
  data_files:
  - data/03/ord_dataset-0316886541d9435489859c2ad7edc863.parquet
- config_name: ord_dataset-0c75d67751634f0594b24b9f498b77c2
  data_files:
  - data/0c/ord_dataset-0c75d67751634f0594b24b9f498b77c2.parquet
- config_name: ord_dataset-10b940e7982c4622b1e1ac879394aba6
  data_files:
  - data/10/ord_dataset-10b940e7982c4622b1e1ac879394aba6.parquet
- config_name: ord_dataset-1158e351757f315b93cbcbe7bc55f38e
  data_files:
  - data/11/ord_dataset-1158e351757f315b93cbcbe7bc55f38e.parquet
- config_name: ord_dataset-172039a759a440219a68af62d203b79b
  data_files:
  - data/17/ord_dataset-172039a759a440219a68af62d203b79b.parquet
- config_name: ord_dataset-1d3a1a6fb70d46c084602d0688967afc
  data_files:
  - data/1d/ord_dataset-1d3a1a6fb70d46c084602d0688967afc.parquet
- config_name: ord_dataset-1ec2807f02fa4beda27d2a81b86eb843
  data_files:
  - data/1e/ord_dataset-1ec2807f02fa4beda27d2a81b86eb843.parquet
- config_name: ord_dataset-2038a3c967db4a32a8fbce288437e929
  data_files:
  - data/20/ord_dataset-2038a3c967db4a32a8fbce288437e929.parquet
- config_name: ord_dataset-2be11f57f3304e678ea8469baf6dd1bc
  data_files:
  - data/2b/ord_dataset-2be11f57f3304e678ea8469baf6dd1bc.parquet
- config_name: ord_dataset-2be30f5d8dcd471aa6ad410bdee05902
  data_files:
  - data/2b/ord_dataset-2be30f5d8dcd471aa6ad410bdee05902.parquet
- config_name: ord_dataset-31989f1b2b9d4885b1dd2d9982da4517
  data_files:
  - data/31/ord_dataset-31989f1b2b9d4885b1dd2d9982da4517.parquet
- config_name: ord_dataset-35a5a513f1dd44a3a97c88da99f81a00
  data_files:
  - data/35/ord_dataset-35a5a513f1dd44a3a97c88da99f81a00.parquet
- config_name: ord_dataset-3b5db90e337942ea886b8f5bc5e3aa72
  data_files:
  - data/3b/ord_dataset-3b5db90e337942ea886b8f5bc5e3aa72.parquet
- config_name: ord_dataset-3b8a2ef300e145468579027f206a3ac8
  data_files:
  - data/3b/ord_dataset-3b8a2ef300e145468579027f206a3ac8.parquet
- config_name: ord_dataset-46ff9a32d9e04016b9380b1b1ef949c3
  data_files:
  - data/46/ord_dataset-46ff9a32d9e04016b9380b1b1ef949c3.parquet
- config_name: ord_dataset-47eaacc46c3a4487bbdf99adb1a15e41
  data_files:
  - data/47/ord_dataset-47eaacc46c3a4487bbdf99adb1a15e41.parquet
- config_name: ord_dataset-488402f6ec0d441ca2f7d6fabea7c220
  data_files:
  - data/48/ord_dataset-488402f6ec0d441ca2f7d6fabea7c220.parquet
- config_name: ord_dataset-4d431564f3ef4e9c91d8da5836f4eae6
  data_files:
  - data/4d/ord_dataset-4d431564f3ef4e9c91d8da5836f4eae6.parquet
- config_name: ord_dataset-52bd3b0ec72c443aab113bcea09bf3f4
  data_files:
  - data/52/ord_dataset-52bd3b0ec72c443aab113bcea09bf3f4.parquet
- config_name: ord_dataset-5415f83da68e4797856ddd330dda5c61
  data_files:
  - data/54/ord_dataset-5415f83da68e4797856ddd330dda5c61.parquet
- config_name: ord_dataset-5481550056a14935b76e031fb94b88be
  data_files:
  - data/54/ord_dataset-5481550056a14935b76e031fb94b88be.parquet
- config_name: ord_dataset-5540e162c09f4c04905ddc8ba9c931c6
  data_files:
  - data/55/ord_dataset-5540e162c09f4c04905ddc8ba9c931c6.parquet
- config_name: ord_dataset-55de08a995554f558c25fc43eac62359
  data_files:
  - data/55/ord_dataset-55de08a995554f558c25fc43eac62359.parquet
- config_name: ord_dataset-5c9a10329a8a48968d18879a48bb8ab2
  data_files:
  - data/5c/ord_dataset-5c9a10329a8a48968d18879a48bb8ab2.parquet
- config_name: ord_dataset-5e8318f0dda04b398c14f4c3adfeb32c
  data_files:
  - data/5e/ord_dataset-5e8318f0dda04b398c14f4c3adfeb32c.parquet
- config_name: ord_dataset-5eb7f2689f4a42eba63ad9e37e49a5cd
  data_files:
  - data/5e/ord_dataset-5eb7f2689f4a42eba63ad9e37e49a5cd.parquet
- config_name: ord_dataset-675eddcaa6674ce3ae61e79bbc1e1c08
  data_files:
  - data/67/ord_dataset-675eddcaa6674ce3ae61e79bbc1e1c08.parquet
- config_name: ord_dataset-68cb8b4b2b384e3d85b5b1efae58b203
  data_files:
  - data/68/ord_dataset-68cb8b4b2b384e3d85b5b1efae58b203.parquet
- config_name: ord_dataset-6a0bfcdf53a64c07987822162ae591e2
  data_files:
  - data/6a/ord_dataset-6a0bfcdf53a64c07987822162ae591e2.parquet
- config_name: ord_dataset-7acd6ad2bf4d4cff841cad008ab726d5
  data_files:
  - data/7a/ord_dataset-7acd6ad2bf4d4cff841cad008ab726d5.parquet
- config_name: ord_dataset-7d8f5fd922d4497d91cb81489b052746
  data_files:
  - data/7d/ord_dataset-7d8f5fd922d4497d91cb81489b052746.parquet
- config_name: ord_dataset-805ad863feef48579d95d86a728035f4
  data_files:
  - data/80/ord_dataset-805ad863feef48579d95d86a728035f4.parquet
- config_name: ord_dataset-89b083710e2d441aa0040c361d63359f
  data_files:
  - data/89/ord_dataset-89b083710e2d441aa0040c361d63359f.parquet
- config_name: ord_dataset-8d1e28ec1f6b4ee8ad372e0b5ed7a62e
  data_files:
  - data/8d/ord_dataset-8d1e28ec1f6b4ee8ad372e0b5ed7a62e.parquet
- config_name: ord_dataset-99c23cf435dc42f1af884053bc8b11c7
  data_files:
  - data/99/ord_dataset-99c23cf435dc42f1af884053bc8b11c7.parquet
- config_name: ord_dataset-9b8aa9a7835143ef8ce3f70abfab7545
  data_files:
  - data/9b/ord_dataset-9b8aa9a7835143ef8ce3f70abfab7545.parquet
- config_name: ord_dataset-a12fa15d036d489c971b0b514caeae52
  data_files:
  - data/a1/ord_dataset-a12fa15d036d489c971b0b514caeae52.parquet
- config_name: ord_dataset-ac78456835404910b3a4c840248b6ac9
  data_files:
  - data/ac/ord_dataset-ac78456835404910b3a4c840248b6ac9.parquet
- config_name: ord_dataset-b440f8c90b6343189093770060fc4098
  data_files:
  - data/b4/ord_dataset-b440f8c90b6343189093770060fc4098.parquet
- config_name: ord_dataset-bc349c19b4384756a2aee8aa525b6c2a
  data_files:
  - data/bc/ord_dataset-bc349c19b4384756a2aee8aa525b6c2a.parquet
- config_name: ord_dataset-c5b00523487a4211a194160edf45e9ab
  data_files:
  - data/c5/ord_dataset-c5b00523487a4211a194160edf45e9ab.parquet
- config_name: ord_dataset-c703268ea43a4c7e802c6048b6166b34
  data_files:
  - data/c7/ord_dataset-c703268ea43a4c7e802c6048b6166b34.parquet
- config_name: ord_dataset-cbcc4048add7468e850b6ec42549c70d
  data_files:
  - data/cb/ord_dataset-cbcc4048add7468e850b6ec42549c70d.parquet
- config_name: ord_dataset-ce5045aceb214cfc8bfd0ef3031e2737
  data_files:
  - data/ce/ord_dataset-ce5045aceb214cfc8bfd0ef3031e2737.parquet
- config_name: ord_dataset-d26118acda314269becc35db5c22dc59
  data_files:
  - data/d2/ord_dataset-d26118acda314269becc35db5c22dc59.parquet
- config_name: ord_dataset-d319c2a22ecf4ce59db1a18ae71d529c
  data_files:
  - data/d3/ord_dataset-d319c2a22ecf4ce59db1a18ae71d529c.parquet
- config_name: ord_dataset-d92976309c3a48a3a64a4cf5e7048086
  data_files:
  - data/d9/ord_dataset-d92976309c3a48a3a64a4cf5e7048086.parquet
- config_name: ord_dataset-dc0249930af34d17a3c76881a762aebf
  data_files:
  - data/dc/ord_dataset-dc0249930af34d17a3c76881a762aebf.parquet
- config_name: ord_dataset-e7830cd6b11158b43994ccfb5ee9acb3
  data_files:
  - data/e7/ord_dataset-e7830cd6b11158b43994ccfb5ee9acb3.parquet
- config_name: ord_dataset-eeba974d3c284aed86d1c1d442260a1e
  data_files:
  - data/ee/ord_dataset-eeba974d3c284aed86d1c1d442260a1e.parquet
- config_name: ord_dataset-fc83743b978f4deea7d6856deacbfe53
  data_files:
  - data/fc/ord_dataset-fc83743b978f4deea7d6856deacbfe53.parquet
- config_name: ord_dataset-feaf1b793c6d408aaec1cac7cc3ceadc
  data_files:
  - data/fe/ord_dataset-feaf1b793c6d408aaec1cac7cc3ceadc.parquet
---

# ord-data

![](https://github.com/Open-Reaction-Database/ord-data/workflows/Validation/badge.svg)
[![DOI](https://zenodo.org/badge/283813042.svg)](https://zenodo.org/badge/latestdoi/283813042)

## Getting the Data

The datasets live under [`data/`](data) and are stored with
[Git LFS](https://git-lfs.com/). LFS reads are redirected to the
[Hugging Face mirror](https://huggingface.co/datasets/open-reaction-database/ord-data)
via [`.lfsconfig`](.lfsconfig), so dataset objects are fetched from Hugging
Face's CDN rather than from GitHub's shared (and limited) LFS bandwidth. This is
automatic — you do not need to configure anything.

### Option 1: Clone the repository

```bash
git clone https://github.com/open-reaction-database/ord-data.git
```

With [Git LFS](https://git-lfs.com/) installed, this pulls every dataset object
from the Hugging Face mirror and gives you the full Git history with the data in
place.

### Option 2: Download only the data (a subset, or without Git history)

```bash
pip install huggingface_hub
python scripts/download_from_huggingface.py
```

(If you use [uv](https://docs.astral.sh/uv/), `uv run scripts/download_from_huggingface.py`
installs the dependencies for you.)

The script mirrors the `data/` directory from the Hugging Face dataset into your
local checkout. Pass `--allow-pattern 'data/4d/*.pb.gz'` (repeatable) to download
only a subset, or `--output-dir <path>` to write somewhere other than the
repository root. To skip LFS entirely during the clone and fetch the data
afterward:

```bash
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/open-reaction-database/ord-data.git
cd ord-data
python scripts/download_from_huggingface.py
```

You can also browse and download datasets directly from the
[Hugging Face dataset page](https://huggingface.co/datasets/open-reaction-database/ord-data).

For how this LFS / Hugging Face mirror setup works (and what it means for
contributors), see
[Git LFS and the Hugging Face mirror](#git-lfs-and-the-hugging-face-mirror)
below.

## Data Manipulation

The `ord-data` repository contains the Open Reaction Database (ORD) in Google's Protobuf binary
format, which is stored in the [`data`](data) directory. Currently, all the data are stored in e.g.
*.pb.gz format (compressed Protobuf binary files) for the sake of efficiency. The user can convert
the data into human readable text format, *.pb.txt.

```python
# import requirements
from ord_schema.message_helpers import load_message, save_message
from ord_schema.proto import dataset_pb2

# load the binary ord file
dataset = load_message("input_fname.pb.gz", dataset_pb2.Dataset)
# save the ord file as human readable text
save_message(dataset, "output_fname.pbtxt")
```

We can also convert ORD data into JSON format.

```python
# import requirements
import json

from ord_schema.message_helpers import load_message
from ord_schema.proto import dataset_pb2
from google.protobuf.json_format import MessageToJson

input_fname = "sample_file.pb.gz"
dataset = load_message(
    input_fname,
    dataset_pb2.Dataset,
)

# take one reaction message from the dataset for example
rxn = dataset.reactions[0]
rxn_json = json.loads(
    MessageToJson(
        message=rxn,
        including_default_value_fields=False,
        preserving_proto_field_name=True,
        indent=2,
        sort_keys=False,
        use_integers_for_enums=False,
        descriptor_pool=None,
        float_precision=None,
        ensure_ascii=True,
    )
)

print(
    f"We have converted the {input_fname} to JSON format shown as below, \n{rxn_json}"
)
```

## Git LFS and the Hugging Face mirror

Dataset files under [`data/`](data) are stored with Git LFS. Clone and fork
traffic was dominating GitHub's shared LFS bandwidth quota, so the repository is
configured to keep that traffic off GitHub while leaving GitHub authoritative
for the data:

- **Reads come from Hugging Face.** [`.lfsconfig`](.lfsconfig) points `lfs.url`
  at the
  [Hugging Face mirror](https://huggingface.co/datasets/open-reaction-database/ord-data),
  so clones and forks fetch LFS objects from HF's CDN instead of GitHub.
- **GitHub remains the source of truth.** LFS objects are always written to
  GitHub (storage there is fine; only download bandwidth was the problem), and
  the [mirror workflow](.github/workflows/huggingface_mirror.yml) copies them to
  Hugging Face after every merge to `main`. Hugging Face is purely a read
  replica — every object is always retrievable from GitHub.
- **LFS is scoped to `data/`** (see [`.gitattributes`](.gitattributes)). A new
  dataset staged at the repository root is an ordinary Git file, so submissions
  can be pushed from a fork with no LFS configuration; the submission workflow
  turns the file into an LFS object when it moves it into `data/`.

### For contributors

- **Submitting a new dataset:** nothing special is required — stage your file at
  the repository root and open a PR (see [CONTRIBUTING.md](CONTRIBUTING.md) and
  the
  [Submission Workflow](https://docs.open-reaction-database.org/en/latest/submissions.html)).
- **Editing a file that already lives under `data/` from a fork:** that file is
  an LFS object, so point LFS uploads at your own fork once before pushing (you
  cannot write to the canonical repository's LFS store):

  ```bash
  git config lfs.pushurl https://github.com/<your-username>/ord-data.git/info/lfs
  ```

### For maintainers (CI)

Freshly pushed objects are not on the Hugging Face mirror until the post-merge
mirror job runs, so CI and the mirror override the read endpoint back to GitHub
at runtime (`git config lfs.url …`):

- [`validation.yml`](.github/workflows/validation.yml) pulls only each matrix
  shard's objects from GitHub, sparsely, instead of the whole dataset in every
  job.
- [`submission.yml`](.github/workflows/submission.yml) reads from GitHub so fork
  and branch submissions are validated before their bytes reach Hugging Face.
- [`huggingface_mirror.yml`](.github/workflows/huggingface_mirror.yml) reads the
  to-be-mirrored objects from GitHub.

## Contributing

Please see the [Submission Workflow](https://docs.open-reaction-database.org/en/latest/submissions.html) documentation. Make sure to review the [license](https://github.com/open-reaction-database/ord-data/blob/main/LICENSE) and [terms of use](https://github.com/open-reaction-database/ord-data/blob/main/CONTRIBUTING.md#terms-of-use).

## Maintainer notes

### Skipping the `Update submission` step

The submission workflow's `Update submission` step runs
[`scripts/process_dataset.py`](scripts/process_dataset.py) `--update --cleanup`
to assign reaction/dataset IDs and timestamps to newly
submitted files and rewrite them to the canonical on-disk format. For
maintainer PRs that touch dataset files but should *not* be re-processed
this way — e.g., format conversions or mass migrations of already-finalized
data — apply the `skip-update-submission` label to the PR. The validation
side of the workflow still runs.

### Converting datasets to Parquet

New submissions are written as Parquet, the standard format. Older datasets are
stored as `.pb.gz`; most already have a Parquet sibling, and the rest are
backfilled with [`scripts/convert_to_parquet.py`](scripts/convert_to_parquet.py).
Editing an existing `.pb.gz` leaves it as `.pb.gz` — converting the corpus is
this script's job, not a side effect of changing one dataset. The
script globs every `data/**/*.pb.gz`, merges the known de-shard groups (the
`uspto-grants-YYYY_MM` monthly buckets and the `C8SC04228D` shards) into single
outputs, converts everything else 1:1 (carrying the existing `dataset_id`), and
skips any output that already exists — so it is safe to re-run and writes only
what is missing.

It needs `ord_schema`, which comes from the `pipeline` dependency group. Because
it reads every `.pb.gz` to classify by name, pull the inputs first:

```bash
uv sync --only-group pipeline

git lfs pull --include="data/**/*.pb.gz"  # the converter reads pb.gz content
uv run --no-sync python scripts/convert_to_parquet.py --dry-run  # preview
uv run --no-sync python scripts/convert_to_parquet.py  # write the siblings
```

Commit the new `.parquet` files (they become LFS objects), push them (see
[Pushing new LFS objects](#pushing-new-lfs-objects)), and open the PR with the
`skip-update-submission` label. Validation runs against the full dataset on
merge to `main`.

### Pushing new LFS objects

[`.lfsconfig`](.lfsconfig) routes LFS **reads** to the Hugging Face mirror and
deliberately sets no `pushurl`, so a plain push would try to upload new objects
to HF — which you cannot write. Point LFS uploads at GitHub for the push, and
make sure git can authenticate to `github.com` over **HTTPS** for the LFS API
(the LFS endpoint is HTTPS even when your `git` remote is SSH). The simplest
auth is the GitHub CLI:

```bash
git config lfs.pushurl https://github.com/open-reaction-database/ord-data.git/info/lfs
gh auth setup-git  # let git use your gh token for github.com over HTTPS
git push -u origin <branch>
```

Or, as a one-off without persisting any config:

```bash
git -c lfs.pushurl=https://github.com/open-reaction-database/ord-data.git/info/lfs \
    -c 'credential.https://github.com.helper=!gh auth git-credential' \
    push -u origin <branch>
```

Reads stay on the mirror; only your uploads go to GitHub. On merge to `main`,
`huggingface_mirror.yml` copies the new objects to Hugging Face.

## License

This repository carries two licenses, because it holds both data and code:

| what | license | file |
| --- | --- | --- |
| The datasets under `data/` (and the repository metadata describing them) | [CC-BY-SA-4.0](LICENSE) | `LICENSE` |
| The code under `scripts/` and `.github/` | [Apache-2.0](LICENSE-CODE) | `LICENSE-CODE` |

If you are using ORD data, CC-BY-SA-4.0 is the license that applies to you; it
is what `CITATION.cff` and the [Hugging Face
mirror](https://huggingface.co/datasets/open-reaction-database/ord-data) declare.

The code carries a separate license because Creative Commons licenses are not
intended for software — [Creative Commons recommends against
it](https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software)
— and because the project's other code repositories, including
[ord-schema](https://github.com/Open-Reaction-Database/ord-schema), are
Apache-2.0.

## Citation

If you use this dataset, please cite the Open Reaction Database paper:

```bibtex
@article{kearnes2021ord,
  author = {Kearnes, Steven M. and Maser, Michael R. and Wleklinski, Michael and Kast, Anton and Doyle, Abigail G. and Dreher, Spencer D. and Hawkins, Joel M. and Jensen, Klavs F. and Coley, Connor W.},
  title = {The Open Reaction Database},
  journal = {Journal of the American Chemical Society},
  year = {2021},
  volume = {143},
  number = {45},
  pages = {18820--18826},
  doi = {10.1021/jacs.1c09820},
}
```