File size: 84,603 Bytes
edd6562
 
 
 
 
 
 
 
62a4ab3
edd6562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9c03d62
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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
import gradio as gr
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
from langchain.document_loaders import PyPDFLoader
import google.generativeai as genai
import os
from langchain_google_genai import ChatGoogleGenerativeAI

os.environ['GOOGLE_API_KEY'] = "AIzaSyArbqj5BvP8d7aeNsOf-6-5LI_12CO79BI"
genai.configure(api_key = os.environ['GOOGLE_API_KEY'])

### part by part prompts
result_1Point5 = """
"meta": [
    {
      "kind": "Unit",
      "name": "m",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"L\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:m:",
      "propertyNames": [
        "BitRecord[].DiameterBit",
        "BitRecord[].DiameterPassThrough",
        "BitRecord[].DiameterPilot",
        "OperationsActivity[].ActivityMDTop",
        "OperationsActivity[].ActivityMDBase",
        "OperationsActivity[].ActivityTVDTop",
        "OperationsActivity[].ActivityTVDBase",
        "OperationsActivity[].BitMDTop",
        "OperationsActivity[].BitMDBase",
        "OperationsActivity[].PlannedHoleDepthIn",
        "OperationsActivity[].PlannedHoleDepthOut",
        "OperationsActivity[].TargetDepth",
        "OperationsActivity[].SectionDiameter",
        "StatusInfo[].ReportEndMD",
        "StatusInfo[].ReportEndTVD",
        "StatusInfo[].PlugTopMD",
        "StatusInfo[].DiameterHole",
        "StatusInfo[].DiameterHoleStartMD",
        "StatusInfo[].DiameterPilot",
        "StatusInfo[].DiameterPilotPlanMD",
        "StatusInfo[].DiameterPilotPlanTVD",
        "StatusInfo[].KickoffMD",
        "StatusInfo[].KickoffTVD",
        "StatusInfo[].FormationStrengthMD",
        "StatusInfo[].FormationStrengthTVD",
        "StatusInfo[].CasingDiameterLast",
        "StatusInfo[].CasingMDLast",
        "StatusInfo[].CasingTVDLast",
        "StatusInfo[].MdPlanned",
        "StatusInfo[].DrilledDistance",
        "StatusInfo[].DistDrillRot",
        "StatusInfo[].DistDrillSlid",
        "StatusInfo[].DistReam",
        "StatusInfo[].DistHold",
        "StatusInfo[].DistSteering",
        "StatusInfo[].TvdLot",
        "Weather[].PrecipitationAmount",
        "Weather[].CloudCeiling",
        "Weather[].WaveHeightAverage",
        "Weather[].WaveHeightMax",
        "Weather[].WaveSignificant",
        "Weather[].Visibility",
        "PumpOp[].LinerInnerDiameter",
        "PumpOp[].StrokeLength",
        "PumpOp[].MeasuredDepthBit",
        "MudVolume[].MudVolumeMeasureDepthTop",
        "MudVolume[].MudVolumeMeasureDepthBase",
        "MudVolume[].MudVolumeTvdTop",
        "MudVolume[].MudVolumeTvdBase",
        "MudLosses[].MudLostVolumeMeasureDepthTop",
        "MudLosses[].MudLostVolumeMeasureDepthBase",
        "MudLosses[].MudLostVolumeTvdTop",
        "MudLosses[].MudLostVolumeTvdBase",
        "GasReading[].GasReadingMeasureDepthTop",
        "GasReading[].GasReadingTvdBase"
      ]
    },
    {
      "kind": "Unit",
      "name": "s",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"s\",\"baseMeasurement\":{\"ancestry\":\"T\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:s:",
      "propertyNames": [
        "OperationsActivity[].ActualDuration",
        "OperationsActivity[].PlannedDuration",
        "StatusInfo[].ElapsedTimeStart",
        "StatusInfo[].ElapsedTimeSpud",
        "StatusInfo[].ElapsedTimeLoc",
        "StatusInfo[].ElapsedTimeDrill",
        "StatusInfo[].ElapsedTimeDrillRot",
        "StatusInfo[].ElapsedTimeDrillSlid",
        "StatusInfo[].ElapsedTimeCirc",
        "StatusInfo[].ElapsedTimeReam",
        "StatusInfo[].ElapsedTimeHold",
        "StatusInfo[].ElapsedTimeSteering",
        "TargetDays",
        "TotalDays",
        "TotalNPT"
      ]
    },
    {
      "kind": "Unit",
      "name": "kg/m3",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"kg/m3\",\"baseMeasurement\":{\"ancestry\":\"M/L3\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:kg%2Fm3:",
      "propertyNames": [
        "StatusInfo[].FormationStrength",
        "StatusInfo[].PresLotEmw"
      ]
    },
    {
      "kind": "Unit",
      "name": "m/s",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m/s\",\"baseMeasurement\":{\"ancestry\":\"L/T\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:m%2Fs:",
      "propertyNames": [
        "StatusInfo[].RopCurrent",
        "StatusInfo[].RopAverage",
        "Weather[].CurrentSeaSpeed",
        "Weather[].WindSpeed"
      ]
    },
    {
      "kind": "Unit",
      "name": "Pa",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"Pa\",\"baseMeasurement\":{\"ancestry\":\"M/LT2\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:Pa:",
      "propertyNames": [
        "StatusInfo[].PresKickTol",
        "StatusInfo[].MAASP",
        "Weather[].BarometricPressure",
        "PumpOp[].PumpPressure",
        "HSE[].PressureAnnular",
        "HSE[].PressureChokeLine",
        "HSE[].PressureChokeMan",
        "HSE[].PressureDiverter",
        "HSE[].PressureKellyHose",
        "HSE[].PressureLastCasing",
        "HSE[].PressureBOPRam",
        "HSE[].PressureStandPipeManifold"
      ]
    },
    {
      "kind": "Unit",
      "name": "m3",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m3\",\"baseMeasurement\":{\"ancestry\":\"L3\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:m3:",
      "propertyNames": [
        "StatusInfo[].VolKickTol",
        "MudVolume[].MudVolumeStart",
        "MudVolume[].MudVolumeEnd",
        "MudVolume[].MudVolumeBuild",
        "MudVolume[].MudVolumeCasing",
        "MudVolume[].MudVolumeDumped",
        "MudVolume[].MudVolumeHole",
        "MudVolume[].MudVolumeReceived",
        "MudVolume[].MudVolumeReturned",
        "MudVolume[].MudVolumeRiser",
        "MudVolume[].MudVolumeString",
        "MudVolume[].TotalMudVolume",
        "MudVolume[].ExpectedMudVolume",
        "Inventory[].VolumeItem",
        "HSE[].VolumeFluidDischarged",
        "HSE[].VolumeCuttingDischarged",
        "HSE[].VolumeOilCuttingDischarge",
        "HSE[].VolumeWasteDischarged",
        "MudLosses[].MudLostVolumeAbandonDownhole",
        "MudLosses[].MudLostVolumeBehindCasingDownhole",
        "MudLosses[].MudLostVolumeCirculatingDownhole",
        "MudLosses[].MudLostVolumeCementingDownhole",
        "MudLosses[].MudLostVolumeCasingHole",
        "MudLosses[].MudLostVolumeMudCleanerSurface",
        "MudLosses[].MudLostVolumeOtherLocationDownhole",
        "MudLosses[].MudLostVolumeOtherLocationSurface",
        "MudLosses[].MudLostVolumePitsSurface",
        "MudLosses[].MudLostVolumeShakerSurface",
        "MudLosses[].MudLostVolumeTrippingSurface",
        "MudLosses[].TotalMudLostVolumeDownhole",
        "MudLosses[].TotalMudLostVolumeSurface"
      ]
    },
    {
      "kind": "Unit",
      "name": "rad",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"rad\",\"baseMeasurement\":{\"ancestry\":\"A\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:rad:",
      "propertyNames": [
        "Weather[].SeaCurrentDirection",
        "Weather[].WaveDirection",
        "Weather[].WindDirection"
      ]
    },
    {
      "kind": "Unit",
      "name": "K",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"K\",\"baseMeasurement\":{\"ancestry\":\"K\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:K:",
      "propertyNames": [
        "Weather[].SeaTemp",
        "Weather[].SurfaceTempMin",
        "Weather[].SurfaceTempMax",
        "Weather[].WindChillTemp"
      ]
    },
    {
      "kind": "Unit",
      "name": "W/W",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"W/W\",\"baseMeasurement\":{\"ancestry\":\"1\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:W%2FW:",
      "propertyNames": [
        "PumpOp[].PumpEfficiency"
      ]
    },
    {
      "kind": "Unit",
      "name": "m3/s",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m3/s\",\"baseMeasurement\":{\"ancestry\":\"L3/T\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:m3%2Fs:",
      "propertyNames": [
        "PumpOp[].PumpOutput"
      ]
    },
    {
      "kind": "Unit",
      "name": "rad/s",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"rad/s\",\"baseMeasurement\":{\"ancestry\":\"A/T\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:rad%2Fs:",
      "propertyNames": [
        "PumpOp[].StrokeRate"
      ]
    },
    {
      "kind": "Unit",
      "name": "m3/rad",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m3/rad\",\"baseMeasurement\":{\"ancestry\":\"L3/A\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:m3%2Frad:",
      "propertyNames": [
        "PumpOp[].PumpDisplacement"
      ]
    },
    {
      "kind": "Unit",
      "name": "kg",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"kg\",\"baseMeasurement\":{\"ancestry\":\"M\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:kg:",
      "propertyNames": [
        "Inventory[].WeightItem"
      ]
    },
    {
      "kind": "Unit",
      "name": "m3/m3",
      "persistableReference": "{\"abcd\":{\"a\":0.0,\"b\":1.0,\"c\":1.0,\"d\":0.0},\"symbol\":\"m3/m3\",\"baseMeasurement\":{\"ancestry\":\"1\",\"type\":\"UM\"},\"type\":\"UAD\"}",
      "unitOfMeasureID": "namespace:reference-data--UnitOfMeasure:m3%2Fm3:",
      "propertyNames": [
        "GasReading[].TotalGasMax",
        "GasReading[].TotalGasMin",
        "GasReading[].TotalGasAverage",
        "GasReading[].Methane",
        "GasReading[].Ethane",
        "GasReading[].Propane",
        "GasReading[].Isobutane",
        "GasReading[].Norbutane",
        "GasReading[].Isopentane"
      ]
    }
  ],
"""

