suggestions-questions-brainstorming
suggestions-questions-brainstorming copied to clipboard
query: re ImageObject, <picture>, & <source>
if ImageObject is applied to a <picture> element and contentUrl is applied to <source>, how should the srcset and type values be treated?
The simplistic answer would be to suggest using JSON-LD output where the data elements in the mark-up are not influenced by the the relationships between HTML tags and their constraints.
However, I understand it is not always that easy to switch between Microdata and JSON-LD, so I'll have a stab at answering your query in Microdata.
<picture itemtype="http://schema.org/ImageObject>
<source srcset="/media/examples/surfer-240-200.jpg" media="(min-width: 800px)" type="image/jpeg">
<meta itemprop="encodingFormat" content="image/jpeg"/>
<img itemprop="contentUrl" src="/media/examples/painted-hand-298-332.jpg" />
</picture>
srcset does not map to a specific property of ImageObject, so is not marked up.
<source> does not have a value, only attributes. In which case <meta> tag is used to capture the relevant type value.
This would only work where there is only one image being described.
If you are looking to describe each individual image in a source set, it would probably best to approach the solution as an array of ImageObject descriptions - much easier in JSON-LD!
Hope this helps.
srcsetdoes not map to a specific property ofImageObject, so is not marked up.
this is the bit that I was mostly unsure about; a single url in srcset maps to contentUrl, but it gets a little more complicated when throwing in width & dpi specifiers.
Would I be correct in thinking that it's out-of-scope for microdata parsers to be expected to understand the multitudes of source[srcset] & source[type] combos ??
The current W3C specifications of microdata make no mention of srcset so it indeed seems they fall outside microdata's scope for the time being.
@danbri, was this taken into consideration when updating the microdata specifications?
See issue #7 for the context of the move from the main Schema.org issue tracker to this repository.
This is now impacting google search console and the "Image licenses" issue report, reporting that images are lacking a contentUrl because the spec doesn't explicitly mention the srcset attribute as a data source for the contentUrl property.