Urgent.News

600+ sources. One page. See who else covered it.

Editions

Tech

Structured Data That Machines Read

Structured data is the one place where you tell a machine what your page means rather than hoping it infers it. It is also where honest sites quietly stop being honest, and where a mechanical detail — that JSON-LD lives inside a <script> element — decides whether half the systems you care about ever see it. Three encodings, one vocabulary schema.org is a vocabulary of types and properties. It can…

Structured data is crucial for communicating a page's meaning to machines. There are three ways to encode it: JSON-LD, Microdata, and RDFa. JSON-LD is the recommended and most mechanically compatible form, as it lives in a separate script element that remains intact even after a redesign. Microdata attaches attributes to visible elements but can become verbose and difficult to maintain. RDFa is a less commonly used alternative within the linked-data world.

Despite its benefits, structured data can be invisible to text extractors. HTML-to-text converters often strip out script and style elements, including JSON-LD, before the text is processed. This means that JSON-LD is discarded before it can be read by the text extractor.

However, JSON-LD remains the best choice when it's generated from the same variables used in the visible markup. This ensures consistency and avoids discrepancies between the machine-readable data and what humans see on the page. It's essential that the structured data contains only facts already present on the page, such as the article type, author, and relevant properties.

Following a simple rule—keeping the structured data honest by mirroring what is visible on the page—simplifies the process and helps maintain the integrity of the data. This approach ensures that structured data effectively serves its purpose without compromising the page's honesty or the information available to human readers.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Putting a 200-Table Schema Into a Prompt

A 200-table schema does not fit usefully in a prompt, even when it fits in the context window. The design that works is a two-stage one — a cheap call that picks the tables, a second call that sees…

Schema Versioning When Your Extraction Changes

The schema you shipped in March is not the schema you will want in September. Unlike a database migration, some changes to an extraction schema cannot be applied to existing rows by any transform, and…

More from Wednesday 12 August →