kianschmalenbach / rdf-browser

A Firefox Add-on that requests RDF files and renders RDF files as Turtle documents with clickable links
MIT License
16 stars 6 forks source link

Allow for rendering files with incorrect content types #1

Closed kaefer3000 closed 4 years ago

kaefer3000 commented 4 years ago

Hi,

great work, I find the extension really useful! I wonder if you could enable the following functionality: When I look at RDF files on the web, they often do not come with the right content-type header set, as the web server in question does not have RDF media types in its list of media types. For instance, GitHub, which ships RDF/XML and Turtle files as text/plain, see (here)[https://raw.githubusercontent.com/w3c/rdf-tests/gh-pages/rdf-xml/datatypes/test001.rdf], Eclipse Jetty, and also, in versions from before 2011, Apache Tomcat and Apache Web Server. Of course, there should not be semantics in URIs, but often, the "file extension" gives hints about what the type of the file may be. Therefore, besides checking for the content-type header, you could also look for the end of URIs before query and fragment, and either enable your extension immediately, or ask the user if s/he wants to try the extension, as the file extension looks like it is RDF, but the content-type does not say it.

Cheers,

Tobias

kianschmalenbach commented 4 years ago

Hi Tobias,

Thanks for your feedback! I agree that this feature might be useful since many servers are not configured to send the correct content-type header. I will include it in the next release of the plugin. Moreover, I am planning to add a whitelist and blacklist such that each user can also manually configure URIs where the plugin should kick-in or not, as there is sometimes also the opposite problem (content-type header with RDF format even though the actual page content is different).

I will ping you once the new release is available.

Cheers, Kian

kianschmalenbach commented 4 years ago

Hi Tobias,

The new version including this functionality is now released. The consideration of the end of URIs can be enabled on the plugin's settings page (about:addons).

Cheers, Kian