Multiple occurences of same itemprop in Microdata

2019-01-15 21:29发布

I tested My microdata schema.org on google:

The google tools did not return any error...

**Item** 
    type:   http://schema.org/webpage
    property:   
    url:    http://127.0.0.1/
    image:  http://127.0.0.1/design/logo.jpg
    datemodified:   2014-03-05 20:12:56
    text:   
    Item 1
    breadcrumb: Skip to content
    text:   
    Item 2



    **Item 1**
    type:   http://schema.org/wpheader
    property:   
    url:    http://127.0.0.1
    headline:   website name
    image:  http://127.0.0.1/design/logo.jpg
    description:    some text


    **Item 2**
    type:   http://schema.org/sitenavigationelement

You can see I used multiple itemprop="text" for the webpage type...

Is it valid?

If yes you know itemprop="url" for WebPage type is invalid... or itemListElement for ItemList is valid. How can I recognize which itemprop is valid and which one is invalid?

----------------///EDIT///-------------------

<html itemscope itemtype="http://schema.org/webpage">
<body>
<div itemprop="text" itemscope="itemscope" itemtype="http://schema.org/wpheader">
...
</div>

<div itemprop="text" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
...
</div>
</body>
</html>

1条回答
干净又极端
2楼-- · 2019-01-15 22:14

You can have the same property several times for the same item (for example, to specify Schema.org’s name in different languages). But note that Microdata doesn’t define what it should mean when there is the same property more than one time specified.

So something like this is totally fine:

<html itemscope itemtype="http://schema.org/WebPage">
  <body>
    <div itemprop="text">…</div>
    <div itemprop="text">…</div>
  </body>
</html>

(Note that there may be a problem with your specific example: Schema.org’s text property expects Text, but you are using another item as value. It’s not forbidden, though.)

(Also note that the case matters, so it has to be http://schema.org/WPHeader instead of http://schema.org/wpheader. Same with http://schema.org/WebPage.)

查看更多
登录 后发表回答