微数据还是 JSON-LD?我很困惑 [英] Microdata or JSON-LD? I'm confused

查看:43
本文介绍了微数据还是 JSON-LD?我很困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使在谷歌搜索了几个小时之后,我也没有找到明确且最新的答案,所以它是这样的:

I haven't found a clear and updated answer, even after googling for a few hours, so here it goes:

  1. 我知道微数据和 JSON-LD 的优缺点.我也知道微数据是从 W3C 中删除的(因此也从浏览器的 API 中删除).我不确定的是,它将如何影响任何专门将微数据用于 SEO 目的的网站.

  1. I am aware of the advantages and disadvantages of both Microdata and JSON-LD. I also know that Microdata was dropped from W3C (and consequently from the browsers' API). What I'm not sure about is that how it will affect any site where Microdata is used specifically for SEO purpose.

Google 是否支持 SERP 的 JSON-LD?建议使用什么格式?我正在寻找更新的答案 - 不是 2011 年或 2012 年的(如果它们仍然适用,请随时发布).

Does Google support JSON-LD for SERPs? What format does it recommend to use? I am looking for updated answers - not from 2011 or 2012 (if they are still applicable though, feel free to post it).

对于具有大量内容(例如:50000 个视频、图像等)的动态站点,什么更合适:JSON-LD、微数据或 RDFa?为什么?

What is more appropriate for a dynamic site with lots of contents (think: 50000 videos, images etc): JSON-LD, Microdata or RDFa? Why?

推荐答案

支持微数据的消费者支持微数据,无论是否或在何处指定微数据.

Consumers that support Microdata support Microdata, no matter if or where Microdata is specified.

可以想象,新用户可能会决定不支持它,但该语法仍然非常流行,并且仍然是 WHATWG 的 HTML Living Standard 的一部分,因此它可能不会消失.

It’s conceivable that new consumers might decide not to support it, but the syntax is still very popular and still part of WHATWG’s HTML Living Standard, so it’s probably not going to vanish.

几年前,JSON-LD 的许多功能都不支持,他们建议作者使用 Microdata(他们也支持 RDFa).今天不一样了.

Some years ago, JSON-LD was not supported for many of their features, and they recommended that authors use Microdata (and they supported RDFa, too). Today it’s different.

请参阅 Google 的标记格式和展示位置:

See Google’s Markup formats and placement:

JSON-LD 是推荐的格式.Google 正在为所有标记驱动的功能添加 JSON-LD 支持.下表列出了例外情况.我们建议尽可能使用 JSON-LD.

JSON-LD is the recommended format. Google is in the process of adding JSON-LD support for all markup-powered features. The table below lists the exceptions to this. We recommend using JSON-LD where possible.

根据上述表格,Microdata 和 RDFa 支持 Google 的所有数据类型,而 JSON-LD 支持除 Breadcrumbs 功能之外的所有数据类型.

According to the mentioned table, Microdata and RDFa support all of Google’s data types, while JSON-LD supports everything except their Breadcrumbs feature.

我不会太看重他们的推荐.他们说结构化数据标记最容易以 JSON-LD 格式表示",但我认为可以肯定地说,这仅适用于以编程方式生成结构化数据的作者(尤其是使用支持 JSON 的工具).
对于手动添加结构化数据标记的作者,使用 Microdata 或 RDFa 通常更容易,并且使用这些语法可以最大限度地降低作者更新内容而不更新结构化数据的风险(参见 DRY 原则).

I wouldn’t give much weight to their recommendation. They say that "Structured data markup is most easily represented in JSON-LD format", but I think it’s safe to say that this only applies to authors that generate the structured data programmatically (especially from tools that support JSON).
For authors that manually add the structured data markup, it’s typically easier to use Microdata or RDFa, and using these syntaxes minimizes the risk that an author updates the content without updating the structured data, too (see DRY principle).

除非您知道(并关心)不支持所有三种语法的消费者,否则这无关紧要.使用对您和您的工具来说更容易的东西.

Unless you know (and care for) consumers that don’t support all three syntaxes, it doesn’t matter. Use what is easier for you and your tools.

如果你没有偏好,我会说 JSON-LD 或 RDFa,因为与微数据相反,

If you have no preference, I would say JSON-LD or RDFa, because contrary to Microdata,

  • 两者都是 W3C 推荐标准,
  • 两者都可以在非 HTML5 上下文中使用,
  • 两者都允许(轻松)混合多个词汇.

JSON-LD 如果您希望结构化数据不与标记混合"(= 复制内容),RDFa 如果您希望使用现有标记(= 不复制内容).

JSON-LD if you like your structured data not "intermingled" with your markup (= duplicating the content), RDFa if you like to use your existing markup (= not duplicating the content).

这篇关于微数据还是 JSON-LD?我很困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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