Skip to content

Design Objective: Follow Best Practices

timrdf edited this page Oct 9, 2012 · 52 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)

Resources

303 Redirects and HTML link

http://vivo.ufl.edu/individual/n1225880055 303s to http://vivo.ufl.edu/display/n1225880055, which includes:

<link rel="alternate" type="application/rdf+xml" href="/individual/n1225880055/n1225880055.rdf" /> 

LOC example

<link rel="alternate" type="application/rdf+xml" href="http://id.loc.gov/vocabulary/countries.rdf"/>
rapper -q -g -o turtle http://id.loc.gov/vocabulary/countries.html
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://www.w3.org/1999/xhtml> .

<http://id.loc.gov/vocabulary/countries.html>
    <http://www.w3.org/1999/xhtml/vocab#alternate> <http://id.loc.gov/vocabulary/countries.json>, <http://id.loc.gov/vocabulary/countries.nt>, <http://id.loc.gov/vocabulary/countries.rdf>, <http://id.loc.gov/vocabulary/countries/feed/1> ;
    <http://www.w3.org/1999/xhtml/vocab#stylesheet> <http://id.loc.gov/static/css/loc_print_v2.css>, <http://id.loc.gov/static/css/loc_standard_v2.css> .

Semantic Q&A

HTTP 406

That's an ongoing argument in http circles. The spec clearly allows it, and a lot of people think it's the implied recommended behavior. However, the spec has this informative note:

""" Note: HTTP/1.1 servers are allowed to return responses which are not acceptable according to the accept headers sent in the request. In some cases, this may even be preferable to sending a 406 response. User agents are encouraged to inspect the headers of an incoming response to determine if it is acceptable. """

I think it's stupid, and clearly has an anti-user feel to it. If you're using Accept headers/conneg, then you have to be checking the content-type of the response anyway, so there shouldn't be any problem with sending them back a response with a type they didn't request if you can't satisfy their conneg preferences directly. But doing the 406 thing ends up fucking people up like you who try to do curl or something and end up with a zero-length content body. It's stupid (especially if there's no content body that tells you what media types are acceptable which IS recommended by the spec).

At the very least our system should include a list of acceptable media types. I'd suggest it should just be picking a canonical one, though, and returning that in case of conneg failure.

-g

Clone this wiki locally