diff --git a/counterexamples/places/bad-address-invalid-property.yaml b/counterexamples/places/bad-address-invalid-property.yaml index c87e018ab..03930d1a4 100644 --- a/counterexamples/places/bad-address-invalid-property.yaml +++ b/counterexamples/places/bad-address-invalid-property.yaml @@ -11,8 +11,6 @@ properties: version: 0 names: primary: Fancy POI with invalid address property (region2) - categories: - primary: some_category addresses: - freeform: "770 Broadway, Floor 8" locality: "New York" diff --git a/counterexamples/places/bad-categories-missing-primary.yaml b/counterexamples/places/bad-categories-missing-primary.yaml deleted file mode 100644 index 9e797e228..000000000 --- a/counterexamples/places/bad-categories-missing-primary.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: overture:places:place:1 -type: Feature -geometry: - type: Point - coordinates: [0, 0] -properties: - ext_expected_errors: ["missing property 'primary'"] - theme: places - type: place - version: 1 - names: - primary: Fancy POI missing primary category property - categories: - alternate: - - some_category diff --git a/counterexamples/places/bad-categories-value.yaml b/counterexamples/places/bad-categories-value.yaml deleted file mode 100644 index 31f853a60..000000000 --- a/counterexamples/places/bad-categories-value.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: counterexample:place:bad-categories-values -type: Feature -geometry: - type: Point - coordinates: [0, 0] -properties: - ext_expected_errors: - - "'foo_' does not match pattern" - - "' bar ' does not match pattern" - - "'BAZ' does not match pattern" - theme: places - type: place - version: 1 - categories: - primary: foo_ - alternate: - - " bar " - - BAZ - confidence: 0.9 - names: - primary: Problematic POI with problematic categories diff --git a/counterexamples/places/bad-empty-emails.yaml b/counterexamples/places/bad-empty-emails.yaml index 765034436..ceadf1bab 100644 --- a/counterexamples/places/bad-empty-emails.yaml +++ b/counterexamples/places/bad-empty-emails.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/counterexamples/places/bad-empty-phones.yaml b/counterexamples/places/bad-empty-phones.yaml index ea48419cc..7e75d3323 100644 --- a/counterexamples/places/bad-empty-phones.yaml +++ b/counterexamples/places/bad-empty-phones.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/counterexamples/places/bad-empty-socials.yaml b/counterexamples/places/bad-empty-socials.yaml index 3f45d54cf..946d122a9 100644 --- a/counterexamples/places/bad-empty-socials.yaml +++ b/counterexamples/places/bad-empty-socials.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/counterexamples/places/bad-empty-websites.yaml b/counterexamples/places/bad-empty-websites.yaml index 0a28806eb..1b3136df5 100644 --- a/counterexamples/places/bad-empty-websites.yaml +++ b/counterexamples/places/bad-empty-websites.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: [] emails: diff --git a/counterexamples/places/bad-geometry.yaml b/counterexamples/places/bad-geometry.yaml index 917eee5a0..6568b028d 100644 --- a/counterexamples/places/bad-geometry.yaml +++ b/counterexamples/places/bad-geometry.yaml @@ -8,5 +8,3 @@ properties: theme: places type: place version: 0 - categories: - primary: a_category diff --git a/counterexamples/places/bad-operating-status.yaml b/counterexamples/places/bad-operating-status.yaml index 83888870a..1de6d12d5 100644 --- a/counterexamples/places/bad-operating-status.yaml +++ b/counterexamples/places/bad-operating-status.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 - https://www.example.com/ emails: diff --git a/examples/common/timestamp/timestamp-utc.yaml b/examples/common/timestamp/timestamp-utc.yaml index 0018b9ba9..cf5f6ed25 100644 --- a/examples/common/timestamp/timestamp-utc.yaml +++ b/examples/common/timestamp/timestamp-utc.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category theme: places type: place version: 1 diff --git a/examples/places/place-alternate-categories.yaml b/examples/places/place-alternate-categories.yaml index 17f771262..660263dd3 100644 --- a/examples/places/place-alternate-categories.yaml +++ b/examples/places/place-alternate-categories.yaml @@ -5,10 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: the1_category_you_want_first - alternate: - - another_category confidence: 0.9 websites: - https://www.example.com diff --git a/examples/places/place-no-emails-phones-socials-websites.yaml b/examples/places/place-no-emails-phones-socials-websites.yaml index e1aafb250..e9ebaad15 100644 --- a/examples/places/place-no-emails-phones-socials-websites.yaml +++ b/examples/places/place-no-emails-phones-socials-websites.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 brand: names: diff --git a/examples/places/place-with-basic-category.yaml b/examples/places/place-with-basic-category.yaml index 37c0667b0..6bc68e1ff 100644 --- a/examples/places/place-with-basic-category.yaml +++ b/examples/places/place-with-basic-category.yaml @@ -6,10 +6,6 @@ geometry: coordinates: [0, 0] properties: basic_category: casual_eatery - categories: - primary: gas_station_sushi - alternate: - - just_for_fun confidence: 0.9 websites: - https://www.example.com diff --git a/examples/places/place-with-operating-status.yaml b/examples/places/place-with-operating-status.yaml index 145b40560..a7ade9b22 100644 --- a/examples/places/place-with-operating-status.yaml +++ b/examples/places/place-with-operating-status.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com/ diff --git a/examples/places/place-with-taxonomy.yaml b/examples/places/place-with-taxonomy.yaml index 450ce0cc3..835b89ae3 100644 --- a/examples/places/place-with-taxonomy.yaml +++ b/examples/places/place-with-taxonomy.yaml @@ -16,11 +16,6 @@ properties: alternates: - gas_station - sushi_restaurant - categories: - primary: gas_station_sushi - alternate: - - gas_station - - sushi_restaurant confidence: 0.85 websites: - https://www.buckysgas.example.com diff --git a/examples/places/place.yaml b/examples/places/place.yaml index cbcbc03e1..d8c92ec36 100644 --- a/examples/places/place.yaml +++ b/examples/places/place.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/examples/places/place2.yaml b/examples/places/place2.yaml index 6a7ac50d9..6e7fe9089 100644 --- a/examples/places/place2.yaml +++ b/examples/places/place2.yaml @@ -16,8 +16,6 @@ properties: names: primary: Example wikidata: Q1000 - categories: - primary: some_category emails: - info@example.com phones: diff --git a/packages/overture-schema-cli/tests/test_heterogeneous_collections.py b/packages/overture-schema-cli/tests/test_heterogeneous_collections.py index e3c9d93d8..ed34de7a6 100644 --- a/packages/overture-schema-cli/tests/test_heterogeneous_collections.py +++ b/packages/overture-schema-cli/tests/test_heterogeneous_collections.py @@ -20,7 +20,6 @@ def heterogeneous_collection_json() -> str: geometry_type="Point", coordinates=[0.5, 0.5], operating_status="open", - categories={"primary": "restaurant"}, names={"primary": "Valid Place"}, ) return json.dumps([building, place]) @@ -55,7 +54,6 @@ def heterogeneous_with_missing_fields_json() -> str: type="place", geometry_type="Point", coordinates=[6.5, 6.5], - categories={"primary": "restaurant"}, names={"primary": "Place missing required field"}, ) return json.dumps([building1, building2, building3, place]) diff --git a/packages/overture-schema-places-theme/src/overture/schema/places/__init__.py b/packages/overture-schema-places-theme/src/overture/schema/places/__init__.py index 6f77edc42..1785651b4 100644 --- a/packages/overture-schema-places-theme/src/overture/schema/places/__init__.py +++ b/packages/overture-schema-places-theme/src/overture/schema/places/__init__.py @@ -6,6 +6,6 @@ __path__ = __import__("pkgutil").extend_path(__path__, __name__) -from .place import Address, Brand, Categories, OperatingStatus, Place +from .place import Address, Brand, OperatingStatus, Place -__all__ = ["Address", "Brand", "Categories", "OperatingStatus", "Place"] +__all__ = ["Address", "Brand", "OperatingStatus", "Place"] diff --git a/packages/overture-schema-places-theme/src/overture/schema/places/place.py b/packages/overture-schema-places-theme/src/overture/schema/places/place.py index b7ac4d415..445fdfd9d 100644 --- a/packages/overture-schema-places-theme/src/overture/schema/places/place.py +++ b/packages/overture-schema-places-theme/src/overture/schema/places/place.py @@ -51,37 +51,6 @@ class OperatingStatus(str, Enum): TEMPORARILY_CLOSED = "temporarily_closed" -@no_extra_fields -class Categories(BaseModel): - """ - Categories a place belongs to. - - Complete list is available on GitHub: https://github.com/OvertureMaps/schema/blob/main/docs/schema/concepts/by-theme/places/overture_categories.csv - """ - - # Required - - primary: Annotated[ - SnakeCaseString, - Field(description="The primary or main category of the place."), - ] - - # Optional - - alternate: Annotated[ - list[SnakeCaseString] | None, - Field( - description=textwrap.dedent(""" - Alternate categories of the place. - - Some places might fit into two categories, e.g., a book store and a coffee shop. In - these cases, the primary category can be augmented with additional categories. - """).strip(), - ), - UniqueItemsConstraint(), - ] = None - - @no_extra_fields class Taxonomy(BaseModel): """ @@ -225,7 +194,6 @@ class Place(OvertureFeature[Literal["places"], Literal["place"]], Named): # Optional - categories: Categories | None = None basic_category: Annotated[ SnakeCaseString | None, Field( 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 b4d37759b..57468fd59 100644 --- a/packages/overture-schema-places-theme/tests/place_baseline_schema.json +++ b/packages/overture-schema-places-theme/tests/place_baseline_schema.json @@ -56,34 +56,6 @@ "title": "Brand", "type": "object" }, - "Categories": { - "additionalProperties": false, - "description": "Categories a place belongs to.\n\nComplete list is available on GitHub: https://github.com/OvertureMaps/schema/blob/main/docs/schema/concepts/by-theme/places/overture_categories.csv", - "properties": { - "alternate": { - "description": "Alternate categories of the place.\n\nSome places might fit into two categories, e.g., a book store and a coffee shop. In\nthese cases, the primary category can be augmented with additional categories.", - "items": { - "description": "Category in snake_case format", - "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", - "type": "string" - }, - "title": "Alternate", - "type": "array", - "uniqueItems": true - }, - "primary": { - "description": "The primary or main category of the place.", - "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$", - "title": "Primary", - "type": "string" - } - }, - "required": [ - "primary" - ], - "title": "Categories", - "type": "object" - }, "NameRule": { "additionalProperties": false, "description": "A rule that can be evaluated to determine the name in advanced scenarios.\n\nName rules are used for cases where the primary name is not sufficient; the common name is not\nthe right fit for the use case and another variant is needed; or where the name only applies in\ncertain specific circumstances.\n\nExamples might include:\n- An official, alternate, or short name.\n- A name that only applies to part of a linear path like a road segment (geometric range\n scoping).\n- A name that only applies to the left or right side of a linear path like a road segment (side\n scoping).\n- A name that is only accepted by some political perspectives.", @@ -428,9 +400,6 @@ "$ref": "#/$defs/Brand", "description": "The brand associated with the place." }, - "categories": { - "$ref": "#/$defs/Categories" - }, "confidence": { "description": "A score between 0 and 1 indicating how confident we are that the place exists.\n\nA confidence score of 0 indicates that we are certain the place doesn't exist\nanymore and will always be paired with an `operating_status` of\n`\"permanently_closed\"`.\n\nA confidence score of 1 indicates that we are certain the place does exist.\n\nIf there is no value for confidence, it means we don't have enough information on\nwhich to estimate our confidence level.", "maximum": 1.0, diff --git a/reference/counterexamples/places/bad-address-invalid-property.yaml b/reference/counterexamples/places/bad-address-invalid-property.yaml index 12ada7bbe..97814a418 100644 --- a/reference/counterexamples/places/bad-address-invalid-property.yaml +++ b/reference/counterexamples/places/bad-address-invalid-property.yaml @@ -12,8 +12,6 @@ properties: version: 0 names: primary: Fancy POI with invalid address property (region2) - categories: - primary: some_category addresses: - freeform: "770 Broadway, Floor 8" locality: "New York" diff --git a/reference/counterexamples/places/bad-categories-missing-primary.yaml b/reference/counterexamples/places/bad-categories-missing-primary.yaml deleted file mode 100644 index 9e797e228..000000000 --- a/reference/counterexamples/places/bad-categories-missing-primary.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: overture:places:place:1 -type: Feature -geometry: - type: Point - coordinates: [0, 0] -properties: - ext_expected_errors: ["missing property 'primary'"] - theme: places - type: place - version: 1 - names: - primary: Fancy POI missing primary category property - categories: - alternate: - - some_category diff --git a/reference/counterexamples/places/bad-categories-value.yaml b/reference/counterexamples/places/bad-categories-value.yaml deleted file mode 100644 index 31f853a60..000000000 --- a/reference/counterexamples/places/bad-categories-value.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: counterexample:place:bad-categories-values -type: Feature -geometry: - type: Point - coordinates: [0, 0] -properties: - ext_expected_errors: - - "'foo_' does not match pattern" - - "' bar ' does not match pattern" - - "'BAZ' does not match pattern" - theme: places - type: place - version: 1 - categories: - primary: foo_ - alternate: - - " bar " - - BAZ - confidence: 0.9 - names: - primary: Problematic POI with problematic categories diff --git a/reference/counterexamples/places/bad-empty-emails.yaml b/reference/counterexamples/places/bad-empty-emails.yaml index 765034436..ceadf1bab 100644 --- a/reference/counterexamples/places/bad-empty-emails.yaml +++ b/reference/counterexamples/places/bad-empty-emails.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/reference/counterexamples/places/bad-empty-phones.yaml b/reference/counterexamples/places/bad-empty-phones.yaml index ea48419cc..7e75d3323 100644 --- a/reference/counterexamples/places/bad-empty-phones.yaml +++ b/reference/counterexamples/places/bad-empty-phones.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/reference/counterexamples/places/bad-empty-socials.yaml b/reference/counterexamples/places/bad-empty-socials.yaml index 3f45d54cf..946d122a9 100644 --- a/reference/counterexamples/places/bad-empty-socials.yaml +++ b/reference/counterexamples/places/bad-empty-socials.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com diff --git a/reference/counterexamples/places/bad-empty-websites.yaml b/reference/counterexamples/places/bad-empty-websites.yaml index 0a28806eb..1b3136df5 100644 --- a/reference/counterexamples/places/bad-empty-websites.yaml +++ b/reference/counterexamples/places/bad-empty-websites.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: [] emails: diff --git a/reference/counterexamples/places/bad-geometry.yaml b/reference/counterexamples/places/bad-geometry.yaml index 917eee5a0..6568b028d 100644 --- a/reference/counterexamples/places/bad-geometry.yaml +++ b/reference/counterexamples/places/bad-geometry.yaml @@ -8,5 +8,3 @@ properties: theme: places type: place version: 0 - categories: - primary: a_category diff --git a/reference/counterexamples/places/bad-operating-status.yaml b/reference/counterexamples/places/bad-operating-status.yaml index 83888870a..1de6d12d5 100644 --- a/reference/counterexamples/places/bad-operating-status.yaml +++ b/reference/counterexamples/places/bad-operating-status.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 - https://www.example.com/ emails: diff --git a/reference/examples/common/timestamp/timestamp-utc.yaml b/reference/examples/common/timestamp/timestamp-utc.yaml index 0018b9ba9..cf5f6ed25 100644 --- a/reference/examples/common/timestamp/timestamp-utc.yaml +++ b/reference/examples/common/timestamp/timestamp-utc.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category theme: places type: place version: 1 diff --git a/reference/examples/places/place-alternate-categories.yaml b/reference/examples/places/place-alternate-categories.yaml index 0245c65dc..095407105 100644 --- a/reference/examples/places/place-alternate-categories.yaml +++ b/reference/examples/places/place-alternate-categories.yaml @@ -5,10 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: the1_category_you_want_first - alternate: - - another_category confidence: 0.9 websites: - https://www.example.com/ diff --git a/reference/examples/places/place-no-emails-phones-socials-websites.yaml b/reference/examples/places/place-no-emails-phones-socials-websites.yaml index e1aafb250..e9ebaad15 100644 --- a/reference/examples/places/place-no-emails-phones-socials-websites.yaml +++ b/reference/examples/places/place-no-emails-phones-socials-websites.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 brand: names: diff --git a/reference/examples/places/place-with-basic-category.yaml b/reference/examples/places/place-with-basic-category.yaml index ea3fbefcd..fba06fb17 100644 --- a/reference/examples/places/place-with-basic-category.yaml +++ b/reference/examples/places/place-with-basic-category.yaml @@ -6,10 +6,6 @@ geometry: coordinates: [0, 0] properties: basic_category: casual_eatery - categories: - primary: gas_station_sushi - alternate: - - just_for_fun confidence: 0.9 websites: - https://www.example.com/ diff --git a/reference/examples/places/place-with-operating-status.yaml b/reference/examples/places/place-with-operating-status.yaml index 145b40560..a7ade9b22 100644 --- a/reference/examples/places/place-with-operating-status.yaml +++ b/reference/examples/places/place-with-operating-status.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com/ diff --git a/reference/examples/places/place-with-taxonomy.yaml b/reference/examples/places/place-with-taxonomy.yaml index 3dd33b30a..80a2804c5 100644 --- a/reference/examples/places/place-with-taxonomy.yaml +++ b/reference/examples/places/place-with-taxonomy.yaml @@ -16,11 +16,6 @@ properties: alternates: - gas_station - sushi_restaurant - categories: - primary: gas_station_sushi - alternate: - - gas_station - - sushi_restaurant confidence: 0.85 websites: - https://www.buckysgas.example.com/ diff --git a/reference/examples/places/place.yaml b/reference/examples/places/place.yaml index 66dd59e97..a636a034f 100644 --- a/reference/examples/places/place.yaml +++ b/reference/examples/places/place.yaml @@ -5,8 +5,6 @@ geometry: type: Point coordinates: [0, 0] properties: - categories: - primary: some_category confidence: 0.9 websites: - https://www.example.com/ diff --git a/reference/examples/places/place2.yaml b/reference/examples/places/place2.yaml index ac70b11df..0652a9246 100644 --- a/reference/examples/places/place2.yaml +++ b/reference/examples/places/place2.yaml @@ -16,8 +16,6 @@ properties: names: primary: Example wikidata: Q1000 - categories: - primary: some_category emails: - info@example.com phones: diff --git a/schema/places/place.yaml b/schema/places/place.yaml index 3c741aea2..9c1a7e7d9 100644 --- a/schema/places/place.yaml +++ b/schema/places/place.yaml @@ -21,26 +21,6 @@ properties: - "$ref": ../defs.yaml#/$defs/propertyContainers/overtureFeaturePropertiesContainer - "$ref": ../defs.yaml#/$defs/propertyContainers/namesContainer properties: - categories: - description: | - The categories of the place. Complete list is available on - GitHub: https://github.com/OvertureMaps/schema/blob/main/docs/schema/concepts/by-theme/places/overture_categories.csv - type: object - required: [primary] - properties: - primary: - description: The primary or main category of the place. This can be empty. - "$ref": "./defs.yaml#/$defs/typeDefinitions/category" - alternate: - description: - Alternate categories of the place. Some places might fit into two - categories, e.g. a book store and a coffee shop. In such a case, - the primary category can be augmented with additional applicable - categories. - type: array - items: - "$ref": "./defs.yaml#/$defs/typeDefinitions/category" - uniqueItems: true basic_category: description: >- The basic level category of a place. At present this is a mapping of the categories.primary entry to a new, simplified name. This mapping can be 1:1 or M:1 from the