在这个场景中,我有一个关于正确使用mainEntityOfPage
的问题:
Organization
类型,包括公司名称、公司描述、电话、地址等。Organization
类型的主页,作为网页的主要主题。另外,我想用Schema.org声明,这家公司已经写了3篇不同的文章,它们都位于自己的网页上。这些片段由文章的标题、介绍段落、图片和“阅读更多”按钮组成。我使用以下代码:
<body itemscope itemtype="http://schema.org/Organization" >
<a href="https://testsite.com/index.html" itemprop="url">
<img src="https://testsite.com/img/logo.jpg" itemprop="logo" alt="Company logo" />
</a>
<p itemprop="name">Company name</p>
<p itemprop="description">Company description</p>
<div itemprop="mainEntityOfPage" itemscope itemtype="https://schema.org/CreativeWork">
<meta itemprop="thumbnailUrl" content="https://testsite.com/img/article-1-picture.jpg" />
<p itemprop="headline">Article 1 headline</p>
<p itemprop="description">Article 1 first paragraph.</p>
<a itemprop="url" href="https://testsite.com/url-article-1.html">Read more</a>
</div>
<div itemprop="mainEntityOfPage" itemscope itemtype="https://schema.org/CreativeWork">
<meta itemprop="thumbnailUrl" content="https://testsite.com/img/article-2-picture.jpg" />
<p itemprop="headline">Article 2 headline</p>
<p itemprop="description">Article 2 first paragraph.</p>
<a itemprop="url" href="https://testsite.com/url-article-2.html">Read more</a>
</div>
<div itemprop="mainEntityOfPage" itemscope itemtype="https://schema.org/CreativeWork">
<meta itemprop="thumbnailUrl" content="https://testsite.com/img/article-3-picture.jpg" />
<p itemprop="headline">Article 3 headline</p>
<p itemprop="description">Article 3 first paragraph.</p>
<a itemprop="url" href="https://testsite.com/url-article-3.html">Read more</a>
</div>
</body>
上面的代码生成以下模式:
该代码在结构化数据测试工具中是有效的。
我担心在这里使用mainEntityOfPage
3次介绍文章片段会导致搜索引擎错误地认为我的页面是CreativeWork
类型,而不是Organization
类型,这才是本网页的真正主题。
因此,这段代码告诉搜索引擎,页面是Organization
的,在单独的页面上有3篇文章,还是只有CreativeWork
类型?
发布于 2019-03-24 01:05:37
你的结构化数据并没有传达你想要传达的信息。据说Organization
是三个CreativeWork
的主要实体。
因此,我试图声明
Organization
类型的主页,作为网页的主要主题。
为此,您需要一个表示主页的WebPage
项。
<body itemscope itemtype="http://schema.org/Organization">
<div itemprop="mainEntityOfPage" itemscope itemtype="http://schema.org/WebPage">
<link itemprop="url" href="https://example.com/" /> <!-- the canonical URL of your homepage -->
</div>
</body>
我想用Schema.org声明,这家公司已经写了3篇不同的文章,这些文章都位于他们自己的网页上。
为此,您需要说明公司和条款之间的关系的属性,例如:
注意,例如,publisher
只为一个方向(一篇文章有一个发布者)定义,而不是为另一个方向定义(组织已经发布了一篇文章).²,因此您必须在Article
中而不是在Organization
中提供该属性。
<article itemscope itemtype="http://schema.org/Article">
<div itemprop="mainEntityOfPage" itemscope itemtype="http://schema.org/ItemPage">
<link itemprop="url" href="https://example.com/url-article-1.html" /> <!-- the canonical URL of the article page -->
</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<link itemprop="url" href="https://example.com/" /> <!-- the canonical URL of the organization’s homepage -->
</div>
</article>
如果它们实际上是文章,则应该使用Article
类型而不是父类型CreativeWork
。
2微数据(与RDFa和JSON不同)只提供了一种非标准化的方法来在另一个方向上使用这些属性:see this answer
https://stackoverflow.com/questions/54912193
复制相似问题