attributes_1 = """
id: Previously called ResourceID or SRN which identifies this OSDU resource object without version.,\n
kind: The schema identification for the OSDU resource object following the pattern {Namespace}:{Source}:{Type}:{VersionMajor}.{VersionMinor}.{VersionPatch}. The versioning scheme follows the semantic versioning,\n
version: The version number of this OSDU resource; set by the framework.,\n
acl.owners[]: The list of owners of this data record formatted as an email,\n
acl.viewers[]: The list of viewers to which this data record is accessible/visible/discoverable formatted as an email,\n
legal.legaltags[]: The list of legal tags, which resolve to legal properties (like country of origin, export classification code, etc.) and rules with the help of the Compliance Service.,\n
legal.otherRelevantDataCountries[]: The list of other relevant data countries as an array of two-letter country codes,\n
legal.status: The legal status. Set by the system after evaluation against the compliance rules associated with the "legaltags" using the Compliance Service.,\n
tags: A generic dictionary of string keys mapping to string value. Only strings are permitted as keys and values., \n
createTime: Timestamp of the time at which initial version of this OSDU resource object was created. Set by the System. The value is a combined date-time string in ISO-8601 given in UTC.,\n
createUser: The user reference, which created the first version of this resource object. Set by the System.,\n
modifyTime: Timestamp of the time at which this version of the OSDU resource object was created. Set by the System. The value is a combined date-time string in ISO-8601 given in UTC.,\n
ancestry.parents[]: An array of none, one or many entity references of 'direct parents' in the data platform, which mark the current record as a derivative. In contrast to other relationships, the source record version is required. During record creation or update the ancestry.parents[] relationships are used to collect the legal tags from the sources and aggregate them in the legal.legaltags[] array. As a consequence, should e.g., one or more of the legal tags of the source data expire, the access to the derivatives is also terminated. For details, see ComplianceService tutorial, 'Creating derivative Records'.,\n
modifyUser: The user reference, which created this version of this resource object. Set by the System.,\n
data.GeoContexts[].GeoPoliticalEntityID: Reference to GeoPoliticalEntity.,\n
data.GeoContexts[].GeoTypeID: The GeoPoliticalEntityType reference of the GeoPoliticalEntity (via GeoPoliticalEntityID) for application convenience.,\n
data.GeoContexts[].BasinID: Reference to Basin.,\n
data.GeoContexts[].GeoTypeID: The BasinType reference of the Basin (via BasinID) for application convenience.,\n
data.GeoContexts[].FieldID: Reference to Field.,\n
data.GeoContexts[].GeoTypeID: The fixed type 'Field' for this AbstractGeoFieldContext.,\n
data.GeoContexts[].PlayID: Reference to the play.,\n
data.GeoContexts[].GeoTypeID: The PlayType reference of the Play (via PlayID) for application convenience.,\n
data.GeoContexts[].ProspectID: Reference to the prospect.,\n
data.GeoContexts[].GeoTypeID: The ProspectType reference of the Prospect (via ProspectID) for application convenience.,\n
data.SpatialLocation.SpatialLocationCoordinatesDate: Date when coordinates were measured or retrieved.,\n
data.SpatialLocation.QuantitativeAccuracyBandID: An approximate quantitative assessment of the quality of a location (accurate to > 500 m (i.e. not very accurate)), to < 1 m, etc.,\n
data.SpatialLocation.QualitativeSpatialAccuracyTypeID: A qualitative description of the quality of a spatial location, e.g. unverifiable, not verified, basic validation.,\n
data.SpatialLocation.CoordinateQualityCheckPerformedBy: The user who performed the Quality Check.,\n
data.SpatialLocation.CoordinateQualityCheckDateTime: The date of the Quality Check,\n
data.SpatialLocation.CoordinateQualityCheckRemarks[]: Freetext remarks on Quality Check.,\n
data.SpatialLocation.AsIngestedCoordinates: The original or 'as ingested' coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon). The name 'AsIngestedCoordinates' was chosen to contrast it to 'OriginalCoordinates', which carries the uncertainty whether any coordinate operations took place before ingestion. In cases where the original CRS is different from the as-ingested CRS, the AppliedOperations can also contain the list of operations applied to the coordinate prior to ingestion. The data structure is similar to GeoJSON FeatureCollection, however in a CRS context explicitly defined within the AbstractAnyCrsFeatureCollection. The coordinate sequence follows GeoJSON standard, i.e. 'eastward/longitude', 'northward/latitude' {, 'upward/height' unless overridden by an explicit direction in the AsIngestedCoordinates.VerticalCoordinateReferenceSystemID}. Fragment Description: A schema like GeoJSON FeatureCollection with a non-WGS 84 CRS context; based on https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude/Easting/Westing/X first, followed by Latitude/Northing/Southing/Y, optionally height as third coordinate,\n
data.SpatialLocation.Wgs84Coordinates: The normalized coordinates (Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon) based on WGS 84 (EPSG:4326 for 2-dimensional coordinates, EPSG:4326 + EPSG:5714 (MSL) for 3-dimensional coordinates). This derived coordinate representation is intended for global discoverability only. The schema of this substructure is identical to the GeoJSON FeatureCollection https://geojson.org/schema/FeatureCollection.json. The coordinate sequence follows GeoJSON standard, i.e. longitude, latitude {, height} Fragment Description: GeoJSON feature collection as originally published in https://geojson.org/schema/FeatureCollection.json. Attention: the coordinate order is fixed: Longitude first, followed by Latitude, optionally height above MSL (EPSG:5714) as third coordinate.,\n
data.SpatialLocation.AppliedOperations[]: The audit trail of operations applied to the coordinates from the original state to the current state. The list may contain operations applied prior to ingestion as well as the operations applied to produce the Wgs84Coordinates. The text elements refer to ESRI style CRS and Transformation names, which may have to be translated to EPSG standard names.,\n
data.SpatialLocation.SpatialParameterTypeID: A type of spatial representation of an object, often general (e.g. an Outline, which could be applied to Field, Reservoir, Facility, etc.) or sometimes specific (e.g. Onshore Outline, State Offshore Outline, Federal Offshore Outline, 3 spatial representations that may be used by Countries).,\n
data.SpatialLocation.SpatialGeometryTypeID: Indicates the expected look of the SpatialParameterType, e.g. Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon. The value constrains the type of geometries in the GeoJSON Wgs84Coordinates and AsIngestedCoordinates.,\n
data.VersionCreationReason: This describes the reason that caused the creation of a new version of this master data.,\n
data.TechnicalAssurances[].TechnicalAssuranceTypeID: Describes a record's overall suitability for general business consumption based on data quality. Clarifications: Since Certified is the highest classification of suitable quality, any further change or versioning of a Certified record should be carefully considered and justified. If a Technical Assurance value is not populated then one can assume the data has not been evaluated or its quality is unknown (=Unevaluated). Technical Assurance values are not intended to be used for the identification of a single "preferred" or "definitive" record by comparison with other records.,\n
data.TechnicalAssurances[].Reviewers[].EmailAddress: Contact email address. Property may be left empty where it is inappropriate to provide personally identifiable information.,\n
data.TechnicalAssurances[].Reviewers[].PhoneNumber: Contact phone number. Property may be left empty where it is inappropriate to provide personally identifiable information.,\n
data.TechnicalAssurances[].Reviewers[].RoleTypeID: The identifier of a reference value for the role of the contact within the associated organisation, such as Account owner, Sales Representative, Technical Support, Project Manager, Party Chief, Client Representative, Senior Observer.,\n
data.TechnicalAssurances[].Reviewers[].DataGovernanceRoleTypeID: The data governance role assigned to this contact if and only if the context has a data governance role (in context of TechnicalAssurance). The value is kept absent in all other cases.,\n
data.TechnicalAssurances[].Reviewers[].WorkflowPersonaTypeID: The persona in context of workflows associated with this contact, as used in TechnicalAssurance.,\n
data.TechnicalAssurances[].Reviewers[].Comment: Additional information about the contact,\n
data.TechnicalAssurances[].Reviewers[].OrganisationID: Reference to the company the contact is associated with.,\n
data.TechnicalAssurances[].Reviewers[].Name: Name of the individual contact. Property may be left empty where it is inappropriate to provide personally identifiable information.,\n
data.TechnicalAssurances[].AcceptableUsage[].WorkflowUsageTypeID: Name of the business activities, processes, and/or workflows that the record's technical assurance value is valid for.,\n
data.TechnicalAssurances[].AcceptableUsage[].WorkflowPersonaTypeID: Name of the role or personas that the record's technical assurance value is valid for.,\n
data.TechnicalAssurances[].AcceptableUsage[].DataQualityRuleSetID: The DataQualityRuleSet, which had to pass successfully to achieve this level of technical assurance.,\n
data.TechnicalAssurances[].AcceptableUsage[].DataQualityID: The relationship to a work-product-component--DataQuality assessment record, which was used as the basis for this decision.,\n
data.TechnicalAssurances[].AcceptableUsage[].ValueChainStatusTypeID: The stage of business where the record is acceptable for workflow usage.,\n
data.TechnicalAssurances[].UnacceptableUsage[].WorkflowUsageTypeID: Name of the business activities, processes, and/or workflows that the record's technical assurance value is not valid for.,\n
data.TechnicalAssurances[].UnacceptableUsage[].WorkflowPersonaTypeID: Name of the role or personas that the record is technical assurance value is not valid for.,\n
data.TechnicalAssurances[].UnacceptableUsage[].DataQualityRuleSetID: The DataQualityRuleSet, which did not pass successfully to achieve this level of technical assurance.,\n
data.TechnicalAssurances[].UnacceptableUsage[].DataQualityID: The relationship to a work-product-component--DataQuality assessment record, which was used as the basis for this decision.,\n
data.TechnicalAssurances[].UnacceptableUsage[].ValueChainStatusTypeID: The stage of business where the record is not acceptable for workflow usage.,\n
data.TechnicalAssurances[].EffectiveDate: Date when the technical assurance determination for this record has taken place,\n
data.TechnicalAssurances[].Comment: Any additional context to support the determination of technical assurance,\n
"""

