You may be a little unfamiliar with this topic, and you don’t know what it is. To put it bluntly, RDFa is to make your page better understood by the machine, rather than simply displaying your page. Here’s about it. Give a brief introduction to what RDFa is.
background :
Why does RDFa appear?
The current Internet is mainly created for human use. Although machine-readable data is the first to appear on the Internet, these machine-readable data are generally published on the Internet in separate files and separate formats. , the correlation between machine-readable and human-readable data is rather minimal. The result is that current browsers are very poor at parsing and processing web data because the browser is only responsible for displaying this information.
But what is the use of the browser being able to identify this data?
It has many uses. If the browser can recognize this data well, it will form an inherent data structure. If these data structures are used, we do not need to record some information through countless ctrl+ c and ctrl+V to complete, one-click operation is very convenient, and for search engines, it means better search result display and more powerful data mining capabilities.
So based on this purpose, RDFa appeared, just to achieve our purpose. Its full name is "Resource Description Framework in attributes". In fact, you can get a lot of information from its full name, haha.
Introduction to RDFa:
We mentioned why RDFa appears, so what is RDFa? It is mainly reflected in the following points:
Compared with the pages we usually make, when using RDFa technology, its header doctype is defined like this:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML+RDFa 1.0//EN”
" http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd ">
The above one is based on XHTML, mainly because of the scalability of this tag, which can make RDFa better embedded. However, although html cannot have such good extensions, there are still standards for it, which are defined as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML4+RDFa 1.0//EN"
http://www.w3.org/MarkUp/DTD/html4-rdfa-1.dtd >
For html, the only problem that needs to be solved is the lack of namespace.
Advantages :
Implementation principle :
The implementation is mainly to add RDFa corresponding attributes to existing tags by introducing namespaces so that browsers or search engines that support RDFa technology can parse them, so as to achieve the purpose of optimization. Let's use a simple code as an example. Bar:
<div xmlns:dc=" http://purl.org/dc/elements/1.1/ " about=" http://www.example.com/books/wikinomics ">
<span property="dc:title">Wikinomics</span>
<span property="dc:creator">Mr right</span>
<span property="dc:date">2006-09-02</span>
</div>
In the above code example, the about attribute and property attribute in RDFa attributes are mainly used. This code example illustrates an article, and then describes information related to this article, such as title, creator and creation date. These attributes can enable machine recognition that supports RDFa, thus forming a system with the structure that we humans understand, to achieve our purpose.
What we have to do is that while we understand this network, we also need to let the machine understand it as well as we do.
prospect:
From these we can see that the prospect of RDFa is still very good. If one day real browsers also support it, then a new situation will appear on our Internet. We are looking forward to it. If you have any questions, you can also join us. Discuss.
Original text: http://www.rainaxin.com/2009/08/technology-share-about-rdfa/