W3C home > Mailing lists > Public > public-media-annotation@w3.org > December 2011

[MAWG-API] Status code 206

From: Florian Stegmaier <stegmai@dimis.fim.uni-passau.de>
Date: Wed, 21 Dec 2011 12:38:12 +0100
Message-Id: <B78BC6A6-9CA1-490F-8455-B5994E96E3AC@dimis.fim.uni-passau.de>
To: public-media-annotation@w3.org
Dear all,

while creating the JSON responses it was quiet unclear, how the status code 206 should be used. I had a few discussions with Werner and Martin about this. We have defined it as follows in the spec:

"206 - Partial Content - only a subset of the available data stored in the result set"

There are quiet a few ways, how it could be interpreted.

Currently, code 206 (partial content) seems to be use in cases, where not all fields of the response data structure are filled, as the information was not present in the source document. IMO this is incorrect due to the following reasons.

According to RFC2616, 206 is a partial GET request, i.e. only part of the existing document is returned. Thus, 206 should in our case only be used. If only part of the information in the source document can be returned. If all information from the source document is returned, 200 should be used, even if this does not fill all possible return values.

It is the usual case, that not all return values can be filled (e.g., language for each and every property). Thus using not OK return code seems very impractical, as an error status would be the default. Also, many of the example JSON responses seem to fill these values with a kind of default (e.g., set language to "en"). This should not be done, as it invents information that is (i) not in the source document and (ii) optional. In such cases, the respective attributes should not be returned.

To make this clear, the definition of this status code should be revised in the API document.

For the test suite, both files (RDF as well as the examples) have to be taken into account to ensure this behavior of 206. Further, we have to decide how we handle a "known" loss of information. This is the case if we have a mapping into our core ontology where the according property in the source format is more specific.

Best regards,
Dipl. Inf. Florian Stegmaier
Chair of Distributed Information Systems
University of Passau
Innstr. 43
94032 Passau

Room 248 ITZ

Tel.: +49 851 509 3063
Fax: +49 851 509 3062

Received on Wednesday, 21 December 2011 11:38:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:17:44 UTC