JSON_file1 = """
{
  "id": <<id>>,
  "kind": <<kind>>,
  "version": <<version>>,
  "acl": {
    "owners": [
      <<acl.owners[]>>
    ],
    "viewers": [
      <<acl.viewers[]>>
    ]
  },
  "legal": {
    "legaltags": [
      <<legal.legaltags[]>>
    ],
    "otherRelevantDataCountries": [
      <<legal.otherRelevantDataCountries[]>>
    ],
    "status": <<legal.status>>
  },
  "tags": {<<tags>>},
  "createTime": <<createTime>>,
  "createUser": <<createUser>>,
  "modifyTime": <<modifyTime>>,
  "modifyUser": <<modifyUser>>,
  "ancestry": {
    "parents": [<<ancestry.parents[]>>]
  }
    "data": {
    "ResourceHomeRegionID": "namespace:reference-data--OSDURegion:AWSEastUSA:",
    "ResourceHostRegionIDs": [
      "namespace:reference-data--OSDURegion:AWSEastUSA:"
    ],
    "ResourceCurationStatus": "namespace:reference-data--ResourceCurationStatus:Created:",
    "ResourceLifecycleStatus": "namespace:reference-data--ResourceLifecycleStatus:Loading:",
    "ResourceSecurityClassification": "namespace:reference-data--ResourceSecurityClassification:Public:",
    "Source": "Example Data Source",
    "ExistenceKind": "namespace:reference-data--ExistenceKind:Prototype:",
    "NameAliases": [
      {
        "AliasName": "Example AliasName",
        "AliasNameTypeID": "namespace:reference-data--AliasNameType:RegulatoryIdentifier:",
        "DefinitionOrganisationID": "namespace:master-data--Organisation:SomeUniqueOrganisationID:",
        "EffectiveDateTime": "2020-02-13T09:13:15.55Z",
        "TerminationDateTime": "2020-02-13T09:13:15.55Z"
      }
    ],
    "GeoContexts": [
      {
        "GeoPoliticalEntityID": <<data.GeoContexts[].GeoPoliticalEntityID>>,
        "GeoTypeID": <<data.GeoContexts[].GeoTypeID>>
      },
      {
        "BasinID": <<data.GeoContexts[].BasinID>>,
        "GeoTypeID": <<data.GeoContexts[].GeoTypeID>>
      },
      {
        "FieldID": <<data.GeoContexts[].FieldID>>,
        "GeoTypeID": <<data.GeoContexts[].GeoTypeID>>
      },
      {
        "PlayID": <<data.GeoContexts[].PlayID>>,
        "GeoTypeID": <<data.GeoContexts[].GeoTypeID>>
      },
      {
        "ProspectID": <<data.GeoContexts[].ProspectID>>,
        "GeoTypeID": <<data.GeoContexts[].GeoTypeID>>
      }
    ],
    "SpatialLocation": {
      "SpatialLocationCoordinatesDate": <<data.SpatialLocation.SpatialLocationCoordinatesDate>>,
      "QuantitativeAccuracyBandID": <<data.SpatialLocation.QuantitativeAccuracyBandID>>,
      "QualitativeSpatialAccuracyTypeID": <<data.SpatialLocation.QualitativeSpatialAccuracyTypeID>>,
      "CoordinateQualityCheckPerformedBy": <<data.SpatialLocation.CoordinateQualityCheckPerformedBy>>,
      "CoordinateQualityCheckDateTime": <<data.SpatialLocation.CoordinateQualityCheckDateTime>>,
      "CoordinateQualityCheckRemarks": [
        <<data.SpatialLocation.CoordinateQualityCheckRemarks[]>>
      ],
      "AsIngestedCoordinates": {
      <<data.SpatialLocation.AsIngestedCoordinates>>
      },
      "Wgs84Coordinates": {
        <<data.SpatialLocation.Wgs84Coordinates>>
      },
      "AppliedOperations": [
        <<data.SpatialLocation.AppliedOperations[]>>
      ],
      "SpatialParameterTypeID": <<data.SpatialLocation.SpatialParameterTypeID>>,
      "SpatialGeometryTypeID": <<data.SpatialLocation.SpatialGeometryTypeID>>
    },
    "VersionCreationReason": <<data.VersionCreationReason>>,
    "TechnicalAssuranceTypeID": <<data.TechnicalAssurances[].TechnicalAssuranceTypeID>>,
    "TechnicalAssurances": [
      {
        "TechnicalAssuranceTypeID": <<data.TechnicalAssurances[].TechnicalAssuranceTypeID>>,
        "Reviewers": [
          {
            "RoleTypeID": <<data.TechnicalAssurances[].Reviewers[].RoleTypeID>>,
            "DataGovernanceRoleTypeID": <<data.TechnicalAssurances[].Reviewers[].DataGovernanceRoleTypeID>>,
            "WorkflowPersonaTypeID": <<data.TechnicalAssurances[].Reviewers[].WorkflowPersonaTypeID>>,
            "OrganisationID": <<data.TechnicalAssurances[].Reviewers[].OrganisationID>>,
            "Name": <<data.TechnicalAssurances[].Reviewers[].Name>>
          }
        ],
        "AcceptableUsage": [
          {
            "WorkflowUsageTypeID": <<data.TechnicalAssurances[].AcceptableUsage[].WorkflowUsageTypeID>>,
            "WorkflowPersonaTypeID": <<data.TechnicalAssurances[].AcceptableUsage[].WorkflowPersonaTypeID>>,
            "DataQualityRuleSetID": <<data.TechnicalAssurances[].AcceptableUsage[].DataQualityRuleSetID>>,
            "DataQualityID": <<data.TechnicalAssurances[].AcceptableUsage[].DataQualityID>>,
            "ValueChainStatusTypeID": <<data.TechnicalAssurances[].AcceptableUsage[].ValueChainStatusTypeID>>
          }
        ],
        "UnacceptableUsage": [
          {
            "WorkflowUsageTypeID": <<data.TechnicalAssurances[].UnacceptableUsage[].WorkflowUsageTypeID>>,
            "WorkflowPersonaTypeID": <<data.TechnicalAssurances[].UnacceptableUsage[].WorkflowPersonaTypeID>>,
            "DataQualityRuleSetID": <<data.TechnicalAssurances[].UnacceptableUsage[].DataQualityRuleSetID>>,
            "DataQualityID": <<data.TechnicalAssurances[].UnacceptableUsage[].DataQualityID>>,
            "ValueChainStatusTypeID": <<data.TechnicalAssurances[].UnacceptableUsage[].ValueChainStatusTypeID>>
          }
        ],
        "EffectiveDate": <<data.TechnicalAssurances[].EffectiveDate>>,
        "Comment": <<data.TechnicalAssurances[].Comment>>
      }
    ],
"""

attributes_2 = """
data.StartDateTime: Date and time that the reporting period started. A report period is commonly 24 hours.,\n
data.EndDateTime: Date and time that the reporting period ended. A report period is commonly 24 hours.,\n
data.BitRecord[].NumBit: Bit number and rerun number e.g. "4.1" for the first rerun of bit 4.,\n
data.BitRecord[].DiameterBit: Diameter of drilled hole.,\n
data.BitRecord[].DiameterPassThrough: Minimum hole or tubing which bit will pass through (for bi-center bits).,\n
data.BitRecord[].DiameterPilot: Diameter of pilot bit (for bi-center bits).,\n
data.BitRecord[].Manufacturer: Manufacturer / supplier of the item.,\n
data.BitRecord[].TypeBit: Type of bit.,\n
data.BitRecord[].Cost: Bit cost in local currency.,\n
data.BitRecord[].CostCurrency: The name of the local currency,\n
data.BitRecord[].MfgCode: The manufacturers code for the bit.,\n
data.BitRecord[].IADCCode: IADC bit code.,\n
data.BitRecord[].InitialConditionInner: Condition of inner tooth rows (inner 2/3 of bit) (0-8).,\n
data.BitRecord[].InitialConditionOuter: Condition of outer tooth rows (outer 1/3 of bit) (0-8).,\n
data.BitRecord[].InitialConditionDull: Overall dull condition from IADC bit wear 2 character codes.,\n
data.BitRecord[].InitialConditionLocation: Row and cone numbers for items which need location information (e.g. Cracked Cone, Lost Cone etc).,\n
data.BitRecord[].InitialConditionBearing: Condition of bit bearings (integer 0-8 or E, F, N or X)).,\n
data.BitRecord[].InitialConditionGauge: Condition of bit gauge in 1/16 of an inch. I = in gauge, else number of 16ths out of gauge.,\n
data.BitRecord[].InitialConditionOther: Other comments on bit condition from IADC list (BitDullCode in standard list).,\n
data.BitRecord[].InitialConditionReason: Reason bit was pulled from IADC codes.,\n
data.BitRecord[].FinalConditionInner: Condition of inner tooth rows (inner 2/3 of bit) (0-8).,\n
data.BitRecord[].FinalConditionOuter: Condition of outer tooth rows (outer 1/3 of bit) (0-8).,\n
data.BitRecord[].FinalConditionDull: Overall dull condition from IADC bit wear 2 character codes.,\n
data.BitRecord[].FinalConditionLocation: Row and cone numbers for items which need location information (e.g. Cracked Cone, Lost Cone etc).,\n
data.BitRecord[].FinalConditionBearing: Condition of bit bearings (integer 0-8 or E, F, N or X).,\n
data.BitRecord[].FinalConditionGauge: Condition of bit gauge in 1/16 of a inch. I = in gauge, else number of 16ths out of gauge.,\n
data.BitRecord[].FinalConditionOther: Other comments on bit condition from IADC list (BitDullCode in Standard LISTS).,\n
data.BitRecord[].FinalConditionReason: Reason bit was pulled from IADC codes.,\n
data.BitRecord[].DriveType: Bit drive type (Motor, rotary table etc),\n
data.BitRecord[].BitClass: N = new, U = used.,\n
data.OperationsActivity[].ActivityID: Identifier of the activity.,\n
data.OperationsActivity[].StartDateTime: Date and time that activities started.,\n
data.OperationsActivity[].EndDateTime: Date and time that activities ended.,\n
data.OperationsActivity[].ActualDuration: Actual duration of the activity.,\n
data.OperationsActivity[].Phase: Phase refers to a large activity classification, e.g., drill surface hole.,\n
data.OperationsActivity[].ActivityCodeID: The activity code of the activity,\n
data.OperationsActivity[].DetailActivity: Custom string to further define an activity.,\n
data.OperationsActivity[].TypeActivityClassID: Classifier (planned, unplanned, downtime).,\n
data.OperationsActivity[].ActivityMDTop: Measured depth at the top of interval over which the activity was conducted.,\n
data.OperationsActivity[].ActivityMDBase: Measured depth at the base of interval over which the activity was conducted.,\n
data.OperationsActivity[].ActivityTVDTop: TVD at the top of interval over which the activity was conducted.,\n
data.OperationsActivity[].ActivityTVDBase: TVD at the base of interval over which the activity was conducted.,\n
data.OperationsActivity[].BitMDTop: Measured depth of the bit at the top of interval over which the activity was conducted.,\n
data.OperationsActivity[].BitMDBase: Measured depth of the bit at the ase of interval over which the activity was conducted.,\n
data.OperationsActivity[].ActivityOutcomeID: OK, Finish, interrupted, failed, etc.,\n
data.OperationsActivity[].ActivityOutcomeDetailID: More detail on the outcome of the activity. For Example Injury, Operation Failed, Kick, Circulation Loss, Mud Loss,\n
data.OperationsActivity[].OperatorID: Reference to the Organisation that represents the Operator,\n
data.OperationsActivity[].ServiceProviderID: Reference to the Organisation that represents the Service Provider,\n
data.OperationsActivity[].TubularID: A pointer to the tubular object related to this activity. Not the Hole Section that you are operating within.,\n
data.OperationsActivity[].IsOptimum: Is the activity optimum? Values are "true" (or "1") and "false" (or "0").,\n
data.OperationsActivity[].IsProductive: Does activity bring closer to objective? Values are "true" (or "1") and "false" (or "0").,\n
data.OperationsActivity[].IsOffline: Is the activity an Offline activity, Values are "true" (or "1") and "false" (or "0"),\n
data.OperationsActivity[].ItemState: The item state for the data object. (Actual, Planned, Unknown and Modeled),\n
data.OperationsActivity[].Comments: Comments and remarks.,\n
data.OperationsActivity[].ProprietaryActivityCode[].Identifier: Identifier property,\n
data.OperationsActivity[].ProprietaryActivityCode[].Description: Description Property,\n
data.OperationsActivity[].ProprietaryActivityCode[].Authority: Authority property,\n
data.OperationsActivity[].ParentID: The UID of the parent activity,\n
data.OperationsActivity[].PredecessorID: The UID of the preceding activity,\n
data.OperationsActivity[].PlannedHoleDepthIn: The planned hole depth at the start of the activity,\n
data.OperationsActivity[].PlannedHoleDepthOut: The planned hole depth at the end of the activity,\n
data.OperationsActivity[].PlannedDuration: The planned duration for the activity.,\n
data.OperationsActivity[].TargetDepth: The target depth of the activity,\n
data.OperationsActivity[].OperationalNotes: Notes associated with the operation,\n
data.OperationsActivity[].AttachmentIDs[]: Attachments associated with the activity,\n
data.OperationsActivity[].SectionDiameter: The Diameter of the section in which the activity took place,\n
data.OperationsActivity[].ObjectReference: link to an external object or document. For example Regulatory submission, Tour sheet.,\n
data.OperationsActivity[].WellboreID: A Reference to the wellbore in which the activities take place.,\n
"""

