@climateriskcommons/crc-framework 0.5.4 → 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1193 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://climateriskcommons.org/schemas/dataset/2.0",
4
+ "title": "Canonical scientific dataset",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "metadata",
9
+ "rows"
10
+ ],
11
+ "properties": {
12
+ "metadata": {
13
+ "$ref": "#/$defs/metadata"
14
+ },
15
+ "rows": {
16
+ "type": "array",
17
+ "items": {
18
+ "$ref": "#/$defs/row"
19
+ }
20
+ }
21
+ },
22
+ "$defs": {
23
+ "scientific_value": {
24
+ "anyOf": [
25
+ {
26
+ "type": [
27
+ "null",
28
+ "boolean",
29
+ "number",
30
+ "string"
31
+ ]
32
+ },
33
+ {
34
+ "type": "array",
35
+ "items": {
36
+ "$ref": "#/$defs/scientific_value"
37
+ }
38
+ },
39
+ {
40
+ "type": "object",
41
+ "additionalProperties": {
42
+ "$ref": "#/$defs/scientific_value"
43
+ }
44
+ }
45
+ ]
46
+ },
47
+ "variable": {
48
+ "type": "object",
49
+ "required": [
50
+ "id"
51
+ ],
52
+ "properties": {
53
+ "id": {
54
+ "type": "string",
55
+ "minLength": 1,
56
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
57
+ },
58
+ "measurement": {
59
+ "$ref": "https://climateriskcommons.org/schemas/measurement-1.0.schema.json"
60
+ },
61
+ "label": {
62
+ "type": "string"
63
+ }
64
+ },
65
+ "additionalProperties": false
66
+ },
67
+ "scenario": {
68
+ "type": "object",
69
+ "required": [
70
+ "id"
71
+ ],
72
+ "properties": {
73
+ "id": {
74
+ "type": "string",
75
+ "minLength": 1,
76
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
77
+ },
78
+ "definition": {
79
+ "type": "object",
80
+ "additionalProperties": {
81
+ "$ref": "#/$defs/scientific_value"
82
+ }
83
+ },
84
+ "schema": {
85
+ "type": "object",
86
+ "additionalProperties": {
87
+ "$ref": "#/$defs/scientific_value"
88
+ }
89
+ },
90
+ "label": {
91
+ "type": "string"
92
+ }
93
+ },
94
+ "additionalProperties": false,
95
+ "dependentRequired": {
96
+ "schema": [
97
+ "definition"
98
+ ]
99
+ }
100
+ },
101
+ "period": {
102
+ "oneOf": [
103
+ {
104
+ "type": "object",
105
+ "required": [
106
+ "id",
107
+ "kind",
108
+ "start",
109
+ "end"
110
+ ],
111
+ "properties": {
112
+ "id": {
113
+ "type": "string",
114
+ "pattern": "^period:[0-9a-f]{64}$"
115
+ },
116
+ "kind": {
117
+ "const": "window"
118
+ },
119
+ "start": {
120
+ "type": "integer"
121
+ },
122
+ "end": {
123
+ "type": "integer"
124
+ },
125
+ "calendar": {
126
+ "enum": [
127
+ "gregorian",
128
+ "no_leap",
129
+ "360_day",
130
+ "all_leap",
131
+ "julian",
132
+ "proleptic_gregorian"
133
+ ]
134
+ }
135
+ },
136
+ "additionalProperties": false
137
+ },
138
+ {
139
+ "type": "object",
140
+ "required": [
141
+ "id",
142
+ "kind"
143
+ ],
144
+ "properties": {
145
+ "id": {
146
+ "type": "string",
147
+ "pattern": "^period:[0-9a-f]{64}$"
148
+ },
149
+ "kind": {
150
+ "enum": [
151
+ "timeless",
152
+ "unknown"
153
+ ]
154
+ }
155
+ },
156
+ "additionalProperties": false
157
+ }
158
+ ]
159
+ },
160
+ "probability": {
161
+ "oneOf": [
162
+ {
163
+ "type": "object",
164
+ "required": [
165
+ "kind",
166
+ "tail"
167
+ ],
168
+ "properties": {
169
+ "kind": {
170
+ "const": "annual"
171
+ },
172
+ "tail": {
173
+ "enum": [
174
+ "upper",
175
+ "lower"
176
+ ]
177
+ }
178
+ },
179
+ "additionalProperties": false
180
+ },
181
+ {
182
+ "type": "object",
183
+ "required": [
184
+ "kind"
185
+ ],
186
+ "properties": {
187
+ "kind": {
188
+ "enum": [
189
+ "distribution",
190
+ "confidence",
191
+ "projection"
192
+ ]
193
+ }
194
+ },
195
+ "additionalProperties": false
196
+ }
197
+ ]
198
+ },
199
+ "series": {
200
+ "type": "object",
201
+ "required": [
202
+ "variable_id",
203
+ "scenario_id",
204
+ "period_id"
205
+ ],
206
+ "properties": {
207
+ "variable_id": {
208
+ "type": "string",
209
+ "minLength": 1,
210
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
211
+ },
212
+ "scenario_id": {
213
+ "anyOf": [
214
+ {
215
+ "type": "string",
216
+ "minLength": 1,
217
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
218
+ },
219
+ {
220
+ "type": "null"
221
+ }
222
+ ]
223
+ },
224
+ "period_id": {
225
+ "anyOf": [
226
+ {
227
+ "type": "string",
228
+ "pattern": "^period:[0-9a-f]{64}$"
229
+ },
230
+ {
231
+ "type": "null"
232
+ }
233
+ ]
234
+ },
235
+ "probability": {
236
+ "$ref": "#/$defs/probability"
237
+ }
238
+ },
239
+ "additionalProperties": false
240
+ },
241
+ "data_spec": {
242
+ "type": "object",
243
+ "required": [
244
+ "variables",
245
+ "scenarios",
246
+ "periods",
247
+ "series"
248
+ ],
249
+ "properties": {
250
+ "variables": {
251
+ "type": "array",
252
+ "items": {
253
+ "$ref": "#/$defs/variable"
254
+ },
255
+ "uniqueItems": true
256
+ },
257
+ "scenarios": {
258
+ "type": "array",
259
+ "items": {
260
+ "$ref": "#/$defs/scenario"
261
+ },
262
+ "uniqueItems": true
263
+ },
264
+ "periods": {
265
+ "type": "array",
266
+ "items": {
267
+ "$ref": "#/$defs/period"
268
+ },
269
+ "uniqueItems": true
270
+ },
271
+ "series": {
272
+ "type": "array",
273
+ "items": {
274
+ "$ref": "#/$defs/series"
275
+ },
276
+ "uniqueItems": true
277
+ }
278
+ },
279
+ "additionalProperties": false
280
+ },
281
+ "resource": {
282
+ "type": "object",
283
+ "properties": {
284
+ "uri": {
285
+ "type": "string",
286
+ "minLength": 1,
287
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
288
+ },
289
+ "sha256": {
290
+ "type": "string",
291
+ "pattern": "^sha256:[0-9a-f]{64}$"
292
+ },
293
+ "license": {
294
+ "type": "string",
295
+ "minLength": 1
296
+ },
297
+ "attribution": {
298
+ "type": "string",
299
+ "minLength": 1
300
+ },
301
+ "retrieved_at": {
302
+ "type": "string",
303
+ "format": "date-time"
304
+ }
305
+ },
306
+ "required": [
307
+ "uri",
308
+ "sha256"
309
+ ],
310
+ "additionalProperties": false
311
+ },
312
+ "release": {
313
+ "type": "object",
314
+ "properties": {
315
+ "id": {
316
+ "type": "string",
317
+ "minLength": 1,
318
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
319
+ },
320
+ "sha256": {
321
+ "type": "string",
322
+ "pattern": "^sha256:[0-9a-f]{64}$"
323
+ },
324
+ "retrieved_at": {
325
+ "type": "string",
326
+ "format": "date-time"
327
+ }
328
+ },
329
+ "required": [
330
+ "id",
331
+ "sha256"
332
+ ],
333
+ "additionalProperties": false
334
+ },
335
+ "source": {
336
+ "type": "object",
337
+ "properties": {
338
+ "provider": {
339
+ "type": "string",
340
+ "minLength": 1,
341
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
342
+ },
343
+ "product": {
344
+ "type": "string",
345
+ "minLength": 1,
346
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
347
+ },
348
+ "member": {
349
+ "type": "string",
350
+ "minLength": 1,
351
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
352
+ },
353
+ "model": {
354
+ "type": "string",
355
+ "minLength": 1,
356
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
357
+ },
358
+ "release": {
359
+ "$ref": "#/$defs/release"
360
+ },
361
+ "resources": {
362
+ "type": "array",
363
+ "items": {
364
+ "$ref": "#/$defs/resource"
365
+ }
366
+ }
367
+ },
368
+ "required": [
369
+ "provider",
370
+ "product",
371
+ "resources"
372
+ ],
373
+ "additionalProperties": false
374
+ },
375
+ "diagnostic": {
376
+ "oneOf": [
377
+ {
378
+ "type": "object",
379
+ "properties": {
380
+ "code": {
381
+ "type": "string",
382
+ "minLength": 1,
383
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
384
+ },
385
+ "severity": {
386
+ "enum": [
387
+ "error",
388
+ "warning",
389
+ "info"
390
+ ]
391
+ },
392
+ "stage": {
393
+ "enum": [
394
+ "acquisition",
395
+ "decoding",
396
+ "selection",
397
+ "reduction",
398
+ "fitting",
399
+ "joining",
400
+ "evaluation",
401
+ "validation",
402
+ "writing"
403
+ ]
404
+ },
405
+ "message": {
406
+ "type": "string",
407
+ "minLength": 1
408
+ },
409
+ "source": {
410
+ "type": "string",
411
+ "minLength": 1,
412
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
413
+ },
414
+ "support_id": {
415
+ "type": "string",
416
+ "minLength": 1,
417
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
418
+ },
419
+ "query_value": {
420
+ "type": "number"
421
+ },
422
+ "remedy": {
423
+ "type": "string",
424
+ "minLength": 1
425
+ }
426
+ },
427
+ "required": [
428
+ "code",
429
+ "severity",
430
+ "stage",
431
+ "message"
432
+ ],
433
+ "additionalProperties": false
434
+ },
435
+ {
436
+ "type": "object",
437
+ "properties": {
438
+ "code": {
439
+ "type": "string",
440
+ "minLength": 1,
441
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
442
+ },
443
+ "severity": {
444
+ "enum": [
445
+ "error",
446
+ "warning",
447
+ "info"
448
+ ]
449
+ },
450
+ "stage": {
451
+ "const": "fitting"
452
+ },
453
+ "message": {
454
+ "type": "string",
455
+ "minLength": 1
456
+ },
457
+ "source": {
458
+ "type": "string",
459
+ "minLength": 1,
460
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
461
+ },
462
+ "support_id": {
463
+ "type": "string",
464
+ "minLength": 1,
465
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
466
+ },
467
+ "query_value": {
468
+ "type": "number"
469
+ },
470
+ "remedy": {
471
+ "type": "string",
472
+ "minLength": 1
473
+ },
474
+ "record": {
475
+ "$ref": "https://climateriskcommons.org/schemas/fitting/1.0"
476
+ }
477
+ },
478
+ "required": [
479
+ "code",
480
+ "severity",
481
+ "stage",
482
+ "message",
483
+ "record"
484
+ ],
485
+ "additionalProperties": false
486
+ },
487
+ {
488
+ "type": "object",
489
+ "properties": {
490
+ "code": {
491
+ "const": "station_year_unavailable"
492
+ },
493
+ "severity": {
494
+ "const": "warning"
495
+ },
496
+ "stage": {
497
+ "enum": [
498
+ "acquisition",
499
+ "decoding"
500
+ ]
501
+ },
502
+ "message": {
503
+ "type": "string",
504
+ "minLength": 1
505
+ },
506
+ "source": {
507
+ "type": "string",
508
+ "minLength": 1,
509
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
510
+ },
511
+ "query_value": {
512
+ "type": "number"
513
+ },
514
+ "remedy": {
515
+ "type": "string",
516
+ "minLength": 1
517
+ },
518
+ "station_id": {
519
+ "type": "string",
520
+ "minLength": 1,
521
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
522
+ },
523
+ "year": {
524
+ "type": "integer",
525
+ "minimum": 1,
526
+ "maximum": 9999
527
+ },
528
+ "minimum_fraction": {
529
+ "type": "number",
530
+ "exclusiveMinimum": 0,
531
+ "maximum": 1
532
+ }
533
+ },
534
+ "required": [
535
+ "code",
536
+ "severity",
537
+ "stage",
538
+ "message",
539
+ "station_id",
540
+ "year",
541
+ "minimum_fraction"
542
+ ],
543
+ "additionalProperties": false
544
+ }
545
+ ]
546
+ },
547
+ "counts": {
548
+ "type": "object",
549
+ "properties": {
550
+ "requested": {
551
+ "type": "integer",
552
+ "minimum": 0
553
+ },
554
+ "produced": {
555
+ "type": "integer",
556
+ "minimum": 0
557
+ },
558
+ "skipped": {
559
+ "type": "integer",
560
+ "minimum": 0
561
+ },
562
+ "no_data": {
563
+ "type": "integer",
564
+ "minimum": 0
565
+ },
566
+ "matched_assets": {
567
+ "type": "integer",
568
+ "minimum": 0
569
+ },
570
+ "unmatched_assets": {
571
+ "type": "integer",
572
+ "minimum": 0
573
+ },
574
+ "usable_years": {
575
+ "type": "integer",
576
+ "minimum": 0
577
+ },
578
+ "incomplete_years": {
579
+ "type": "integer",
580
+ "minimum": 0
581
+ }
582
+ },
583
+ "required": [
584
+ "requested",
585
+ "produced",
586
+ "skipped",
587
+ "no_data",
588
+ "matched_assets",
589
+ "unmatched_assets",
590
+ "usable_years",
591
+ "incomplete_years"
592
+ ],
593
+ "additionalProperties": false
594
+ },
595
+ "report": {
596
+ "type": "object",
597
+ "properties": {
598
+ "complete": {
599
+ "type": "boolean"
600
+ },
601
+ "valid": {
602
+ "type": [
603
+ "boolean",
604
+ "null"
605
+ ]
606
+ },
607
+ "counts": {
608
+ "$ref": "#/$defs/counts"
609
+ },
610
+ "diagnostics": {
611
+ "type": "array",
612
+ "items": {
613
+ "$ref": "#/$defs/diagnostic"
614
+ }
615
+ },
616
+ "source_identities": {
617
+ "type": "array",
618
+ "items": {
619
+ "$ref": "#/$defs/source"
620
+ }
621
+ }
622
+ },
623
+ "required": [
624
+ "complete",
625
+ "valid",
626
+ "counts",
627
+ "diagnostics",
628
+ "source_identities"
629
+ ],
630
+ "additionalProperties": false,
631
+ "allOf": [
632
+ {
633
+ "if": {
634
+ "properties": {
635
+ "valid": {
636
+ "const": true
637
+ }
638
+ }
639
+ },
640
+ "then": {
641
+ "properties": {
642
+ "complete": {
643
+ "const": true
644
+ },
645
+ "diagnostics": {
646
+ "not": {
647
+ "contains": {
648
+ "properties": {
649
+ "severity": {
650
+ "const": "error"
651
+ }
652
+ }
653
+ }
654
+ }
655
+ }
656
+ }
657
+ }
658
+ }
659
+ ]
660
+ },
661
+ "spatial": {
662
+ "type": "object",
663
+ "properties": {
664
+ "supports": {
665
+ "type": "array",
666
+ "items": {
667
+ "enum": [
668
+ "point",
669
+ "polygon",
670
+ "cell"
671
+ ]
672
+ },
673
+ "uniqueItems": true,
674
+ "minItems": 1
675
+ },
676
+ "index_resolution": {
677
+ "type": "integer",
678
+ "minimum": 0,
679
+ "maximum": 15
680
+ }
681
+ },
682
+ "required": [
683
+ "supports"
684
+ ],
685
+ "additionalProperties": false
686
+ },
687
+ "transformation": {
688
+ "oneOf": [
689
+ {
690
+ "type": "object",
691
+ "properties": {
692
+ "kind": {
693
+ "const": "unit_conversion"
694
+ },
695
+ "variable_id": {
696
+ "type": "string",
697
+ "minLength": 1,
698
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
699
+ },
700
+ "source_unit": {
701
+ "type": "string",
702
+ "minLength": 1,
703
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
704
+ },
705
+ "target_unit": {
706
+ "type": "string",
707
+ "minLength": 1,
708
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
709
+ },
710
+ "scale": {
711
+ "type": "number",
712
+ "not": {
713
+ "const": 0
714
+ }
715
+ },
716
+ "offset": {
717
+ "type": "number"
718
+ }
719
+ },
720
+ "required": [
721
+ "kind",
722
+ "variable_id",
723
+ "source_unit",
724
+ "target_unit",
725
+ "scale",
726
+ "offset"
727
+ ],
728
+ "additionalProperties": false
729
+ },
730
+ {
731
+ "type": "object",
732
+ "properties": {
733
+ "kind": {
734
+ "const": "rename"
735
+ },
736
+ "dimension": {
737
+ "enum": [
738
+ "variable",
739
+ "scenario"
740
+ ]
741
+ },
742
+ "mapping": {
743
+ "type": "object",
744
+ "propertyNames": {
745
+ "type": "string",
746
+ "minLength": 1,
747
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
748
+ },
749
+ "additionalProperties": {
750
+ "type": "string",
751
+ "minLength": 1,
752
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
753
+ }
754
+ }
755
+ },
756
+ "required": [
757
+ "kind",
758
+ "dimension",
759
+ "mapping"
760
+ ],
761
+ "additionalProperties": false
762
+ },
763
+ {
764
+ "type": "object",
765
+ "properties": {
766
+ "kind": {
767
+ "const": "observation_time_selection"
768
+ },
769
+ "time": {
770
+ "allOf": [
771
+ {
772
+ "$ref": "#/$defs/period"
773
+ },
774
+ {
775
+ "properties": {
776
+ "kind": {
777
+ "const": "window"
778
+ }
779
+ }
780
+ }
781
+ ]
782
+ }
783
+ },
784
+ "required": [
785
+ "kind",
786
+ "time"
787
+ ],
788
+ "additionalProperties": false
789
+ },
790
+ {
791
+ "type": "object",
792
+ "additionalProperties": false,
793
+ "required": [
794
+ "kind",
795
+ "operation",
796
+ "coverage",
797
+ "input_sampling",
798
+ "output_sampling"
799
+ ],
800
+ "properties": {
801
+ "kind": {
802
+ "const": "temporal_reduction"
803
+ },
804
+ "operation": {
805
+ "enum": [
806
+ "daily_total",
807
+ "daily_maximum",
808
+ "daily_minimum",
809
+ "rolling_total",
810
+ "annual_maximum",
811
+ "annual_minimum"
812
+ ]
813
+ },
814
+ "coverage": {
815
+ "type": "number",
816
+ "exclusiveMinimum": 0,
817
+ "maximum": 1
818
+ },
819
+ "input_sampling": {
820
+ "type": "object",
821
+ "additionalProperties": false,
822
+ "required": [
823
+ "calendar",
824
+ "step",
825
+ "timestamp"
826
+ ],
827
+ "properties": {
828
+ "calendar": {
829
+ "enum": [
830
+ "gregorian",
831
+ "no_leap",
832
+ "360_day",
833
+ "all_leap",
834
+ "julian",
835
+ "proleptic_gregorian"
836
+ ]
837
+ },
838
+ "timestamp": {
839
+ "enum": [
840
+ "start",
841
+ "end"
842
+ ]
843
+ },
844
+ "step": {
845
+ "type": "object",
846
+ "additionalProperties": false,
847
+ "required": [
848
+ "value",
849
+ "unit"
850
+ ],
851
+ "properties": {
852
+ "value": {
853
+ "type": "number",
854
+ "exclusiveMinimum": 0,
855
+ "maximum": 1.7976931348623157e+308
856
+ },
857
+ "unit": {
858
+ "enum": [
859
+ "s",
860
+ "h",
861
+ "d",
862
+ "month",
863
+ "yr"
864
+ ]
865
+ }
866
+ }
867
+ }
868
+ }
869
+ },
870
+ "output_sampling": {
871
+ "type": "object",
872
+ "additionalProperties": false,
873
+ "required": [
874
+ "calendar",
875
+ "step",
876
+ "timestamp"
877
+ ],
878
+ "properties": {
879
+ "calendar": {
880
+ "enum": [
881
+ "gregorian",
882
+ "no_leap",
883
+ "360_day",
884
+ "all_leap",
885
+ "julian",
886
+ "proleptic_gregorian"
887
+ ]
888
+ },
889
+ "timestamp": {
890
+ "enum": [
891
+ "start",
892
+ "end"
893
+ ]
894
+ },
895
+ "step": {
896
+ "type": "object",
897
+ "additionalProperties": false,
898
+ "required": [
899
+ "value",
900
+ "unit"
901
+ ],
902
+ "properties": {
903
+ "value": {
904
+ "type": "number",
905
+ "exclusiveMinimum": 0,
906
+ "maximum": 1.7976931348623157e+308
907
+ },
908
+ "unit": {
909
+ "enum": [
910
+ "s",
911
+ "h",
912
+ "d",
913
+ "month",
914
+ "yr"
915
+ ]
916
+ }
917
+ }
918
+ }
919
+ }
920
+ },
921
+ "window": {
922
+ "type": "object",
923
+ "additionalProperties": false,
924
+ "required": [
925
+ "value",
926
+ "unit"
927
+ ],
928
+ "properties": {
929
+ "value": {
930
+ "type": "integer",
931
+ "minimum": 1
932
+ },
933
+ "unit": {
934
+ "const": "d"
935
+ }
936
+ }
937
+ },
938
+ "measurements": {
939
+ "type": "array",
940
+ "items": {
941
+ "type": "object",
942
+ "additionalProperties": false,
943
+ "required": [
944
+ "variable_id",
945
+ "input",
946
+ "output"
947
+ ],
948
+ "properties": {
949
+ "variable_id": {
950
+ "type": "string",
951
+ "minLength": 1,
952
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
953
+ },
954
+ "input": {
955
+ "$ref": "https://climateriskcommons.org/schemas/measurement-1.0.schema.json"
956
+ },
957
+ "output": {
958
+ "$ref": "https://climateriskcommons.org/schemas/measurement-1.0.schema.json"
959
+ }
960
+ }
961
+ }
962
+ }
963
+ }
964
+ }
965
+ ]
966
+ },
967
+ "failure": {
968
+ "oneOf": [
969
+ {
970
+ "type": "object",
971
+ "properties": {
972
+ "code": {
973
+ "type": "string",
974
+ "minLength": 1,
975
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
976
+ },
977
+ "message": {
978
+ "type": "string",
979
+ "minLength": 1
980
+ },
981
+ "record": {
982
+ "allOf": [
983
+ {
984
+ "$ref": "https://climateriskcommons.org/schemas/fitting/1.0"
985
+ },
986
+ {
987
+ "properties": {
988
+ "converged": {
989
+ "const": false
990
+ }
991
+ }
992
+ }
993
+ ]
994
+ }
995
+ },
996
+ "required": [
997
+ "code",
998
+ "message",
999
+ "record"
1000
+ ],
1001
+ "additionalProperties": false
1002
+ },
1003
+ {
1004
+ "type": "object",
1005
+ "properties": {
1006
+ "kind": {
1007
+ "const": "source_unavailable"
1008
+ },
1009
+ "code": {
1010
+ "type": "string",
1011
+ "minLength": 1,
1012
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
1013
+ },
1014
+ "message": {
1015
+ "type": "string",
1016
+ "minLength": 1
1017
+ }
1018
+ },
1019
+ "required": [
1020
+ "kind",
1021
+ "code",
1022
+ "message"
1023
+ ],
1024
+ "additionalProperties": false
1025
+ }
1026
+ ]
1027
+ },
1028
+ "metadata": {
1029
+ "type": "object",
1030
+ "properties": {
1031
+ "schema_version": {
1032
+ "const": "2.0"
1033
+ },
1034
+ "spec": {
1035
+ "$ref": "#/$defs/data_spec"
1036
+ },
1037
+ "spatial": {
1038
+ "$ref": "#/$defs/spatial"
1039
+ },
1040
+ "source": {
1041
+ "$ref": "#/$defs/source"
1042
+ },
1043
+ "report": {
1044
+ "$ref": "#/$defs/report"
1045
+ },
1046
+ "provenance": {
1047
+ "type": "array",
1048
+ "items": {
1049
+ "$ref": "#/$defs/transformation"
1050
+ }
1051
+ }
1052
+ },
1053
+ "required": [
1054
+ "schema_version",
1055
+ "spec",
1056
+ "spatial",
1057
+ "report",
1058
+ "provenance"
1059
+ ],
1060
+ "additionalProperties": false
1061
+ },
1062
+ "row": {
1063
+ "type": "object",
1064
+ "properties": {
1065
+ "variable_id": {
1066
+ "type": "string",
1067
+ "minLength": 1,
1068
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
1069
+ },
1070
+ "scenario_id": {
1071
+ "anyOf": [
1072
+ {
1073
+ "type": "string",
1074
+ "minLength": 1,
1075
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
1076
+ },
1077
+ {
1078
+ "type": "null"
1079
+ }
1080
+ ]
1081
+ },
1082
+ "period_id": {
1083
+ "anyOf": [
1084
+ {
1085
+ "type": "string",
1086
+ "minLength": 1,
1087
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
1088
+ },
1089
+ {
1090
+ "type": "null"
1091
+ }
1092
+ ]
1093
+ },
1094
+ "support_id": {
1095
+ "type": "string",
1096
+ "minLength": 1,
1097
+ "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
1098
+ },
1099
+ "cell_id": {
1100
+ "type": "integer",
1101
+ "minimum": 0,
1102
+ "maximum": 18446744073709551615
1103
+ },
1104
+ "geometry": {
1105
+ "type": "string",
1106
+ "minLength": 42,
1107
+ "pattern": "^(?:[0-9a-f]{2})+$"
1108
+ },
1109
+ "curve": {
1110
+ "$ref": "https://climateriskcommons.org/schemas/numerical/1.0"
1111
+ },
1112
+ "fit": {
1113
+ "allOf": [
1114
+ {
1115
+ "$ref": "https://climateriskcommons.org/schemas/fitting/1.0"
1116
+ },
1117
+ {
1118
+ "properties": {
1119
+ "converged": {
1120
+ "const": true
1121
+ }
1122
+ }
1123
+ }
1124
+ ]
1125
+ },
1126
+ "failure": {
1127
+ "$ref": "#/$defs/failure"
1128
+ }
1129
+ },
1130
+ "required": [
1131
+ "variable_id",
1132
+ "scenario_id",
1133
+ "period_id",
1134
+ "support_id",
1135
+ "cell_id"
1136
+ ],
1137
+ "additionalProperties": false,
1138
+ "allOf": [
1139
+ {
1140
+ "oneOf": [
1141
+ {
1142
+ "required": [
1143
+ "curve"
1144
+ ],
1145
+ "not": {
1146
+ "required": [
1147
+ "failure"
1148
+ ]
1149
+ }
1150
+ },
1151
+ {
1152
+ "required": [
1153
+ "failure"
1154
+ ],
1155
+ "not": {
1156
+ "anyOf": [
1157
+ {
1158
+ "required": [
1159
+ "curve"
1160
+ ]
1161
+ },
1162
+ {
1163
+ "required": [
1164
+ "fit"
1165
+ ]
1166
+ }
1167
+ ]
1168
+ }
1169
+ }
1170
+ ]
1171
+ },
1172
+ {
1173
+ "if": {
1174
+ "required": [
1175
+ "fit"
1176
+ ]
1177
+ },
1178
+ "then": {
1179
+ "properties": {
1180
+ "curve": {
1181
+ "properties": {
1182
+ "object": {
1183
+ "const": "distribution"
1184
+ }
1185
+ }
1186
+ }
1187
+ }
1188
+ }
1189
+ }
1190
+ ]
1191
+ }
1192
+ }
1193
+ }