Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions counterexamples/places/bad-address-invalid-property.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 0 additions & 16 deletions counterexamples/places/bad-categories-missing-primary.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions counterexamples/places/bad-categories-value.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions counterexamples/places/bad-empty-emails.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions counterexamples/places/bad-empty-phones.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions counterexamples/places/bad-empty-socials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions counterexamples/places/bad-empty-websites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites: []
emails:
Expand Down
2 changes: 0 additions & 2 deletions counterexamples/places/bad-geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ properties:
theme: places
type: place
version: 0
categories:
primary: a_category
2 changes: 0 additions & 2 deletions counterexamples/places/bad-operating-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
- https://www.example.com/
emails:
Expand Down
2 changes: 0 additions & 2 deletions examples/common/timestamp/timestamp-utc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
theme: places
type: place
version: 1
Expand Down
4 changes: 0 additions & 4 deletions examples/places/place-alternate-categories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions examples/places/place-no-emails-phones-socials-websites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
brand:
names:
Expand Down
4 changes: 0 additions & 4 deletions examples/places/place-with-basic-category.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions examples/places/place-with-operating-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com/
Expand Down
5 changes: 0 additions & 5 deletions examples/places/place-with-taxonomy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions examples/places/place.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions examples/places/place2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ properties:
names:
primary: Example
wikidata: Q1000
categories:
primary: some_category
emails:
- info@example.com
phones:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -225,7 +194,6 @@ class Place(OvertureFeature[Literal["places"], Literal["place"]], Named):

# Optional

categories: Categories | None = None
basic_category: Annotated[
SnakeCaseString | None,
Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

This file was deleted.

22 changes: 0 additions & 22 deletions reference/counterexamples/places/bad-categories-value.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions reference/counterexamples/places/bad-empty-emails.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions reference/counterexamples/places/bad-empty-phones.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions reference/counterexamples/places/bad-empty-socials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites:
- https://www.example.com
Expand Down
2 changes: 0 additions & 2 deletions reference/counterexamples/places/bad-empty-websites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
websites: []
emails:
Expand Down
2 changes: 0 additions & 2 deletions reference/counterexamples/places/bad-geometry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ properties:
theme: places
type: place
version: 0
categories:
primary: a_category
2 changes: 0 additions & 2 deletions reference/counterexamples/places/bad-operating-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ geometry:
type: Point
coordinates: [0, 0]
properties:
categories:
primary: some_category
confidence: 0.9
- https://www.example.com/
emails:
Expand Down
Loading
Loading