[CODE4LIB] Expectations for count queries

2012-03-21 Thread Walter Lewis
In the various bundles of good ideas that represent result set
standards in the library and greater world, apart from the
atom/opensearch totalResults element, is there an expectation of how
one should package a number when that is *all* that is being
requested?

Use Case:
  dear dataset:
   if I asked you for steamboat records, how many would you send me?
   signed:  curious

  dear curious:
  12
signed: dataset

I'm inclined to return just the number as Content-Type: text/plain.

Clearly the semantics of the query string require a mutual
understanding, but that's not my specific concern here.

Walter


Re: [CODE4LIB] Expectations for count queries

2012-03-21 Thread Ross Singer
If you're not using any sort of standard request protocol, I'm not sure it 
matters to use a standardized response protocol.

I mean, you could wrap the answer in a JSON string (which would give you a 
little more flexibility as far as error conditions, etc. as well as typing the 
integer), but, since this seems to be an internal thing (is that right?) it's 
completely at your discretion as to how it should work.

-Ross.

On Mar 21, 2012, at 11:31 AM, Walter Lewis wrote:

 In the various bundles of good ideas that represent result set
 standards in the library and greater world, apart from the
 atom/opensearch totalResults element, is there an expectation of how
 one should package a number when that is *all* that is being
 requested?
 
 Use Case:
  dear dataset:
   if I asked you for steamboat records, how many would you send me?
   signed:  curious
 
  dear curious:
  12
signed: dataset
 
 I'm inclined to return just the number as Content-Type: text/plain.
 
 Clearly the semantics of the query string require a mutual
 understanding, but that's not my specific concern here.
 
 Walter