@welldot/core 0.3.0 → 0.4.0-next.20261014.26249fd

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.
@@ -1,8 +1,119 @@
1
- # `.well` File Format Specification — Version 2.1: Overview
1
+ # `.well` File Format Specification — Version 2.3: Overview
2
2
 
3
- **Version:** 2.1 **Extension:** `.well` **Encoding:** UTF-8 **Base format:** JSON **MIME type:** `application/vnd.well+json` **JSON Schema:** `https://welldot.org/schema/v2/well.schema.json` **JSON Schema draft:** 2020-12 **JSON-LD Context (optional):** `https://welldot.org/context/v2.jsonld` **Status:** v2.0 ratified — shipped in `@welldot/core` v0.2.0 · v2.1 shipped in `@welldot/core` v0.3.0
3
+ **Version:** 2.3 **Extension:** `.well` **Encoding:** UTF-8 **Base format:** JSON **MIME type:** `application/vnd.well+json` **JSON Schema:** `https://welldot.org/schema/v2/well.schema.json` **JSON Schema draft:** 2020-12 **JSON-LD Context (optional):** `https://welldot.org/context/v2.jsonld` **Status:** v2.0 ratified — shipped in `@welldot/core` v0.2.0 · v2.1 shipped in `@welldot/core` v0.3.0 · v2.3 shipped in `@welldot/core` v0.4.0
4
4
 