JSON_file2 = """
    "StartDateTime": <<data.StartDateTime>>,
    "EndDateTime": <<data.EndDateTime>>,
    "BitRecord": [
      {
        "NumBit": <<data.BitRecord[].NumBit>>,
        "DiameterBit": <<data.BitRecord[].DiameterBit>>,
        "DiameterPassThrough": <<data.BitRecord[].DiameterPassThrough>>,
        "DiameterPilot": <<data.BitRecord[].DiameterPilot>>,
        "Manufacturer": <<data.BitRecord[].Manufacturer>>,
        "TypeBit": <<data.BitRecord[].TypeBit>>,
        "Cost": <<data.BitRecord[].Cost>>,
        "CostCurrency": <<data.BitRecord[].CostCurrency>>,
        "MfgCode": <<data.BitRecord[].MfgCode>>,
        "IADCCode": <<data.BitRecord[].IADCCode>>,
        "InitialConditionInner": <<data.BitRecord[].InitialConditionInner>>,
        "InitialConditionOuter": <<data.BitRecord[].InitialConditionOuter>>,
        "InitialConditionDull": <<data.BitRecord[].InitialConditionDull>>,
        "InitialConditionLocation": <<data.BitRecord[].InitialConditionLocation>>,
        "InitialConditionBearing": <<data.BitRecord[].InitialConditionBearing>>,
        "InitialConditionGauge": <<data.BitRecord[].InitialConditionGauge>>,
        "InitialConditionOther": <<data.BitRecord[].InitialConditionOther>>,
        "InitialConditionReason": <<data.BitRecord[].InitialConditionReason>>,
        "FinalConditionInner": <<data.BitRecord[].FinalConditionInner>>,
        "FinalConditionOuter": <<data.BitRecord[].FinalConditionOuter>>,
        "FinalConditionDull": <<data.BitRecord[].FinalConditionDull>>,
        "FinalConditionLocation": <<data.BitRecord[].FinalConditionLocation>>,
        "FinalConditionBearing": <<data.BitRecord[].FinalConditionBearing>>,
        "FinalConditionGauge": <<data.BitRecord[].FinalConditionGauge>>,
        "FinalConditionOther": <<data.BitRecord[].FinalConditionOther>>,
        "FinalConditionReason": <<data.BitRecord[].FinalConditionReason>>,
        "DriveType": <<data.BitRecord[].DriveType>>,
        "BitClass": <<data.BitRecord[].BitClass>>
      }
    ],
"OperationsActivity": [
      {
        "ActivityID": <<data.OperationsActivity[].ActivityID>>,
        "StartDateTime": <<data.OperationsActivity[].StartDateTime>>,
        "EndDateTime": <<data.OperationsActivity[].EndDateTime>>,
        "ActualDuration": <<data.OperationsActivity[].ActualDuration>>,
        "Phase": <<data.OperationsActivity[].Phase>>,
        "ActivityCodeID": <<data.OperationsActivity[].ActivityCodeID>>,
        "DetailActivity": <<data.OperationsActivity[].DetailActivity>>,
        "TypeActivityClassID": <<data.OperationsActivity[].TypeActivityClassID>>,
        "ActivityMDTop": <<data.OperationsActivity[].ActivityMDTop>>,
        "ActivityMDBase": <<data.OperationsActivity[].ActivityMDBase>>,
        "ActivityTVDTop": <<data.OperationsActivity[].ActivityTVDTop>>,
        "ActivityTVDBase": <<data.OperationsActivity[].ActivityTVDBase>>,
        "BitMDTop": <<data.OperationsActivity[].BitMDTop>>,
        "BitMDBase": <<data.OperationsActivity[].BitMDBase>>,
        "ActivityOutcomeID": <<data.OperationsActivity[].ActivityOutcomeID>>,
        "ActivityOutcomeDetailID": <<data.OperationsActivity[].ActivityOutcomeDetailID>>,
        "OperatorID": <<data.OperationsActivity[].OperatorID>>,
        "ServiceProviderID": <<data.OperationsActivity[].ServiceProviderID>>,
        "TubularID": <<data.OperationsActivity[].TubularID>>,
        "IsOptimum": <<data.OperationsActivity[].IsOptimum>>,
        "IsProductive": <<data.OperationsActivity[].IsProductive>>,
        "IsOffline": <<data.OperationsActivity[].IsOffline>>,
        "ItemState": <<data.OperationsActivity[].ItemState>>,
        "Comments": <<data.OperationsActivity[].Comments>>,
        "ProprietaryActivityCode": [
          {
            "Identifier": <<data.OperationsActivity[].ProprietaryActivityCode[].Identifier>>,
            "Description": <data.OperationsActivity[].ProprietaryActivityCode[].Description>>,
            "Authority": <<data.OperationsActivity[].ProprietaryActivityCode[].Authority>>
          }
        ],
        "ParentID": <<data.OperationsActivity[].ParentID>>,
        "PredecessorID": <<data.OperationsActivity[].PredecessorID>>,
        "PlannedHoleDepthIn": <<data.OperationsActivity[].PlannedHoleDepthIn>>,
        "PlannedHoleDepthOut": <<data.OperationsActivity[].PlannedHoleDepthOut>>,
        "PlannedDuration": <<data.OperationsActivity[].PlannedDuration>>,
        "TargetDepth": <<data.OperationsActivity[].TargetDepth>>,
        "OperationalNotes": <<data.OperationsActivity[].OperationalNotes>>,
        "AttachmentIDs": [
          <<data.OperationsActivity[].AttachmentIDs[]>>
        ],
        "SectionDiameter": <<data.OperationsActivity[].SectionDiameter>>,
        "ObjectReference": <<data.OperationsActivity[].ObjectReference>>,
        "WellboreID": <<data.OperationsActivity[].WellboreID>>
      }
    ],
"""

attributes_3 = """
data.WellboreID: A link to the wellbore that was active at the end of this report period.,\n
data.WellAlias.Identifier: Identifier property,\n
data.WellAlias.Description: Description Property,\n
data.WellAlias.Authority: Authority property,\n
data.WellboreAlias[]: Local name defined for the wellbore Fragment Description: Definition of an alias,\n
data.WellboreAlias[].Identifier: Identifier property,\n
data.WellboreAlias[].Description: Description Property,\n
data.WellboreAlias[].Authority: Authority property,\n
data.StatusInfo[].StatusDateTime: The date and time for which the well status is reported.,\n
data.StatusInfo[].ReportEndMD: Wellbore measured depth at the end of the report period.,\n
data.StatusInfo[].ReportEndTVD: Wellbore true vertical depth at the end of the report.,\n
data.StatusInfo[].PlugTopMD: The measured plug back depth.,\n
data.StatusInfo[].DiameterHole: Hole nominal inside diameter.,\n
data.StatusInfo[].DiameterHoleStartMD: Measured depth to the start of the current hole diameter.,\n
data.StatusInfo[].DiameterPilot: Pilot hole nominal inside diameter.,\n
data.StatusInfo[].DiameterPilotPlanMD: The planned measured depth of the pilot hole.,\n
data.StatusInfo[].DiameterPilotPlanTVD: The planned true vertical depth of the pilot hole.,\n
data.StatusInfo[].TypeWellbore: Type of wellbore.,\n
data.StatusInfo[].KickoffMD: Measured depth to the kickoff point of the wellbore.,\n
data.StatusInfo[].KickoffTVD: True vertical depth to the kickoff point of the wellbore.,\n
data.StatusInfo[].FormationStrength: The measured formation strength. This should be the final measurement before the end of the report period.,\n
data.StatusInfo[].FormationStrengthMD: The measured depth of the formation strength measurement.,\n
data.StatusInfo[].FormationStrengthTVD: The true vertical depth of the formation strength measurement.,\n
data.StatusInfo[].CasingDiameterLast: Diameter of the last casing joint.,\n
data.StatusInfo[].CasingMDLast: Measured depth of the last casing joint.,\n
data.StatusInfo[].CasingTVDLast: True vertical depth of last casing joint.,\n
data.StatusInfo[].PresTestType: The type of pressure test that was run.,\n
data.StatusInfo[].MdPlanned: The measured depth planned to be reached.,\n
data.StatusInfo[].DrilledDistance: Distance drilled. This should be measured along the centerline of the wellbore.,\n
data.StatusInfo[].Summary24Hr: A summary of the activities performed and the status of the ongoing activities.,\n
data.StatusInfo[].Forecast24Hr: A summary of planned activities for the next reporting period.,\n
data.StatusInfo[].RopCurrent: Rate of penetration at the end of the reporting period.,\n
data.StatusInfo[].Rig: A pointer to the rig used.,\n
data.StatusInfo[].ElapsedTimeStart: Time from the start of operations (commonly in days).,\n
data.StatusInfo[].ElapsedTimeSpud: Time since the bit broke ground (commonly in days).,\n
data.StatusInfo[].ElapsedTimeLoc: Time the rig has been on location (commonly in days).,\n
data.StatusInfo[].ElapsedTimeDrill: Drilling time.,\n
data.StatusInfo[].RopAverage: Average rate of penetration.,\n
data.StatusInfo[].Supervisor: Name of the rig supervisor,\n
data.StatusInfo[].Engineer: Name of the operator's drilling engineer.,\n
data.StatusInfo[].Geologist: Name of operator's wellsite geologist.,\n
data.StatusInfo[].ElapsedTimeDrillRot: Time spent rotary drilling.,\n
data.StatusInfo[].ElapsedTimeDrillSlid: Time spent slide drilling from the start of the bit run.,\n
data.StatusInfo[].ElapsedTimeCirc: Time spent circulating from the start of the bit run.,\n
data.StatusInfo[].ElapsedTimeReam: Time spent reaming from the start of the bit run.,\n
data.StatusInfo[].ElapsedTimeHold: Time spent with no directional drilling work (commonly in hours).,\n
data.StatusInfo[].ElapsedTimeSteering: Time spent steering the bottomhole assembly (commonly in hours).,\n
data.StatusInfo[].DistDrillRot: Distance drilled: rotating.,\n
data.StatusInfo[].DistDrillSlid: Distance drilled: sliding.,\n
data.StatusInfo[].DistReam: Distance reamed.,\n
data.StatusInfo[].DistHold: Distance covered while holding angle with a steerable drilling assembly.,\n
data.StatusInfo[].DistSteering: Distance covered while actively steering with a steerable drilling assembly.,\n
data.StatusInfo[].NumPOB: Total number of personnel on board the rig.,\n
data.StatusInfo[].NumContract: Number of contractor personnel on the rig.,\n
data.StatusInfo[].NumOperator: Number of operator personnel on the rig.,\n
data.StatusInfo[].NumService: Number of service company personnel on the rig.,\n
data.StatusInfo[].NumAFE: Authorization for expenditure (AFE) number that this cost item applies to.,\n
data.StatusInfo[].ConditionHole: Description of the hole condition.,\n
data.StatusInfo[].TvdLot: True vertical depth of a leak off test point.,\n
data.StatusInfo[].PresLotEmw: Leak off test equivalent mud weight.,\n
data.StatusInfo[].PresKickTol: Kick tolerance pressure.,\n
data.StatusInfo[].VolKickTol: Kick tolerance volume.,\n
data.StatusInfo[].MAASP: Maximum allowable shut-in casing pressure.,\n
data.StatusInfo[].Tubular: A pointer to the tubular (assembly) used in this report period.,\n
data.StatusInfo[].CostDayMud: The cost per day of the mud used,\n
data.FluidsIDs[]: References to the Fluids Reports generated during this reporting period.,\n
data.PorePressure[]: A reference to the PPFG information for this reporting period,\n
data.TimedComments[].Comment: A comment that has been recorded at a particular time,\n
data.TimedComments[].CommentTime: The time that the comment was made,\n
data.Weather[].Agency: Name of company that supplied the weather data.,\n
data.Weather[].PrecipitationAmount: Amount of precipitation.,\n
data.Weather[].SeaCurrentDirection: Azimuth of current.,\n
data.Weather[].WaveDirection: The direction from which the waves are coming, measured from true north.,\n
data.Weather[].WindDirection: The direction from which the wind is blowing, measured from true north.,\n
data.Weather[].BarometricPressure: Atmospheric pressure.,\n
data.Weather[].BeaufortScaleNumber: The Beaufort wind force scale is a system used to estimate and report wind speeds when no measuring apparatus is available. It was invented in the early 19th century by Admiral Sir Francis Beaufort of the British Navy as a way to interpret winds from conditions. Values range from 0 (calm) to 12 (hurricane force).,\n
data.Weather[].CloudCeiling: Height of cloud cover.,\n
data.Weather[].Comments: Comments and remarks,\n
data.Weather[].CloudCover: Description of cloud cover.,\n
data.Weather[].CurrentSeaSpeed: The speed of the ocean current.,\n
data.Weather[].DateTime: Date and time that weather was observed,\n
data.Weather[].WaveHeightAverage: Average height of the sea waves.,\n
data.Weather[].WaveHeightMax: The maximum wave height.,\n
data.Weather[].WavePeriodDuration: The elapsed time between the passing of two wave tops.,\n
data.Weather[].WaveSignificant: An average of the higher 1/3 of the wave heights passing during a sample period (typically 20 to 30 minutes).,\n
data.Weather[].SeaTemp: Sea temperature.,\n
data.Weather[].SurfaceTempMin: Minimum temperature above ground. Temperature of the atmosphere.,\n
data.Weather[].SurfaceTempMax: Maximum temperature above ground.,\n
data.Weather[].WindChillTemp: A measure of the combined chilling effect of wind and low temperature on living things, also named chill factor, e.g., according to the US weather service table, an air temperature of 30 degF with a 10 mph corresponds to a windchill of 22 degF.,\n
data.Weather[].WeatherType: Type of weather.,\n
data.Weather[].WindSpeed: Wind speed.,\n
data.Weather[].Visibility: Horizontal visibility.,\n
data.Personnel[].OrganizationID: A Reference to the organization for which have their headcount measured during this report,\n
data.Personnel[].HeadCount: Number of persons on board or on location for the selected company/organization. HeadCount should be reported as a non-negative integer.,\n
data.Personnel[].TotalTime: Total time worked by the company (commonly in hours).,\n
data.Personnel[].OrganizationRole: Role the organization is playing for the service being provided,\n
data.Personnel[].ServiceType: Service provided by the company.,\n
data.Personnel[].Comments: Comments and remarks,\n
"""

