- From: Nandana Mihindukulasooriya <nmihindu@fi.upm.es>
- Date: Wed, 30 Jul 2014 12:08:27 +0200
- To: public-hydra@w3.org
- Message-ID: <CAAOEr1n6p7WOcAR66-y_9s4e8vgmHKQ8rtBk2WUnPHLbu4rGNA@mail.gmail.com>
Looking at the Section 4.2.2 HTTP GET and HEAD in Triple Patterns Fragments draft, [[reply with status code 404 Not Found if the fragment (page) with the given URL does not exist or is empty, i.e., no triples match the selector.]] If I understand correctly, these two scenarios are bit different and it might be useful differentiate those two, isn't it? The former could be because I used a wrong template or mistyped something but in the latter case the fragment is actually valid but it just happen to be empty. So may be for the latter "204 No Content" would be a better response so that the client knows the reason. [[reply with status code 404 Not Found if the selector is invalid i.e., the parameter values are not in the domain of the selector. This is the case if, for instance, a literal is used as subject. ]] In this case, isn't it better to send a '400 Bad Request' rather than a '404 Not Found'. I can see why 404 could be technically correct because that fragment URL doesn't exist but may be it is more helpful to the client to know the reason. Looking at the definitions in RFC7231, it seems 404 could be used for all the aforementioned scenarios but may be it is useful to differentiate those using the response codes. [[ The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists. The 204 (No Content) status code indicates that the server has successfully fulfilled the request and that there is no additional content to send in the response payload body. ]] Best Regards, Nandana On Wed, Jul 30, 2014 at 11:34 AM, Andreas Kuckartz <a.kuckartz@ping.de> wrote: > Ruben Verborgh: > >> "The 4xx (Client Error) class of status code indicates that the client > >> seems to have erred." > >> http://tools.ietf.org/html/rfc7231#section-6.5 > >> > >> An empty page or fragment is (normally) not a result of an error. Any > >> 4xx code therefore is (normally) inappropriate. > > > > Depends on how you look at it. > > > > Client: "Give me the fragment with selector ?x rdf:type ex:Alien." > > Server: "You asked for something that didn't exist. That's an error." > > > > In other words, 4xx errors are those that only a client can fix. > > And indeed, the client can fix by asking a different fragment. > > Well, I think that it is perfectly legitimate and not erroneous to ask a > server to provide a set of all aliens. > > And in this concrete case the server very likely _can_ provide a > non-empty set by using improved SETI techniques ! > > Cheers, > Andreas > >
Received on Wednesday, 30 July 2014 10:09:15 UTC