RE: ATOM representation of search result facets

"Rushforth, Peter" <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <1CD55F04538DEA4F85F3ADF7745464AF1AE46388@S-BSC-MBX1.nrn.nrcan.gc.ca>
As long as you don't use the application/atom+xml media type to describe it, you should be OK.

http://tools.ietf.org/html/rfc4287#section-4.2.7.6

In that media type, @length means something different than what I think you are using it for, in which case application/atom+xml no longer applies.

That's the way I see it anyway.

Cheers,
Peter


________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Rich Cariens
Sent: August 28, 2012 17:36
To: [email protected]
Subject: [rest-discuss] ATOM representation of search result facets



Hello!

I need to start including facet counts in my ATOM search results. I'd prefer to reuse existing ATOM elements and attributes if possible. Might as well jump in with a representative example...

Assume a user is submitting a search for "35mm" and would like Manufacturer facet counts included in the results:

-snip-
GET /search?q=35mm&facet=Manufacturer... HTTP/1.1
Accept: application/atom+xml
...
-snip-

I'm thinking the response could look something like this:

-snip-
<feed xmlns="http://www.w3.org/2005/Atom">
     <title>Product Search Results - 35mm by Manufacturer</title>
     <updated>2012-08-28T17:27:02Z</updated>
     <author>
       <name>My, Inc</name>
     </author>
     <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>

     <!-- facet results -->
     <link rel="related" title="Canon" length="134" type="application/atom+xml" href="/search?q=35mm&fq=Manufacturer%3DCanon..." />
     <link rel="related" title="Sony" length="78" type="application/atom+xml" href="/search?q=35mm&fq=Manufacturer%3DSony..." />
     <link rel="related" title="Nikon" length="23" type="application/atom+xml" href="/search?q=35mm&fq..." />
     ...

     <entry>
       ...
-snip-

I'm thinking to overload the "link" elements "length" attribute to hold  the facet count. Is this abuse of the spec or the spirit of REST?

Thanks very much!
Rich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.