【问题标题】:schema.org and an online dictionaryschema.org 和在线词典
【发布时间】:2012-07-28 04:40:26
【问题描述】:

我在使用来自schema.org 的内容时遇到问题。我正在制作一个类似于urbandictionary.com 的网站。用户是词典的贡献者。此外,该词典可能包含“2012 年伦敦奥运会”、“麻省理工学院宿舍”等短语。随便。所以我想向网站添加架构。单词/短语和用户的描述应该以什么模式命名?

http://schema.org/docs/full.html

编辑:示例页面的布局:

Gmail

  1. Google 的电子邮件服务 -user63
  2. 垃圾邮件预防方面的最佳电子邮件服务 -user21
  3. Gmail 支持 IMAP、POP3、SMTPi OAUTH、FRD、双向安全登录 -userMew

Edit2:另一个示例页面的布局:

蝙蝠侠 5

  1. 即将上映的蝙蝠侠电影,贾斯汀·比伯将在其中扮演小丑 -user43,2015 年 5 月
  2. 开幕是一场灾难;比伯滑到楼梯上,然后被抬到医院 - 用户22,2015 年 12 月
  3. 这部电影是一场灾难,一部质量很差的电影 -userKitten,2016 年 3 月

【问题讨论】:

    标签: schema.org


    【解决方案1】:

    一般

    schema.org 上的文档中有一个getting started page。当您正在构建字典时,您可能在那里有一个关于电影的条目(他们正在使用的示例)。标记可能如下所示:

    <div itemscope itemtype ="http://schema.org/Movie">
      <h1 itemprop="name">Avatar</h1>
      <span>Director: <span itemprop="director">James Cameron</span></span>
      <span itemprop="genre">Science fiction</span>
      <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
    </div>
    

    这要求您知道您的数据输入当然是一部电影。如果您不知道,您可以使用 itemtype Article(甚至是 Thing)和全局属性 namedescription

    还有关于 格式 的附加信息,例如日期以及如何使用meta tag 和设置content 属性来整合不可见数据&lt;meta itemprop="bestRating" content="5" /&gt;

    您始终可以通过指定属性additionalType 为项目赋予多种类型。你甚至可以extend the schema。但是您应该谨慎使用它们,因为它们不会被搜索引擎识别,但将来可能会被使用:

    如果架构获得采用并证明对搜索应用程序有用,搜索引擎可能会开始使用这些数据。

    一般来说,所有这些标记都是可选的,因此请尽可能多地标记,但只标记那些有意义的部分。来自schema.org FAQ

    只标记项目的某些属性很好 - 标记不是全有或全无的选择。

    标记验证

    为了测试您的标记,Google 提供了Rich Snippets Testing Tool。您可以在那里粘贴您的 HTML,然后查看 Google 从中提取的内容。对于上面的例子,结果如下:

    Item
        Type: http://schema.org/movie
        name = Avatar
        director = James Cameron
        genre = Science fiction
        trailer
        text = Trailer
        href = http://www.example.com/movies/avatar-theatrical-trailer.html
    

    在您的页面上

    由于您页面上的信息是用户生成的,您可以让用户从更高级别的 schema.org 类型中进行选择(MoviePlace(麻省理工学院宿舍)、SportsEvent(2012 年伦敦奥运会)等.) 并回退到Thing。然后获取与这些类型的属性匹配的表单元素中的数据。保存数据并在构建字典页面时对其进行评估。然后由 Google(和其他人)抓取并用于索引。

    对于您提供的 Gmail 示例,标记可能如下所示(将其复制并粘贴到 testing tool 以查看 Google 是否理解嵌套):

    <div itemscope itemtype ="http://www.schema.org/SoftwareApplication">
      <h1 itemprop="name">Gmail</h1>
      <div itemprop="comment" itemscope itemtype="http://www.schema.org/Comment">
        <span itemprop="comment">Google's email service</span>
        <span itemprop="author">user63</span>
      </div>
      <div itemprop="comment" itemscope itemtype="http://www.schema.org/Comment">
        <span itemprop="comment">best email service in terms of spam prevention</span>
        <span itemprop="author">user21</span>
      </div>
      <div itemprop="comment" itemscope itemtype="http://www.schema.org/Comment">
        <span itemprop="comment">Gmail has a support of IMAP, POP3, SMTPi OAUTH, FRD, two-way secure login</span>
        <span itemprop="author">userMew</span>
      </div>
    </div>
    

    附加信息

    有关详细信息,请参阅Google schema.org FAQs。另请参阅Dublin Core Metadata Initiatice (DCMI) (Wikipedia) 作为对数据进行语义标记的替代方法。他们还有a wiki page for mapping between schema.org and DC

    【讨论】:

    • 用户描述的 itemtype 应该是什么?每个用户都会为一个词编写自己的描述。
    • 我猜一个用户的类型应该是Person。这些属性通常是可选的(所以如果您没有地址或真实姓名也没有问题),您可以随时使用additionalType 命名更多类型。
    • 另见UserInteraction。如果用户对某个字典条目发表评论,则子类型 UserComments 可能是正确的选择。
    【解决方案2】:

    现在可以通过多种方式在 schema.org 中表示字典。目前谷歌搜索结果不是基于结构化数据/schema.org,但未来可能会改变。

    下面的大多数建议都是更具体的http://schema.org/CreativeWork 类型——这很重要,因为它包含commentcontributortext 等属性,这些属性对于用户可编辑的内容和贡献很有用。 CreativeWork 还包含 learningResourceType,可以设置为 dictionary - 但这不是 schema.org 的建议值,因此搜索引擎可能不知道在哪里查找。

    用于字典的 SEO 和语义 HTML

    使用带有和的标签是进行字典术语/定义的标准方式,并被顶级字典网站使用,您可以将这些标签与其中的架构一起使用,

    <div itemscope itemtype="http://schema.org/Collection"><h1 itemprop="name">Dictionary</h1>
     <dl id="gmail" itemscope itemtype="http://schema.org/CreativeWork">
      <dt itemprop="name">Gmail</dt>
       <meta itemprop="sameAs" content="http://gmail.com">
       <meta itemprop="url" content="http://mydictionary.com/page1.html#gmail">
      <dd itemprop="description"><span itemprop="comment">Google's email service</span> -<span itemprop="contributor">user63</span></dd>
     </dl>
    </div>
    

    为每个术语设置一个单独的页面(或面包屑导航)似乎是获得高排名的关键。排名中使用了页面名称(包括任何书签),因此如果您搜索“ardvark”,即使两个页面在其他方面相同,URL http://mydictionary.com/A 的排名也会低于http://mydictionary.com/Aardvark

    解释 3 种合适的模式类型,包括“官方”字典

    方法一)

    使用http://schema.org/Thinghttp://schema.org/Intangible,仅设置name(您的术语)和description(您的定义)。这将是数百个(或更多)单独的数据,因此您可以使用http://schema.org/Collective 将它们分组到一个集合中(这就是 VideoGallery 和 ImageGallery 结构化数据的完成方式)。这样做的好处是它很简单,而且每个都在单独的页面上显示,这应该会增加点击率。

    方法二)

    架构将 Dictionary 的值识别为 Dictionary 的唯一方法是使用 http://schema.org/publicationType - 它可以是任何一个值 listed here - 其中之一是 Dictionary。另一个是术语

    问题是,目前publicationType 只能在http://schema.org/MedicalScholarlyArticle 内部使用-但提出请求,这可能会扩展,例如扩展到其他ScholarlyArticles,或CreativeWork(它是医学学术文章)。 MedicalScholarlyArticle 是一种 CreativeWork - 如上所述。如果使用 MedicalScholarlyArticle,您可以在其中嵌套项目,每个术语一个,可能使用 http://schema.org/Thinghttp://schema.org/Intangible(设置 namedescriptionsameAs 可用于指向维基百科或城市词典条目,该条目标识这个词,或社交媒体)。

    您可以打开问题here 以请求将publicationType 添加到所有CreativeWork。

    方法三)

    字典是一本书(无论是离线还是在线),所以使用http://schema.org/Book 并通过嵌套在其中添加每个术语。 Book 是http://schema.org/CreativeWork 的一种类型,与方法 1 一样,您可以使用 Thing、Intangible 设置术语,甚至可以将每个术语放入其自己的 CreativeWork 中(只需检查一下,因为谷歌可能需要每个 ScholarlyArticle 的图像) .

    【讨论】:

      猜你喜欢
      • 2012-11-08
      • 2012-03-03
      • 2018-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多