Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

structured data - Can Schema.org Expected Types be collections, too?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...