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)
On Wed, 18 Aug 2021 05:40:04 +1000, Andrea Rendine
@.***> wrote:
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. Itsdatetime
attribute handles machine-readable (ISO datetime) equivalent. Microdata Is supposed to consumedatetime
.<meter>
is for scale values, rendered visually for the user in form of a color-coded bar. Itsvalue
attribute determines the bar fulfillment. Microdata is supposed to consumevalue
, 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 byvalue
attribute. Microdata consumesvalue
.<meta>
is for all those cases where there is no visible, natural language expression for the user.<meta>
with anitemprop
(Microdata) or aproperty
(RDFa) attribute can be in document body. Its information is expressed bycontent
attribute, which is consumed by either Microdata (ifitemprop
is also present) or RDFa (ifproperty
is also present).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.