105
5.2 Encoding microdata
The microdata model consists of groups of name-value pairs known asitemsp677
.
Each group is known as anitemp677
. Eachitemp677
can haveitem typesp677
, aglobal identifierp677
(if the vocabulary specified by theitem typesp677
support global identifiers for itemsp677
), and a list of name-value pairs. Each name in the name-value pair is known as apropertyp681
, and each
propertyp681
has one or morevaluesp680
. Eachvaluep680
is either a string or itself a group of name-value pairs (anitemp677
). The names are
unordered relative to each other, but if a particular name has multiple values, they do have a relative order.
EveryHTML elementp43
may have anitemscopeattribute specified. Theitemscopep677
attribute is aboolean attributep65
.
An element with theitemscopep677
attribute specified creates a newitem, a group of name-value pairs.
Elements with anitemscopep677
attribute may have anitemtypeattribute specified, to give theitem typesp677
of theitemp677
.
Theitemtypep677
attribute, if specified, must have a value that is anunordered set of unique space-separated tokensp84
that arecase-sensitivep63
,
each of which is avalid URLp86
that is anabsolute URL
, and all of which are defined to use the same vocabulary. The attribute's value must have at
least one token.
Theitem typesof anitemp677
are the tokens obtained bysplitting the element'sitemtypeattribute's value on spacesp84
. If theitemtypep677
attribute is missing or parsing it in this way finds no tokens, theitemp677
is said to have noitem typesp677
.
Theitem typesp677
must all be types defined inapplicable specificationsp62
and must all be defined to use the same vocabulary.
Except if otherwise specified by that specification, theURLs
given as theitem typesp677
should not be automatically dereferenced.
Item typesp677
are opaque identifiers, and user agents must not dereference unknownitem typesp677
, or otherwise deconstruct them, in order to
determine how to processitemsp677
that use them.
Theitemtypep677
attribute must not be specified on elements that do not have anitemscopep677
attribute specified.
Anitemp677
is said to be atyped itemwhen either it has anitem typep677
, or it is thevaluep680
of apropertyp681
of atyped itemp677
. Therelevant
typesfor atyped itemp677
is theitemp677
'sitem typesp677
, if it has any, or else is therelevant typesp677
of theitemp677
for which it is apropertyp681
's
valuep680
.
Elements with anitemscopep677
attribute and anitemtypep677
attribute that references a vocabulary that is defined tosupport global
identifiers for itemsmay also have anitemidattribute specified, to give a global identifier for theitemp677
, so that it can be related to other
itemsp677
on pages elsewhere on the Web.
Theitemidp677
attribute, if specified, must have a value that is avalid URL potentially surrounded by spacesp86
.
Theglobal identifierof anitemp677
is the value of its element'sitemidp677
attribute, if it has one,parsedp87
relative to thenode document
of the
element on which the attribute is specified. If theitemidp677
attribute is missing or if resolving it fails, it is said to have noglobal identifierp677
.
Theitemidp677
attribute must not be specified on elements that do not have both anitemscopep677
attribute and anitemtypep677
attribute
specified, and must not be specified on elements with anitemscopep677
attribute whoseitemtypep677
attribute specifies a vocabulary that does
notsupport global identifiers for itemsp677
, as defined by that vocabulary's specification.
A specification could define that itsitem typep677
can be dereferenced to provide the user with help information, for example. In fact,
vocabulary authors are encouraged to provide useful information at the givenURL
.
Note
5.2.1 The microdata model
5.2.2 Items
677