OpenGraph or Schema.org?

后端 未结 8 985
情歌与酒
情歌与酒 2020-11-27 11:18

Just wondering whether you guys out there are favouring the OpenGraph protocol following markup like:



        
相关标签:
8条回答
  • 2020-11-27 11:35

    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

    0 讨论(0)
  • 2020-11-27 11:36

    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.

    0 讨论(0)
  • 2020-11-27 11:40

    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

    0 讨论(0)
  • 2020-11-27 11:42

    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.

    0 讨论(0)
  • 2020-11-27 11:53

    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.

    0 讨论(0)
  • 2020-11-27 11:56

    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 ;)

    0 讨论(0)
提交回复
热议问题