5
- **See also:** [format-reference.md](./format-reference.md) · [object-schemas.md](./object-schemas.md) · [interoperability.md](./interoperability.md)
5
+ **See also:** [format-reference.md](./format-reference.md) · [object-schemas.md](./object-schemas.md) · [interoperability.md](./interoperability.md) · [water-quality.md](./water-quality.md)
6
+
7
+ ---
8
+
9
+ ## Changes in v2.3
10
+
11
+ v2.3 is an additive minor revision. Every valid v2.1 document is a valid v2.3 document, and documents keep declaring `"version": 2`. It adds the operational blocks (equipment, documents, permits, metering, production and operating regime) and the water quality block (`water_samples`).
12
+
13
+ ```
14
+ v2.3 additions:
15
+ - attachments (optional Attachment[]): root-level documents about the
16
+ well as a whole (drilling report, as-built drawing, registry record…)
17
+ - Attachment becomes a common type and gains document_type
18
+ (drilling_report, as_built_drawing, registry_record, photo,
19
+ permit_document, condition_evidence, pump_curve, field_sheet,
20
+ test_report, lab_report, invoice)
21
+ - pump_installations (optional PumpInstallation[]): pump installation
22
+ history, with nameplate, intake depth, riser and electrical data
23
+ - permits (optional Permit[]): legal instruments governing abstraction
24
+ (outorga, dispensa, cadastro) with validity, granted flow, daily
25
+ operating time, volume limits, monthly schedule and conditions
26
+ (condicionantes) whose deadlines are derived from ISO 8601 date
27
+ durations; renewals are linked with supersedes. Each permit carries
28
+ its identifier and/or request_identifier (verbatim, any format), a
29
+ closed administrative status (requested, granted, suspended,
30
+ revoked, denied, withdrawn), an administrative history (filing,
31
+ process, notifications, fees, with done/due_date) and, on each
32
+ condition, a responsible and the fulfillments of its deadlines
33
+ (datetime, due_date, author, event_id, sample_id)
34
+ - meters (optional Meter[]): totalizer (hidrômetro) installation
35
+ history; device facts only (type, serial, nominal diameter,
36
+ max_reading for rollover)
37
+ - production (optional ProductionEntry[]): append-only ledger of
38
+ meter_reading entries (register values in m³) and estimated_volume
39
+ entries (volumes estimated for a period without a meter); volumes
40
+ are derived from consecutive readings, never stored as totals.
41
+ Volumes declared to a regulator are not production data: they are
42
+ the fulfillment of the permit's reporting condition
43
+ - operating_regime (optional OperatingRegime[]): declared flow rate,
44
+ daily operating time and days per week, each entry in force from
45
+ effective_from
46
+ - history_logs category status_change, with status (active,
47
+ maintenance, inactive, decommissioned, abandoned): the well's
48
+ operating status; current status is unknown without one
49
+ - history_logs category maintenance gains maintenance_type,
50
+ pump_installation_id and meter_id
51
+ - history_logs gains hydrodynamic_event_ids and sample_ids (any
52
+ category): references to the data an entry produced or observed,
53
+ never copies of measured values
54
+ - hydrodynamic_events[].corrects: retracts an earlier event (ledger
55
+ correction)
56
+ - hydrodynamic_events[].attachments, aquifer_analysis[].attachments
57
+ - Canonical units kW (power), V (voltage), mm² (cable cross-section),
58
+ m³ (volume), h (daily operating time only)
59
+ - water_samples (optional WaterSample[]): ledger of water samples,
60
+ each with its field and laboratory results in one list
61
+ (distinguished by measured_in), sampling point (point depth or
62
+ isolated interval, or the production pump), purge and stabilization
63
+ readings, laboratory and chain of custody, field QA/QC
64
+ (field_duplicate, split_sample via parent_sample_id; blanks),
65
+ per-result filtration, lab flags and data validation; corrected
66
+ reports and revalidations are new samples with corrects
67
+ - Parameter identity { code, vocabulary } with vocabularies welldot,
68
+ cas and x-…; the welldot parameter vocabulary (98 codes) is
69
+ published as versioned data in @welldot/core, with CAS
70
+ equivalences; the unit of a welldot or cas parameter comes from its
71
+ code (substances always mg/L), and unit (UCUM) exists only for x-
72
+ codes
73
+ - Canonical units mg/L, µS/cm at 25 °C, °C, mV, NTU / FNU / FAU / FTU
74
+ (by code), Hazen (uH), MPN/100 mL, CFU/100 mL, CFU/mL, Bq/L and µm
75
+ - _resolution convention: analyzed_at_resolution and
76
+ laboratory.received_at_resolution set to "day" mark an instant
77
+ known only by its date; consumers MUST ignore the time of day
78
+ - permit condition fulfillments gain sample_id (e.g. a water-quality
79
+ monitoring condition)
80
+ - well_screen[].slot_type (screen design: continuous_slot, slotted,
81
+ bridge_slot, louver, perforated, nold); type remains the screen
82
+ material
83
+ - Recommended vocabularies for drilling_method, construction materials
84
+ (well_case / well_screen / reduction type, riser_material),
85
+ well_screen slot_type,
86
+ centralizer steels, cement_pad.type, history_logs severity,
87
+ measurement_method and aquifer_analysis method; every recommended
88
+ vocabulary is published by @welldot/core with en/pt labels
89
+
90
+ v2.3 clarifications:
91
+ - Block kinds: every top-level array is a ledger, a mutable record or
92
+ an installation; the kind decides how records are corrected
93
+ - Open vocabulary values are stored as their key, never as a
94
+ translated label
95
+ - Datetime families: legal documents use calendar dates (YYYY-MM-DD),
96
+ everything else uses RFC 3339 instants
97
+ - Naming rules: no units in field names; nameplate values use the
98
+ rated_ prefix; time intervals use period_start / period_end
99
+ - supersedes (legal succession between permits) is distinct from
100
+ corrects (ledger retraction)
101
+ - Permit status and condition deadlines are derived on the local civil
102
+ date at the well site, never stored
103
+ - Volume derivation is normative: rollover via max_reading, never
104
+ across two meters, unknown (never zero or negative) where readings
105
+ do not cover; metered volume takes precedence over estimated
106
+ volumes
107
+ - history_logs category change_of_use is no longer a recommended
108
+ value; a change of use is an event entry (the current use lives in
109
+ well_purpose)
110
+ - Jurisdiction neutrality: water quality limits, exceedances and
111
+ national rules are never written to the file; limit sets (WHO, EU,
112
+ Brazil…) are data in @welldot/core and local requirements enter
113
+ through profiles
114
+ ```
115
+
116
+ v2.3 contains no deprecations.
6
117
 
7
118
  ---
8
119
 
