From 0893ae6db4e61ee18d6a23dc644049f6b4e83d24 Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Thu, 21 May 2026 10:12:34 -0700 Subject: [PATCH 1/8] Added provider, resource, and version parameters to the sourcePropertyItem Signed-off-by: ericgodwin --- .../buildings/bad-sources-empty-provider.yaml | 16 +++++++++ examples/buildings/sources-with-version.yaml | 26 ++++++++++++++ schema/defs.yaml | 36 ++++++++++++++----- 3 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 counterexamples/buildings/bad-sources-empty-provider.yaml create mode 100644 examples/buildings/sources-with-version.yaml diff --git a/counterexamples/buildings/bad-sources-empty-provider.yaml b/counterexamples/buildings/bad-sources-empty-provider.yaml new file mode 100644 index 000000000..59ed1d03e --- /dev/null +++ b/counterexamples/buildings/bad-sources-empty-provider.yaml @@ -0,0 +1,16 @@ +--- +id: overture:buildings:building:1234 +type: Feature +geometry: + type: Polygon + coordinates: [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]] +properties: + theme: buildings + type: building + version: 1 + sources: + - dataset: MyGreatDataset + property: "/geometry" + provider: "" + resource: "" + version: "" diff --git a/examples/buildings/sources-with-version.yaml b/examples/buildings/sources-with-version.yaml new file mode 100644 index 000000000..f341227c0 --- /dev/null +++ b/examples/buildings/sources-with-version.yaml @@ -0,0 +1,26 @@ +--- +id: overture:buildings:building:1234 +type: Feature +geometry: + type: Polygon + coordinates: [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]] +properties: + theme: buildings + type: building + version: 1 + sources: + - property: "/geometry" + dataset: osm-planet + provider: osm + resource: planet + version: '2078-08-28T14:44:41Z' + - property: "/properties/name" + dataset: metaML-buildings + provider: meta + resource: ml-buildings + version: 'abcdef' + - property: "/properties/height" + dataset: microsoft-buildings + provider: microsoft + resource: buildings + version: '352' diff --git a/schema/defs.yaml b/schema/defs.yaml index a20de9047..7b0652ca3 100644 --- a/schema/defs.yaml +++ b/schema/defs.yaml @@ -260,13 +260,14 @@ description: Common schema definitions shared by all themes enum: [left, right] sourcePropertyItem: description: >- - An object storing the source for a specificed property. The property + An object storing the source for a specified property. The property is a reference to the property element within this Feature, and will be referenced using JSON Pointer Notation RFC 6901 - (https://datatracker.ietf.org/doc/rfc6901/). The source dataset for - that referenced property will be specified in the overture list of - approved sources from the Overture Data Working Group that contains - the relevant metadata for that dataset including license source organization. + (https://datatracker.ietf.org/doc/rfc6901/). The source is currently + identified by the dataset field, but will, in the future, be replaced + by the combination of provider, resource, and version fields. + Additional metadata such as license, record_id, update_time, and + confidence may also be provided. type: object required: [property, dataset] allOf: @@ -292,14 +293,31 @@ description: Common schema definitions shared by all themes type: number minimum: 0 maximum: 1 + provider: + type: string + description: >- + The Provider Label for the entity that produced this data + (e.g. osm, meta, esri). + minLength: 1 + resource: + type: string + description: >- + The subject or type of data provided by the provider (e.g. planet, + buildings, division-names). + minLength: 1 + version: + type: string + description: >- + A sortable identifier for the specific snapshot of the resource + (e.g. 2026-02-13, 5.3, A5692). + minLength: 1 sources: description: >- The array of source information for the properties of a given feature, with each entry being a source object which - lists the property in JSON Pointer notation and the dataset - that specific value came from. All features must have a root - level source which is the default source if a specific - property's source is not specified. + lists the property in JSON Pointer notation. All features + must have a root level source which is the default source + if a specific property's source is not specified. type: array items: {"$ref" : "#/$defs/propertyDefinitions/sourcePropertyItem"} minItems: 1 From 55a6f6feb6a1a160e1036445f1e0e6313f547e9a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 May 2026 20:18:51 +0000 Subject: [PATCH 2/8] Allow null for source provider resource version Agent-Logs-Url: https://github.com/OvertureMaps/schema/sessions/2997187e-b460-4134-a7d3-bd9fab7b2c22 Co-authored-by: ericgodwin <1336911+ericgodwin@users.noreply.github.com> --- schema/defs.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/defs.yaml b/schema/defs.yaml index 7b0652ca3..4bce6f440 100644 --- a/schema/defs.yaml +++ b/schema/defs.yaml @@ -294,19 +294,19 @@ description: Common schema definitions shared by all themes minimum: 0 maximum: 1 provider: - type: string + type: [string, "null"] description: >- The Provider Label for the entity that produced this data (e.g. osm, meta, esri). minLength: 1 resource: - type: string + type: [string, "null"] description: >- The subject or type of data provided by the provider (e.g. planet, buildings, division-names). minLength: 1 version: - type: string + type: [string, "null"] description: >- A sortable identifier for the specific snapshot of the resource (e.g. 2026-02-13, 5.3, A5692). From 2d55be2ef75065d1b1c36905e3c0bb89e92763c5 Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Wed, 27 May 2026 08:26:43 -0700 Subject: [PATCH 3/8] Addressed PR comments - added pydantic model, require lowercase, no embedded white space. Signed-off-by: ericgodwin --- .../src/overture/schema/common/sources.py | 33 +++++++++++++ .../tests/test_models.py | 47 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/packages/overture-schema-common/src/overture/schema/common/sources.py b/packages/overture-schema-common/src/overture/schema/common/sources.py index d6e5c282a..c7d38fbb9 100644 --- a/packages/overture-schema-common/src/overture/schema/common/sources.py +++ b/packages/overture-schema-common/src/overture/schema/common/sources.py @@ -86,6 +86,39 @@ class SourceItem(BaseModel): """).strip() ), ] = None + provider: Annotated[ + str | None, + Field( + min_length=1, + pattern=r"^[a-z0-9][a-z0-9._-]*$", + description=textwrap.dedent(""" + The provider label (lowercase with no white space) for the entity that contributed this data + (e.g., osm, meta, esri). + """).strip(), + ), + ] = None + resource: Annotated[ + str | None, + Field( + min_length=1, + pattern=r"^[a-z0-9][a-z0-9._-]*$", + description=textwrap.dedent(""" + The subject or type of data contributed by the provider (lowercase with no white space) + (e.g., planet, buildings, division-names). + """).strip(), + ), + ] = None + version: Annotated[ + str | None, + Field( + min_length=1, + pattern=r"^\S+$", + description=textwrap.dedent(""" + A sortable identifier for the specific snapshot of the resource + (e.g., 2026-02-13, 5.3, A5692). + """).strip(), + ), + ] = None Sources = NewType( diff --git a/packages/overture-schema-common/tests/test_models.py b/packages/overture-schema-common/tests/test_models.py index a2c83e69c..262e06bdc 100644 --- a/packages/overture-schema-common/tests/test_models.py +++ b/packages/overture-schema-common/tests/test_models.py @@ -5,6 +5,8 @@ import pytest from deepdiff import DeepDiff from overture.schema.common.models import OvertureFeature +from overture.schema.common.sources import SourceItem +from pydantic import ValidationError from overture.schema.system.json_schema import GenerateOmitNullableOptionalJsonSchema from overture.schema.system.primitive import ( BBox, @@ -57,6 +59,21 @@ def test_feature_json_schema() -> None: }, "property": {"type": "string"}, "dataset": {"type": "string"}, + "provider": { + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "type": "string", + }, + "resource": { + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "type": "string", + }, + "version": { + "minLength": 1, + "pattern": "^\\S+$", + "type": "string", + }, "license": { "pattern": "^(\\S(.*\\S)?)?$", "type": "string", @@ -510,3 +527,33 @@ def test_feature_validate_json( ) assert feature == validated + + +@pytest.mark.parametrize( + "field_name", + ["provider", "resource", "version"], +) +def test_source_item_rejects_embedded_whitespace(field_name: str) -> None: + payload = { + "property": "", + "dataset": "osm-planet", + field_name: "with space", + } + + with pytest.raises(ValidationError): + SourceItem.model_validate(payload) + + +@pytest.mark.parametrize( + "field_name", + ["provider", "resource"], +) +def test_source_item_rejects_uppercase_in_provider_resource(field_name: str) -> None: + payload = { + "property": "", + "dataset": "osm-planet", + field_name: "ContainsUpper", + } + + with pytest.raises(ValidationError): + SourceItem.model_validate(payload) From 5248fedb0bc338bda1931ef859085056fbac3449 Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Wed, 27 May 2026 08:32:31 -0700 Subject: [PATCH 4/8] Changed wording from produced to contributed Signed-off-by: ericgodwin --- schema/defs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/defs.yaml b/schema/defs.yaml index 4bce6f440..edfe4e086 100644 --- a/schema/defs.yaml +++ b/schema/defs.yaml @@ -296,13 +296,13 @@ description: Common schema definitions shared by all themes provider: type: [string, "null"] description: >- - The Provider Label for the entity that produced this data + The Provider Label for the entity that contributed this data (e.g. osm, meta, esri). minLength: 1 resource: type: [string, "null"] description: >- - The subject or type of data provided by the provider (e.g. planet, + The subject or type of data contributed by the provider (e.g. planet, buildings, division-names). minLength: 1 version: From 2369d81d5a551601ba0e5de1c8efb0d8867ea9c5 Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Thu, 28 May 2026 12:31:49 -0700 Subject: [PATCH 5/8] test: regenerate golden baseline schemas for new source fields Update all 15 baseline JSON schema files to include the new provider, resource, and version fields added to the sources model. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ericgodwin --- .../tests/address_baseline_schema.json | 21 +++++++++++++++++++ .../tests/bathymetry_baseline_schema.json | 21 +++++++++++++++++++ .../tests/infrastructure_baseline_schema.json | 21 +++++++++++++++++++ .../tests/land_baseline_schema.json | 21 +++++++++++++++++++ .../tests/land_cover_baseline_schema.json | 21 +++++++++++++++++++ .../tests/land_use_baseline_schema.json | 21 +++++++++++++++++++ .../tests/water_baseline_schema.json | 21 +++++++++++++++++++ .../tests/building_baseline_schema.json | 21 +++++++++++++++++++ .../tests/building_part_baseline_schema.json | 21 +++++++++++++++++++ .../tests/division_area_baseline_schema.json | 21 +++++++++++++++++++ .../tests/division_baseline_schema.json | 21 +++++++++++++++++++ .../division_boundary_baseline_schema.json | 21 +++++++++++++++++++ .../tests/place_baseline_schema.json | 21 +++++++++++++++++++ .../tests/connector_baseline_schema.json | 21 +++++++++++++++++++ .../tests/segment_baseline_schema.json | 21 +++++++++++++++++++ 15 files changed, 315 insertions(+) diff --git a/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json b/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json index 1ae5a6ab6..3171a069c 100644 --- a/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json +++ b/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json @@ -54,16 +54,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json b/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json index c7b14a349..1523bb6bc 100644 --- a/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json @@ -75,16 +75,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json b/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json index c53570380..305cab758 100644 --- a/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json @@ -384,16 +384,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-base-theme/tests/land_baseline_schema.json b/packages/overture-schema-base-theme/tests/land_baseline_schema.json index be1f6d780..ba4d14ca3 100644 --- a/packages/overture-schema-base-theme/tests/land_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/land_baseline_schema.json @@ -257,16 +257,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json b/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json index a104da44a..68fe9649e 100644 --- a/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json @@ -92,16 +92,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json b/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json index c1ad6e97f..9a85a8c8a 100644 --- a/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json @@ -335,16 +335,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-base-theme/tests/water_baseline_schema.json b/packages/overture-schema-base-theme/tests/water_baseline_schema.json index fd78c6fb9..cf16ab281 100644 --- a/packages/overture-schema-base-theme/tests/water_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/water_baseline_schema.json @@ -188,16 +188,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json b/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json index 31d563883..99de3ab52 100644 --- a/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json +++ b/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json @@ -371,16 +371,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json b/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json index 760f53efd..e1c6d0430 100644 --- a/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json +++ b/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json @@ -257,16 +257,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json b/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json index 3838c20e0..0c1472f8c 100644 --- a/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json +++ b/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json @@ -216,16 +216,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json b/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json index 8097ee0df..e780c8c62 100644 --- a/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json +++ b/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json @@ -319,16 +319,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json b/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json index 82b9b38b9..aa21d9fd5 100644 --- a/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json +++ b/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json @@ -106,16 +106,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-places-theme/tests/place_baseline_schema.json b/packages/overture-schema-places-theme/tests/place_baseline_schema.json index b8752ff24..c3dcb809b 100644 --- a/packages/overture-schema-places-theme/tests/place_baseline_schema.json +++ b/packages/overture-schema-places-theme/tests/place_baseline_schema.json @@ -283,16 +283,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json b/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json index a51faf3f0..8e74212c6 100644 --- a/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json +++ b/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json @@ -39,16 +39,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ diff --git a/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json b/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json index 4ec108313..6b30a4bb0 100644 --- a/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json +++ b/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json @@ -1165,16 +1165,37 @@ "title": "Property", "type": "string" }, + "provider": { + "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Provider", + "type": "string" + }, "record_id": { "description": "Identifies the specific record within the source dataset where the source data can\nbe found.\n\nThe format of record identifiers is dataset-specific.", "title": "Record Id", "type": "string" }, + "resource": { + "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "minLength": 1, + "pattern": "^[a-z0-9][a-z0-9._-]*$", + "title": "Resource", + "type": "string" + }, "update_time": { "description": "Last update time of the source data record.", "format": "date-time", "title": "Update Time", "type": "string" + }, + "version": { + "description": "A sortable identifier for the specific snapshot of the resource\n(e.g., 2026-02-13, 5.3, A5692).", + "minLength": 1, + "pattern": "^\\S+$", + "title": "Version", + "type": "string" } }, "required": [ From 0fefe80c52b68dd1240db5f46631b14a2f18c93a Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Thu, 28 May 2026 12:35:06 -0700 Subject: [PATCH 6/8] style: fix import ordering in test_models.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ericgodwin --- packages/overture-schema-common/tests/test_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/overture-schema-common/tests/test_models.py b/packages/overture-schema-common/tests/test_models.py index 262e06bdc..018dd2e28 100644 --- a/packages/overture-schema-common/tests/test_models.py +++ b/packages/overture-schema-common/tests/test_models.py @@ -6,12 +6,12 @@ from deepdiff import DeepDiff from overture.schema.common.models import OvertureFeature from overture.schema.common.sources import SourceItem -from pydantic import ValidationError from overture.schema.system.json_schema import GenerateOmitNullableOptionalJsonSchema from overture.schema.system.primitive import ( BBox, Geometry, ) +from pydantic import ValidationError from shapely.geometry import LineString, Point From 2fe0540f11adc1500e0d14f71d77db036fa055a9 Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Thu, 4 Jun 2026 11:57:20 -0700 Subject: [PATCH 7/8] refactor: use SnakeCaseString and NoWhitespaceString for source fields Replace inline regex patterns with the existing system string types: - provider: SnakeCaseString (^[a-z0-9]+(_[a-z0-9]+)*$) - resource: SnakeCaseString (^[a-z0-9]+(_[a-z0-9]+)*$) - version: NoWhitespaceString (^\S+$) Update example to use underscores instead of hyphens for resource names (e.g., ml_buildings instead of ml-buildings). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ericgodwin --- examples/buildings/sources-with-version.yaml | 2 +- .../tests/address_baseline_schema.json | 8 +++---- .../tests/bathymetry_baseline_schema.json | 8 +++---- .../tests/infrastructure_baseline_schema.json | 8 +++---- .../tests/land_baseline_schema.json | 8 +++---- .../tests/land_cover_baseline_schema.json | 8 +++---- .../tests/land_use_baseline_schema.json | 8 +++---- .../tests/water_baseline_schema.json | 8 +++---- .../tests/building_baseline_schema.json | 8 +++---- .../tests/building_part_baseline_schema.json | 8 +++---- .../src/overture/schema/common/sources.py | 22 ++++++++++--------- .../tests/test_models.py | 4 ++-- .../tests/division_area_baseline_schema.json | 8 +++---- .../tests/division_baseline_schema.json | 8 +++---- .../division_boundary_baseline_schema.json | 8 +++---- .../tests/place_baseline_schema.json | 8 +++---- .../tests/connector_baseline_schema.json | 8 +++---- .../tests/segment_baseline_schema.json | 8 +++---- 18 files changed, 75 insertions(+), 73 deletions(-) diff --git a/examples/buildings/sources-with-version.yaml b/examples/buildings/sources-with-version.yaml index f341227c0..d65debd85 100644 --- a/examples/buildings/sources-with-version.yaml +++ b/examples/buildings/sources-with-version.yaml @@ -17,7 +17,7 @@ properties: - property: "/properties/name" dataset: metaML-buildings provider: meta - resource: ml-buildings + resource: ml_buildings version: 'abcdef' - property: "/properties/height" dataset: microsoft-buildings diff --git a/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json b/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json index 3171a069c..69fcb73c6 100644 --- a/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json +++ b/packages/overture-schema-addresses-theme/tests/address_baseline_schema.json @@ -55,9 +55,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -67,9 +67,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json b/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json index 1523bb6bc..6e11a6057 100644 --- a/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/bathymetry_baseline_schema.json @@ -76,9 +76,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -88,9 +88,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json b/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json index 305cab758..9b2d4f1d8 100644 --- a/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/infrastructure_baseline_schema.json @@ -385,9 +385,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -397,9 +397,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-base-theme/tests/land_baseline_schema.json b/packages/overture-schema-base-theme/tests/land_baseline_schema.json index ba4d14ca3..a299e8574 100644 --- a/packages/overture-schema-base-theme/tests/land_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/land_baseline_schema.json @@ -258,9 +258,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -270,9 +270,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json b/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json index 68fe9649e..98c372db0 100644 --- a/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/land_cover_baseline_schema.json @@ -93,9 +93,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -105,9 +105,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json b/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json index 9a85a8c8a..97cd3c13d 100644 --- a/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/land_use_baseline_schema.json @@ -336,9 +336,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -348,9 +348,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-base-theme/tests/water_baseline_schema.json b/packages/overture-schema-base-theme/tests/water_baseline_schema.json index cf16ab281..94a796c01 100644 --- a/packages/overture-schema-base-theme/tests/water_baseline_schema.json +++ b/packages/overture-schema-base-theme/tests/water_baseline_schema.json @@ -189,9 +189,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -201,9 +201,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json b/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json index 99de3ab52..ab7542026 100644 --- a/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json +++ b/packages/overture-schema-buildings-theme/tests/building_baseline_schema.json @@ -372,9 +372,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -384,9 +384,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json b/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json index e1c6d0430..3c8d750a5 100644 --- a/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json +++ b/packages/overture-schema-buildings-theme/tests/building_part_baseline_schema.json @@ -258,9 +258,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -270,9 +270,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-common/src/overture/schema/common/sources.py b/packages/overture-schema-common/src/overture/schema/common/sources.py index c7d38fbb9..0d1326be5 100644 --- a/packages/overture-schema-common/src/overture/schema/common/sources.py +++ b/packages/overture-schema-common/src/overture/schema/common/sources.py @@ -12,7 +12,12 @@ from overture.schema.common.types import ConfidenceScore from overture.schema.system.field_constraint import UniqueItemsConstraint from overture.schema.system.model_constraint import no_extra_fields -from overture.schema.system.string import JsonPointer, StrippedString +from overture.schema.system.string import ( + JsonPointer, + NoWhitespaceString, + SnakeCaseString, + StrippedString, +) @no_extra_fields @@ -87,32 +92,29 @@ class SourceItem(BaseModel): ), ] = None provider: Annotated[ - str | None, + SnakeCaseString | None, Field( min_length=1, - pattern=r"^[a-z0-9][a-z0-9._-]*$", description=textwrap.dedent(""" - The provider label (lowercase with no white space) for the entity that contributed this data + The provider label for the entity that contributed this data (e.g., osm, meta, esri). """).strip(), ), ] = None resource: Annotated[ - str | None, + SnakeCaseString | None, Field( min_length=1, - pattern=r"^[a-z0-9][a-z0-9._-]*$", description=textwrap.dedent(""" - The subject or type of data contributed by the provider (lowercase with no white space) - (e.g., planet, buildings, division-names). + The subject or type of data contributed by the provider + (e.g., planet, buildings, division_names). """).strip(), ), ] = None version: Annotated[ - str | None, + NoWhitespaceString | None, Field( min_length=1, - pattern=r"^\S+$", description=textwrap.dedent(""" A sortable identifier for the specific snapshot of the resource (e.g., 2026-02-13, 5.3, A5692). diff --git a/packages/overture-schema-common/tests/test_models.py b/packages/overture-schema-common/tests/test_models.py index 018dd2e28..cc8003ae5 100644 --- a/packages/overture-schema-common/tests/test_models.py +++ b/packages/overture-schema-common/tests/test_models.py @@ -61,12 +61,12 @@ def test_feature_json_schema() -> None: "dataset": {"type": "string"}, "provider": { "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "type": "string", }, "resource": { "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "type": "string", }, "version": { diff --git a/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json b/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json index 0c1472f8c..862061a7c 100644 --- a/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json +++ b/packages/overture-schema-divisions-theme/tests/division_area_baseline_schema.json @@ -217,9 +217,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -229,9 +229,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json b/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json index e780c8c62..a542515f4 100644 --- a/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json +++ b/packages/overture-schema-divisions-theme/tests/division_baseline_schema.json @@ -320,9 +320,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -332,9 +332,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json b/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json index aa21d9fd5..986753743 100644 --- a/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json +++ b/packages/overture-schema-divisions-theme/tests/division_boundary_baseline_schema.json @@ -107,9 +107,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -119,9 +119,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-places-theme/tests/place_baseline_schema.json b/packages/overture-schema-places-theme/tests/place_baseline_schema.json index c3dcb809b..8805de8e6 100644 --- a/packages/overture-schema-places-theme/tests/place_baseline_schema.json +++ b/packages/overture-schema-places-theme/tests/place_baseline_schema.json @@ -284,9 +284,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -296,9 +296,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json b/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json index 8e74212c6..dab0d3051 100644 --- a/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json +++ b/packages/overture-schema-transportation-theme/tests/connector_baseline_schema.json @@ -40,9 +40,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -52,9 +52,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, diff --git a/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json b/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json index 6b30a4bb0..d121e69c4 100644 --- a/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json +++ b/packages/overture-schema-transportation-theme/tests/segment_baseline_schema.json @@ -1166,9 +1166,9 @@ "type": "string" }, "provider": { - "description": "The provider label (lowercase with no white space) for the entity that contributed this data\n(e.g., osm, meta, esri).", + "description": "The provider label for the entity that contributed this data\n(e.g., osm, meta, esri).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Provider", "type": "string" }, @@ -1178,9 +1178,9 @@ "type": "string" }, "resource": { - "description": "The subject or type of data contributed by the provider (lowercase with no white space)\n(e.g., planet, buildings, division-names).", + "description": "The subject or type of data contributed by the provider\n(e.g., planet, buildings, division_names).", "minLength": 1, - "pattern": "^[a-z0-9][a-z0-9._-]*$", + "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", "title": "Resource", "type": "string" }, From c47e5f97d801d33599586334c35812bcc6e3e361 Mon Sep 17 00:00:00 2001 From: ericgodwin Date: Thu, 18 Jun 2026 11:32:31 -0700 Subject: [PATCH 8/8] fix: change provider/resource/version type from [string, "null"] to string Optionality is already handled by the fields not being in the required list. The quoted "null" was incorrect JSON Schema syntax and did not actually allow JSON null values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ericgodwin --- schema/defs.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/defs.yaml b/schema/defs.yaml index edfe4e086..53bf92d92 100644 --- a/schema/defs.yaml +++ b/schema/defs.yaml @@ -294,19 +294,19 @@ description: Common schema definitions shared by all themes minimum: 0 maximum: 1 provider: - type: [string, "null"] + type: string description: >- The Provider Label for the entity that contributed this data (e.g. osm, meta, esri). minLength: 1 resource: - type: [string, "null"] + type: string description: >- The subject or type of data contributed by the provider (e.g. planet, buildings, division-names). minLength: 1 version: - type: [string, "null"] + type: string description: >- A sortable identifier for the specific snapshot of the resource (e.g. 2026-02-13, 5.3, A5692).