Person builder
Creates a Person for authors, performers, and other identities. The Person builder injects @type, validates synchronously, and
rejects unknown properties.
Import
Section titled “Import”// Astro — shown first when Astro is selectedimport { Person } from '@unschema-graph/astro';
// Svelte 5import { Person } from '@unschema-graph/svelte';
// Core / Node.jsimport { Person } from '@unschema-graph/core';import { PersonSchema } from '@unschema-graph/core';The PersonSchema Zod schema is also exported for composition and advanced validation.
TypeScript types
Section titled “TypeScript types”import { PersonSchema, type SchemaInput, type SchemaOutput,} from '@unschema-graph/core';
type PersonInput = SchemaInput<typeof PersonSchema>;type PersonOutput = SchemaOutput<typeof PersonSchema, 'Person'>;Input properties
Section titled “Input properties”| Property | Input type | Required | Default / constraints |
|---|---|---|---|
@id |
string | No | — |
name |
string | Yes | non-empty |
givenName |
string | No | — |
familyName |
string | No | — |
additionalName |
string | No | — |
url |
string | No | — |
image |
string | ImageObject | No | non-empty |
jobTitle |
string | No | — |
worksFor |
string | object | No | — |
sameAs |
string | Array |
No | — |
email |
string | No | format: email |
telephone |
string | No | — |
description |
string | No | — |
address |
string | PostalAddress | EntityReference | No | — |
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: 'Person'.
Minimal example
Section titled “Minimal example”import { Person } from '@unschema-graph/core';
const entity = Person({ "name": "Ada Lovelace", "jobTitle": "Engineer"});Output
Section titled “Output”{ "@type": "Person", "name": "Ada Lovelace", "jobTitle": "Engineer"}Relationships and recipes
Section titled “Relationships and recipes”- Related builders:
Organization,LocalBusiness,Restaurant,Store - Used by: Blog & media
- External sources: Schema.org Person
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 Person.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.