Schema.org预期类型也可以是集合吗? [英] Can Schema.org Expected Types be collections, too?

查看:93
本文介绍了Schema.org预期类型也可以是集合吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类型为 Schema.org 对象="nofollow noreferrer"> Person 可以具有 sameAs 属性,其类型为 URL . 根据Google的结构化数据网站属性可以是单个项目或数组.

Schema.org上的文档未提及sameAs可以是单个项目还是数组.这仅仅是Google偏离Schema.org吗?还是Schema.org中的所有属性都可以是单个项目或数组?

解决方案

每个Schema.org属性都可以具有多个值.某些属性(例如 birthDate )不一定有意义,但仍然允许./p>

在JSON-LD中:

 "sameAs": ["/foo", "/bar"],
 

在微数据中:

 <link itemprop="sameAs" href="/foo" />
<link itemprop="sameAs" href="/bar" />
 

在RDFa中:

 <link property="sameAs" href="/foo" />
<link property="sameAs" href="/bar" />
 

这不一定意味着Google(或任何其他消费者)也为每个媒体资源都支持此功能.因此,当Google在其文档中明确提及这一点时,您可以确保相应的搜索结果功能可以使用多个值.

A Schema.org object of type Person can have a sameAs property of type URL. According to Google's structured data site, the sameAs property can be a single item or an array.

The docs on Schema.org do not mention whether sameAs can be a single item or an array. Is this just Google deviating from Schema.org? Or is it the case that all properties in Schema.org can be single items or arrays?

解决方案

Every Schema.org property can have multiple values. It doesn’t necessarily make sense for some properties (e.g., birthDate), but it’s still allowed.

In JSON-LD:

"sameAs": ["/foo", "/bar"],

In Microdata:

<link itemprop="sameAs" href="/foo" />
<link itemprop="sameAs" href="/bar" />

In RDFa:

<link property="sameAs" href="/foo" />
<link property="sameAs" href="/bar" />

This doesn’t necessarily mean that Google (or any other consumer) supports this for every property, too. So when Google explicitly mentions this in their documentation, you can be sure that the respective search result feature works with multiple values.

这篇关于Schema.org预期类型也可以是集合吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