Google无法使用相同的URI ID在同一页面中正确合并微数据和json + ld [英] Google does not correctly merge microdata and json+ld in the same page using same URI id

查看:122
本文介绍了Google无法使用相同的URI ID在同一页面中正确合并微数据和json + ld的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有微数据"和"json + ld"代码的产品页面.两种代码都引用相同的@id URI对象( http://www.example.org/product# ),因此我希望混合/合并"这两个属性,但是结构化数据测试工具会显示2种个人"产品,因此....

I have a product page with "microdata" and "json+ld" codes. Both of the codes refers to the same @id URI object (http://www.example.org/product#this) so I would expect to "mix/merge" both properties, but instead structured data testing tool shows 2 "individual" products so....

1- Google是否支持在同一页面中使用两种语法?
2-实施得好吗?我可以使用微数据的itemId和json + ld的@id将两个代码引用到同一对象吗?
3-就结构数据索引而言,这会损坏我的页面吗?

1- Does Google support using two syntax in the same page?
2- Is this well implemented? Can I refer two codes to the same object using itemId for microdata and @id for json+ld?
3- Can this damage my page in terms of structure data indexing?

谢谢

您可以在测试工具中使用此代码进行检查:

You can check it out using this code in test tool:

<div itemscope itemtype="http://schema.org/Product" itemid="http://www.example.org/product#this">
    <a itemprop="url" href="http://www.example.org/product">
    <div itemprop="name"><strong>Product Name</strong></div></a>
    <div itemprop="description">Product Description</div>
    <div itemprop="brand" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">Product Brand</span></div>
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">        <span itemprop="price">100</span><link itemprop="itemCondition" href="http://schema.org/NewCondition" /> New</div>
</div>
<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@id": "http://www.example.org/product#this",
  "name": "Product Name",
  "@type": "Product",
  "image": "http://www.example.com/anvil_executive.jpg",
  "mpn": "925872",
  "brand": {
    "@type": "Thing",
    "name": "ACME"
  },
  "offers": {
    "@type": "Offer",
    "priceCurrency": "USD",
    "price": "119.99",
    "itemCondition": "http://schema.org/UsedCondition",
    "availability": "http://schema.org/InStock"
  }
}
</script>

推荐答案

我的猜测是Google的结构化数据测试工具不支持不同的语法,因为如果使用相同的语法,它似乎可以工作.但是,由于它们仍然正确显示URI(在两种情况下均为http://www.example.org/product#this),您可能会说这只是工具的界面无法合并它们.
但是,据我所知,Google仍然没有文档来支持这些主题URI(但这并不一定意味着它们不支持这些URI),因此对他们而言可能无关紧要.

My guess would be that Google’s Structured Data Testing Tool doesn’t support this for different syntaxes, as it seems to work if using the same syntax. But as they still display the URIs correctly (http://www.example.org/product#this in both cases), you could argue that it’s just the tool’s interface that doesn’t merge them.
However, as far as I know Google does not document to support these subject URIs anyway (but this doesn’t necessarily mean that they don’t support it), so it might not matter for them.

如果使用 http://linter.structured-data.org/,您的示例效果很好:它会创建带有两个品牌和两个报价的一个项目.

Your example works fine if using http://linter.structured-data.org/: it creates one item with both brands and both offers.

这篇关于Google无法使用相同的URI ID在同一页面中正确合并微数据和json + ld的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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