OpenGraph 还是 Schema.org?

发布于 2024-11-16 07:02:00 字数 1700 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

╭ゆ眷念 2024-11-23 07:02:00

因此,首先从一些陈词滥调和扭曲的隐喻开始——我们谈论的是苹果和橘子,比较 OG 和 Schema.org,当谈到这个元数据时,它就是课程的马。

正确的答案取决于您向页面添加元数据的意图。你希望获得什么?你在这里的胜利是什么?不同形式的元数据的用途略有不同。

Google 已明确表示,它正在从对微格式的关注转向对 Schema.org 的关注,以便为搜索构建丰富的数据结果。如果您想针对 Google、Bing 和其他搜索引擎进行优化,请添加 Schema.org 标记。这是 HTML5 介入的方向。

如果您想要从将内容转变为社交对象并使其与 Facebook 宇宙的社交图谱进行多点连接中受益,则需要添加 Facebook OG 标记。

根据我的经验,大多数人都希望从这两种方法中获益——在搜索排名方面尽其所能,并通过社交渠道增加影响力和分布。因此,恕我直言,最好尽可能彻底地添加适合您内容的 Schema.org 标记并使用开放图谱元数据。他们所做的事情略有不同,但互补。

So, to start with a couple of cliche's and mangled metaphors - we're talking apples and oranges a bit comparing OG and Schema.org, and when it comes to this metadata it's horses for courses.

The right answer depends on your intent, in adding metadata to your page. What is it that you're hoping to gain? What is the win for you here? The different forms of metadata are for slightly different purposes.

Google has made it clear that it's moving away from a focus on microformats and onto a focus on Schema.org in order to build rich-data results for search. If you want to optimize for Google, Bing and other search engines add the Schema.org markup. It's the direction HTML5 has stepped in.

Facebook OG markup is to be added if what you want is to benefit from turning your content into a social object and enable its multi-point connectivity to the social graph that is the Facebook universe.

In my experience most people are looking to gain from both approaches - do as well as they can in search rankings and increase reach and distribution through social channels. So, IMHO, it's probably best to be as thorough as possible adding the Schema.org markup where it fits your content and use Open Graph metadata. They do slightly different, but complementary things.

洋洋洒洒 2024-11-23 07:02:00

我们在这里讨论两个独立的概念:语法词汇

开放图协议Schema.org词汇表。其他词汇例如,都柏林核心FOAF,以及 SIOC

这些词汇表通常与特定语法耦合。如果您想使用此类词汇表来描述 HTML 文档中的内容,您可以使用语法 RDFa和/或微观数据

我应该集成哪一个,因为我认为只需要 1 个? [其实只能整合一个或者吗?]

你的第一个示例使用开放图协议(=词汇)和RDFa(=语法)。您的第二个示例使用 Schema.org(= 词汇)和 Microdata(= 语法)。

你可以随意混合它们。 (您可以在同一页面上使用具有两种语法的两个词汇表。您可以仅使用一种语法来使用这两个词汇表。您可以仅使用一个具有两种语法的词汇表,或者仅使用一种语法。...)。这完全取决于您的具体用例。

你想实现什么目标?如果您对解析您的内容的特定第三方感兴趣,您应该检查他们的文档。它们通常仅支持具有特定语法的特定词汇表。

但是,如果您想使用语义元数据标记内容,而不考虑特定的用例,则可以坚持一种语法并使用适合您的内容的词汇表。就我个人而言,我会选择 RDFa (Lite)。它基于 RDF,它也适用于 HTML 以外的其他格式。它是 W3C 推荐标准(Microdata 不是)。您会发现大多数词汇表都是在 RDF(S) 中定义的。请参阅我关于RDFa 和 Microdata 的未来的回答。

We are talking about two separate concepts here: syntax and vocabulary.

The Open Graph Protocol and Schema.org are vocabularies. Other vocabularies are, for example, Dublin Core, FOAF, and SIOC.

These vocabularies are typically not coupled to a specific syntax. If you want to describe your content in HTML documents with such a vocabulary, you could use the syntaxes RDFa and/or Microdata.

Which one should I integrate as I think only 1 is necessary ? [actually can you only integrate one or ?]