JSON_file3 = """
"WellboreID": <<data.WellboreID>>,
    "WellAlias": {
      "Identifier": <<data.WellAlias.Identifier>>,
      "Description": <<data.WellAlias.Description>>,
      "Authority": <<data.WellAlias.Authority>>
    },
    "WellboreAlias": [
      {
        "Identifier": <<data.WellboreAlias[].Identifier>>,
        "Description": <<data.WellboreAlias[].Description>>,
        "Authority": <<data.WellboreAlias[].Authority>>
      }
    ],
    "StatusInfo": [
      {
        "StatusDateTime": <<data.StatusInfo[].StatusDateTime>>,
        "ReportEndMD": <<data.StatusInfo[].ReportEndMD>>,
        "ReportEndTVD": <<data.StatusInfo[].ReportEndTVD>>,
        "PlugTopMD": <<data.StatusInfo[].PlugTopMD>>,
        "DiameterHole": <<data.StatusInfo[].DiameterHole>>,
        "DiameterHoleStartMD": <<data.StatusInfo[].DiameterHoleStartMD>>,
        "DiameterPilot": <<data.StatusInfo[].DiameterPilot>>,
        "DiameterPilotPlanMD": <<data.StatusInfo[].DiameterPilotPlanMD>>,
        "DiameterPilotPlanTVD": <<data.StatusInfo[].DiameterPilotPlanTVD>>,
        "TypeWellbore": <<data.StatusInfo[].TypeWellbore>>,
        "KickoffMD": <<data.StatusInfo[].KickoffMD>>,
        "KickoffTVD": <<data.StatusInfo[].KickoffTVD>>,
        "FormationStrength": <<data.StatusInfo[].FormationStrength>>,
        "FormationStrengthMD": <<data.StatusInfo[].FormationStrengthMD>>,
        "FormationStrengthTVD": <<data.StatusInfo[].FormationStrengthTVD>>,
        "CasingDiameterLast": <<data.StatusInfo[].CasingDiameterLast>>,
        "CasingMDLast": <<data.StatusInfo[].CasingMDLast>>,
        "CasingTVDLast": <<data.StatusInfo[].CasingTVDLast>>,
        "PresTestType": <<data.StatusInfo[].PresTestType>>,
        "MdPlanned": <<data.StatusInfo[].MdPlanned>>,
        "DrilledDistance": <<data.StatusInfo[].DrilledDistance>>,
        "Summary24Hr": <<data.StatusInfo[].Summary24Hr>>,
        "Forecast24Hr": <<data.StatusInfo[].Forecast24Hr>>,
        "RopCurrent": <<data.StatusInfo[].RopCurrent>>,
        "Rig": <<data.StatusInfo[].Rig>>,
        "ElapsedTimeStart": <<data.StatusInfo[].ElapsedTimeStart>>,
        "ElapsedTimeSpud": <<data.StatusInfo[].ElapsedTimeSpud>>,
        "ElapsedTimeLoc": <<data.StatusInfo[].ElapsedTimeLoc>>,
        "ElapsedTimeDrill": <<data.StatusInfo[].ElapsedTimeDrill>>,
        "RopAverage": <<data.StatusInfo[].RopAverage>>,
        "Supervisor": <<data.StatusInfo[].Supervisor>>,
        "Engineer": <<data.StatusInfo[].Engineer>>,
        "Geologist": <<data.StatusInfo[].Geologist>>,
        "ElapsedTimeDrillRot": <<data.StatusInfo[].ElapsedTimeDrillRot>>,
        "ElapsedTimeDrillSlid": <<data.StatusInfo[].ElapsedTimeDrillSlid>>,
        "ElapsedTimeCirc": <<data.StatusInfo[].ElapsedTimeCirc>>,
        "ElapsedTimeReam": <<data.StatusInfo[].ElapsedTimeReam>>,
        "ElapsedTimeHold": <<data.StatusInfo[].ElapsedTimeHold>>,
        "ElapsedTimeSteering": <<data.StatusInfo[].ElapsedTimeSteering>>,
        "DistDrillRot": <<data.StatusInfo[].DistDrillRot>>,
        "DistDrillSlid": <<data.StatusInfo[].DistDrillSlid>>,
        "DistReam": <<data.StatusInfo[].DistReam>>,
        "DistHold": <<data.StatusInfo[].DistHold>>,
        "DistSteering": <<data.StatusInfo[].DistSteering>>,
        "NumPOB": <<data.StatusInfo[].NumPOB>>,
        "NumContract": <<data.StatusInfo[].NumContract>>,
        "NumOperator": <<data.StatusInfo[].NumOperator>>,
        "NumService": <<data.StatusInfo[].NumService>>,
        "NumAFE": <<data.StatusInfo[].NumAFE>>,
        "ConditionHole": <<data.StatusInfo[].ConditionHole>>,
        "TvdLot": <<data.StatusInfo[].TvdLot>>,
        "PresLotEmw": <<data.StatusInfo[].PresLotEmw>>,
        "PresKickTol": <<data.StatusInfo[].PresKickTol>>,
        "VolKickTol": <<data.StatusInfo[].VolKickTol>>,
        "MAASP": <<data.StatusInfo[].MAASP>>,
        "Tubular": <<data.StatusInfo[].Tubular>>,
        "CostDayMud": <<data.StatusInfo[].CostDayMud>>
      }
    ],
    "FluidsIDs": [
      <<data.FluidsIDs[]>>
    ],
    "PorePressure": [
      <<data.PorePressure[]>>
    ],
    "TimedComments": [
      {
        "Comment": <<data.TimedComments[].Comment>>,
        "CommentTime": <<data.TimedComments[].CommentTime>>
      }
    ],
    "Weather": [
      {
        "Agency": <<data.Weather[].Agency>>,
        "PrecipitationAmount": <<data.Weather[].PrecipitationAmount>>,
        "SeaCurrentDirection": <<data.Weather[].SeaCurrentDirection>>,
        "WaveDirection": <<data.Weather[].WaveDirection>>,
        "WindDirection": <<data.Weather[].WindDirection>>,
        "BarometricPressure": <<data.Weather[].BarometricPressure>>,
        "BeaufortScaleNumber": <<data.Weather[].BeaufortScaleNumber>>,
        "CloudCeiling": <<data.Weather[].CloudCeiling>>,
        "Comments": <<data.Weather[].Comments>>,
        "CloudCover": <<data.Weather[].CloudCover>>,
        "CurrentSeaSpeed": <<data.Weather[].CurrentSeaSpeed>>,
        "DateTime": <<data.Weather[].DateTime>>,
        "WaveHeightAverage": <<data.Weather[].WaveHeightAverage>>,
        "WaveHeightMax": <<data.Weather[].WaveHeightMax>>,
        "WavePeriodDuration": <<data.Weather[].WavePeriodDuration>>,
        "WaveSignificant": <<data.Weather[].WaveSignificant>>,
        "SeaTemp": <<data.Weather[].SeaTemp>>,
        "SurfaceTempMin": <<data.Weather[].SurfaceTempMin>>,
        "SurfaceTempMax": <<data.Weather[].SurfaceTempMax>>,
        "WindChillTemp": <<data.Weather[].WindChillTemp>>,
        "WeatherType": <<data.Weather[].WeatherType>>,
        "WindSpeed": <<data.Weather[].WindSpeed>>,
        "Visibility": <<data.Weather[].Visibility>>
      }
    ],
    "Personnel": [
      {
        "OrganizationID": <<data.Personnel[].OrganizationID>>,
        "HeadCount": <<data.Personnel[].HeadCount>>,
        "TotalTime": <<data.Personnel[].TotalTime>>,
        "OrganizationRole": <<data.Personnel[].OrganizationRole>>,
        "ServiceType": <<data.Personnel[].ServiceType>>,
        "Comments": <<data.Personnel[].Comments>>
      }
    ],
"""

