1

Schema.org describes how to implement object properties using the meta tag but the examples given are properties with primitive types such as Text or Boolean. Let's say I want to display a grid of images and each image is of type ImageObject. The copyrightHolder property itself is either an Organization or Person. If I want to include the organization legal name, how would I do that using only meta data?

With "regular" HTML elements I would write:

<span itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
  <span itemprop="legalName">ACME Inc.</span>
</span>

This obviously doesn't look right:

<meta itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
  <meta itemprop="legalName" content="ACME Inc.">
</meta>

The only thing that comes into mind is using a set of hidden spans or divs.

unor
  • 92,415
  • 26
  • 211
  • 360

2 Answers2

1

Using Microdata, if you want to provide structured data that is not visible on the page, you can make use of these elements:

  • link (with itemprop) for values that are URLs
  • meta (with itemprop) for values that aren’t URLs
  • div/span (with itemscope) for items

So your example could look like this:

<div itemscope itemtype="http://schema.org/ImageObject">
  <div itemprop="copyrightHolder" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="legalName" content="ACME Inc." />
  </div>
</div>

If you want to provide the whole structured data in the head element (where div/span aren’t allowed), see this answer. If you only want to provide a few properties in the head element, you can make use of the itemref attribute.

That said, if you want to provide much data in that hidden way, you might want to consider using JSON-LD instead of Microdata (see a comparison).

unor
  • 92,415
  • 26
  • 211
  • 360
0

I was reading Getting Started again and noticed 2b that states

When browsing the schema.org types, you will notice that many properties have "expected types". This means that the value of the property can itself be an embedded item (see section 1d: embedded items). But this is not a requirement—it's fine to include just regular text or a URL.

So I assume it would be fine to just use

<meta itemprop="copyrightHolder" content="ACME Inc.">
  • 1
    Correct, but note that it’s typically preferable to provide an item with a type explicitly. When using only a text value, consumers don’t necessarily know which type is meant (is it a person or is it an organization?), and authors can’t provide additional data (e.g., the URL of the copyright holder). – unor Nov 21 '18 at 11:54