Website Spec
← Agent Readiness
Optional

Schemamap — discoverable JSON-LD endpoints per resource

A convention this site proposes — no external standard exists yet. `/schemamap.xml` indexes one JSON-LD endpoint per resource so agents fetch the structured-data graph directly instead of extracting it from HTML.

What it is

Schemamap is a convention this site proposes. It has no external standard, no IANA-registered link relation, and no second implementer at the time of writing. It is documented here as a worked proposal — not as settled web infrastructure. Treat the status as optional and adopt it because the design fits your needs, not because anyone else expects you to ship it.

The shape:

  1. A per-resource JSON-LD endpoint. Every page that has structured data exposes its JSON-LD graph at a predictable URL — by convention, the canonical URL with a .jsonld suffix — served with Content-Type: application/ld+json. The endpoint returns the same @graph the HTML embeds, in a stable shape, with no surrounding markup to parse.
  1. An index — /schemamap.xml. A sitemap-shaped XML file at the site root lists every resource that has a JSON-LD endpoint. Each <resource> carries the canonical URL, the .jsonld URL, the schema.org @types present, and an optional <lastmod>.
  1. HTML discovery. Two <link> tags in <head>. The site-wide one points at the index using the proposed rel="schemamap". The per-page one points at this resource's JSON-LD endpoint using the registered rel="alternate" type="application/ld+json" — so agents that do not recognise schemamap still find the per-page graph through a standard relation.
<!-- Per page -->
<link rel="alternate" type="application/ld+json"
      href="https://example.com/articles/foo.jsonld"
      title="Foo — JSON-LD graph">

<!-- Site-wide -->
<link rel="schemamap" type="application/xml"
      href="/schemamap.xml"
      title="Schemamap index">
<?xml version="1.0" encoding="UTF-8"?>
<schemamap xmlns="https://example.com/schemas/schemamap/0.1">
  <resource>
    <loc>https://example.com/articles/foo/</loc>
    <jsonld>https://example.com/articles/foo.jsonld</jsonld>
    <type>Article</type>
    <type>BreadcrumbList</type>
    <lastmod>2026-05-29</lastmod>
  </resource>
</schemamap>

This site ships it. Every spec page exposes a JSON-LD graph at /spec/<category>/<slug>.jsonld, and the index at /schemamap.xml lists all of them. The per-page graph is also registered in the api-catalog Linkset under a URI-based rel so the discovery path is self-describing without the IANA registry.

Why it matters

The status quo for structured data is "parse the HTML and pick out every <script type=\"application/ld+json\">". That works, but it has costs:

A discoverable index of JSON-LD endpoints fixes all four cheaply. The cost is one new endpoint type and one extra file. Compare with the Markdown source endpoints convention, which solves the same kind of problem for prose.

How to implement

Expose the per-page endpoint first. Without .jsonld URLs, the index has nothing to point at. For each page that ships structured data, render the same graph you embed in the HTML to a separate endpoint:

GET /articles/foo.jsonld HTTP/1.1

HTTP/1.1 200 OK
Content-Type: application/ld+json; charset=utf-8
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=3600

Use a stable @id on every node (the canonical URL with a fragment is fine — #article, #breadcrumb, #organization). Include a license field on the graph if your content is licensed.

Build the index from the same content source. On specification.website, src/pages/schemamap.xml.ts iterates the content collection that drives the rest of the site, so the index cannot drift from the per-page endpoints. Sort entries by category then order then title — agents that incrementally fetch will see the same ordering as humans on /spec/.

Advertise discovery in <head>.

<link rel="alternate" type="application/ld+json" href="…/page.jsonld" title="… JSON-LD graph">
<link rel="schemamap" type="application/xml" href="/schemamap.xml" title="Schemamap index">

Add the per-page link on every page that has a JSON-LD endpoint. Add the schemamap link site-wide.

Pick the right serving headers. Content-Type: application/ld+json for the endpoints, application/xml for the index. Set Access-Control-Allow-Origin: * so cross-origin agents can fetch the graph from a browser context. Cache aggressively — the graph only changes when the source content does.

Be honest in the index about the registration gap. The rel="schemamap" value is not in the IANA Link Relations Registry. HTTP Link headers explicitly warns against inventing custom rel values for that reason. Two ways to handle it:

Registration is the prerequisite for promoting any of this beyond optional. Until then, treat schemamap as an opt-in proposal you can audit and walk back from.

Common mistakes

Verification

Sources