问题原文
原帖链接 · petesiss · CC BY-SA 3.0
I am adding structured data to a new page which could sensibly be defined as either an article (http://schema.org/Article) or an Item List (http://schema.org/ItemList), as it is a news article about a new top 10, where all 10 items exist on their own pages elsewhere on our site.
So this page has a title, author, some unique content, a publish date... but it also has a ranked list of items.
Is there a best practice for use of schema.org structured data that would add weight to going with one or the other? Or could we even use both definitions on the same page to define the list within the article?
已采纳解答
原帖链接 · unor · CC BY-SA 3.0
You can use both, if the ItemList is the primary thing the Article is about.
Use the mainEntity property of the Article type to provide the ItemList.
mainEntity is typically used to denote the primary thing a WebPage is about (e.g., probably the Article in your case), but this is not the only way how it can be used (bold emphasis mine):
Indicates the primary entity described in some page or other
CreativeWork.
You could use mainEntity for both ways in the same document:
<body vocab="http://schema.org/" typeof="ItemPage">
<article property="mainEntity" typeof="Article">
<ul property="mainEntity" typeof="ItemList">
</ul>
</article>
</body>
If the ItemList is not the primary thing the Article is about, there doesn’t seem to be a suitable property to link these items. The hasPart property can’t be used, because it expects a CreativeWork as value, but ItemList isn’t one.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
