schema.org: What to use: Microdata or JSON-LD?

Asked

Viewed 323 times

8

The marking of structured data Schema.org for search engines Google, Yahoo! , Bing and Yandex is great for rich snippets. However I realized that most webmasters use Microdata and almost never use JSON-LD. I recently met JSON-LD and have some doubts I did not find researching:

  1. I can use it without compatibility problem with all search engines?
  2. I can use the attribute src="" ?

  • Solved your doubt?

1 answer

0

I replied something similar in 2017, but I’ll try to refine a little here.

Before some important reminders:

  • Microdata is an extension of HTML to mark the content. Imagine, for practical effect, as something that "hovers over and discovers the semantics of the fragment".

  • JSON-LD will generally be used for the "cataloging sheet" in this type of HTML application, except if it ties together very well the identifiers of each part of the content.

... Imagine that a Semantic Web robot, such as e.g. the search.google.com/Structured-data/testing-tool, transforms any HTML page into a "cataloging sheet" (SHEET) page descriptor:

  • Microdata markup can be perfectly translated into JSON-LD, Rdfa or RDF.
    Imagine that transforming the whole marking into a simple PLUG, will be the same PLUG, independent of the language.
    PS: the formal definition of Microdata was created along with this translation (see "Converting Microdata to other formats" in the new proposal W3.org/TR/Microdata).

  • Microdata is less expressive than Rdfa or JSON-LD.
    That is, there is a complex FICHE that can only be expressed with JSON-LD (see "Microdata and RDF" in the new proposal W3.org/TR/Microdata).

NOTE: there is no technical impediment or dichotomy, you can use JSON-LD and Microdata together on the same page.
Imagine the HTML of your authorship presenting an artist’s review, with the <body> already marked with Microdata for example Webpage and properties copyrightHolder (you) and genre (review); there adds in <head> or <body> the <script type="application/ld+json"> with Person’s JSON-LD, describing the artist.

Repetitive contextualisation headers

  [Prefer JSON-LD]

If the site wants to standardize on all its pages, general properties such as permissions, authorship, etc. is much simpler and more practical to add JSON-LD in all of them. Wordpress and hundreds of other tools love to do this, precisely because it is done kind of "blindly", or based on metadata that eventually are not even present in HTML content, but CMS (content manager system) has access and can automatically generate - e.g. SQL tools such as Postgresql generate JSON from relational data.

PS: If you have never had much contact with this and want to generate "at hand", there are tools that help, typically "JSON-LD generators", such as this or this other. Ex. if the page is about a person, describe it with Person with basic public information.

More serious semantic marking

  [Prefer Microdata]

When one intends to highlight the semantics of figures, blocks of text, etc. as if to summarize to the reader what that content is, the ideal and most used is the direct marking on the content, ie Microdata.

PS: Technically we can reference Ids in JSON-LD, but having the content explicitly marked is still considered more reliable than referencing Ids. Tools such as dbpedia-Spotlight help mark along the text.

Transparency

  [Prefer Microdata]

For example, in a contract or in an Official Journal article, to mark identification elements, it is essential that what the human reads is also what the machine will interpret. In this case for example (or in this other) ensure that all metadata required by lexml pattern be exactly the same as the human reader is auditing when reading the document.

General rule: in doubt...

  • Merely technical doubt about which technology to use, Google and the SEO freaks suggest JSON-LD

  • If the doubt of type "what should I describe?" then the best is to use Microdata, because the semantics will emerge from its marking made on the content. Express yourself with Microdata is simpler and there are good editors.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.