3

I have added Schema.org/Microdata properties to a list component on my site:

// This is one item in my list:

<div itemscope 
     itemtype  = "http://schema.org/WebApplication"
  >
  <span itemprop  = "name">
    The Awesome Web App 01
  </span>
  <span 
        itemprop  = "locationCreated"
        itemscope
        itemtype = "http://schema.org/City" 
    >
    <span itemprop = "name">
      Chicago
    </span>
  </span>
</div>

When I run that through the google Structured Data Testing Tool I get error:

Two of operatingSystem, aggregateRating, applicationCategory, offers are required.

So I have a few questions:

1 - Does it matter that I have this error? Will the error force google to ignore everything else?

2 - Do I now have to create new visible <div>'s to hold these new fields?

3 - Of the 4 required fields, only one, applicationCategory, is relevant to my situation ... the others are not ... so why should I have to use them?


UPDATE: I would like to use the Microdata format rather that the JSON-LD format (or RDFa). See a comparison of formats here.

unor
  • 92,415
  • 26
  • 211
  • 360
dsdsdsdsd
  • 2,880
  • 6
  • 41
  • 56

2 Answers2

2

1 - yes and yes.

2 - no, see below.

3 - OK, just add the operatingSystem, per below. If you support 2+ operatingSystem, make it an array (JSON-LD) or inlude another <span></span>.

The following is valid and will be parsed properly by Google:

<div itemscope 
     itemtype  = "http://schema.org/WebApplication"
  >
  <span itemprop  = "name">
    The Awesome Web App 01
  </span>
  <span 
        itemprop  = "locationCreated"
        itemscope
        itemtype = "http://schema.org/City" 
    >
    <span itemprop = "name">
      Chicago
    </span>
  </span>
  <span itemprop = "operatingSystem">
       Android
  </span>
  <span itemprop = "applicationCategory">
       Games
  </span>
</div>

If you want to hide the value of an element, use this approach:

<span>
  <meta itemprop = "operatingSystem" content="Android"/>
 </span>
Jay Gray
  • 1,706
  • 2
  • 20
  • 36
  • Jay, thanks for responding ... but those two spans are both going to be visible ... BUT maybe I can put a display:none on them ... I'll check ... – dsdsdsdsd May 27 '16 at 19:34
  • by the way, I was able to use ``, which is invisible (and redundant (because I had already used `WebApplication` as `itemtype` ... if there were more `SoftwareApplication` sub-categories at [http://schema.org/docs/full.html](http://schema.org/docs/full.html), I could have chose something else)) – dsdsdsdsd May 27 '16 at 19:37
  • nice ... I did not know about the `` option ... ... it also accepted ` any `, though that seems very wrong ... ... It still leaves me a bit frustrated that I have to require properties that are just not relevant ... for instance `operating system` is meaningless for web apps ... – dsdsdsdsd May 27 '16 at 19:56
  • schema.org has a grammar and you need to conform to the min specs for that grammar. You don't have to use microdata; you could use JSON-LD and an alternative vocab that has fewer limits on Domain and Range. But given your expressed requirements, you need to play their (Google) rules. – Jay Gray May 27 '16 at 19:59
  • I am still not sure which I like better: microdata or json-ld ... microdata is convenient because you can easily employ it while you are creating your html document ... and it adds the descriptions right where they need to be (especially if in the future you make edits to your html) ... but it is hoakie providing a data construct that is dispersed throughout your html content, whereas the json-ld is nice and compact, a payload of data with a clear purpose ... – dsdsdsdsd May 27 '16 at 20:09
  • Completely agree. We use to do RDFa but have switched to vanilla HTML with one or more JSON-LD islands per page. We have access to more folks with general-purpose HTML capabilities. We have different folks - data folks - who do the JSON-LD. Much better division-of-labor. – Jay Gray May 27 '16 at 20:40
2

You don’t have to provide these properties. The vocabulary Schema.org does not define any required properties.

If Google’s Structured Data Testing Tool says that a property is required, it only means that this property is required for getting one of Google’s search result features (e.g., a Rich Snippet).

If you don’t provide the properties, Google will (likely) not display that search result feature. Nothing else happens. It’s perfectly fine/normal not to provide all properties the SDTT would like to see.

If you could provide the properties, but you don’t want to have them visible on your page, you can use the link element (if the value is a URI) or the meta element (for all other values). For Microdata these elements may be added to the body, and they are hidden by default.

unor
  • 92,415
  • 26
  • 211
  • 360
  • "For Microdata these elements may be added to the body, and they are hidden by default." ... ... by `these elements` do you mean the `meta` tags .. ... in other words: that when `meta` elements are within the `body`, they are hidden? – dsdsdsdsd May 28 '16 at 03:27
  • @dsdsdsdsd: Yes, `link` and `meta` elements are hidden in the default stylesheets (in the `head`, where everything’s hidden by default anyway, but also in the `body`). – unor May 28 '16 at 03:58