What is the relationship between RDF, RDFa, Microformats and Microdata

巧了我就是萌 提交于 2019-12-03 04:52:33

问题


I've done quite a bit of research but I can't understand the exact relationship between the 3. Also, now that W3C has officially recognised RDFa, would you recommend it over Microdata, taking into consideration that it matches Microdata's features and more?


回答1:


<sarcasm>I can't imagine what you find so confusing</sarcasm> (edit: these tags were invisible before)

Very briefly:

  • Microformats A way to use html pages as both a human readable document and machine readable data, without repetition (e.g. sticking CSV in the head element).
  • RDF A data model designed for the web. Schemaless, uses URLs to name types and relations.
  • RDFa A way to encode (write) RDF in html, following the style of microformats (i.e. minimising repetition). Works by adding a few attributes to html.
  • Microdata An alternative to RDFa, using different attributes and a different data model.

Less briefly, RDF came from attempts to make data 'webby'. There was even a plug-in for browsing RDF's precursor MCF (from Apple, curiously). The data model was designed so that you could write what you want without having to pre-arrange how to column names or key meanings with everyone else on the web. RDF was standardly written (serialised) using XML (although other, more pleasant, formats are available).

So in this world you might have a readable homepage (me.html) and a data homepage (me.rdf) for machines to scoop up. Those machines won't understand the meaning of <p>I live in <a href="http://example.com/Chicago">Chicago</a></p>, but they might be able to use :me ex:livesIn <http://example.com/Chicago> if they look up 'livesIn'.

Microformats also tries to make data 'webby', or perhaps that should be the web 'data-y'. The insight here is that there's a lot of data in web pages, between the prose. If you have a few hints a machine can work out that that piece of html above is basically an address. Those hints are microformats. Typically they use conventions around html class names to indicate that the content is more than text.

So microformats don't need a separate web page for machines. But microformats only cover a few types of data (addresses, friend links, position...) because of the way they work. Each is a particular convention which needs to be agreed. Used without care they can mix badly, too.

RDFa is an attempt to get both the flexibility of RDF and the simplicity of microformats. Microdata was a response to RDFa, but with a different data model (roughly arrays and hashes rather than a relational model). Unlike microformats neither dictate what sort of information is provided, just how it is encoded.

To complete what's missing we now have schema.org, which is an initiative from the big search engines (Google, Bing, Yahoo, Yandex) to index web data. schema.org coordinates those meanings so the search engine knows that, say, events have locations. Microdata was originally used by schema.org, but now both microdata and RDFa are supported.

I'd ignore microformats these days and go for schema.org. My personal taste is the RDFa encoding, but either it or microdata should work fine.




回答2:


I suggest to ignore the semantic web at all. The search engines won't sent you more visitors because of that. Instead they will use the perfectly organized data to provide the answer without sending you visitors at all.

Today you can see the problem with the following "movie box" example: https://www.google.com/search?q=The+Godfather

The IMDb and Rotten Tomatoes ratings are displayed. A snippet of Wikipedia as well. Nice for the users, bad for those websites. Or how often did you visit IMDb in the past and today?

And don't forget. The displayed data is not from IMDb or Rotten Tomatoes alone. Dates, director, awards, music, images etc. have been collected from other sites. For example a search engine can easily search in its database for "The Godfather" + "Director" and if 99 of 100 websites include the name "Francis Ford Coppola" its easy to verify the answer without any manual interaction.

Finally search engines are able to build there own content without paying or mentioning the authors. And with semantic classification you will make it easier for them.




回答3:


all three are an attempt to make web content more semantic.

rdfa faced many barriers to entry; it shared the same growing pain(s) that xml (rdfa is xml based) did in the early years of the web, only probably more significant because there were less developers invovled.

i don't know enough about rdfa to recommend it over microdata. i am biased towards microdata because Google, Yahoo!, and Microsoft (now Bing) got together and created it. rdfa was being developed and the microformats proposal was done. moreover microformats were already in mass production and consumption on the web. so the big 3 decided to collude and came up with microdata. i'm a bit jaded, i think because i don't fundamentally understand why microformats was ditched. sounds like a bunch of smoke and mirrors.

so i recommend microformats over all. they're sooooooo easy. and so awesome. what can you achieve with the microdata that you can't with microformats?

that said....i'd pick microdata over rdfa because they are just as easy. and data-attributes are far superior to html classes. actually, maybe that's the big bonus? data-attributes? just like your bit of research, i've looked long and hard for the reasonings behind microdata but all i can find is normal, cookie-cutter posts.



来源:https://stackoverflow.com/questions/14307792/what-is-the-relationship-between-rdf-rdfa-microformats-and-microdata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!