我这样使用:
itemtype="http://schema.org/ImageObject"
,但请求http://schema.org/ImageObject
将转发到https://schema.org/ImageObject
。
如果我更改为itemtype="https://schema.org/ImageObject"
,则Google SDTT表示没有问题,但是几乎所有有关Google的结构化数据的示例都带有http。
对于http://schema.org
,最好还是建议使用https://schema.org
或itemtype
?
答案 0 :(得分:1)
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.
itemtype
URIsNote 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.
答案 1 :(得分:0)