schemaorg: Microdata examples incorrect markup

https://schema.org/price is just an example.

Note that both RDFa and Microdata syntax allow the use of a “content=” attribute

On what planet? Microdata just expects the use of content on the only element which natively supports it: the <meta> element. The use of <span> element in the Microdata example is totally incorrect. HTML has a completely different way to markup data with a machine-equivalent content: the <data> element in conjunction with the value attribute. This is the model supported (and suggested) by Microdata spec. Speaking of new elements, why embedding non-textual numeric content (namely in ratings) with <meta> element? There is <meter> for that purpose, it supports articulated value semantics, it’s used for Microdata and it’s also visually rendered in page.

This scenario deserves updating.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

On Wed, 18 Aug 2021 05:40:04 +1000, Andrea Rendine
@.***> wrote:

any need at all for content? Not at all, as far as Microdata-consuming tools interpret Rich Snippets
correctly. Spoiler: they still don’t, probably because until 28 January 2021 the
relevant HTML spec was W3 HTML5, with its stupid mistake >about content
which nobody needed to care. One can only hope that Structured Data
tools are still in process of upgrading. (It was 2018 not 2021 that W3C work stopped)

They don’t, because they were reading several specs badly. The schema.org
examples were built based on the reality of implementations.

While W3C was still developing an HTML spec, there was also a concerted
effort to make a microdata spec that matched reality - and as part of
that, work with the various consumers of microdata including search
engines and other processors, to update the tools so they actually worked
the same way as the spec and vice versa.

As part of leaving it all to WHATWG, that spec (which was by then fairly
accurate) was dumped in favour of the WHATWG version that was wildly out
of touch with reality. I have no idea where it is now, but last I looked,
maybe a year ago, they still had the same old stuff.

The W3C spec is available at
https://www.w3.org/TR/2021/NOTE-microdata-20210128/

(I did a lot of work to get that microdata spec to happen and be
worthwhile. I’m sad that we’ve gone so far backwards after that).

– Using Opera’s mail client: http://www.opera.com/mail/

@WeaverStever a recap.

  • <time> is for date, period and time related visible, user-friendly, natural language expressions. Its datetime attribute handles machine-readable (ISO datetime) equivalent. Microdata Is supposed to consume datetime.
  • <meter> is for scale values, rendered visually for the user in form of a color-coded bar. Its value attribute determines the bar fulfillment. Microdata is supposed to consume value, while other parameters must be expressed non-visually (see below)
  • <data> is for any other case where a visible, user-friendly, natural language expression must have machine-readable equivalent. Machine-readable equivalent is expressed by value attribute. Microdata consumes value.
  • <meta> is for all those cases where there is no visible, natural language expression for the user. <meta> with an itemprop (Microdata) or a property (RDFa) attribute can be in document body. Its information is expressed by content attribute, which is consumed by either Microdata (if itemprop is also present) or RDFa (if property is also present).
  • for other use cases, please read the specs. Good people have died (not quite literally) to write them.

There is no specific way to mark up other parameters for a meter scenario. Maximum value can be marked up via accompanying <meta> elements, while if a different data scale is to be expressed, it may be nested inside a <data> element.