schema.org和在线词典

时间:2012-07-28 04:40:27

标签: schema.org

我在使用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
  4. Edit2:loyout另一个示例页面:

    蝙蝠侠5

    1. 即将上映的蝙蝠侠电影,Justien Bieber将扮演Joker -user43,2015年5月
    2. 开幕是一场灾难;比伯滑倒楼梯然后被带到医院 - 2015年12月的用户
    3. 这部电影是一场灾难,一部质量很差的电影 - 用户名,2016年3月

2 个答案:

答案 0 :(得分:4)

一般

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属性:<meta itemprop="bestRating" content="5" />

通过指定属性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(MIT宿舍),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

答案 1 :(得分:4)

现在可以通过多种方式在schema.org中表示字典。目前,Google搜索结果并非基于结构化数据/ schema.org,但未来可能会发生变化。

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

词典的SEO和Semanic 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>

为每个术语设置单独的页面(或面包屑)似乎是高度排名的关键。页面名称(包括任何书签)用于排名,因此如果您搜索&#39; ardvark&#39;即使两个页面完全相同,网址http://mydictionary.com/A也会排在http://mydictionary.com/Aardvark以下。

3个合适的架构类型的解释,包括官方&#39;字典

方法1)

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

方法2)

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

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

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

方法3)

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