Your first example uses Open Graph Protocol (= vocabulary) with RDFa (= syntax). Your second example uses Schema.org (= vocabulary) with Microdata (= syntax).

You can mix them up as you like. (You could use both vocabularies with both syntaxes on the same page. You could use both vocabularies with only one syntax. You could use only one vocabulary with both syntaxes, or with only one syntax. …). It totally depends on your specific use case.

What do you want to achieve? If you are interested in a specific 3rd party parsing your content, you should check their documentation. They typically support only certain vocabularies with certain syntaxes.

But if you want to mark up your content with semantic metadata without having a specific use case in mind, you could stick to one syntax and use whichever vocabularies are appropriate for your content. Personally, I’d choose RDFa (Lite). It is based on RDF, which works with other formats than HTML, too. It is a W3C Recommendation (Microdata is not). And most vocabularies you’ll find are defined in RDF(S). See my answer about the future of RDFa and Microdata.

怎会甘心 2024-11-23 07:02:00

一切都取决于您是否尝试针对社交世界(Facebook)或搜索引擎标记您的网站。两者都是推荐的,但如果你只有时间之一,那么优先考虑公司的营销重点。 OGP 对 Facebook 来说意义重大,但在 SEO 中却没有丝毫用处。 Seo完全依赖于微数据,是正确创建html5的方式。

HTML5Doctor 上的微数据
http://html5doctor.com/microdata/

Google 谈论标记:
http://www.google.com/support/webmasters/bin /answer.py?answer=1211158

Bing 谈论标记:
http://onlinehelp.microsoft.com/en-us/bing/hh207238.aspx


更新

对于任何找到这个答案的人来说,自从我第一次发布它以来,已经发生了很多变化。
Schema.org 被所有主要搜索引擎广泛使用,但现在标记比 JSON-LD 更受青睐。 SEO 怀疑论者概述了这一变化的精彩文章由谷歌制作。

Google 结构化数据提供 JSON-LD 格式的文档,尽管 RDFa 和微数据仍然不全面,但我们大力鼓励支持。

JSON-LD 应与您尝试针对 Facebook 的 OGP、针对 Twitter 的 Twitter 卡等的任何社交渠道结合使用

All depends if you're trying to markup your website for a social world (facebook) or search engines. Both are recommended but if you only have time for one then prioritize the company's marketing focus. OGP is huge for facebook, but does not have an ounce of use in SEO. Seo is completely reliant on micro-data and is the way for proper html5 creation.

HTML5Doctor on Microdata
http://html5doctor.com/microdata/

Google talking about markup:
http://www.google.com/support/webmasters/bin/answer.py?answer=1211158

Bing talking about markup:
http://onlinehelp.microsoft.com/en-us/bing/hh207238.aspx


Update

For anyone finding this answer, a lot has changed since I first posted it.
Schema.org is widely used by all major search engines and then some but the markup is now preferred to JSON-LD. Great article from SEO Skeptic outlining the change made by Google.

Google Structured Data provides documentation in JSON-LD and is greatly encouraged although RDFa and microdata is still partial supported.

JSON-LD should be used in conjunction with any social channels you are trying to target OGP for Facebook, Twitter Cards for Twitter, etc

姜生凉生 2024-11-23 07:02:00

它们可以安全地一起使用。目前,这两项工作使用不同的语法对 HTML 中的数据进行编码(W3C RDFa 或 Microdata),但 W3C 正在积极讨论这些设计的最终融合。或者至少具有更好的兼容性。 Schema.org 和 OGP 之间或使用两者的服务之间是否会在词汇层面上实现融合,还有待观察。但与此同时,它们都可以增加价值并且可以安全地组合。

They can both be used safely together. Currently the two efforts use different syntaxes to encode data in HTML (W3C RDFa or Microdata), but there are active discussions at W3C towards eventual convergence of those designs. Or greater compatibility, at least. Whether there will also be convergence at the vocabulary level between Schema.org and OGP, or services that consume both, remains to be seen. But in the meantime they both add value and can be safely combined.

嘦怹 2024-11-23 07:02:00

谷歌确实偏爱模式,而开放图更适合与社交媒体相关的网络内容。 包含前缀

<html prefix="og: http://ogp.me/ns#">

您的示例代码看起来不错,但不要忘记在每个具有 ogp 的页面的头部

