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/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-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..018dd2e28 100644 --- a/packages/overture-schema-common/tests/test_models.py +++ b/packages/overture-schema-common/tests/test_models.py @@ -5,11 +5,13 @@ import pytest from deepdiff import DeepDiff from overture.schema.common.models import OvertureFeature +from overture.schema.common.sources import SourceItem 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 @@ -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) 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": [ diff --git a/schema/defs.yaml b/schema/defs.yaml index a20de9047..edfe4e086 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, "null"] + description: >- + 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 contributed by the provider (e.g. planet, + buildings, division-names). + minLength: 1 + version: + type: [string, "null"] + 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