扩展html5微数据事件架构 [英] extending html5 microdata event schema

查看:116
本文介绍了扩展html5微数据事件架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直在我的在线简历中添加html5微数据,并阅读 http://www.schema您可以扩展现有架构的.org / docs / extension.html



我一直试图用以下标记来扩展Event来描述Job:

 < div class =jobitemscope itemtype =http://schema.org/Event/Job> 

< div itemprop =organizeritemscope itemtype =http://schema.org/Organization>
< span itemprop =name>公司名称2< / span>
< span itemprop =location>伦敦< / span>
< / div>
< span itemprop =startDate> 2000年1月< / span>
< span itemprop =endDate> 2009年2月< / span>
< p itemprop =description> Lorem ipsum dolor sit amet,consectetuer adipiscing elit ...< / p>
< / div>

当我使用Google结构化数据测试工具时,会出现以下错误:

 项目
类型:http://schema.org/event/job
属性:
名称:Web Developer
组织者:项目4
开始日期:2000年1月
结束日期:2009年2月
描述:Lorem ipsum dolor sit amet,consectetuer adipiscing elit ...
错误:页面包含不属于模式一部分的属性名称。
错误:页面包含不属于模式一部分的属性组织者。
错误:页面包含不属于模式一部分的属性startdate。
错误:页面包含不属于模式一部分的属性enddate。
错误:页面包含不属于模式一部分的属性描述。
错误:缺少必填字段dtstart。
错误:缺少必填字段名称。

任何想法有什么不对?应该如何做?



非常感谢,!

解决方案

Google的工具对错误是错误的,可能是因为他们没有处理Schema.org扩展的情况(这是对词汇表的有效使用)。



但是请注意,无论如何,此扩展机制都被视为过时,请参阅 docs / extension.html已过期,应该标记为或修复。它的目的是尽快在扩展页面上显示此消息:


历史(基于斜线的)扩展机制(2011- 2013)



状态备注:我们保留此文档以记录我们原始的可扩展性方法。我们目前不提倡使用基于'/'的扩展名称,尽管使用它们应该是无害的。包括RDFa,JSON-LD, Role 类型和 additionalType 属性的其他机制现在也可以用于不同的扩展场景。
$ b

[b]

(顺便说一句,您的值 startDate endDate 无效:您需要使用 ISO 8601 日期格式。)


Have been adding html5 microdata to my online resume, and read in http://www.schema.org/docs/extension.html that you can extend existing schema.

I've been trying to extend Event to describe a Job with the following markup:

        <div class="job" itemscope itemtype="http://schema.org/Event/Job">
            <h2 itemprop="name">Web Developer</h2>
            <div itemprop="organizer" itemscope itemtype="http://schema.org/Organization">
                <span itemprop="name">Company Name 2</span>
                <span itemprop="location">London</span>
            </div>
            <span itemprop="startDate">January 2000</span>
            <span itemprop="endDate">February 2009</span>
            <p itemprop="description">Lorem ipsum dolor sit amet, consectetuer adipiscing elit...</p>
        </div>

When i use the Google Structured Data Testing Tool it gives the following errors:

        Item
            type:   http://schema.org/event/job
            property:
              name:         Web Developer
              organizer:    Item 4
              start date:   January 2000
              enddate:      February 2009
              description:  Lorem ipsum dolor sit amet, consectetuer adipiscing elit...
        Error: Page contains property "name" which is not part of the schema.
        Error: Page contains property "organizer" which is not part of the schema.
        Error: Page contains property "startdate" which is not part of the schema.
        Error: Page contains property "enddate" which is not part of the schema.
        Error: Page contains property "description" which is not part of the schema.
        Error: Missing required field "dtstart".
        Error: Missing required field "name".

Any ideas what's wrong? and how it should be done?

Many thanks,!

解决方案

Google’s tool is wrong about the errors, probably because they don’t handle the case of Schema.org extensions (which is a valid use of the vocabulary).

But note that this extension mechanism is considered "outdated" anyway, see docs/extension.html is out of date, should be marked as such or fixed. It’s intended to display this message on the extension page soon:

Historical ("Slash-based") Extension Mechanism (2011-2013)

Status Note: We preserve this text to document our original approach to extensibility. We do not currently advocate the use of '/'-based extended names, although it should be harmless to use these. Other mechanisms including RDFa, JSON-LD, the Role type and additionalType property can now also be used for different extension scenarios.

[…]

(By the way, your values of startDate and endDate are not valid: you need to use the ISO 8601 date format.)

这篇关于扩展html5微数据事件架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