@@ -89,8 +200,12 @@ The `.well` format is an open standard for representing water well data. It is d
89
200
  - **CRS is declared, not assumed** — geographic coordinates are accompanied by an explicit coordinate reference system declaration. The default is WGS84 (`EPSG:4326`).
90
201
  - **Ground level as zero** — all depth values are measured from ground level (0); elevation above the WGS84 ellipsoid (or declared datum) is stored separately in `location.elevation`. Water levels above ground are negative.
91
202
  - **Geographic north** — all azimuth values are referenced to geographic north.
92
- - **Append-only event history (by authoring convention)** — `hydrodynamic_events` is intended as a ledger. New measurements should be added as new entries; existing entries should not be modified. This is enforced by authoring tools in the welldot stack, not by the file format itself. The format provides `id`, `datetime`, and `sequence` to support this discipline.
203
+ - **Three block kinds** — every top-level array is one of three kinds, and the kind decides how records are corrected:
204
+ - **Ledger** (`hydrodynamic_events`, `production`, `water_samples`) — append-only. An error is corrected by appending a new entry whose `corrects` points to the retracted entry; existing entries are never edited in place. A retracted entry stays in the file but is excluded from every derivation. This is enforced by authoring tools in the welldot stack, not by the file format itself. The format provides `id`, `datetime`, `sequence` and `corrects` to support this discipline.
205
+ - **Mutable record** (`history_logs`, `permits`, `operating_regime`) — edited in place; `updated_at` records the last edit.
206
+ - **Installation** (`pump_installations`, `meters`) — equipment present in the well for a period (`installed_at` / `removed_at`); edited in place with `updated_at`.
93
207
  - **Derived values are never stored raw** — `s/Q`, `Q/s`, drawdown `s`, and any other value computable from stored fields must not appear as stored fields. Applications compute them on demand.
208
+ - **Jurisdiction neutrality** — the file records what was measured, never what it means under a given rule. Water quality limits, exceedances and national requirements are not stored and no field names a national standard; limit sets (WHO, EU, Brazil, …) are versioned data in `@welldot/core`, chosen by the consumer at display time, and local obligations (required parameters, sampling frequencies) enter through profiles.
94
209
  - **Interpreted results are versioned** — `aquifer_analysis` records which method was used, who performed the analysis, and which events were used as input. Multiple analyses may coexist.
95
210
  - **Graceful incompleteness** — a record with only a flow rate and a dynamic level is valid. A record with only a static level measurement is valid. Validators must not reject incomplete events.
96
211
  - **Mutable operational log with edit traceability** — `history_logs` entries are editable to allow correction of field errors. Each entry carries a separate `updated_at` timestamp that records when the entry itself was last modified, distinct from the `datetime` field that records when the logged event occurred.
@@ -103,10 +218,11 @@ The `.well` format is an open standard for representing water well data. It is d
103
218
  The following are recognized limitations of this version, reserved for future versions:
104
219
 
105
220
  - **No internationalization of text fields.** All free-text fields (`description`, `notes`, `author`, etc.) are opaque strings with no language tag. A file produced in Brazil will have Portuguese content; one from Norway will have Norwegian. v3 will consider BCP 47 language objects for text fields, with backward-compatible string fallback.
106
- - **No water quality block.** Chemical and physical water quality measurements are out of scope for v2 and reserved for v3.
221
+ - **No interpreted water quality assessment.** `water_samples` records samples and measured results only. Interpreted assessments (water class, hydrochemical facies as a stored judgment, fitness for use) have no block yet; facies, ion balance and exceedances are derived on demand.
222
+ - **Collective permits are repeated per well.** A grant covering several wells is repeated in each well's file until cross-file references arrive in v3.
107
223
  - **No geophysical logs block.** Downhole geophysical surveys (resistivity, gamma ray, caliper) are out of scope for v2 and reserved for v3.
108
224
  - **No multi-well linking.** Storativity determination requires observation well data. The top-level `references` field name is reserved for v3 to link wells across files.
109
225
 
110
226
  ---
111
227
 
112
- _`.well` Format Specification v2.1_
228
+ _`.well` Format Specification v2.3_