Local business
Outcome
Section titled “Outcome”Describe a real business location with contact details, opening hours, and optional verified coordinates.
Local validation — Builders reject unknown properties and expose
safeParse()for external data.Schema.org — The vocabulary defines property meaning; it does not guarantee any search appearance.
Google eligibility — Google requirements are additional and can change. Valid markup never guarantees a rich result.
Prerequisites
Section titled “Prerequisites”- A trustworthy canonical URL and
baseUrl. - Current, visible data from your domain source.
- Related builders:
LocalBusiness,PostalAddress,GeoCoordinates.
Recommended graph
Section titled “Recommended graph”LocalBusiness— primary nodePostalAddressGeoCoordinates
Minimal example
Section titled “Minimal example”import { LocalBusiness } from '@unschema-graph/core';
const entity = LocalBusiness({ "name": "Acme Paris", "address": { "streetAddress": "1 Rue de Rivoli", "addressLocality": "Paris", "postalCode": "75001", "addressCountry": "FR" }});Production pattern
Section titled “Production pattern”Use one node per physical location. Add geo only from a trusted source and keep opening hours aligned with customer-facing information.
const result = LocalBusiness.safeParse(cmsData);if (!result.success) { throw new Error(result.error.issues.map((issue) => issue.message).join('\n'));}
const graph = buildJsonLdGraph([result.data], { baseUrl: 'https://example.com' });Environment variants
Section titled “Environment variants”| Astro | Svelte 5 / SvelteKit | Core |
|---|---|---|
<Schema items={items} /> |
<Schema items={items} /> |
serializeJsonLd(buildJsonLdGraph(items)) |
Common errors and diagnosis
Section titled “Common errors and diagnosis”- Combining several branches into one LocalBusiness. Compare the source data,
safeParse()result, and JSON-LD in the built HTML. - Guessing latitude or longitude. Compare the source data,
safeParse()result, and JSON-LD in the built HTML. - Publishing stale or malformed opening hours. Compare the source data,
safeParse()result, and JSON-LD in the built HTML.
Validation
Section titled “Validation”- Run
safeParse()at the data boundary. - Inspect the script in built HTML.
- Run
unschema-graph auditagainst the output directory. - Schema.org / official documentation.
Final checklist
Section titled “Final checklist”- Marked-up content is visible and current.
- Every reusable identity has a stable
@id. - Local validation and the build audit pass.
- Eligibility is understood as non-guaranteed.
Go deeper: graphs and references, validation, audit CLI.