I use like:
itemtype="http://schema.org/ImageObject"
but the request http://schema.org/ImageObject
will be forwarded to https://schema.org/ImageObject
.
If I change to itemtype="https://schema.org/ImageObject"
, the Google SDTT shows no problem, but nearly all examples about structured data from Google are with http.
What is best or recommended to use http://schema.org
or https://schema.org
for itemtype
?
Q: Should we write
https://schema.org
orhttp://schema.org
in our markup?There is a general trend towards using
https
more widely, and you can already writehttps://schema.org
in your structured data. Over time we will migrate the schema.org site itself towards usinghttps:
as the default version of the site and our preferred form in examples. Howeverhttp://schema.org
-based URLs in structured data markup will remain widely understood for the forseeable future and there should be no urgency about migrating existing data. This is a lengthy way of saying that bothhttps://schema.org
andhttp://schema.org
are fine.
tl;dr: Both variants are possible.
The purpose of itemtype
URIs
Note that the URIs used for itemtype
are primarily identifiers, they typically don’t get dereferenced:
If a Microdata consumer doesn’t know what the URI in
itemtype="http://schema.org/ImageObject"
stands for, this consumer "must not automatically dereference" it.If a Microdata consumer does know what the URI stands for, this consumer has no need to dereference this URI in the first place.
So, there is no technical reason to prefer the HTTPS variant. User agents won’t dereference this URI (in contrast to URIs specified in href
/src
attributes), and users can’t click on it. I think there is only one case where the HTTPS variant is useful: if a visitor looks into the source code and copy-pastes the URI to check what the type is about.
I would recommend to stick with the HTTP variant until Schema.org switched everything to HTTPS, most importantly the URI in RDF’a initial context.
The specification of Schema for the type ImageObject indicated:
Canonical URL: http://schema.org/ImageObject
It is probably useful to refer to the canonical URL because it is the “preferred” version of the web page.
来源:https://stackoverflow.com/questions/55242400/itemtype-with-http-or-better-https