schemamarkup.wikiThe schema.org and structured data reference

Places, areaServed and containedInPlace

From schemamarkup.wiki, the sourced reference on schema.org and structured data

A business's location and the area it serves are themselves entities. Schema.org's Place covers "entities that have a somewhat fixed, physical extension," and its subtype AdministrativeArea, "a geographical region, typically under the jurisdiction of a particular government," has the subtypes City, Country, SchoolDistrict, State.[1][2] This page covers place types, the containment and coordinate properties, and areaServed, "the geographic area where a service or offered item is provided."[3] Street addresses, opening hours and GeoCircle service radii are covered on Address, hours and service areas.

Place types

Place's direct subtypes in the current release are Accommodation, AdministrativeArea, CivicStructure, DefinedRegion, Landform, LandmarksOrHistoricalBuildings, LocalBusiness, Residence, TouristAttraction, TouristDestination.[1] LocalBusiness is a subtype of both Organization and Place, which is why a business can carry Place properties such as geo and containedInPlace.[4]

For areas, the useful types are AdministrativeArea and its subtypes City ("a city or town"), State ("a state or province of a country") and Country ("a country").[5][6][7] Schema.org has no County type in the current release, so a county is best typed as AdministrativeArea rather than City.[2][8]

Place properties that carry meaning

PropertyExpected valuesSchema.org definition (quoted)
geoGeoCoordinates, GeoShape"The geo coordinates of the place."[9]
containedInPlacePlace"The basic containment relation between a place and one that contains it."[10]
containsPlacePlace"The basic containment relation between a place and another that it contains."[11]
addressPostalAddress, Text"Physical address of the item."[12]
hasMapMap, URL"A URL to a map of the place."[13]
sameAsURL"URL of a reference Web page that unambiguously indicates the item's identity."[14]

containedInPlace is "the basic containment relation between a place and one that contains it," and containsPlace is its inverse.[10][11] A City node can therefore state that it is containedInPlace a State, and a business that is a Place can state the city it sits in, so the chain from a branch to its city and state is explicit.[10]

areaServed and serviceArea

PropertyExpected valuesSchema.org definition (quoted)
areaServedAdministrativeArea, GeoShape, Place, Text"The geographic area where a service or offered item is provided."[3]
serviceArea (superseded by areaServed)AdministrativeArea, GeoShape, Place"The geographic area where the service is provided."[15]

areaServed can be used on ContactPoint, DeliveryChargeSpecification, Demand, FinancialIncentive, Offer, Organization and Service, and accepts AdministrativeArea, GeoShape, Place or Text.[3] serviceArea, the older property, is superseded by areaServed.[15] A text value such as "Exampleville" is permitted, but a typed City node with a name, and where possible a sameAs link that identifies the city, states which Exampleville is meant.[3][14]

Identifying a place

Place names repeat across states and countries. Schema.org's sameAs, defined on Thing, takes the URL of "a reference Web page that unambiguously indicates the item's identity," and names a Wikipedia page or Wikidata entry as examples.[14] For a city, a Wikidata entry is such a page. The containment chain (City containedInPlace State) and the address fields give the same information in words.[10][16]

The link must point to the right place: a city's sameAs should not point to a county, a neighborhood or a similarly named city elsewhere. Google's guidelines on relevance and accuracy apply to every value.[17]

What Google documents

Google's LocalBusiness documentation requires an address and recommends geo, saying latitude and longitude precision "must be at least 5 decimal places."[18] Google's Organization documentation recommends address and allows several addresses for organizations in several places.[19] Google's job posting documentation requires jobLocation to be "the physical location(s) of the business where the employee will report to work," and its event documentation requires a location of type Place with an address.[20][21]

Google's documentation does not list areaServed or containedInPlace for any feature.[22] They describe service geography and containment for any consumer that reads schema.org, without a documented Google effect.

Common mistakes

  • Wrong area type. A county typed as City, or a metropolitan region typed as State.[5][6]
  • Duplicate place nodes. The same city described twice with different names; one node with an @id can be referenced instead.[23]
  • Coordinates with too little precision. Google asks for at least 5 decimal places.[18]
  • Long lists of towns the page never mentions. areaServed should reflect the service area the business actually states.[24]
  • sameAs to the wrong place. Check that the linked page describes the same place.[14]
  • Using serviceArea in new markup. It is superseded by areaServed.[15]

Example

A fictional business located in one city and serving two. Wikidata URLs are placeholders.

{
  "@context": "https://schema.org",
  "@type": "Electrician",
  "@id": "https://www.example.com/#organization",
  "name": "Example Electric",
  "address": { "@type": "PostalAddress", "streetAddress": "200 Example Ave", "addressLocality": "Exampleville", "addressRegion": "CA", "postalCode": "90000", "addressCountry": "US" },
  "geo": { "@type": "GeoCoordinates", "latitude": 33.12345, "longitude": -117.12345 },
  "containedInPlace": { "@id": "https://www.example.com/#exampleville" },
  "areaServed": [
    { "@type": "City", "@id": "https://www.example.com/#exampleville", "name": "Exampleville", "sameAs": "https://www.wikidata.org/wiki/Q00000001",
      "containedInPlace": { "@type": "State", "name": "California" } },
    { "@type": "City", "name": "Sampletown", "sameAs": "https://www.wikidata.org/wiki/Q00000002" }
  ]
}

Common questions

Should areaServed be text or a Place?

Both are allowed; a typed Place or City identifies the area more precisely.[3]

Is serviceArea still valid?

It is superseded by areaServed.[15]

Is there a County type?

Not in the current schema.org release; AdministrativeArea is the general type.[2]

References

  1. ^ "Place (type)". Schema.org.
  2. ^ "AdministrativeArea (type)". Schema.org.
  3. ^ "areaServed (property)". Schema.org.
  4. ^ "LocalBusiness (type)". Schema.org.
  5. ^ "City (type)". Schema.org.
  6. ^ "State (type)". Schema.org.
  7. ^ "Country (type)". Schema.org.
  8. ^ "Schema.org developer downloads (current release vocabulary files)". Schema.org.
  9. ^ "geo (property)". Schema.org.
  10. ^ "containedInPlace (property)". Schema.org.
  11. ^ "containsPlace (property)". Schema.org.
  12. ^ "address (property)". Schema.org.
  13. ^ "hasMap (property)". Schema.org.
  14. ^ "sameAs (property)". Schema.org.
  15. ^ "serviceArea (property)". Schema.org.
  16. ^ "PostalAddress (type)". Schema.org.
  17. ^ "General structured data guidelines". Google Search Central.
  18. ^ "Local business (LocalBusiness) structured data". Google Search Central.
  19. ^ "Organization (Organization) structured data". Google Search Central.
  20. ^ "Job posting (JobPosting) structured data". Google Search Central.
  21. ^ "Event (Event) structured data". Google Search Central.
  22. ^ "Structured data markup that Google Search supports (search gallery)". Google Search Central.
  23. ^ "JSON-LD 1.1, section 4.5 Embedding". World Wide Web Consortium (W3C).
  24. ^ "Introduction to structured data markup in Google Search". Google Search Central.