feat(datasets): periods (start_date/end_date), dg_id column, date filters; rename observation dates
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
146
api/openapi.yaml
146
api/openapi.yaml
@@ -194,6 +194,41 @@ paths:
|
||||
type: string
|
||||
enum:
|
||||
[pending, parsing, processing, awaiting_mapping, extracting, ready, failed]
|
||||
- name: dg_id
|
||||
in: query
|
||||
required: false
|
||||
description: Filter to a dataset group by id.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
- name: start_date_from
|
||||
in: query
|
||||
required: false
|
||||
description: Keep datasets whose `start_date` is on or after this date.
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
- name: start_date_to
|
||||
in: query
|
||||
required: false
|
||||
description: Keep datasets whose `start_date` is on or before this date.
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
- name: end_date_from
|
||||
in: query
|
||||
required: false
|
||||
description: Keep datasets whose `end_date` is on or after this date.
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
- name: end_date_to
|
||||
in: query
|
||||
required: false
|
||||
description: Keep datasets whose `end_date` is on or before this date.
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
responses:
|
||||
"200":
|
||||
description: A page of dataset summaries
|
||||
@@ -240,6 +275,20 @@ paths:
|
||||
description: Arbitrary user JSON (sent as a JSON string).
|
||||
automated:
|
||||
type: boolean
|
||||
dg_id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Optional dataset group the dataset belongs to.
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
description: Start of the period the dataset describes.
|
||||
end_date:
|
||||
type: string
|
||||
format: date
|
||||
description: >-
|
||||
End of the period (inclusive); must not be before
|
||||
`start_date`.
|
||||
responses:
|
||||
"201":
|
||||
description: Dataset created; processing enqueued
|
||||
@@ -275,7 +324,8 @@ paths:
|
||||
Updates category, name, description, and unit. Every field is
|
||||
required; the file, file type, and processing/lifecycle state are
|
||||
never touched here. Sending an empty string for `description` or
|
||||
`unit` clears that (optional) field.
|
||||
`unit` clears that (optional) field. `dg_id`, `start_date` and
|
||||
`end_date` are optional: omitting one clears that (nullable) column.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
@@ -295,9 +345,9 @@ paths:
|
||||
summary: Partially update a dataset's editable metadata
|
||||
description: |
|
||||
Updates only the fields present in the body, from category, name,
|
||||
description, and unit. The file, file type, and processing/lifecycle
|
||||
state are never touched here. Sending an explicit `null` for
|
||||
`description` or `unit` clears that (optional) field; omitting a
|
||||
description, unit, `dg_id`, `start_date` and `end_date`. The file,
|
||||
file type, and processing/lifecycle state are never touched here.
|
||||
Sending an explicit `null` for a nullable field clears it; omitting a
|
||||
field leaves it unchanged.
|
||||
requestBody:
|
||||
required: true
|
||||
@@ -492,9 +542,9 @@ paths:
|
||||
the dataset's detected `attribute_columns`. Moves the dataset to
|
||||
`extracting`; observations are produced asynchronously.
|
||||
|
||||
Each year column maps to either a single point in time (`date` only,
|
||||
the original behavior) or a period (`date` and `date_to`, inclusive).
|
||||
`date_to`, when present, must not be before `date`.
|
||||
Each year column maps to either a single point in time (`start_date`
|
||||
only, the original behavior) or a period (`start_date` and `end_date`,
|
||||
inclusive). `end_date`, when present, must not be before `start_date`.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
@@ -685,6 +735,20 @@ components:
|
||||
unit:
|
||||
type: string
|
||||
description: An empty string clears the field.
|
||||
dg_id:
|
||||
type: [string, "null"]
|
||||
format: uuid
|
||||
description: Dataset group; omitted or null clears the field.
|
||||
start_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: Start of the dataset's period; omitted or null clears it.
|
||||
end_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: >-
|
||||
End of the dataset's period (inclusive); omitted or null clears it.
|
||||
Must not be before `start_date`.
|
||||
|
||||
DatasetPatch:
|
||||
type: object
|
||||
@@ -703,6 +767,20 @@ components:
|
||||
unit:
|
||||
type: [string, "null"]
|
||||
description: null clears the field.
|
||||
dg_id:
|
||||
type: [string, "null"]
|
||||
format: uuid
|
||||
description: null clears the field.
|
||||
start_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: null clears the field.
|
||||
end_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: >-
|
||||
null clears the field. Must not be before the resulting
|
||||
`start_date`.
|
||||
|
||||
AttributeColumn:
|
||||
type: object
|
||||
@@ -717,23 +795,23 @@ components:
|
||||
|
||||
YearColumn:
|
||||
type: object
|
||||
required: [column, date]
|
||||
required: [column, start_date]
|
||||
properties:
|
||||
column:
|
||||
type: string
|
||||
date:
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
description: >-
|
||||
Point in time, or the start of the period when `date_to` is also
|
||||
Point in time, or the start of the period when `end_date` is also
|
||||
set.
|
||||
date_to:
|
||||
end_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: >-
|
||||
Optional period end (inclusive), must not be before `date`. Omitted
|
||||
or null means a single point in time (the original, pre-period
|
||||
behavior).
|
||||
Optional period end (inclusive), must not be before `start_date`.
|
||||
Omitted or null means a single point in time (the original,
|
||||
pre-period behavior).
|
||||
|
||||
GeoJSONGeometry:
|
||||
type: [object, "null"]
|
||||
@@ -763,7 +841,7 @@ components:
|
||||
mapping to its date->value pairs.
|
||||
|
||||
For a `vector_with_kato` dataset mapped with one or more period
|
||||
year columns (`date_to` set), a sibling `periods` object is also
|
||||
year columns (`end_date` set), a sibling `periods` object is also
|
||||
present, mapping each period's start date (the same key used in
|
||||
`data`) to its end date. `periods` is omitted entirely when the
|
||||
dataset has no period mappings.
|
||||
@@ -792,6 +870,19 @@ components:
|
||||
category_id:
|
||||
type: string
|
||||
format: uuid
|
||||
dg_id:
|
||||
type: [string, "null"]
|
||||
format: uuid
|
||||
description: The dataset group this dataset belongs to, if any.
|
||||
start_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: Start of the period the dataset describes.
|
||||
end_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: >-
|
||||
End of the period (inclusive). Drives the "freshest in group" rule.
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
@@ -824,6 +915,19 @@ components:
|
||||
category_id:
|
||||
type: string
|
||||
format: uuid
|
||||
dg_id:
|
||||
type: [string, "null"]
|
||||
format: uuid
|
||||
description: The dataset group this dataset belongs to, if any.
|
||||
start_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: Start of the period the dataset describes.
|
||||
end_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: >-
|
||||
End of the period (inclusive). Drives the "freshest in group" rule.
|
||||
name:
|
||||
type: string
|
||||
description:
|
||||
@@ -901,12 +1005,12 @@ components:
|
||||
examples:
|
||||
- kato_column: "като"
|
||||
year_columns:
|
||||
- { column: F_2023, date: "2023-01-01" }
|
||||
- { column: D_2025, date: "2025-01-01" }
|
||||
- { column: F_2023, start_date: "2023-01-01" }
|
||||
- { column: D_2025, start_date: "2025-01-01" }
|
||||
|
||||
Observation:
|
||||
type: object
|
||||
required: [id, dataset_id, kato_code, date]
|
||||
required: [id, dataset_id, kato_code, start_date]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
@@ -916,15 +1020,15 @@ components:
|
||||
format: uuid
|
||||
kato_code:
|
||||
type: string
|
||||
date:
|
||||
start_date:
|
||||
type: string
|
||||
format: date
|
||||
date_to:
|
||||
end_date:
|
||||
type: [string, "null"]
|
||||
format: date
|
||||
description: >-
|
||||
Period end (inclusive), carried over from the year mapping's
|
||||
`date_to`. Null for a point-in-time observation.
|
||||
`end_date`. Null for a point-in-time observation.
|
||||
value:
|
||||
type: [number, "null"]
|
||||
description: Numeric cell value, or null when non-numeric/empty.
|
||||
|
||||
Reference in New Issue
Block a user