itemid

The itemid attribute in HTML provides a unique identifier for an item within a structured data context like Microdata, associating it with an external reference or schema.

Itemid Attribute

The itemid attribute assigns a unique global identifier to an item within the context of Microdata. It is used together with the itemscope and itemtype attributes.

Syntax

index.html
<element itemscope itemtype="URL" itemid="unique-id">
  <!-- Content -->
</element>

Example

Here is an example showing the usage of the itemid attribute to represent structured data for a book:

Title
Owls of the Eastern Ice
Author
Publication date
index.html
<dl
  itemscope
  itemtype="https://schema.org/Book"
  itemid="urn:isbn:0-374-22848-5<">
  <dt>Title</dt>
  <dd itemprop="title">Owls of the Eastern Ice</dd>
  <dt>Author</dt>
  <dd itemprop="author">Jonathan C Slaght</dd>
  <dt>Publication date</dt>
  <dd>
    <time itemprop="datePublished" datetime="2020-08-04">August 4 2020</time>
  </dd>
</dl>

The itemid attribute is used to give a unique identifier to items within structured data, ensuring proper referencing and linkage across various datasets.

Key Points

  • Usage Requirement: The itemid attribute must be applied only on elements that also include both the itemscope and itemtype attributes.
  • Identifier Format: While typically a URL, the itemid can also use other formats like URNs, depending on the vocabulary defined by itemtype.
  • Vocabularies: The value of the itemtype attribute determines the structure and processing of the global identifier.

See Also

Conclusion

The itemid attribute provides a unique global identifier for items in structured data, enhancing data linkage and reference. It must be used alongside itemscope and itemtype attributes to ensure proper functionality. This attribute is crucial for maintaining consistency and integration across datasets in HTML-based Microdata.