attributes_4 = """
data.PumpOp[].DateTime: Date and time when the pump operation occurred,\n
data.PumpOp[].LinerInnerDiameter: Liner inside diameter.,\n
data.PumpOp[].StrokeLength: Pump stroke length.,\n
data.PumpOp[].MeasuredDepthBit: Along-hole measured depth of the measurement from the drill datum.,\n
data.PumpOp[].PumpEfficiency: Pump efficiency.,\n
data.PumpOp[].PumpPressure: Pump pressure recorded.,\n
data.PumpOp[].PumpNumber: The sequence number of the pump (e.g., pump 1),\n
data.PumpOp[].PumpOutput: Pump output (included for efficiency).,\n
data.PumpOp[].StrokeRate: Pump rate (strokes per minute).,\n
data.PumpOp[].OperationType: Type of pump operation.,\n
data.PumpOp[].Comments: Comments and remarks,\n
data.PumpOp[].PumpDisplacement: how much fluid is moved by the pump in one cycle,\n
data.PumpOp[].PumpModelName: The model name for the pump,\n
data.MudVolume[].MudVolumeStart: Volume of mud at start of report interval (including pits and hole).,\n
data.MudVolume[].MudVolumeEnd: Volume of mud at the end of the report interval (including pits and hole).,\n
data.MudVolume[].DateTime: Date and time of the mud volume,\n
data.MudVolume[].MudVolumeMeasureDepthTop: Top measured depth for which the mud volume reading was conducted,\n
data.MudVolume[].MudVolumeMeasureDepthBase: Bottom measured depth for which the mud volume reading was conducted,\n
data.MudVolume[].MudVolumeTvdTop: Top true vertical depth interval over which the mud volume reading was conducted.,\n
data.MudVolume[].MudVolumeTvdBase: Bottom true vertical depth interval over which the mud volume reading was conducted.,\n
data.MudVolume[].MudVolumeBuild: Volume of mud built.,\n
data.MudVolume[].MudVolumeCasing: Volume of mud contained in casing annulus.,\n
data.MudVolume[].MudVolumeDumped: Volume of mud dumped.,\n
data.MudVolume[].MudVolumeHole: Volume of mud contained in the openhole annulus.,\n
data.MudVolume[].MudVolumeReceived: Volume of mud received from mud warehouse.,\n
data.MudVolume[].MudVolumeReturned: Volume of mud returned to mud warehouse.,\n
data.MudVolume[].MudVolumeRiser: Volume of mud contained in riser section annulus.,\n
data.MudVolume[].MudVolumeString: Volume of mud contained within active string.,\n
data.MudVolume[].TotalMudVolume: Actual total mud volume that was measured,\n
data.MudVolume[].ExpectedMudVolume: Total mud volume that was expected,\n
data.MudVolume[].Comments: Comments and remarks,\n
data.Inventory[].CostOfItem: Cost for the product for the report interval.,\n
data.Inventory[].VolumeItem: Item volume per unit.,\n
data.Inventory[].WeightItem: Item weight per unit.,\n
data.Inventory[].Name: Name or type of inventory item.,\n
data.Inventory[].PricePerUnit: Price per item unit, assume same currency for all items.,\n
data.Inventory[].TotalQuantityAdjustment: Daily quantity adjustment/correction.,\n
data.Inventory[].TotalQuantityOnLocation: Amount of the item remaining on location after all adjustments for the report interval.,\n
data.Inventory[].TotalQuantityReceived: Quantity received at the site.,\n
data.Inventory[].TotalQuantityReturned: Quantity returned to base from site.,\n
data.Inventory[].TotalQuantityStart: Start quantity for report interval.,\n
data.Inventory[].TotalQuantityUsed: Quantity used for the report interval.,\n
data.Inventory[].Comments: Comments and remarks,\n
data.Inventory[].ItemDescription: Description of the inventory item,\n
data.Cost[].Comments: Comments and remarks,\n
data.Cost[].TotalCostAmount: Total cost for the item for this period,\n
data.Cost[].CostCurrency: Currency used for Cost Amount,\n
data.Cost[].CostClass: Cost class code.,\n
data.Cost[].CostCode: Cost code.,\n
data.Cost[].CostGroup: Cost group code.,\n
data.Cost[].ItemDescription: Description of the cost item.,\n
data.Cost[].UnitCost: Cost per item, assume same currency.,\n
data.Cost[].CostSubCode: Cost subcode.,\n
data.Cost[].IsEstimated: Is this an estimated cost?,\n
data.Cost[].IsCarryOver: Is this item carried from day to day?,\n
data.Cost[].IsRental: Is this item a rental?,\n
data.Cost[].UnitKind: The kind of cost item specified (e.g., barrel, sack, gallon),\n
data.Cost[].UnitSize: Quantity of the unit kind (e.g., 50),\n
data.Cost[].TagName: An identification tag for the item. A serial number is a type of identification tag; however, some tags contain many pieces of information. This element only identifies the tag and does not describe the contents.,\n
data.Cost[].VendorName: Name of the vendor.,\n
data.Cost[].AFENumber: AFE number that this cost item applies to.,\n
data.Cost[].InvoiceNumber: Invoice number for cost item; the bill is sent to the operator.,\n
data.Cost[].PONumber: Purchase order number provided by the operator.,\n
data.Cost[].ItemSerialNumber: Serial number.,\n
data.Cost[].TicketNumber: The field ticket number issued by the service company on location.,\n
data.Cost[].VendorNumber: Vendor number.,\n
data.Cost[].CostPoolName: Name of pool/reservoir that this cost item can be accounted to.,\n
data.Cost[].TotalQuantityItemsUsed: Number of cost items used that day, e.g., 1 rig dayrate, 30 joints of casing.,\n
data.Cost[].ActivityPhaseID: Activity code classification describing higher level steps in the Well Activity,\n
data.Cost[].InUse: Used to indicate if Equipment or Service in scope for the Cost Item is being used. Can drive different Standby/In Use Rental Rates where applicable.,\n
data.Cost[].ProductType: High Level cost category qualifier,\n
"""

JSON_file4 = """
"PumpOp": [
      {
        "DateTime": <<data.PumpOp[].DateTime>>,
        "LinerInnerDiameter": <<data.PumpOp[].LinerInnerDiameter>>,
        "StrokeLength": <<data.PumpOp[].StrokeLength>>,
        "MeasuredDepthBit": <<data.PumpOp[].MeasuredDepthBit>>,
        "PumpEfficiency": <<data.PumpOp[].PumpEfficiency>>,
        "PumpPressure": <<data.PumpOp[].PumpPressure>>,
        "PumpNumber": <<data.PumpOp[].PumpNumber>>,
        "PumpOutput": <<data.PumpOp[].PumpOutput>>,
        "StrokeRate": <<data.PumpOp[].StrokeRate>>,
        "OperationType": <<data.PumpOp[].OperationType>>,
        "Comments": <<data.PumpOp[].Comments>>,
        "PumpDisplacement": <<data.PumpOp[].PumpDisplacement>>,
        "PumpModelName": <<data.PumpOp[].PumpModelName>>
      }
    ],
    "MudVolume": [
      {
        "MudVolumeStart": <<data.MudVolume[].MudVolumeStart>>,
        "MudVolumeEnd": <<data.MudVolume[].MudVolumeEnd>>,
        "DateTime": <<data.MudVolume[].DateTime>>,
        "MudVolumeMeasureDepthTop": <<data.MudVolume[].MudVolumeMeasureDepthTop>>,
        "MudVolumeMeasureDepthBase": <<data.MudVolume[].MudVolumeMeasureDepthBase>>,
        "MudVolumeTvdTop": <<data.MudVolume[].MudVolumeTvdTop>>,
        "MudVolumeTvdBase": <<data.MudVolume[].MudVolumeTvdBase>>,
        "MudVolumeBuild": <<data.MudVolume[].MudVolumeBuild>>,
        "MudVolumeCasing": <<data.MudVolume[].MudVolumeCasing>>,
        "MudVolumeDumped": <<data.MudVolume[].MudVolumeDumped>>,
        "MudVolumeHole": <<data.MudVolume[].MudVolumeHole>>,
        "MudVolumeReceived": <<data.MudVolume[].MudVolumeReceived>>,
        "MudVolumeReturned": <<data.MudVolume[].MudVolumeReturned>>,
        "MudVolumeRiser": <<data.MudVolume[].MudVolumeRiser>>,
        "MudVolumeString": <<data.MudVolume[].MudVolumeString>>,
        "TotalMudVolume": <<data.MudVolume[].TotalMudVolume>>,
        "ExpectedMudVolume": <<data.MudVolume[].ExpectedMudVolume>>,
        "Comments": <<data.MudVolume[].Comments>>
      }
    ],
    "Inventory": [
      {
        "CostOfItem": <<data.Inventory[].CostOfItem>>,
        "VolumeItem": <<data.Inventory[].VolumeItem>>,
        "WeightItem": <<data.Inventory[].WeightItem>>,
        "Name": <<data.Inventory[].Name>>,
        "PricePerUnit": <<data.Inventory[].PricePerUnit>>,
        "TotalQuantityAdjustment": <<data.Inventory[].TotalQuantityAdjustment>>,
        "TotalQuantityOnLocation": <<data.Inventory[].TotalQuantityOnLocation>>,
        "TotalQuantityReceived": <<data.Inventory[].TotalQuantityReceived>>,
        "TotalQuantityReturned": <<data.Inventory[].TotalQuantityReturned>>,
        "TotalQuantityStart": <<data.Inventory[].TotalQuantityStart>>,
        "TotalQuantityUsed": <<data.Inventory[].TotalQuantityUsed>>,
        "Comments": <<data.Inventory[].Comments>>,
        "ItemDescription": <<data.Inventory[].ItemDescription>>
      }
    ],
    "Cost": [
      {
        "Comments": <<data.Cost[].Comments>>,
        "TotalCostAmount": <<data.Cost[].TotalCostAmount>>,
        "CostCurrency": <<data.Cost[].CostCurrency>>,
        "CostClass": <<data.Cost[].CostClass>>,
        "CostCode": <<data.Cost[].CostCode>>,
        "CostGroup": <<data.Cost[].CostGroup>>,
        "ItemDescription": <<data.Cost[].ItemDescription>>,
        "UnitCost": <<data.Cost[].UnitCost>>,
        "CostSubCode": <<data.Cost[].CostSubCode>>,
        "IsEstimated": <<data.Cost[].IsEstimated>>,
        "IsCarryOver": <<data.Cost[].IsCarryOver>>,
        "IsRental": <<data.Cost[].IsRental>>,
        "UnitKind": <<data.Cost[].UnitKind>>,
        "UnitSize": <<data.Cost[].UnitSize>>,
        "TagName": <<data.Cost[].TagName>>,
        "VendorName": <<data.Cost[].VendorName>>,
        "AFENumber": <<data.Cost[].AFENumber>>,
        "InvoiceNumber": <<data.Cost[].InvoiceNumber>>,
        "PONumber": <<data.Cost[].PONumber>>,
        "ItemSerialNumber": <<data.Cost[].ItemSerialNumber>>,
        "TicketNumber": <<data.Cost[].TicketNumber>>,
        "VendorNumber": <<data.Cost[].VendorNumber>>,
        "CostPoolName": <<data.Cost[].CostPoolName>>,
        "TotalQuantityItemsUsed": <<data.Cost[].TotalQuantityItemsUsed>>,
        "ActivityPhaseID": <<data.Cost[].ActivityPhaseID>>,
        "InUse": <<data.Cost[].InUse>>,
        "ProductType": <<data.Cost[].ProductType>>
      }
    ],
"""

