
Json Ld
- 14 installs
- Updated June 23, 2026
- enderpuentes/ai-agent-skills
Helps with ai & agent building tasks.
About
json-ld is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- json-ld
- AI & Agent Building
- AI-coding skill
Json Ld by the numbers
- 14 all-time installs (skills.sh)
- Ranked #11,296 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 24, 2026 (Skillselion catalog sync)
npx skills add https://github.com/enderpuentes/ai-agent-skills --skill json-ldAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 14 |
|---|---|
| Last updated | June 23, 2026 |
| Repository | enderpuentes/ai-agent-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
JSON-LD
Overview
JSON-LD (JSON for Linked Data) is a W3C standard for embedding machine-readable metadata in JSON. On the web it is most often used with the schema.org vocabulary inside <script type="application/ld+json"> so search engines understand page content and may show rich results.
Principles: Valid JSON first; @context maps terms to IRIs; @type declares entity kind; prefer absolute URLs for @id and links; markup must match visible page content.
Reference: W3C JSON-LD 1.1 · schema.org · Google structured data intro
---
Minimal document
Every JSON-LD document needs @context and usually @type:
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Acme Corp",
"url": "https://example.com",
"logo": "https://example.com/logo.png"
}For schema.org, use "@context": "https://schema.org" (or "https://schema.org/").
---
Embedding in HTML
Per the JSON-LD spec, place JSON in a script element with type="application/ld+json". Multiple scripts on one page are merged into a single dataset.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "About Us",
"url": "https://example.com/about"
}
</script>- Put in
<head>or<body>; both are valid. - Content must be valid JSON (double quotes, no trailing commas, no comments).
- Escape
</script>inside strings if needed (e.g. split as<\/script>).
Next.js (App Router)
Use a dedicated component or inline in layout.tsx / page.tsx:
export function JsonLd({ data }: { data: Record<string, unknown> }) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
/>
)
}- Build the object in TypeScript;
JSON.stringifyhandles escaping. - For dynamic pages, derive
name,url,datePublished, etc. from route params and CMS data. - Site-wide schemas (Organization, WebSite) belong in root
layout.tsx; page-specific schemas in eachpage.tsx.
---
Core keywords (JSON-LD 1.1)
| Keyword | Purpose |
|---|---|
@context | Vocabulary and term mappings (required at document or node level) |
@type | Entity type (e.g. WebPage, Person, Product) |
@id | Canonical IRI for the entity; use for cross-references |
@graph | Array of node objects in one document |
@language / @value | Language-tagged or typed literals (advanced) |
Node references — link entities without duplication:
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com",
"name": "Example",
"publisher": { "@id": "https://example.com/#organization" }
},
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Inc.",
"url": "https://example.com"
}
]
}Use stable fragment IDs (#website, #organization) for site-level entities.
---
Common schema.org types (web)
Add only types that match visible page content. For Google rich results, follow Google's feature docs (required/recommended fields differ per type).
| Type | Typical use |
|---|---|
| Organization | Company / brand (logo, sameAs social URLs) |
| WebSite | Site identity; optional SearchAction for sitelinks search box |
| WebPage | Generic page; pair with isPartOf → WebSite |
| Article / NewsArticle / BlogPosting | Articles and blog posts |
| BreadcrumbList | Breadcrumb navigation |
| Product | E-commerce product pages |
| FAQPage | FAQ sections with Question / Answer |
| LocalBusiness | Physical business (address, hours, geo) |
| Person | Author or profile pages |
| VideoObject | Video embed pages |
| Recipe | Recipe pages |
WebSite + Organization (root layout)
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "https://example.com/#website",
"url": "https://example.com",
"name": "Example",
"publisher": { "@id": "https://example.com/#organization" }
},
{
"@type": "Organization",
"@id": "https://example.com/#organization",
"name": "Example Inc.",
"url": "https://example.com",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png"
}
}
]
}Article / BlogPosting
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "Post title",
"description": "Short summary",
"image": ["https://example.com/og.jpg"],
"datePublished": "2025-06-13",
"dateModified": "2025-06-13",
"author": {
"@type": "Person",
"name": "Jane Doe",
"url": "https://example.com/about"
},
"publisher": { "@id": "https://example.com/#organization" },
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://example.com/blog/post-slug"
}
}BreadcrumbList
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Blog",
"item": "https://example.com/blog"
},
{
"@type": "ListItem",
"position": 3,
"name": "Post title"
}
]
}---
Validation workflow
1. Syntax — ensure valid JSON (no comments, trailing commas). 2. [JSON-LD Playground](https://json-ld.org/playground/) — expand/compact; debug @context and graph structure. 3. [Google Rich Results Test](https://search.google.com/test/rich-results) — eligibility for Google rich results (when targeting SEO). 4. Search Console — monitor rich result status after deploy.
For programmatic checks in Node.js, use the `jsonld` package (jsonld.expand, jsonld.compact).
---
Google / SEO guidelines (summary)
- JSON-LD is Google's recommended format for structured data when you can choose.
- Markup must describe content visible on the page; no hidden or misleading data.
- Prefer complete required fields over stuffing optional properties with weak data.
- Use Google's type-specific docs for required properties — they can be stricter than schema.org.
data-vocabulary.orgis deprecated for Google rich results; use schema.org.
---
Common mistakes
- Invalid JSON — comments, single quotes, trailing commas break parsers.
- Relative URLs — use absolute URLs for
url,image,@id, anditemin breadcrumbs. - Mismatch with UI —
headline, prices, ratings, or FAQ answers that don't match the page. - Duplicate conflicting graphs — multiple scripts defining the same
@idwith different data. - Wrong `@type` — e.g.
Articleon a product page; pick the type that matches primary content. - Missing `@context` — every standalone document needs it.
- Escaping in HTML — raw
</script>in JSON strings breaks the script tag; useJSON.stringify.
---
Advanced (when needed)
- Framing — reshape expanded data with a JSON-LD frame (W3C Framing spec).
- Custom vocabulary — define
@contextwith term mappings for non–schema.org IRIs. - HTTP headers —
Linkwithrel="alternate"; type="application/ld+json"for non-HTML resources (API, PDF). - RDF interop — JSON-LD serializes RDF; use expanded form and N-Quads when integrating with RDF tools.
Related skills
- sitemap — XML sitemap for crawl discovery.
- llms-txt — llms.txt for AI/agent context (complements, does not replace, JSON-LD).
---
Additional resources
- reference.md — W3C specs, schema.org, Google Search Central, tools, npm libraries.
- W3C JSON-LD 1.1: https://www.w3.org/TR/json-ld11/
- JSON-LD Playground: https://json-ld.org/playground/
- schema.org: https://schema.org/
- Google structured data: https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data
License
Skill License - Free Use
This skill (the documentation, structure, and implementation) was created by Ender Puentes <Endev/> and is provided for free and open use. You are free to:
- Use this skill in any project, personal or commercial
- Modify the skill to fit your needs
- Distribute the skill to others
- Share modified versions of the skill
- Include this skill in your own skill collections
No restrictions apply – this skill is available for unrestricted use. Attribution is appreciated but not required.
Note: This skill (json-ld) documents and references JSON-LD (W3C), schema.org, and Google Search Central structured data guidelines; the skill itself is an independent work. JSON-LD, schema.org, and Google documentation have their own terms and licenses.
JSON-LD — Reference & Official Documentation
This file complements the json-ld skill with official documentation links and extra context for indexing.
W3C JSON-LD (normative)
- JSON-LD 1.1 (syntax): https://www.w3.org/TR/json-ld11/
- JSON-LD 1.1 Processing Algorithms and API: https://www.w3.org/TR/json-ld11-api/
- JSON-LD 1.1 Framing: https://www.w3.org/TR/json-ld11-framing/
- JSON-LD 1.0 (legacy): https://www.w3.org/TR/json-ld/
- JSON-LD home: https://json-ld.org/
- JSON-LD Playground: https://json-ld.org/playground/
- JSON-LD Test Suite: https://json-ld.org/test-suite/
- Community Group: https://www.w3.org/community/json-ld/
- GitHub (spec repos): https://github.com/json-ld
Keywords (JSON-LD 1.1)
Core syntax tokens from the spec (§ 9.16 Keywords):
@base, @container, @context, @direction, @graph, @id, @import, @included, @index, @json, @language, @list, @nest, @none, @prefix, @propagate, @protected, @reverse, @set, @type, @value, @version, @vocab
Embedding in HTML: use <script type="application/ld+json"> (§ 7.2 Embedding JSON-LD in HTML Documents). Multiple script elements are merged into one dataset.
Media type: application/ld+json
schema.org vocabulary
- Home: https://schema.org/
- Full hierarchy: https://schema.org/docs/full.html
- Getting started: https://schema.org/docs/gs.html
- JSON-LD examples: https://schema.org/docs/schemas.html
Common types for web applications:
| Type | Docs |
|---|---|
| Organization | https://schema.org/Organization |
| WebSite | https://schema.org/WebSite |
| WebPage | https://schema.org/WebPage |
| Article | https://schema.org/Article |
| BlogPosting | https://schema.org/BlogPosting |
| NewsArticle | https://schema.org/NewsArticle |
| BreadcrumbList | https://schema.org/BreadcrumbList |
| Product | https://schema.org/Product |
| FAQPage | https://schema.org/FAQPage |
| LocalBusiness | https://schema.org/LocalBusiness |
| Person | https://schema.org/Person |
| VideoObject | https://schema.org/VideoObject |
| Recipe | https://schema.org/Recipe |
| Event | https://schema.org/Event |
| Review | https://schema.org/Review |
| SearchAction | https://schema.org/SearchAction |
Google Search Central (structured data)
Google recommends JSON-LD when possible. Use Google docs for required/recommended fields per rich result type.
- Introduction: https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data
- General guidelines: https://developers.google.com/search/docs/appearance/structured-data/sd-policies
- Feature gallery (all rich result types): https://developers.google.com/search/docs/appearance/structured-data/search-gallery
- Rich Results Test: https://search.google.com/test/rich-results
- Article: https://developers.google.com/search/docs/appearance/structured-data/article
- Breadcrumb: https://developers.google.com/search/docs/appearance/structured-data/breadcrumb
- FAQ: https://developers.google.com/search/docs/appearance/structured-data/faqpage
- Product: https://developers.google.com/search/docs/appearance/structured-data/product
- Recipe: https://developers.google.com/search/docs/appearance/structured-data/recipe
- Video: https://developers.google.com/search/docs/appearance/structured-data/video
- Organization / logo: https://developers.google.com/search/docs/appearance/structured-data/logo
- Sitelinks search box: https://developers.google.com/search/docs/appearance/structured-data/sitelinks-searchbox
Note: data-vocabulary.org markup is no longer eligible for Google rich results.
Validation and developer tools
| Tool | URL | Use |
|---|---|---|
| JSON-LD Playground | https://json-ld.org/playground/ | Expand, compact, frame, visualize graphs |
| Google Rich Results Test | https://search.google.com/test/rich-results | Google eligibility and preview |
| Schema Markup Validator | https://validator.schema.org/ | schema.org property validation |
| Search Console | https://search.google.com/search-console | Production monitoring |
JavaScript / TypeScript libraries
- jsonld (Node.js): https://www.npmjs.com/package/jsonld — expand, compact, flatten, frame, toRDF
- jsonld.js (browser + Node): https://github.com/digitalbazaar/jsonld.js
- TypeScript types: define interfaces per schema type or use generic
Record<string, unknown>for script injection
Framework patterns
Next.js App Router
- Site-wide
@graph(Organization + WebSite) inapp/layout.tsx - Page-specific types in
app/**/page.tsxor colocatedJsonLdcomponent - Serialize with
JSON.stringify; never hand-write JSON strings in templates
React / Vite
- Same
<script type="application/ld+json">pattern viadangerouslySetInnerHTMLor SSR head injection (e.g.react-helmet-async)
CMS / SSG
- Generate JSON-LD at build time from frontmatter (title, date, author, image)
- Keep
datePublished/dateModifiedin ISO 8601 (YYYY-MM-DDor full datetime)
Processing algorithms (API spec)
When building tools (not typical page markup):
- Expand — normalize to expanded document form
- Compact — shorten using a context
- Flatten — single default graph with blank-node labels
- Frame — reshape to a template (Framing spec)
- From RDF / To RDF — RDF dataset interop
API entry: https://www.w3.org/TR/json-ld11-api/
Related standards
- JSON (RFC 8259): https://www.rfc-editor.org/rfc/rfc8259
- RDF 1.1 Concepts: https://www.w3.org/TR/rdf11-concepts/
- Linked Data: https://www.w3.org/DesignIssues/LinkedData.html
- YAML-LD (human authoring): https://json-ld.org/yaml-ld/
- CBOR-LD (binary): https://json-ld.org/cbor-ld/
Related skills
- sitemap: sitemaps.org protocol for URL enumeration.
- llms-txt: llms.txt for answer engines and AI agents.