@bedrock-engineer/bro-xml-parser 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -12
- package/dist/browser.d.ts +15 -5
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +7 -5
- package/dist/browser.js.map +1 -1
- package/dist/core/columns.d.ts +80 -0
- package/dist/core/columns.d.ts.map +1 -0
- package/dist/core/columns.js +100 -0
- package/dist/core/columns.js.map +1 -0
- package/dist/core/producer.d.ts +216 -0
- package/dist/core/producer.d.ts.map +1 -0
- package/dist/core/producer.js +85 -0
- package/dist/core/producer.js.map +1 -0
- package/dist/core/schema-parser.d.ts +41 -17
- package/dist/core/schema-parser.d.ts.map +1 -1
- package/dist/core/schema-parser.js +178 -73
- package/dist/core/schema-parser.js.map +1 -1
- package/dist/core/version-detector.d.ts +3 -1
- package/dist/core/version-detector.d.ts.map +1 -1
- package/dist/core/version-detector.js +37 -0
- package/dist/core/version-detector.js.map +1 -1
- package/dist/decoders/constants.d.ts +2 -0
- package/dist/decoders/constants.d.ts.map +1 -0
- package/dist/decoders/constants.js +2 -0
- package/dist/decoders/constants.js.map +1 -0
- package/dist/decoders/type-decoders.d.ts +38 -0
- package/dist/decoders/type-decoders.d.ts.map +1 -0
- package/dist/decoders/type-decoders.js +134 -0
- package/dist/decoders/type-decoders.js.map +1 -0
- package/dist/namespaces.d.ts.map +1 -1
- package/dist/namespaces.js +16 -0
- package/dist/namespaces.js.map +1 -1
- package/dist/node.d.ts +15 -5
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +7 -5
- package/dist/node.js.map +1 -1
- package/dist/parser.d.ts +69 -19
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +103 -29
- package/dist/parser.js.map +1 -1
- package/dist/producers.d.ts +36 -0
- package/dist/producers.d.ts.map +1 -0
- package/dist/producers.js +35 -0
- package/dist/producers.js.map +1 -0
- package/dist/resolvers/gld-resolvers.d.ts +30 -0
- package/dist/resolvers/gld-resolvers.d.ts.map +1 -0
- package/dist/resolvers/gld-resolvers.js +76 -0
- package/dist/resolvers/gld-resolvers.js.map +1 -0
- package/dist/resolvers/gmw-resolvers.d.ts +37 -0
- package/dist/resolvers/gmw-resolvers.d.ts.map +1 -0
- package/dist/resolvers/gmw-resolvers.js +101 -0
- package/dist/resolvers/gmw-resolvers.js.map +1 -0
- package/dist/resolvers.d.ts +2 -0
- package/dist/resolvers.d.ts.map +1 -1
- package/dist/resolvers.js +4 -0
- package/dist/resolvers.js.map +1 -1
- package/dist/schema-presets.d.ts +67 -16
- package/dist/schema-presets.d.ts.map +1 -1
- package/dist/schema-presets.js +51 -114
- package/dist/schema-presets.js.map +1 -1
- package/dist/schemas/bhrg-schema.d.ts +528 -9
- package/dist/schemas/bhrg-schema.d.ts.map +1 -1
- package/dist/schemas/bhrg-schema.js +330 -189
- package/dist/schemas/bhrg-schema.js.map +1 -1
- package/dist/schemas/bhrgt-analysis.d.ts +1057 -0
- package/dist/schemas/bhrgt-analysis.d.ts.map +1 -0
- package/dist/schemas/bhrgt-analysis.js +454 -0
- package/dist/schemas/bhrgt-analysis.js.map +1 -0
- package/dist/schemas/bore-schema.d.ts +773 -9
- package/dist/schemas/bore-schema.d.ts.map +1 -1
- package/dist/schemas/bore-schema.js +344 -292
- package/dist/schemas/bore-schema.js.map +1 -1
- package/dist/schemas/common-fields.d.ts +50 -5
- package/dist/schemas/common-fields.d.ts.map +1 -1
- package/dist/schemas/common-fields.js +70 -19
- package/dist/schemas/common-fields.js.map +1 -1
- package/dist/schemas/cpt-schema.d.ts +126 -9
- package/dist/schemas/cpt-schema.d.ts.map +1 -1
- package/dist/schemas/cpt-schema.js +182 -285
- package/dist/schemas/cpt-schema.js.map +1 -1
- package/dist/schemas/generated/gld.generated.d.ts +9 -0
- package/dist/schemas/generated/gld.generated.d.ts.map +1 -0
- package/dist/schemas/generated/gld.generated.js +19 -0
- package/dist/schemas/generated/gld.generated.js.map +1 -0
- package/dist/schemas/gld-schema.d.ts +92 -0
- package/dist/schemas/gld-schema.d.ts.map +1 -0
- package/dist/schemas/gld-schema.js +88 -0
- package/dist/schemas/gld-schema.js.map +1 -0
- package/dist/schemas/gmw-schema.d.ts +180 -0
- package/dist/schemas/gmw-schema.d.ts.map +1 -0
- package/dist/schemas/gmw-schema.js +131 -0
- package/dist/schemas/gmw-schema.js.map +1 -0
- package/dist/types/index.d.ts +51 -1421
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,297 +1,349 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* BHR-GT (Geotechnical
|
|
2
|
+
* BHR-GT (Geotechnical borehole) schema.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* -
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - required: whether field is mandatory (optional, defaults to false)
|
|
4
|
+
* Maps the dsbhrgt/2.1 registration object to {@link BHRGTData}. Each described
|
|
5
|
+
* layer is a soil/rock discriminated union ({@link oneOf} on `material`); the
|
|
6
|
+
* laboratory-analysis subtree (BHR-GT-BMA) is delegated to
|
|
7
|
+
* {@link ANALYSIS_PRODUCER}. Coverage is verified against the official XSD with
|
|
8
|
+
* `npm run check:xsd-coverage`.
|
|
10
9
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
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
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:samplerType",
|
|
146
|
-
},
|
|
147
|
-
samplingProcedure: {
|
|
148
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:samplingProcedure",
|
|
149
|
-
},
|
|
150
|
-
samplingMethod: {
|
|
151
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:samplingMethod",
|
|
152
|
-
},
|
|
153
|
-
samplingQuality: {
|
|
154
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:samplingQuality",
|
|
155
|
-
},
|
|
156
|
-
orientatedSampled: {
|
|
157
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:orientatedSampled",
|
|
158
|
-
resolver: typeResolvers.parseBoolean,
|
|
159
|
-
},
|
|
160
|
-
// === Sample Container ===
|
|
161
|
-
sampleContainerDiameter: {
|
|
162
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:sampleContainerDiameter",
|
|
163
|
-
resolver: typeResolvers.parseFloat,
|
|
164
|
-
},
|
|
165
|
-
sampleContainerLength: {
|
|
166
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:sampleContainerLength",
|
|
167
|
-
resolver: typeResolvers.parseFloat,
|
|
168
|
-
},
|
|
169
|
-
// === Sampler Equipment Details ===
|
|
170
|
-
pistonPresent: {
|
|
171
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:pistonPresent",
|
|
172
|
-
resolver: typeResolvers.parseBoolean,
|
|
173
|
-
},
|
|
174
|
-
coreCatcherPresent: {
|
|
175
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:coreCatcherPresent",
|
|
176
|
-
resolver: typeResolvers.parseBoolean,
|
|
177
|
-
},
|
|
178
|
-
stockingUsed: {
|
|
179
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:stockingUsed",
|
|
180
|
-
resolver: typeResolvers.parseBoolean,
|
|
181
|
-
},
|
|
182
|
-
lubricationFluidUsed: {
|
|
183
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:lubricationFluidUsed",
|
|
184
|
-
resolver: typeResolvers.parseBoolean,
|
|
185
|
-
},
|
|
186
|
-
rightAngledCuttingShoe: {
|
|
187
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:rightAngledCuttingShoe",
|
|
188
|
-
resolver: typeResolvers.parseBoolean,
|
|
189
|
-
},
|
|
190
|
-
cuttingShoeInsideDiameter: {
|
|
191
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:cuttingShoeInsideDiameter",
|
|
192
|
-
resolver: typeResolvers.parseFloat,
|
|
193
|
-
},
|
|
194
|
-
cuttingShoeOutsideDiameter: {
|
|
195
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:cuttingShoeOutsideDiameter",
|
|
196
|
-
resolver: typeResolvers.parseFloat,
|
|
197
|
-
},
|
|
198
|
-
taperAngle: {
|
|
199
|
-
xpath: "./dsbhrgt:boring/bhrgtcom:sampledInterval/bhrgtcom:sampler/bhrgtcom:taperAngle",
|
|
200
|
-
resolver: typeResolvers.parseFloat,
|
|
201
|
-
},
|
|
202
|
-
// === Description Metadata ===
|
|
203
|
-
boreholeLogChecked: {
|
|
204
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog/bhrgtcom:boreholeLogChecked",
|
|
205
|
-
resolver: typeResolvers.parseBoolean,
|
|
206
|
-
},
|
|
207
|
-
descriptionQuality: {
|
|
208
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog/bhrgtcom:descriptionQuality",
|
|
209
|
-
},
|
|
210
|
-
descriptionLocation: {
|
|
211
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog/bhrgtcom:descriptionLocation",
|
|
212
|
-
},
|
|
213
|
-
descriptionReportDate: {
|
|
214
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptionReportDate",
|
|
215
|
-
resolver: typeResolvers.parseDate,
|
|
216
|
-
},
|
|
217
|
-
describedMaterial: {
|
|
218
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog/bhrgtcom:describedMaterial",
|
|
219
|
-
},
|
|
220
|
-
continuouslySampled: {
|
|
221
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog/bhrgtcom:continuouslySampled",
|
|
222
|
-
resolver: typeResolvers.parseBoolean,
|
|
223
|
-
},
|
|
224
|
-
sampleMoistness: {
|
|
225
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog/bhrgtcom:sampleMoistness",
|
|
226
|
-
},
|
|
227
|
-
// === Layer Data ===
|
|
228
|
-
data: {
|
|
229
|
-
xpath: "./dsbhrgt:boreholeSampleDescription/bhrgtcom:descriptiveBoreholeLog",
|
|
230
|
-
resolver: boreResolvers.processBHRGTLayerData,
|
|
231
|
-
},
|
|
232
|
-
// === Laboratory Analysis (BHR-GT-BMA) ===
|
|
233
|
-
analysis: {
|
|
234
|
-
xpath: ".", // Use current context (BHR_GT_O element) - resolver will find boreholeSampleAnalysis
|
|
235
|
-
resolver: boreResolvers.processBoreholeSampleAnalysis,
|
|
236
|
-
},
|
|
237
|
-
// === Boring Interval Arrays ===
|
|
238
|
-
boredIntervals: {
|
|
239
|
-
xpath: ".", // Use current context - resolver will find all bored intervals
|
|
240
|
-
resolver: boreResolvers.processBoredIntervals,
|
|
241
|
-
},
|
|
242
|
-
sampledIntervals: {
|
|
243
|
-
xpath: ".", // Use current context - resolver will find all sampled intervals
|
|
244
|
-
resolver: boreResolvers.processSampledIntervals,
|
|
245
|
-
},
|
|
246
|
-
completedIntervals: {
|
|
247
|
-
xpath: ".", // Use current context - resolver will find all completed intervals
|
|
248
|
-
resolver: boreResolvers.processCompletedIntervals,
|
|
249
|
-
},
|
|
250
|
-
notDescribedIntervals: {
|
|
251
|
-
xpath: ".", // Use current context - resolver will find all not described intervals
|
|
252
|
-
resolver: boreResolvers.processNotDescribedIntervals,
|
|
253
|
-
},
|
|
254
|
-
postSedimentaryDiscontinuities: {
|
|
255
|
-
xpath: ".", // Use current context - resolver will find all discontinuities
|
|
256
|
-
resolver: boreResolvers.processPostSedimentaryDiscontinuities,
|
|
257
|
-
},
|
|
258
|
-
excavatedLayers: {
|
|
259
|
-
xpath: ".", // Use current context - resolver will find all excavated layers
|
|
260
|
-
resolver: boreResolvers.processExcavatedLayers,
|
|
261
|
-
},
|
|
262
|
-
boringVelocity: {
|
|
263
|
-
xpath: ".", // Use current context - resolver will find the boring velocity profile
|
|
264
|
-
resolver: boreResolvers.processBoringVelocity,
|
|
265
|
-
},
|
|
266
|
-
fluidMudLayer: {
|
|
267
|
-
xpath: ".", // Use current context - resolver will find the fluid mud layer
|
|
268
|
-
resolver: boreResolvers.processFluidMudLayer,
|
|
269
|
-
},
|
|
270
|
-
// === Administrative History ===
|
|
271
|
-
registrationHistory: {
|
|
272
|
-
xpath: ".", // Use current context - resolver will find registration history
|
|
273
|
-
resolver: processRegistrationHistory,
|
|
274
|
-
},
|
|
275
|
-
reportHistory: {
|
|
276
|
-
xpath: ".", // Use current context - resolver will find report history
|
|
277
|
-
resolver: boreResolvers.processReportHistory,
|
|
278
|
-
},
|
|
279
|
-
// === Additional Top-Level Metadata ===
|
|
280
|
-
deliveryContext: {
|
|
281
|
-
xpath: "./dsbhrgt:deliveryContext",
|
|
282
|
-
},
|
|
283
|
-
surveyPurpose: {
|
|
284
|
-
xpath: "./dsbhrgt:surveyPurpose",
|
|
285
|
-
},
|
|
286
|
-
discipline: {
|
|
287
|
-
xpath: "./dsbhrgt:discipline",
|
|
288
|
-
},
|
|
289
|
-
surveyProcedure: {
|
|
290
|
-
xpath: "./dsbhrgt:surveyProcedure",
|
|
291
|
-
},
|
|
292
|
-
siteCharacteristicDetermined: {
|
|
293
|
-
xpath: "./dsbhrgt:siteCharacteristicDetermined",
|
|
294
|
-
resolver: typeResolvers.parseBoolean,
|
|
295
|
-
},
|
|
10
|
+
import { object_, array, custom, oneOf, scalar, text, date, number_, boolean_, } from "../core/producer.js";
|
|
11
|
+
import { COMMON_REGISTRATION_PRODUCERS, REGISTRATION_HISTORY, gmlLocation, } from "./common-fields.js";
|
|
12
|
+
import { ANALYSIS_PRODUCER } from "./bhrgt-analysis.js";
|
|
13
|
+
const BORING = "./dsbhrgt:boring";
|
|
14
|
+
const SAMPLED = `${BORING}/bhrgtcom:sampledInterval`;
|
|
15
|
+
const SAMPLER = `${SAMPLED}/bhrgtcom:sampler`;
|
|
16
|
+
const SAMPLE_DESC = "./dsbhrgt:boreholeSampleDescription";
|
|
17
|
+
const LOG = `${SAMPLE_DESC}/bhrgtcom:descriptiveBoreholeLog`;
|
|
18
|
+
const VPOS = "./dsbhrgt:deliveredVerticalPosition";
|
|
19
|
+
const REQUIRED = { presence: "required" };
|
|
20
|
+
const OMIT = { presence: "omit" };
|
|
21
|
+
/** `"geen"` → false, any other code → true, absent → null. */
|
|
22
|
+
function parseDispersedInhomogeneity(raw) {
|
|
23
|
+
if (raw === null) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return raw.toLowerCase() !== "geen";
|
|
27
|
+
}
|
|
28
|
+
/** Mount an object/array producer at a relative path, keyed only when present. */
|
|
29
|
+
function optional(producer, at) {
|
|
30
|
+
return { ...producer, at, presence: "omit" };
|
|
31
|
+
}
|
|
32
|
+
/** A repeatable code list: text of each match, always present (may be empty). */
|
|
33
|
+
function codeList(each) {
|
|
34
|
+
return array({ each, item: text() });
|
|
35
|
+
}
|
|
36
|
+
// === Rock branch ===
|
|
37
|
+
const ROCK_DESCRIPTION = object_({
|
|
38
|
+
fields: {
|
|
39
|
+
rockType: text("./bhrgtcom:rockType"),
|
|
40
|
+
cementType: text("./bhrgtcom:cementType"),
|
|
41
|
+
colour: text("./bhrgtcom:colour"),
|
|
42
|
+
tertiaryRockConstituent: codeList("./bhrgtcom:tertiaryRockConstituent"),
|
|
43
|
+
interbedding: text("./bhrgtcom:interbedding"),
|
|
44
|
+
dispersedInhomogeneity: codeList("./bhrgtcom:dispersedInhomogeneity"),
|
|
45
|
+
carbonateContentClass: text("./bhrgtcom:carbonateContentClass"),
|
|
46
|
+
crossBedding: text("./bhrgtcom:crossBedding"),
|
|
47
|
+
gradedBedding: text("./bhrgtcom:gradedBedding"),
|
|
48
|
+
voidsPresent: text("./bhrgtcom:voidsPresent"),
|
|
49
|
+
voidDistribution: text("./bhrgtcom:voidDistribution"),
|
|
50
|
+
stability: text("./bhrgtcom:stability"),
|
|
51
|
+
strengthClass: text("./bhrgtcom:strengthClass"),
|
|
52
|
+
weathered: text("./bhrgtcom:weathered"),
|
|
53
|
+
weatheringDegree: optional(object_({
|
|
54
|
+
fields: {
|
|
55
|
+
discolouration: text("./bhrgtcom:discolouration"),
|
|
56
|
+
disintegration: text("./bhrgtcom:disintegration"),
|
|
57
|
+
decomposition: text("./bhrgtcom:decomposition"),
|
|
58
|
+
},
|
|
59
|
+
}), "./bhrgtcom:weatheringDegree"),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const GRAINSHAPE = object_({
|
|
63
|
+
fields: {
|
|
64
|
+
sizeFraction: text("./bhrgtcom:sizeFraction"),
|
|
65
|
+
angularity: text("./bhrgtcom:angularity"),
|
|
66
|
+
sphericity: text("./bhrgtcom:sphericity"),
|
|
67
|
+
roughness: text("./bhrgtcom:roughness"),
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
// === The described layer: soil ⊕ rock ===
|
|
71
|
+
/** Fields shared by every layer, regardless of soil/rock. */
|
|
72
|
+
const LAYER_BASE = {
|
|
73
|
+
upperBoundary: number_("./bhrgtcom:upperBoundary"),
|
|
74
|
+
lowerBoundary: number_("./bhrgtcom:lowerBoundary"),
|
|
75
|
+
upperBoundaryDetermination: text("./bhrgtcom:upperBoundaryDetermination"),
|
|
76
|
+
lowerBoundaryDetermination: text("./bhrgtcom:lowerBoundaryDetermination"),
|
|
77
|
+
anthropogenic: boolean_("./bhrgtcom:anthropogenic"),
|
|
78
|
+
slant: boolean_("./bhrgtcom:slant"),
|
|
79
|
+
bedding: text("./bhrgtcom:bedding", OMIT),
|
|
80
|
+
compositeLayer: boolean_("./bhrgtcom:compositeLayer", OMIT),
|
|
81
|
+
activityType: text("./bhrgtcom:activityType", OMIT),
|
|
82
|
+
bedded: boolean_("./bhrgtcom:bedded"),
|
|
83
|
+
internalStructureIntact: boolean_("./bhrgtcom:internalStructureIntact"),
|
|
84
|
+
specialMaterial: text("./bhrgtcom:specialMaterial", OMIT),
|
|
85
|
+
};
|
|
86
|
+
const LAYER = oneOf({
|
|
87
|
+
tagAs: "material",
|
|
88
|
+
base: LAYER_BASE,
|
|
89
|
+
branches: [
|
|
90
|
+
{
|
|
91
|
+
when: "./bhrgtcom:rock",
|
|
92
|
+
at: "./bhrgtcom:rock",
|
|
93
|
+
tag: "rock",
|
|
94
|
+
fields: { rock: ROCK_DESCRIPTION },
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
// Any non-rock layer describes soil.
|
|
98
|
+
when: ".",
|
|
99
|
+
tag: "soil",
|
|
100
|
+
fields: {
|
|
101
|
+
geotechnicalSoilName: scalar({
|
|
102
|
+
at: "./bhrgtcom:soil/bhrgtcom:geotechnicalSoilName",
|
|
103
|
+
decode: (raw) => raw ?? "",
|
|
104
|
+
}),
|
|
105
|
+
soilNameNEN5104: text("./bhrgtcom:soil/bhrgtcom:soilNameNEN5104", OMIT),
|
|
106
|
+
gravelContentClassNEN5104: text("./bhrgtcom:soil/bhrgtcom:gravelContentClassNEN5104", OMIT),
|
|
107
|
+
organicMatterContentClassNEN5104: text("./bhrgtcom:soil/bhrgtcom:organicMatterContentClassNEN5104", OMIT),
|
|
108
|
+
tertiaryConstituent: text("./bhrgtcom:soil/bhrgtcom:tertiaryConstituent"),
|
|
109
|
+
color: text("./bhrgtcom:soil/bhrgtcom:colour", OMIT),
|
|
110
|
+
dispersedInhomogeneity: scalar({
|
|
111
|
+
at: "./bhrgtcom:soil/bhrgtcom:dispersedInhomogeneity",
|
|
112
|
+
decode: parseDispersedInhomogeneity,
|
|
113
|
+
}),
|
|
114
|
+
organicMatterContentClass: text("./bhrgtcom:soil/bhrgtcom:organicMatterContentClass"),
|
|
115
|
+
carbonateContentClass: text("./bhrgtcom:soil/bhrgtcom:carbonateContentClass"),
|
|
116
|
+
sandMedianClass: text("./bhrgtcom:soil/bhrgtcom:sandMedianClass"),
|
|
117
|
+
gravelMedianClass: text("./bhrgtcom:soil/bhrgtcom:gravelMedianClass", OMIT),
|
|
118
|
+
geotechnicalDepositionalCharacteristic: text("./bhrgtcom:soil/bhrgtcom:geotechnicalDepositionalCharacteristic", OMIT),
|
|
119
|
+
interbedding: text("./bhrgtcom:soil/bhrgtcom:interbedding", OMIT),
|
|
120
|
+
mixed: boolean_("./bhrgtcom:soil/bhrgtcom:mixed"),
|
|
121
|
+
mottled: boolean_("./bhrgtcom:soil/bhrgtcom:mottled"),
|
|
122
|
+
fineSoilConsistency: text("./bhrgtcom:soil/bhrgtcom:fineSoilConsistency"),
|
|
123
|
+
organicSoilConsistency: text("./bhrgtcom:soil/bhrgtcom:organicSoilConsistency"),
|
|
124
|
+
organicSoilTexture: text("./bhrgtcom:soil/bhrgtcom:organicSoilTexture"),
|
|
125
|
+
peatTensileStrength: text("./bhrgtcom:soil/bhrgtcom:peatTensileStrength"),
|
|
126
|
+
crossBedding: text("./bhrgtcom:soil/bhrgtcom:crossBedding", OMIT),
|
|
127
|
+
gradedBedding: text("./bhrgtcom:soil/bhrgtcom:gradedBedding", OMIT),
|
|
128
|
+
mixingType: text("./bhrgtcom:soil/bhrgtcom:mixingType", OMIT),
|
|
129
|
+
fineGravelContentClass: text("./bhrgtcom:soil/bhrgtcom:fineGravelContentClass", OMIT),
|
|
130
|
+
mediumCoarseGravelContentClass: text("./bhrgtcom:soil/bhrgtcom:mediumCoarseGravelContentClass", OMIT),
|
|
131
|
+
veryCoarseGravelContentClass: text("./bhrgtcom:soil/bhrgtcom:veryCoarseGravelContentClass", OMIT),
|
|
132
|
+
sandSortingNEN5104: text("./bhrgtcom:soil/bhrgtcom:sandSortingNEN5104", OMIT),
|
|
133
|
+
peatType: text("./bhrgtcom:soil/bhrgtcom:peatType", OMIT),
|
|
134
|
+
depositionalAge: text("./bhrgtcom:soil/bhrgtcom:depositionalAge", OMIT),
|
|
135
|
+
grainshape: optional(GRAINSHAPE, "./bhrgtcom:soil/bhrgtcom:grainshape"),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
});
|
|
140
|
+
// === Interval item producers ===
|
|
141
|
+
const depthRange = {
|
|
142
|
+
beginDepth: number_("./bhrgtcom:beginDepth", REQUIRED),
|
|
143
|
+
endDepth: number_("./bhrgtcom:endDepth", REQUIRED),
|
|
296
144
|
};
|
|
145
|
+
const BORED_INTERVAL = object_({
|
|
146
|
+
fields: {
|
|
147
|
+
...depthRange,
|
|
148
|
+
boringTechnique: text("./bhrgtcom:boringTechnique"),
|
|
149
|
+
boredDiameter: number_("./bhrgtcom:boredDiameter"),
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
const SAMPLED_INTERVAL = object_({
|
|
153
|
+
fields: {
|
|
154
|
+
...depthRange,
|
|
155
|
+
preTreatment: text("./bhrgtcom:preTreatment"),
|
|
156
|
+
samplingMethod: text("./bhrgtcom:samplingMethod"),
|
|
157
|
+
samplingQuality: text("./bhrgtcom:samplingQuality"),
|
|
158
|
+
orientatedSampled: boolean_("./bhrgtcom:orientatedSampled"),
|
|
159
|
+
sampler: optional(object_({
|
|
160
|
+
fields: {
|
|
161
|
+
samplerType: text("./bhrgtcom:samplerType"),
|
|
162
|
+
sampleContainerDiameter: number_("./bhrgtcom:sampleContainerDiameter"),
|
|
163
|
+
sampleContainerLength: number_("./bhrgtcom:sampleContainerLength"),
|
|
164
|
+
cuttingShoeInsideDiameter: number_("./bhrgtcom:cuttingShoeInsideDiameter"),
|
|
165
|
+
cuttingShoeOutsideDiameter: number_("./bhrgtcom:cuttingShoeOutsideDiameter"),
|
|
166
|
+
stockingUsed: boolean_("./bhrgtcom:stockingUsed"),
|
|
167
|
+
rightAngledCuttingShoe: boolean_("./bhrgtcom:rightAngledCuttingShoe"),
|
|
168
|
+
taperAngle: number_("./bhrgtcom:taperAngle"),
|
|
169
|
+
lubricationFluidUsed: boolean_("./bhrgtcom:lubricationFluidUsed"),
|
|
170
|
+
coreCatcherPresent: boolean_("./bhrgtcom:coreCatcherPresent"),
|
|
171
|
+
pistonPresent: boolean_("./bhrgtcom:pistonPresent"),
|
|
172
|
+
},
|
|
173
|
+
}), "./bhrgtcom:sampler"),
|
|
174
|
+
coreRecovery: optional(object_({
|
|
175
|
+
fields: {
|
|
176
|
+
totalCoreRecovery: number_("./bhrgtcom:totalCoreRecovery"),
|
|
177
|
+
solidCoreRecovery: number_("./bhrgtcom:solidCoreRecovery"),
|
|
178
|
+
rockQualityDesignation: number_("./bhrgtcom:rockQualityDesignation"),
|
|
179
|
+
fieldDetermined: boolean_("./bhrgtcom:fieldDetermined"),
|
|
180
|
+
},
|
|
181
|
+
}), "./bhrgtcom:coreRecovery"),
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
const COMPLETED_INTERVAL = object_({
|
|
185
|
+
fields: {
|
|
186
|
+
...depthRange,
|
|
187
|
+
permanentCasingPresent: boolean_("./bhrgtcom:permanentCasingPresent"),
|
|
188
|
+
diameterPermanentCasing: number_("./bhrgtcom:diameterPermanentCasing"),
|
|
189
|
+
materialPermanentCasing: text("./bhrgtcom:materialPermanentCasing"),
|
|
190
|
+
backfillMaterial: text("./bhrgtcom:backfillMaterial"),
|
|
191
|
+
backfillMaterialWashed: boolean_("./bhrgtcom:backfillMaterialWashed"),
|
|
192
|
+
backfillMaterialCertified: boolean_("./bhrgtcom:backfillMaterialCertified"),
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
const POST_SED_DISCONTINUITY = object_({
|
|
196
|
+
fields: {
|
|
197
|
+
...depthRange,
|
|
198
|
+
inRock: text("./bhrgtcom:inRock"),
|
|
199
|
+
discontinuityType: text("./bhrgtcom:discontinuityType"),
|
|
200
|
+
compositeDiscontinuity: text("./bhrgtcom:compositeDiscontinuity"),
|
|
201
|
+
spacing: number_("./bhrgtcom:spacing"),
|
|
202
|
+
smooth: text("./bhrgtcom:smooth"),
|
|
203
|
+
apertureClass: text("./bhrgtcom:apertureClass"),
|
|
204
|
+
infillMaterial: text("./bhrgtcom:infillMaterial"),
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
export const BORE_PRODUCER = object_({
|
|
208
|
+
fields: {
|
|
209
|
+
// === Core identification (shared brocom fields) ===
|
|
210
|
+
...COMMON_REGISTRATION_PRODUCERS,
|
|
211
|
+
researchReportDate: date("./dsbhrgt:reportHistory/dsbhrgt:reportStartDate"),
|
|
212
|
+
// === Location ===
|
|
213
|
+
deliveredLocation: gmlLocation("./dsbhrgt:deliveredLocation/bhrgtcom:location"),
|
|
214
|
+
standardizedLocation: gmlLocation("./dsbhrgt:standardizedLocation/brocom:location"),
|
|
215
|
+
// === Vertical position ===
|
|
216
|
+
deliveredVerticalPositionOffset: number_(`${VPOS}/bhrgtcom:offset`),
|
|
217
|
+
deliveredVerticalPositionDatum: text(`${VPOS}/bhrgtcom:verticalDatum`),
|
|
218
|
+
deliveredVerticalPositionReferencePoint: text(`${VPOS}/bhrgtcom:localVerticalReferencePoint`),
|
|
219
|
+
// === Boring metadata ===
|
|
220
|
+
descriptionProcedure: text(`${SAMPLE_DESC}/bhrgtcom:descriptionProcedure`),
|
|
221
|
+
groundwaterLevel: number_(`${BORING}/bhrgtcom:groundwaterLevel`),
|
|
222
|
+
meanHighestGroundwaterLevel: number_(`${LOG}/bhrgtcom:meanHighestGroundwaterLevel`),
|
|
223
|
+
meanLowestGroundwaterLevel: number_(`${LOG}/bhrgtcom:meanLowestGroundwaterLevel`),
|
|
224
|
+
boreRockReached: boolean_(`${BORING}/bhrgtcom:rockReached`),
|
|
225
|
+
finalBoreDepth: number_(`${BORING}/bhrgtcom:finalDepthBoring`),
|
|
226
|
+
finalSampleDepth: number_(`${BORING}/bhrgtcom:finalDepthSampling`),
|
|
227
|
+
finalDepthPreparation: number_(`${BORING}/bhrgtcom:finalDepthPreparation`),
|
|
228
|
+
finalDepthExcavation: number_(`${BORING}/bhrgtcom:finalDepthExcavation`),
|
|
229
|
+
finalDepthTemporaryCasing: number_(`${BORING}/bhrgtcom:finalDepthTemporaryCasing`),
|
|
230
|
+
boreHoleCompleted: boolean_(`${BORING}/bhrgtcom:boreholeCompleted`),
|
|
231
|
+
// === Boring execution details ===
|
|
232
|
+
boringStartDate: date(`${BORING}/bhrgtcom:boringStartDate`),
|
|
233
|
+
boringEndDate: date(`${BORING}/bhrgtcom:boringEndDate`),
|
|
234
|
+
boringProcedure: text(`${BORING}/bhrgtcom:boringProcedure`),
|
|
235
|
+
boringTechnique: text(`${BORING}/bhrgtcom:boredInterval/bhrgtcom:boringTechnique`),
|
|
236
|
+
trajectoryExcavated: boolean_(`${BORING}/bhrgtcom:trajectoryExcavated`),
|
|
237
|
+
subsurfaceContaminated: boolean_(`${BORING}/bhrgtcom:subsurfaceContaminated`),
|
|
238
|
+
stopCriterion: text(`${BORING}/bhrgtcom:stopCriterion`),
|
|
239
|
+
flushingMediumUsed: boolean_(`${BORING}/bhrgtcom:flushingMediumUsed`),
|
|
240
|
+
flushingAdditive: text(`${BORING}/bhrgtcom:flushingAdditive`),
|
|
241
|
+
temporaryCasingUsed: boolean_(`${BORING}/bhrgtcom:temporaryCasingUsed`),
|
|
242
|
+
preparation: text(`${BORING}/bhrgtcom:preparation`),
|
|
243
|
+
// === Site characteristic ===
|
|
244
|
+
soilUse: text("./dsbhrgt:siteCharacteristic/bhrgtcom:soilUse"),
|
|
245
|
+
positionOnGroundBody: text("./dsbhrgt:siteCharacteristic/bhrgtcom:positionOnGroundBody"),
|
|
246
|
+
temporaryChange: text("./dsbhrgt:siteCharacteristic/bhrgtcom:temporaryChange"),
|
|
247
|
+
researchOperator: custom({
|
|
248
|
+
at: "./dsbhrgt:researchOperator",
|
|
249
|
+
produce: (lens) => lens.textAt("./brocom:chamberOfCommerceNumber") ??
|
|
250
|
+
lens.textAt("./brocom:europeanCompanyRegistrationNumber"),
|
|
251
|
+
}),
|
|
252
|
+
// === Sampler details ===
|
|
253
|
+
samplerType: text(`${SAMPLER}/bhrgtcom:samplerType`),
|
|
254
|
+
samplingProcedure: text(`${BORING}/bhrgtcom:samplingProcedure`),
|
|
255
|
+
samplingMethod: text(`${SAMPLED}/bhrgtcom:samplingMethod`),
|
|
256
|
+
samplingQuality: text(`${SAMPLED}/bhrgtcom:samplingQuality`),
|
|
257
|
+
orientatedSampled: boolean_(`${SAMPLER}/bhrgtcom:orientatedSampled`),
|
|
258
|
+
sampleContainerDiameter: number_(`${SAMPLER}/bhrgtcom:sampleContainerDiameter`),
|
|
259
|
+
sampleContainerLength: number_(`${SAMPLER}/bhrgtcom:sampleContainerLength`),
|
|
260
|
+
pistonPresent: boolean_(`${SAMPLER}/bhrgtcom:pistonPresent`),
|
|
261
|
+
coreCatcherPresent: boolean_(`${SAMPLER}/bhrgtcom:coreCatcherPresent`),
|
|
262
|
+
stockingUsed: boolean_(`${SAMPLER}/bhrgtcom:stockingUsed`),
|
|
263
|
+
lubricationFluidUsed: boolean_(`${SAMPLER}/bhrgtcom:lubricationFluidUsed`),
|
|
264
|
+
rightAngledCuttingShoe: boolean_(`${SAMPLER}/bhrgtcom:rightAngledCuttingShoe`),
|
|
265
|
+
cuttingShoeInsideDiameter: number_(`${SAMPLER}/bhrgtcom:cuttingShoeInsideDiameter`),
|
|
266
|
+
cuttingShoeOutsideDiameter: number_(`${SAMPLER}/bhrgtcom:cuttingShoeOutsideDiameter`),
|
|
267
|
+
taperAngle: number_(`${SAMPLER}/bhrgtcom:taperAngle`),
|
|
268
|
+
// === Description metadata ===
|
|
269
|
+
boreholeLogChecked: boolean_(`${LOG}/bhrgtcom:boreholeLogChecked`),
|
|
270
|
+
descriptionQuality: text(`${LOG}/bhrgtcom:descriptionQuality`),
|
|
271
|
+
descriptionLocation: text(`${LOG}/bhrgtcom:descriptionLocation`),
|
|
272
|
+
descriptionReportDate: date(`${SAMPLE_DESC}/bhrgtcom:descriptionReportDate`),
|
|
273
|
+
describedMaterial: text(`${LOG}/bhrgtcom:describedMaterial`),
|
|
274
|
+
continuouslySampled: boolean_(`${LOG}/bhrgtcom:continuouslySampled`),
|
|
275
|
+
sampleMoistness: text(`${LOG}/bhrgtcom:sampleMoistness`),
|
|
276
|
+
// === Visual description (BHR-GT-BMB): soil/rock layers ===
|
|
277
|
+
data: array({ at: LOG, each: ".//bhrgtcom:layer", item: LAYER }),
|
|
278
|
+
// === Laboratory analysis (BHR-GT-BMA) ===
|
|
279
|
+
analysis: ANALYSIS_PRODUCER,
|
|
280
|
+
// === Boring interval arrays ===
|
|
281
|
+
boredIntervals: array({ each: `${BORING}/bhrgtcom:boredInterval`, item: BORED_INTERVAL }),
|
|
282
|
+
sampledIntervals: array({ each: SAMPLED, item: SAMPLED_INTERVAL }),
|
|
283
|
+
completedIntervals: array({
|
|
284
|
+
each: `${BORING}/bhrgtcom:completedInterval`,
|
|
285
|
+
item: COMPLETED_INTERVAL,
|
|
286
|
+
}),
|
|
287
|
+
notDescribedIntervals: array({
|
|
288
|
+
each: `${LOG}/bhrgtcom:notDescribedInterval`,
|
|
289
|
+
item: object_({ fields: { ...depthRange, noDescriptionReason: text("./bhrgtcom:noDescriptionReason") } }),
|
|
290
|
+
}),
|
|
291
|
+
postSedimentaryDiscontinuities: array({
|
|
292
|
+
each: `${LOG}/bhrgtcom:postSedimentaryDiscontinuity`,
|
|
293
|
+
item: POST_SED_DISCONTINUITY,
|
|
294
|
+
}),
|
|
295
|
+
excavatedLayers: array({
|
|
296
|
+
each: `${BORING}/bhrgtcom:excavatedLayer`,
|
|
297
|
+
item: object_({
|
|
298
|
+
fields: {
|
|
299
|
+
upperBoundary: number_("./bhrgtcom:upperBoundary", REQUIRED),
|
|
300
|
+
lowerBoundary: number_("./bhrgtcom:lowerBoundary", REQUIRED),
|
|
301
|
+
excavatedMaterial: text("./bhrgtcom:excavatedMaterial"),
|
|
302
|
+
},
|
|
303
|
+
}),
|
|
304
|
+
}),
|
|
305
|
+
boringVelocity: array({
|
|
306
|
+
each: `${BORING}/bhrgtcom:boringVelocity`,
|
|
307
|
+
item: object_({
|
|
308
|
+
fields: {
|
|
309
|
+
elapsedTime: number_("./bhrgtcom:elapsedTime"),
|
|
310
|
+
depth: number_("./bhrgtcom:depth"),
|
|
311
|
+
},
|
|
312
|
+
}),
|
|
313
|
+
}),
|
|
314
|
+
// === Fluid mud layer (optional, single) ===
|
|
315
|
+
fluidMudLayer: optional(object_({
|
|
316
|
+
fields: {
|
|
317
|
+
thickness: number_("./bhrgtcom:thickness"),
|
|
318
|
+
colour: text("./bhrgtcom:colour"),
|
|
319
|
+
upperBoundaryPositioningMethod: text("./bhrgtcom:upperBoundaryPositioningMethod"),
|
|
320
|
+
lowerBoundaryPositioningMethod: text("./bhrgtcom:lowerBoundaryPositioningMethod"),
|
|
321
|
+
},
|
|
322
|
+
}), "./dsbhrgt:fluidMudLayer"),
|
|
323
|
+
// === Administrative history ===
|
|
324
|
+
registrationHistory: REGISTRATION_HISTORY,
|
|
325
|
+
reportHistory: object_({
|
|
326
|
+
at: "./dsbhrgt:reportHistory",
|
|
327
|
+
fields: {
|
|
328
|
+
reportStartDate: date("./dsbhrgt:reportStartDate"),
|
|
329
|
+
reportEndDate: date("./dsbhrgt:reportEndDate"),
|
|
330
|
+
intermediateEvents: array({
|
|
331
|
+
each: "./dsbhrgt:intermediateEvent",
|
|
332
|
+
item: object_({
|
|
333
|
+
fields: {
|
|
334
|
+
eventName: text("./dsbhrgt:eventName"),
|
|
335
|
+
eventDate: date("./dsbhrgt:eventDate"),
|
|
336
|
+
},
|
|
337
|
+
}),
|
|
338
|
+
}),
|
|
339
|
+
},
|
|
340
|
+
}),
|
|
341
|
+
// === Additional top-level metadata ===
|
|
342
|
+
deliveryContext: text("./dsbhrgt:deliveryContext"),
|
|
343
|
+
surveyPurpose: text("./dsbhrgt:surveyPurpose"),
|
|
344
|
+
discipline: text("./dsbhrgt:discipline"),
|
|
345
|
+
surveyProcedure: text("./dsbhrgt:surveyProcedure"),
|
|
346
|
+
siteCharacteristicDetermined: boolean_("./dsbhrgt:siteCharacteristicDetermined"),
|
|
347
|
+
},
|
|
348
|
+
});
|
|
297
349
|
//# sourceMappingURL=bore-schema.js.map
|