0

我不明白在有多个相同类型的项目的情况下如何表现,就像电影的作者一样。我必须为每个作者重复 itemprop="author" 或者我可以将它们包含在一个 div 中?

<div itemprop="author" itemscope itemtype="http://schema.org/Person">
    <span itemprop="name"><a href="#">Cesare Frugoni</a></span>
    <span itemprop="name"><a href="#">Enrico Vanzina</a></span>
</div>

或者

<div itemprop="author" itemscope itemtype="http://schema.org/Person">
    <span itemprop="name"><a href="#">Enrico Vanzina</a></span>
</div>
<div itemprop="author" itemscope itemtype="http://schema.org/Person">
    <span itemprop="name"><a href="#">Cesare Frugoni</a></span>
</div>
4

2 回答 2

2

后者是对的。第一个片段意味着您的人有两个名字(这实际上并不少见)。您可以使用GoogleYandex验证器对其进行检查。他们会给你这样的

person
itemType = http://schema.org/Person
name = Cesare Frugoni
name = Enrico Vanzina

而你(我相信)需要

person
itemType = http://schema.org/Person
name = Enrico Vanzina

person
itemType = http://schema.org/Person
name = Cesare Frugoni

Schema.org 在schema.org/Movie为这种情况提供了很好的示例。

<div itemscope itemtype="http://schema.org/Movie">

<h1 itemprop="name">Pirates of the Carribean: On Stranger Tides (2011)</h1>
<span itemprop="description">Jack Sparrow and Barbossa embark on a quest to
 find the elusive fountain of youth, only to discover that Blackbeard and
 his daughter are after it too.</span>
Director:
 <div itemprop="director" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Rob Marshall</span>
</div>
Writers:
 <div itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Ted Elliott</span>
</div>
<div itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Terry Rossio</span>
</div>
, and 7 more credits
Stars:
 <div itemprop="actor" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Johnny Depp</span>,
 </div>
<div itemprop="actor" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Penelope Cruz</span>,
</div>
<div itemprop="actor" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Ian McShane</span>
</div>
</div>

顺便说一句,围绕 schema.org 属性的基数进行了很多讨论。如果您对细节感兴趣,可以阅读相应的资料:ISSUE at tracker 和W3C Wiki page。

我个人遵循 Guha 所说的规则:

现在,它总是被允许有多个值。

于 2013-07-24T21:12:40.207 回答
0

我认为他们都是正确的。Imdb 使用第一种语法。

<div itemprop="creator" itemscope itemtype="http://schema.org/Person"> 
    <h4 class="inline">Writers:</h4>
    <a href="#" itemprop='url'><span class="itemprop" itemprop="name">Cesare Frugoni</span></a>
    <a href="#" itemprop='url'><span class="itemprop" itemprop="name">Steno</span></a>
</div> 
于 2013-07-24T13:10:53.480 回答