Open source · SEO & Search

Structured Data Diff Checker

Compare JSON-LD graphs between releases and report changed entities.

v1.0.0 · Node.js 22+ · MIT

Browse the public repository · View releases

Compare two local, bounded JSON-LD graph exports by stable @id. It reports added/removed entities and changed types, scalar fields and @id relationships. Object-key and unordered-value order do not produce differences. The tool is offline, read-only, zero-dependency Node.js 22+.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+.

Run the checked-in example

node bin/structured-data-diff-checker.mjs --root examples/pass --before before.json --after after.json --contexts contexts.json
node bin/structured-data-diff-checker.mjs --root examples/fail --before before.json --after after.json --contexts contexts.json
npm run check

Read the result

The first example exits 0 and the second exits 1 with entity-removed. A remote context URI is used only if it has an explicit local mapping; it is never fetched. This implements the documented controlled JSON-LD subset, not full JSON-LD expansion. Unsupported constructs yield incomplete rather than a guessed diff. src/index.mjs exports TOOLID and compareGraphs.