attributes_5 = """
data.HSE[].Comments: Comments and remarks,\n
data.HSE[].DaysIncidentFree: Incident free duration (commonly in days).,\n
data.HSE[].VolumeFluidDischarged: Daily whole mud discarded.,\n
data.HSE[].LastAbandonDrillDate: Last abandonment drill.,\n
data.HSE[].LastBopDrillDate: Last blow out preventer drill.,\n
data.HSE[].LastBopPressureTestDate: Last blow out preventer pressure test.,\n
data.HSE[].LastCasingPressureTestDate: Last casing pressure test date and time.,\n
data.HSE[].LastDiverterDrillDate: Last diverter drill.,\n
data.HSE[].LastFireBoatDrillDate: Last fire or life boat drill.,\n
data.HSE[].LastRigInspectionDate: Last rig inspection/check.,\n
data.HSE[].LastSafetyInspectionDate: Last safety inspection.,\n
data.HSE[].LastSafetyMeetingDate: Last safety meeting.,\n
data.HSE[].LastTripDrillDate: Last trip drill.,\n
data.HSE[].NextBopPresTestDate: Next blow out preventer pressure test.,\n
data.HSE[].NonComplianceIssued: Inspection non-compliance notice served?,\n
data.HSE[].TotalStopCards: Number of health, safety and environment incidents reported.,\n
data.HSE[].PressureAnnular: Blow out preventer annular preventer pressure tested to.,\n
data.HSE[].PressureChokeLine: Choke line pressure tested to.,\n
data.HSE[].PressureChokeMan: Choke line manifold pressure tested to.,\n
data.HSE[].PressureDiverter: Blow out preventer diverter pressure tested to.,\n
data.HSE[].PressureKellyHose: Kelly hose pressure tested to.,\n
data.HSE[].PressureLastCasing: Last casing pressure test pressure.,\n
data.HSE[].PressureBOPRam: Blow out preventer ram pressure tested to.,\n
data.HSE[].PressureStandPipeManifold: Standpipe manifold pressure tested to.,\n
data.HSE[].RegulatoryAgencyInspection: Governmental regulatory inspection agency inspection?,\n
data.HSE[].VolumeCuttingDischarged: Volume of cuttings discharged.,\n
data.HSE[].VolumeOilCuttingDischarge: Oil on cuttings daily discharge.,\n
data.HSE[].VolumeWasteDischarged: Volume of sanitary waste discharged.,\n
data.Incident[].Comments: Comments and remarks,\n
data.Incident[].DateTime: Date and time that incident occurred,\n
data.Incident[].CauseDescription: Cause description.,\n
data.Incident[].CostLossEstimate: Gross estimate of the cost incurred due to the incident.,\n
data.Incident[].AccidentDescription: Accident description.,\n
data.Incident[].LocationDescription: Location description.,\n
data.Incident[].EstimateHoursLost: Number of hours lost due to the incident.,\n
data.Incident[].IsNearMiss: Near miss incident occurrence?,\n
data.Incident[].TotalFatality: Number of personnel killed due to the incident.,\n
data.Incident[].TotalMajorInjury: Number of personnel with major injuries.,\n
data.Incident[].TotalMinorInjury: Number of personnel with minor injuries.,\n
data.Incident[].RemedialActionDescription: Remedial action description.,\n
data.Incident[].IncidentReporterName: Name of the person who prepared the incident report.,\n
data.Incident[].OrganisationID: A reference to the organisation for which is the company primarily involved in managing the incident.,\n
data.MudLosses[].Comments: Comments and remarks,\n
data.MudLosses[].DateTime: Date and time that the mud loss occurred,\n
data.MudLosses[].MudLostVolumeMeasureDepthTop: Top measured depth for which the mud loss reading was occurred,\n
data.MudLosses[].MudLostVolumeMeasureDepthBase: Bottom measured depth for which the mud loss reading was occurred,\n
data.MudLosses[].MudLostVolumeTvdTop: Top true vertical depth interval over which the mud loss reading was occurred,\n
data.MudLosses[].MudLostVolumeTvdBase: Bottom true vertical depth interval over which the mud loss reading was occurred,\n
data.MudLosses[].MudLostVolumeAbandonDownhole: Mud volume lost downhole during abandonment.,\n
data.MudLosses[].MudLostVolumeBehindCasingDownhole: Mud volume lost downhole behind casing.,\n
data.MudLosses[].MudLostVolumeCirculatingDownhole: Mud volume lost downhole while circulating.,\n
data.MudLosses[].MudLostVolumeCementingDownhole: Mud volume lost downhole while cementing.,\n
data.MudLosses[].MudLostVolumeCasingHole: Mud volume lost downhole running casing,\n
data.MudLosses[].MudLostVolumeMudCleanerSurface: Volume of mud lost in mud cleaning equipment (at surface).,\n
data.MudLosses[].MudLostVolumeOtherLocationDownhole: Mud volume lost downhole from other location.,\n
data.MudLosses[].MudLostVolumeOtherLocationSurface: Surface volume lost other location.,\n
data.MudLosses[].MudLostVolumePitsSurface: Volume of mud lost in pit room (at surface).,\n
data.MudLosses[].MudLostVolumeShakerSurface: Volume of mud lost at shakers (at surface).,\n
data.MudLosses[].MudLostVolumeTrippingSurface: Volume of mud lost while tripping (at surface).,\n
data.MudLosses[].TotalMudLostVolumeDownhole: Total volume of mud lost downhole.,\n
data.MudLosses[].TotalMudLostVolumeSurface: Total volume of mud lost at surface.,\n
data.JobContact[].EmailAddress: Contact email address. Property may be left empty where it is inappropriate to provide personally identifiable information.,\n
data.JobContact[].PhoneNumber: Contact phone number. Property may be left empty where it is inappropriate to provide personally identifiable information.,\n
data.JobContact[].RoleTypeID: The identifier of a reference value for the role of the contact within the associated organisation, such as Account owner, Sales Representative, Technical Support, Project Manager, Party Chief, Client Representative, Senior Observer.,\n
data.JobContact[].DataGovernanceRoleTypeID: The data governance role assigned to this contact if and only if the context has a data governance role (in context of TechnicalAssurance). The value is kept absent in all other cases.,\n
data.JobContact[].WorkflowPersonaTypeID: The persona in context of workflows associated with this contact, as used in TechnicalAssurance.,\n
data.JobContact[].Comment: Additional information about the contact,\n
data.JobContact[].OrganisationID: Reference to the company the contact is associated with.,\n
data.JobContact[].Name: Name of the individual contact. Property may be left empty where it is inappropriate to provide personally identifiable information.,\n
data.GasReading[].DateTime: Date and time of the gas reading.,\n
data.GasReading[].TotalGasMax: The highest gas reading.,\n
data.GasReading[].TotalGasMin: The lowest gas reading.,\n
data.GasReading[].TotalGasAverage: The average gas reading,\n
data.GasReading[].GasReadingMeasureDepthTop: Top measured depth for which the gas reading was conducted,\n
data.GasReading[].GasReadingTvdBase: Bottom true vertical depth interval over which the gas reading was conducted.,\n
data.GasReading[].Methane: Methane (C1) concentration,\n
data.GasReading[].Ethane: Ethane (C2) concentration.,\n
data.GasReading[].Propane: Propane (C3) concentration.,\n
data.GasReading[].Isobutane: Iso-butane (iC4) concentration.,\n
data.GasReading[].Norbutane: Nor-butane (nC4) concentration.,\n
data.GasReading[].Isopentane: Iso-pentane (iC5) concentration,\n
data.GasReading[].ReadingType: Type of gas reading, e.g.circulating, background gas, connection gas, drilling background, gas, drilling gas peak, flow check gas, no readings, other, shut down gas, trip gas, unknown.,\n
data.ConditionHole: Hole condition description.,\n
data.CostDay: Daily cost.,\n
data.CostDayMud: Daily mud cost.,\n
data.Lithology: Description of the lithology for the interval.,\n
data.TotalCost: Cumulative cost for the job through the end of current report,\n
data.TargetCost: Authorized cost for the total job,\n
data.TargetDays: Planned days for the total job,\n
data.TotalDays: Cumulative days for the job through the end of the current report,\n
data.TotalNPT: Total days of non-productive time through the end of the current report,\n
data.Name: Name of Operations Report,\n
data.WellActivityID: A link to the well activity to which this report is associated.,\n
data.ReportNumber: Sequential number assigned to report header,\n
data.ReportDescription: Report description,\n
data.ReportRemarks: Report remarks,\n
"""

JSON_file5 = """
"HSE": [
      {
        "Comments": <<data.HSE[].Comments>>,
        "DaysIncidentFree": <<data.HSE[].DaysIncidentFree>>,
        "VolumeFluidDischarged": <<data.HSE[].VolumeFluidDischarged>>,
        "LastAbandonDrillDate": <<data.HSE[].LastAbandonDrillDate>>,
        "LastBopDrillDate": <<data.HSE[].LastBopDrillDate>>,
        "LastBopPressureTestDate": <<data.HSE[].LastBopPressureTestDate>>,
        "LastCasingPressureTestDate": <<data.HSE[].LastCasingPressureTestDate>>,
        "LastDiverterDrillDate": <<data.HSE[].LastDiverterDrillDate>>,
        "LastFireBoatDrillDate": <<data.HSE[].LastFireBoatDrillDate>>,
        "LastRigInspectionDate": <<data.HSE[].LastRigInspectionDate>>,
        "LastSafetyInspectionDate": <<data.HSE[].LastSafetyInspectionDate>>,
        "LastSafetyMeetingDate": <<data.HSE[].LastSafetyMeetingDate>>,
        "LastTripDrillDate": <<data.HSE[].LastTripDrillDate>>,
        "NextBopPresTestDate": <<data.HSE[].NextBopPresTestDate>>,
        "NonComplianceIssued": <<data.HSE[].NonComplianceIssued>>,
        "TotalStopCards": <<data.HSE[].TotalStopCards>>,
        "PressureAnnular": <<data.HSE[].PressureAnnular>>,
        "PressureChokeLine": <<data.HSE[].PressureChokeLine>>,
        "PressureChokeMan": <<data.HSE[].PressureChokeMan>>,
        "PressureDiverter": <<data.HSE[].PressureDiverter>>,
        "PressureKellyHose": <<data.HSE[].PressureKellyHose>>,
        "PressureLastCasing": <<data.HSE[].PressureLastCasing>>,
        "PressureBOPRam": <<data.HSE[].PressureBOPRam>>,
        "PressureStandPipeManifold": <<data.HSE[].PressureStandPipeManifold>>,
        "RegulatoryAgencyInspection": <<data.HSE[].RegulatoryAgencyInspection>>,
        "VolumeCuttingDischarged": <<data.HSE[].VolumeCuttingDischarged>>,
        "VolumeOilCuttingDischarge": <<data.HSE[].VolumeOilCuttingDischarge>>,
        "VolumeWasteDischarged": <<data.HSE[].VolumeWasteDischarged>>
      }
    ],
    "Incident": [
      {
        "Comments": <<data.Incident[].Comments>>,
        "DateTime": <<data.Incident[].DateTime>>,
        "CauseDescription": <<data.Incident[].CauseDescription>>,
        "CostLossEstimate": <<data.Incident[].CostLossEstimate>>,
        "AccidentDescription": <<data.Incident[].AccidentDescription>>,
        "LocationDescription": <<data.Incident[].LocationDescription>>,
        "EstimateHoursLost": <<data.Incident[].EstimateHoursLost>>,
        "IsNearMiss": <<data.Incident[].IsNearMiss>>,
        "TotalFatality": <<data.Incident[].TotalFatality>>,
        "TotalMajorInjury": <<data.Incident[].TotalMajorInjury>>,
        "TotalMinorInjury": <<data.Incident[].TotalMinorInjury>>,
        "RemedialActionDescription": <<data.Incident[].RemedialActionDescription>>,
        "IncidentReporterName": <<data.Incident[].IncidentReporterName>>,
        "OrganisationID": <<data.Incident[].OrganisationID>>
      }
    ],
    "MudLosses": [
      {
        "Comments": <<data.MudLosses[].Comments>>,
        "DateTime": <<data.MudLosses[].DateTime>>,
        "MudLostVolumeMeasureDepthTop": <<data.MudLosses[].MudLostVolumeMeasureDepthTop>>,
        "MudLostVolumeMeasureDepthBase": <<data.MudLosses[].MudLostVolumeMeasureDepthBase>>,
        "MudLostVolumeTvdTop": <<data.MudLosses[].MudLostVolumeTvdTop>>,
        "MudLostVolumeTvdBase": <<data.MudLosses[].MudLostVolumeTvdBase>>,
        "MudLostVolumeAbandonDownhole": <<data.MudLosses[].MudLostVolumeAbandonDownhole>>,
        "MudLostVolumeBehindCasingDownhole": <<data.MudLosses[].MudLostVolumeBehindCasingDownhole>>,
        "MudLostVolumeCirculatingDownhole": <<data.MudLosses[].MudLostVolumeCirculatingDownhole>>,
        "MudLostVolumeCementingDownhole": <<data.MudLosses[].MudLostVolumeCementingDownhole>>,
        "MudLostVolumeCasingHole": <<data.MudLosses[].MudLostVolumeCasingHole>>,
        "MudLostVolumeMudCleanerSurface": <<data.MudLosses[].MudLostVolumeMudCleanerSurface>>,
        "MudLostVolumeOtherLocationDownhole": <<data.MudLosses[].MudLostVolumeOtherLocationDownhole>>,
        "MudLostVolumeOtherLocationSurface": <<data.MudLosses[].MudLostVolumeOtherLocationSurface>>,
        "MudLostVolumePitsSurface": <<data.MudLosses[].MudLostVolumePitsSurface>>,
        "MudLostVolumeShakerSurface": <<data.MudLosses[].MudLostVolumeShakerSurface>>,
        "MudLostVolumeTrippingSurface": <<data.MudLosses[].MudLostVolumeTrippingSurface>>,
        "TotalMudLostVolumeDownhole": <<data.MudLosses[].TotalMudLostVolumeDownhole>>,
        "TotalMudLostVolumeSurface": <<data.MudLosses[].TotalMudLostVolumeSurface>>
      }
    ],
    "JobContact": [
      {
        "EmailAddress": <<data.JobContact[].EmailAddress>>,
        "PhoneNumber": <<data.JobContact[].PhoneNumber>>,
        "RoleTypeID": <<data.JobContact[].RoleTypeID>>,
        "DataGovernanceRoleTypeID": <<data.JobContact[].DataGovernanceRoleTypeID>>,
        "WorkflowPersonaTypeID": <<data.JobContact[].WorkflowPersonaTypeID>>,
        "Comment": <<data.JobContact[].Comment>>,
        "OrganisationID": <<data.JobContact[].OrganisationID>>,
        "Name": <<data.JobContact[].Name>>
      }
    ],
    "GasReading": [
      {
        "DateTime": <<data.GasReading[].DateTime>>,
        "TotalGasMax": <<data.GasReading[].TotalGasMax>>,
        "TotalGasMin": <<data.GasReading[].TotalGasMin>>,
        "TotalGasAverage": <<data.GasReading[].TotalGasAverage>>,
        "GasReadingMeasureDepthTop": <<data.GasReading[].GasReadingMeasureDepthTop>>,
        "GasReadingTvdBase": <<data.GasReading[].GasReadingTvdBase>>,
        "Methane": <<data.GasReading[].Methane>>,
        "Ethane": <<data.GasReading[].Ethane>>,
        "Propane": <<data.GasReading[].Propane>>,
        "Isobutane": <<data.GasReading[].Isobutane>>,
        "Norbutane": <<data.GasReading[].Norbutane>>,
        "Isopentane": <<data.GasReading[].Isopentane>>,
        "ReadingType": <<data.GasReading[].ReadingType>>
      }
    ],
    "ConditionHole": <<data.ConditionHole>>,
    "CostDay": <<data.CostDay>>,
    "CostDayMud": <<data.CostDayMud>>,
    "Lithology": <<data.Lithology>>,
    "TotalCost": <<data.TotalCost>>,
    "TargetCost": <<data.TargetCost>>,
    "TargetDays": <<data.TargetDays>>,
    "TotalDays": <<data.TotalDays>>,
    "TotalNPT": <<data.TotalNPT>>,
    "Name": <<data.Name>>,
    "WellActivityID": <<data.WellActivityID>>,
    "ReportNumber": <<data.ReportNumber>>,
    "ReportDescription": <<data.ReportDescription>>,
    "ReportRemarks": <<data.ReportRemarks>>,
    "ExtensionProperties": {}
  }
}
"""

