Microdata schema.org中出现多次相同的itemprop [英] Multiple occurences of same itemprop in Microdata schema.org
问题描述
我在google上测试了我的microdata schema.org:
Google工具没有返回任何错误...
**项目**
类型:http://schema.org/webpage
属性:
网址:http://127.0 .0.1 /
图片:http://127.0.0.1/design/logo.jpg
datemodified:2014-03-05 20:12:56
文本:
第1项
breadcrumb:跳至内容
文本:
项目2
**项目1 **
类型:http ://schema.org/wpheader
物业:
网址:http://127.0.0.1
标题:网站名称
图片:http://127.0.0.1/design /logo.jpg
描述:一些文本
**项目2 **
类型:http://schema.org/sitenavigationelement
您可以看到我使用了多个itemprop =text作为网页类型...
它是否有效?
如果您知道WebPage类型的itemprop =url是inval ItemList的id ...或itemListElement有效。我怎样才能识别哪个itemprop是有效的,哪一个是无效的?
---------------- ///编辑/ // -------------------
< html itemscope itemtype = http://schema.org/webpage >
< body>
< div itemprop =textitemscope =itemscopeitemtype =http://schema.org/wpheader>
...
< / div>
< div itemprop =textitemscope =itemscopeitemtype =http://schema.org/SiteNavigationElement>
...
< / div>
< / body>
< / html>
项目(例如,以不同语言指定Schema.org的名称
)。但请注意,当指定的时间超过一次时, Microdata没有定义它的意思。
所以像这样的东西是完全正常的:
< html itemscope itemtype = http://schema.org/WebPage >
< body>
< div itemprop =text> ...< / div>
< div itemprop =text> ...< / div>
< / body>
< / html>
(请注意,您的具体示例可能存在问题:Schema.org的 text
属性预计文字,但您正在使用尽管如此,这还不是禁止的)。
(还要注意的是,这个例子很重要,所以它必须是 http:// schema.org/WPHeader
而不是 http://schema.org/wpheader
。与 http://模式相同.org / WebPage
。)
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>
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
.)
这篇关于Microdata schema.org中出现多次相同的itemprop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!