---
name: schema-org-graph-builder
description: Generate and audit interconnected Schema.org @graph JSON-LD blocks using stable @id references across WebSite, Organization, Person, Article, SoftwareApplication, and Dataset pages.
version: 1.0.0
author: Jason Zhu (Yansen Zhu) <https://jasonzhu.ai>
license: MIT
---

# Schema.org @graph JSON-LD Builder & Validator

Disconnected JSON-LD scripts create fragmented entities in Google and LLM knowledge graphs. Use this skill to unify page markup into a single deterministic `@graph` connected by stable `@id` URIs.

## Golden `@id` Architecture
Define permanent fragment IDs anchored to canonical URLs:
- Website: `https://<domain>/#website`
- Organization: `https://<domain>/#organization`
- Founder / Author: `https://<domain>/#person`
- Current Page: `https://<domain>/<path>#webpage`
- Primary Content: `https://<domain>/<path>#article` (or `#dataset`, `#software`, `#skill`)

## Strict Graph Hygiene Rules
1. **Single `@context`:** Emit one `<script type="application/ld+json">` with `"@context": "https://schema.org"` and a `"@graph": [...] ` array per page.
2. **Never Conflate Entity Types:**
   - Put personal social profiles (LinkedIn, GitHub, X, ORCID) ONLY on `Person.sameAs`.
   - Put company profiles (Crunchbase, LinkedIn Company, Wikidata company Q-ID) ONLY on `Organization.sameAs`.
   - Never put papers, DOIs, npm/PyPI packages, or separate product domains inside `Person.sameAs`.
3. **Reference, Don't Duplicate:** On blog posts or product pages, link `"author": { "@id": "https://<domain>/#person" }` and `"publisher": { "@id": "https://<domain>/#organization" }` rather than re-declaring conflicting author objects.
4. **Visible Parity Rule (Google Policy):** Every claim in JSON-LD (dates, prices, ratings, FAQ answers, author names) must match visible content rendered on the page. Never inject fake `AggregateRating` or hidden `FAQPage` spam.
5. **No Deprecated / Dead Types:** Skip deprecated `HowTo` rich result chasing unless genuinely instructional; focus on `Article`, `SoftwareApplication`, `SoftwareSourceCode`, `Dataset`, `ProfilePage`, `Organization`, `BreadcrumbList`.

## Verification Checklist
Before finishing any implementation:
1. Parse every `<script type="application/ld+json">` block with `JSON.parse()` to guarantee zero syntax/escaping bugs.
2. Confirm every internal `@id` reference resolves to a node in the site graph.
3. Confirm `datePublished` and `dateModified` use ISO-8601 format (`YYYY-MM-DD` or full timestamp with timezone).
4. Verify zero `undefined` or empty-string fields remain in the serialized JSON.

