Linked Data, RDF, MIME types and Apache settings
L inked data can be the basis for a new generation of Semantic Web has a very broad application prospects. W3C recently announced, SKOS Linked Data will be full of. (Needle, 2009) which is significant for the library community. SKOS of the linked data should benefit from the libraries of the United States Congress, the Library of Congress Subject Headings (Library of Congress Subject Headings) of all the Linked Data, Linked Data application to become a successful example, promoted the Linked Data to practical. This in turn can be said that libraries contribute to the development of the Internet instance. 
L inked Data are based on RDF and http protocols, in other words, Linked Data is to pass through the Http RDF data, and the RDF data is a special rule to follow the semantics of data, this rule is that any resources are used to characterize the URI. So URI \ RDF \ HHTP constitute the three cornerstones of Linked Data. The application of any Linked Data revolve around these three aspects of the. Such as:
- How to build a resource URI?
- How to create RDF resources?
- How to use http to transfer RDF?
- How to accept and parse RDF data resources? And so on.
L inked Data Application There are two basic models: a model for the browser / server mode, that people through the browser to access Linked Data; The other model is a client / server model, where clients mainly refers to the application system, the model is actually the system and data transfer between systems. Whatever the mode, Linked Data is to pass through Http.
H ttp protocol actually defines two processes, one request, the other is the response. To these two processes as the blueprint, we can simulate a Linked Data transfer process.
- Client-side or browser sends a request to the RDF file server, requests the server to return an RDF document. Send this request is simple, you can directly enter a rdf file suffix, such as http://www.cloudlibrary.info/rainzenfoaf.rdf rdf is a simple request. Of course, this request is very weak, the file suffix is not necessarily with the rdf for RDF format, in turn, RDF format file suffix it may not rdf. So, to pass with the file extension is not very reliable RDF request. What we need is a mandatory request RDF very clear way, this request can only be through the system (such as the browser) rather than be issued manually. Now a common browser can not issue such a request, in order to apply Linked Data RDF we need to send a request to the browser.
- RDF when the server receives a request, need to return an RDF document, and inform the client that this is a RDF file. This process is called content negotiation. To achieve this RDF-based content negotiation, which would set the MIMEType, the definition of an RDF type. RDF 2004, one on the content type: Application / RDF + XML to be registered. In terms of the Linked Data, content negotiation is very important, if you want to publish Linked Data, require the server can implement content negotiation.
- Device sent a service response to a client, particularly the browser, how to parse the RDF file? Particularly in the browser mode, because RDF is not for seeing, but to the machine to see how the machine language translation of the expression of adults to read? This in turn requires a special browser to parse RDF.
View from the process, applications linked data needs:
- RDF can send a request, and be able to resolve RDF browser, we call RDF browser. Keven described in his blog a lot of RDF browser or plug-ins. (Wei, 2009)
- A server to return RDF type of server. Fortunately, we often use the Apache open source http server: that is one of the few to achieve a good content negotiation server.
Published in the Linked Data using Apache, you need a simple set of the Apache needs to be added regarding the RDF of content-type, is set in Apache, or in. Htaccess add a type description: AddType application / rdf + xml rdf . This Apache receives a request for RDF, RDF can be sent back to type messages.
However, as application / rdf + xml is the new register, and some browsers do not compatible, I found a phenomenon, visit http://www.cloudlibrary.info/rdf/rainzenfoaf.rdf when the software by checking the file header that, the server returned an application / rdf + xml document, but by Firefox to see the file information, been interpreted as text / html. It seems firefox's default content-type is text / html, and not authorized application / rdf + xml type, when receiving this type, only use the default value.
Another interesting phenomenon is that, Apache's default type is text / plain, if no RDF type, the server can not confirm RDF file to start the default value, the RDF file as text / plain. Return the text file information, then the browser displays the text file. So, is the need to increase application / rdf + xml then this type? Is not necessarily a matter of fact, already stated, FireFox the application / rdf + xml interpreted as text / html, then we add a type: AddType text / html rdf also line, or directly to the Apache's default value is set to text / html on the line. So how do you explain the return to send over the text / html message, the browser was able to resolve it into RDF? It seems that the browser client also needs a judge, by analyzing the markup language to determine whether the RDF file. However, in the communication between systems, I think, or should be enabled application / rdf + xml, so clearly more reliable.
This text is formed during the discussion and Keven, thanks to Keven contribution to this article.
References:
Needle, David. 2009. W3C's New SKOS Standard Advances Linked Data. [Online] August 18, 2009. [Reference date: August 27, 2009.] http://www.internetnews.com/dev-news/ article.php/3835176 .
Wei, Liu keven. 2009. Associated data browser. Number Chart Research Notes. [Online] August 26, 2009. [Reference date: August 27, 2009.] http://www.kevenlw.name/archives / 1844 .
Background Links
http://www.iana.org/assignments/media-types/application/



