使用 http 或更好的 https 的项目类型?

itemtype with http or better https?

我用的是:

itemtype="http://schema.org/ImageObject"

但请求 http://schema.org/ImageObject 将转发给 https://schema.org/ImageObject

如果我更改为 itemtype="https://schema.org/ImageObject"Google SDTT 显示没有问题,但几乎所有来自 Google 的结构化数据示例都使用 http。

对于 itemtypehttp://schema.orghttps://schema.org 最好或建议使用什么?

From Schema.org’s FAQs:

Q: Should we write https://schema.org or http://schema.org in our markup?

There is a general trend towards using https more widely, and you can already write https://schema.org in your structured data. Over time we will migrate the schema.org site itself towards using https: as the default version of the site and our preferred form in examples. However http://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 both https://schema.org and http://schema.org are fine.

tl;dr: 两种变体都是可能的。

itemtype URI 的用途

请注意,用于 itemtype 的 URI 主要是标识符,它们通常不会被取消引用:

  • 如果一个 Microdata 消费者不知道 itemtype="http://schema.org/ImageObject" 中的 URI 代表什么,这个消费者“must not automatically dereference”它。

  • 如果微数据消费者确实知道 URI 代表什么,则该消费者无需首先取消引用该 URI。

因此,没有技术原因更喜欢 HTTPS 变体。用户代理不会取消引用此 URI(与 href/src 属性中指定的 URI 相反),并且用户无法单击它。我认为只有一种情况 HTTPS 变体有用:如果访问者查看源代码并复制粘贴 URI 以检查类型是什么。

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.

ImageObject 类型的架构规范表明:

Canonical URL: http://schema.org/ImageObject

参考canonicalURL可能有用,因为它是网页的“首选”版本。