Events
Outcome
Section titled “Outcome”Publish one event occurrence with explicit dates, venue, ticket offer, and lifecycle status.
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:
Event,Offer,PostalAddress.
Recommended graph
Section titled “Recommended graph”Event— primary nodeOfferPostalAddress
Minimal example
Section titled “Minimal example”import { Event } from '@unschema-graph/core';
const entity = Event({ "name": "Astro meetup", "startDate": "2026-10-15T18:00:00+02:00", "location": "Paris, France"});Production pattern
Section titled “Production pattern”Use ISO 8601 offsets when the local time zone matters. On cancellation, retain the event URL and set eventStatus instead of deleting the node.
const result = Event.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”- Omitting the time-zone offset for a timed event. Compare the source data,
safeParse()result, and JSON-LD in the built HTML. - Putting the event name in location.name. Compare the source data,
safeParse()result, and JSON-LD in the built HTML. - Deleting a cancelled event instead of updating its status. 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.