Accessing the semantic web on the web
When IRI are published on the web, they are supposed to have a description that comes with them, accessible in different formats using
Accept: HTTP header. Well introduced in this article, the specifications urge to use the status code
303 See Also for redirecting to the queried resource description in the correct format. For further reading, Ruben Veborgh had written an article on the topic.
For wikidata, you can use the following command to get a entity in RDF/XML serialization:
curl -I -H "Accept: application/rdf+xml" https://www.wikidata.org/entity/Q51740
and you will be redirected to this url : https://www.wikidata.org/wiki/Special:EntityData/Q51740.rdf
You can use the mime type
plain/text to get a Ntriple serialization.
In practice on NGINX, it can be implemented following this article.
Build the web on top of the semantic web
The question is the following: how to build a web on top of graphs of data belonging to the semantic web.
SPARQL answers data model and schema
An issue with SPARQL in the web is the choice of data model for the answers. SPARQL queries can return two kind of data either tuples of value by using SELECT or graph by using CONSTRUCT. Tuples answers doesn't explain the relations between the values they contain. In that sense, tuples are not self-described structure for the answers as JSON documents are in most Web API answer. Since JSON is the most used data model on the web, it can be tempting to represent CONSTRUCT answers using it, but it is not capable to represent graph data; only tree data. Ones again, SPARQL seems to expressive.