DDR_document = """
Summary report

Wellbore: 15/9-19 A

Period: 1997-08-14 00:00 - 1997-08-15 00:00

Status:	normal
Report creation time:	2018-05-03 13:53
Report number:	22
Days Ahead/Behind (+/-):
Operator:	Statoil
Rig Name:	BYFORD DOLPHIN
Drilling contractor:
Spud Date:	1997-07-25 00:00
Wellbore type:
Elevation RKB-MSL (m):	25
Water depth MSL (m):	84
Tight well:	Y
HPHT:	Y
Temperature ():
Pressure ():
Date Well Complete:	1997-08-30
Dist Drilled (m):	50.5
Penetration rate (m/h):	-999.99
Hole Dia (in):	8.5
Pressure Test Type:	leak off test
Formation strength (g/cm3):	1.73
Dia Last Casing ():
Depth at Kick Off mMD:	2178
Depth at Kick Off mTVD:
Depth mMd:	3908.5
Depth mTVD:	3112.7
Plug Back Depth mMD:
Depth at formation strength mMD:	2178
Depth At Formation Strength mTVD:	1627
Depth At Last Casing mMD:	4643
Depth At Last Casing mTVD:
Summary of activities (24 Hours)

RETRIVED CORE NO 2, 100 % RECOVERY. RIH AND CUT CORE NO 3. CIRC DOWN
GAS LEVEL AND POH TO CURRENT DEPTH 1412M.

Summary of planned activities (24 Hours)

RETRIEVE CORE NO 3. RIH AND CUT CORE NO 4. CIRC OUT GAS AND POOH WITH
COREBARREL.

Operations

Start time	End time	End Depth mMD	Main - Sub Activity	State	Remark
00:00	01:30	3881	formation evaluation -- core	ok	CONTINUED CORING FROM 3858 - 3881M. TOTAL CUT 27M.
01:30	02:00	3852	formation evaluation -- trip	ok	FLOW CHECKED, OK. LAID DOWN SPACER PUP JT. PUMP SLUG.
02:00	06:00	780	formation evaluation -- trip	ok	POOH. FLOW CHECKED INSIDE CSG WINDOW, OK. CURRENT DEPTH AT REPORT TIME, 780M.
06:00	09:00	0	formation evaluation -- trip	ok	CONTINUED POOH WITH CORE NO 2. REDUCED SPEED LAST 400M. HELD SAFETY BRIEF BEFORE PULL CORE BARREL TO DRILL FLOOR. HAD 20 PPM H2S IN COREBARREL. PERSONNEL PUT ON PROTECTION EQUIPMENT BEFORE START LAYING DOWN CORE.
09:00	10:30	0	formation evaluation -- trip	ok	RETRIVED CORE NO 2, 100 % RECOVERY. MAX 5 PPM H2S WHEN RETRIVING CORE.
10:30	12:30	0	formation evaluation -- trip	ok	M/UP COREBARREL AND COREHEAD. SERVICED COREBARREL.
12:30	15:30	2160	formation evaluation -- trip	ok	RIH TO CSG WINDOW AT 2161M. BREAK CIRC EACH 1000 M.
15:30	16:00	2160	formation evaluation -- wait	ok	HELD SAFETY MEETING WITH ALL PERSONNEL WITH H2S GAS, GAS PROCEDYRES AND CONTINGENCIES.
16:00	18:30	3876	formation evaluation -- trip	ok	CONTINUED RIH TO 3876M.
18:30	20:30	3876	formation evaluation -- circulating conditioning	ok	CIRC BTM'S UP IN ORDER TO CLEAN WELL FOR GAS. MAX PEAK FROM PREVIOUS CORING; 15,2 %. CIRC GAS LEVEL DOWN TO 0,9 %.
20:30	21:00	3881	formation evaluation -- trip	ok	ROTATE AND WASH TO BTM AT 3881,5M. SPACED OUT STRING.
21:00	21:30	3881	formation evaluation -- circulating conditioning	ok	DROP BALL AND SEATED SAME IN COREBARREL WITH 17 BAR PRESS INCREASE. TAKE SCR'S.
21:30	23:00	3908	formation evaluation -- core	ok	CUT CORE NO 3 FROM 3881,5 TO 3908,5M.
23:00	23:30	3820	formation evaluation -- trip	ok	PUMP OUT OF HOLE TO 3820M. HAD 45 T OVER PULL AT CONNECTION AT 3880M. ROTATE STRING AND HAD NO EXCESSIVE TORQUE TO BREAK ROTATION, NORMAL PUMP PRESSURES INDICATING GEOMETRICAL OBSTRUCTION.
23:30	00:00	3820	formation evaluation -- circulating conditioning	ok	CIRC TO CLEAN OUT CORING GAS.
Drilling Fluid

Sample Time	22:30
Sample Point	Flowline
Sample Depth mMD	3893
Fluid Type	ULTIDRILL
Fluid Density (g/cm3)	1.55
Funnel Visc (s)	59
Mf ()
Pm ()
Pm filtrate ()
Chloride ()
Calcium ()
Magnesium ()
Ph
Excess Lime ()
Solids
Sand ()
Water ()
Oil ()
Solids ()
Corrected solids ()
High gravity solids ()
Low gravity solids ()
Viscometer tests
Plastic visc. (mPa.s)	39
Yield point (Pa)	10
Filtration tests
Pm filtrate ()
Filtrate Lthp ()
Filtrate Hthp ()
Cake thickn API ()
Cake thickn HPHT ()
Test Temp HPHT ()
Comment
Pore Pressure

Time	Depth mMD	Depth TVD	Equ Mud Weight (g/cm3)	Reading
00:00	3600		1.22	estimated
00:00	3908.5		1.09	estimated
Core Information

Core No	Depth Top mMD	Depth Bottom mMD	Core Length (m)	Recover core (%)	Core barrel length (m)	Inner barrel type	Description
2	3854	3881.5	27.7	100	28	aluminum	none
Lithology Information

Start Depth mMD	End Depth mMD	Start Depth TVD	End Depth TVD	Shows Description	Lithology Description
3854	-999.99				SANDSTONE
Gas Reading Information

Time	Class	Depth to Top mMD	Depth to Bottom MD	Depth to Top mTVD	Depth to Bottom TVD	Highest Gas (%)	Lowest Gas ()	C1 (ppm)	C2 (ppm)	C3 (ppm)	IC4 (ppm)	IC5 (ppm)
00:00	trip gas	3881.5		3089.3		2.45		22386	2259	464	36	6
00:00	drilling gas peak	3894				12.75		87345	5653	2923	155	68
"""

### Function to extract the attributes using the text format
def getCompletion_DDR(attribute, JSON_file, DDR_document):

    template_string = """
    Extract the following attribute whose meanings are mentioned as follows\
    {attribute} \
    from the text that is delimited by triple backticks \
    output the values of the attribute extracted in the following JSON file format\
    {output_format} \
    if the value of the attribute is missing or cannot be extracted output the null string \
    text: ```{text}```
    """
    prompt = PromptTemplate(template=template_string, input_variables=["attribute, output_format, text"])
    llm = ChatGoogleGenerativeAI(model="gemini-pro")
    llm.temperature=0
    #llm.max_output_tokens = 100000
    llm_chain = LLMChain(prompt=prompt, llm=llm)
    return llm_chain.run(attribute = attribute, output_format = JSON_file, text = DDR_document)

def edit_string(string):

    string = string.replace('`', '')
    string = string.replace('json', '')

    return string

# function to oputput the required DDR in JSON format with the text input
def readPDF_DDR_JSON_document(ddr_path):

    loader = PyPDFLoader(ddr_path)
    pages = loader.load_and_split()
    ddr_document = str(pages[0].page_content)

    attribute_list = [attributes_1, attributes_2, attributes_3, attributes_4, attributes_5]
    JSON_files_list = [JSON_file1, JSON_file2, JSON_file3, JSON_file4, JSON_file5]

    results_list = []
    for i in tqdm.tqdm(range((len(attribute_list)))):
        result = getCompletion_DDR(ddr_document, attribute_list[i], JSON_files_list[i])
        results_list.append(result)

    for i in range(len(results_list)):
        results_list[i] = edit_string(results_list[i])

    results_string = results_list[0] + result_1Point5 + results_list[1] + results_list[2] + results_list[3] + results_list[4]

    return results_string

import tqdm

gr.close_all()
demo = gr.Interface(fn=readPDF_DDR_JSON_document,
                    inputs=[gr.File(label="Kindly upload the Daily drilling report in PDF format", file_count="single", file_types=["text", ".pdf"])],
                    outputs=[gr.Textbox(label="DDR in the JSON format", lines=6)],
                    title="Converting the DDR in the JSON Format using Generative AI",
                    description="File type conversion from pdf to OSDU Complaint JSON Format"
                   )
demo.launch(share=True, debug = True, auth=("HCLTech", "Password2024"))