Can Schema.org Expected Types be collections, too?

时光毁灭记忆、已成空白 提交于 2019-11-27 04:52:41

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/44526548/can-schema-org-expected-types-be-collections-too

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!