【问题标题】:extending html5 microdata event schema扩展 html5 微数据事件模式
【发布时间】:2014-11-27 19:59:39
【问题描述】:

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

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

        <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>

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

        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".

任何想法有什么问题吗?应该怎么做?

非常感谢!

【问题讨论】:

  • 现在有一个open issue 用于创建简历/工作历史。过去的工作并不是真正的“事件”,使用 Person 模式以及其中的 employeeof 和 Organization 可能会更好。 schema.org/Role 模式提供了开始/结束日期和工作描述,因此也可以使用

标签: html markup semantic-markup microdata


【解决方案1】:

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

但请注意,这种扩展机制无论如何都被认为是“过时的”,请参阅docs/extension.html is out of date, should be marked as such or fixed。打算很快在扩展页面上显示此消息:

历史(“基于 Slash”)扩展机制(2011-2013)

状态说明:我们保留此文本以记录我们最初的可扩展性方法。我们目前不提倡使用基于 '/' 的扩展名称,尽管使用这些名称应该是无害的。其他机制包括 RDFa、JSON-LD、Role 类型和additionalType 属性现在也可以用于不同的扩展场景。

[…]

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

【讨论】:

    【解决方案2】:

    我认为您的新架构规范需要托管在某个地方。显示错误可能是因为http://schema.org/Event/Job 不存在。

    您可以尝试使用来自另一个词汇表的属性来扩充 schema.org Event,如 here 所述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-07
      • 1970-01-01
      • 2010-10-14
      • 1970-01-01
      • 2013-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多