Organization builder
Creates an Organization for publishers, providers, and brands. The Organization builder injects @type, validates synchronously, and
rejects unknown properties.
Import
Section titled “Import”// Astro — shown first when Astro is selectedimport { Organization } from '@unschema-graph/astro';
// Svelte 5import { Organization } from '@unschema-graph/svelte';
// Core / Node.jsimport { Organization } from '@unschema-graph/core';import { OrganizationSchema } from '@unschema-graph/core';The OrganizationSchema Zod schema is also exported for composition and advanced validation.
TypeScript types
Section titled “TypeScript types”import { OrganizationSchema, type SchemaInput, type SchemaOutput,} from '@unschema-graph/core';
type OrganizationInput = SchemaInput<typeof OrganizationSchema>;type OrganizationOutput = SchemaOutput<typeof OrganizationSchema, 'Organization'>;Input properties
Section titled “Input properties”| Property | Input type | Required | Default / constraints |
|---|---|---|---|
@id |
string | No | — |
name |
string | Yes | non-empty |
legalName |
string | No | — |
url |
string | No | — |
logo |
string | ImageObject | No | non-empty |
image |
string | ImageObject | No | non-empty |
description |
string | No | — |
sameAs |
string | Array |
No | — |
address |
string | PostalAddress | EntityReference | No | — |
contactPoint |
ContactPoint | Array<ContactPoint> | No | — |
email |
string | No | format: email |
telephone |
string | No | — |
foundingDate |
string | number | Date | No | non-empty |
The aliases above remain the exact authority for nested object types. The builder also accepts a
validation configuration as its second argument and always returns @type: 'Organization'.
Minimal example
Section titled “Minimal example”import { Organization } from '@unschema-graph/core';
const entity = Organization({ "name": "Acme", "url": "https://example.com"});Output
Section titled “Output”{ "@type": "Organization", "name": "Acme", "url": "https://example.com"}Relationships and recipes
Section titled “Relationships and recipes”- Related builders:
Person,LocalBusiness,Restaurant,Store - Used by: Blog & media, Company site, SvelteKit & SSR, Core in any framework
- External sources: Schema.org Organization
Common errors
Section titled “Common errors”- Passing an unknown property to the strict builder.
- Using source data that is missing a required property.
- Assuming valid Schema.org guarantees a search appearance.
Validation
Section titled “Validation”Use Organization.safeParse(input) for external data. If Schema.org supports a property that
is not modeled yet, validate the entity first and then use withAdditionalProperties(). Never
pass invented properties to the strict builder.