Skip to content
Coding Script or NotebookGoogle ColabFree

JSON-LD from an Entity Registry: Claude Drafts, Code Checks, One Graph per Page

ForEntity SEOAI search

By Lazarina Stoy· Updated 5 Dec 2026

Structured data is where you define your entities for machines in your own words. It goes wrong in two predictable ways: markup that claims things the page doesn’t say, and several plugins each printing their own version. These free scripts fix both. An entity registry holds your facts, Claude drafts each page’s JSON-LD, and code checks the result.

Who it’s for

SEOs and developers who want one owned schema graph per page, with every claim traceable to the page or the registry.

What’s included

  • jsonld_from_registry.py: Claude drafts each page’s graph from your registry; code checks that every @id reference resolves and that every claim has evidence on the page or in the registry
  • registry.example.json: a starting registry for your organisation, people, @ids and sameAs links
  • entity-graph-starter.php: a WordPress starter that renders one graph per page from the registry plus live post data, and switches other schema emitters off
  • graph_check.py: a smoke test (exactly one ld+json block per URL, valid, with an @graph) and a site-wide census (one @id per person or organisation name)

How to use it

  1. Open the course scripts notebook in Colab (or download the folder from GitHub to run it on your computer).
  2. Add the keys the script needs as Colab secrets, with notebook access switched on. They never go into the code.
  3. Run the Setup cell. It downloads the scripts and installs what they need.
  4. Fill in your registry.json from the example, and upload a pages.csv with url, title, page type and main content.
  5. Run the draft step with --limit 3, read the review file, then run the rest.
  6. Validate the drafts with Google’s Rich Results Test and the Schema.org validator.
  7. After you deploy, run graph_check.py on your sitemap. It exits with an error if any URL fails, so it can run in CI.

Limits and costs

  • Drafting needs an Anthropic API key, billed per use. The checks are free.
  • Nothing deploys by itself. A person runs the validators and approves.

Why one graph

Two ld+json blocks on one page usually means two plugins that disagree about who you are. The census check found duplicate people on our own site. One registry, one graph and a check after every deploy keeps your entity definitions consistent.

For auditing existing markup, see the Structured Data Automation Kit. The scripts are on GitHub; the The AI-powered Entity Audit course covers structured data as entity definition.

What’s included

  • An entity registry holds the facts your CMS doesn't: organisation, people, @ids and sameAs
  • Claude drafts each page's JSON-LD; code checks graph integrity and evidence for every claim
  • A WordPress starter plugin renders one owned graph per page
  • graph_check.py: one ld+json block per URL, and one @id per person or organisation site-wide
  • Runs in CI after a deploy; nothing is deployed by the scripts