。您可以使用丰富网页摘要测试工具

http:// www.google.com/webmasters/tools/richsnippets

对于 Schema,您可以使用 SDTT:结构化数据测试工具进行检查

https://search.google.com/structured-data/testing-tool

Google does favor schema, and open graph is better for web content that is related to social media. Your sample code looks good, but don't forget to include the prefix

<html prefix="og: http://ogp.me/ns#">

in the head of each page that has ogp.

You can check to make sure the ogp or schema works by using the rich snippet testing tool

http://www.google.com/webmasters/tools/richsnippets

In the case of Schema, you can check by using the SDTT: Structured Data Testing Tool

https://search.google.com/structured-data/testing-tool

不甘平庸 2024-11-23 07:02:00

为什么不使用 json-ld 进行标记?我正在考虑实现基于 json-ld 的 schema.org 标记。这样就不会被打扰。我的幽灵博客就用它。不知道搜索引擎是否支持得很好。但 schema.org 上的所有示例现在都包含 json-ld 的实现。
看这里
http://schema.org/WebPage

我所有的应用程序都使用 Twitter 卡、fb opengraph 标签和 rel 等微格式标签和结构化的 schema.org 元数据。我发现实施 schema.org 元数据最具侵入性。因此,用 json-ld 替换最后一位并保持代码干净是很好的。标签太多,建议保持 html 小;)

Why not use json-ld for markup? I'm thinking of implementing json-ld based schema.org markup. That way it'll not be intrusive. My ghost blog uses it. Don't know if it's well supported by search engines yet. But all examples on schema.org now includes implementation for json-ld.
see here
http://schema.org/WebPage

And all my apps use twitter cards, fb opengraph tags and microformats tags like rel and structured schema.org metadata. And I find implementing schema.org metadata most instrusive. So replacing this last bit with json-ld and keeping code clean is nice. Too many tags and it's recommended to keep your html small ;)

只怪假的太真实 2024-11-23 07:02:00

RDFa og 是通过 REST 更好地识别内容的统一方式,以便在嵌入到创建时未预测的容器中时进行考虑。如果容器被预先确定为搜索结果,则搜索机器人可以很好地理解 schema.org 微数据。容器发布者和发布者有责任进行展示。这种质量自由可能会临时调整搜索排名,而 schema.org 将根据内容创建者的意图临时调整搜索结果的可理解性。当与竞争语义标记技术一起使用时,词汇表通常会被忽略,因此最好仅将微数据与 schema.org 一起使用,将 og 仅与 RDFa 一起使用。微数据和 RDFa 可以共存于同一文档中。

RDFa og serves as uniform way to recognize content better by REST for consideration when embedding within containers not predicted at the time of creation. If the container is predetermined as search results, then schema.org microdata is well-understood by search bots. With og presentation is responsibility of container publisher & such quality freedom might improvise search ranking, while schema.org will improvise search result comprehensibility in the context of content creator's intent. The vocabularies usually are ignored when used with the competing semantic markup technique so best to use microdata with schema.org only and og with RDFa only. Both microdata and RDFa can coexist in same document.

夜声 2024-11-23 07:02:00

rdfa(opengraph) 和 microdata(schema) 不能在同一 html 页面上使用

“3) 我们将继续支持现有的丰富摘要标记格式。
如果您已经使用微格式或 RDFa 在页面上完成标记,我们将继续支持它。需要注意的一点是:虽然可以使用新的 schema.org 标记或继续使用现有的微格式或 RDFa 标记,但您应该避免在同一网页上将这些格式混合在一起,因为这可能会让我们的解析器感到困惑。”

SRC :http://googlewebmastercentral.blogspot.in/2011/06/introducing-schemaorg-search-engines.html

rdfa(opengraph) and microdata(schema) cannot be used on same html page

"3) We’ll continue to support our existing rich snippets markup formats.
If you’ve already done markup on your pages using microformats or RDFa, we’ll continue to support it. One caveat to watch out for: while it’s OK to use the new schema.org markup or continue to use existing microformats or RDFa markup, you should avoid mixing the formats together on the same web page, as this can confuse our parsers."

SRC: http://googlewebmastercentral.blogspot.in/2011/06/introducing-schemaorg-search-engines.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文