Hi:
I wanted to pick up on this point that DeWitt just made:
> If we (the industry) ever have a standard for JSON formatted search results, then it would
> be nice to see the Google Ajax APIs converge with it. In the past none of the
> straightforward full-fidelity conversions of Atom to JSON have really felt quite right to me,
> and I've always wanted to find something that struck the balance of looking like idiomatic
> JSON, but carrying enough data to be useful. We (Google) are actually getting close to
In fact I had been intending anyway to raise the matter here as I was
concerned about reconciling our service with the Google AJAX Feed API.
With
nature.com OpenSearch (
http://www.nature.com/opensearch) we offer
three OpenSearch type responses: RSS 1.0, ATOM and JSON. We aimed to
make our JSON a faithful rendition of the ATOM feed with some obvious
changes in respect of JSON limitations on repeated keys, etc. All of
our feeds carry rich metadata properties. All of our feeds are
OpenSearch (and SRU) compliant.
By contrast, the Google AJAX Feed API seems to have a JSON format that
is a sort of lowest common denominator between ATOM and RSS (which is
nonetheless a useful thing). As far as I can see though it does not
preserve any additional metadata properties. And as one example of
that it does not preserve even the OpenSearch properties or the
OpenSearch navigational links (next, previous, etc.)
See below for a comparison of the JSON returned from the Google AJAX
Feed API with our
nature.com native JSON (ATOM profile) feed. First
the entries, second the feed elements, and third the root elements.
(Note also this earlier post [1] to CrossTech about OpenSearch
response formats.)
I am less sure now of the utility of the Google AJAX Feed API in
handling rich metadata result sets. I remain interested though in
reconciliation.
Cheers,
Tony
[1]
http://www.crossref.org/CrossTech/2009/07/opensearch_formats_for_review.html
==
1a. Google - Entry
{
"title": "Gene frequency clines for host races of
Rhagoletis pomonella in the…",
"link": "
http://dx.doi.org/10.1038/hdy.1989.98",
"author": "",
"publishedDate": "Tue, 08 Dec 2009 02:28:59 -0800",
"contentSnippet": " \n Gene frequency clines for host
races of Rhagoletis pomonella in…",
"content": "<div> <p>\n <b>Gene frequency clines for
host races of Rhagoletis p…",
"categories": [ ]
},
1b. Nature - Entry
{
"title": "Gene frequency clines for host races of
Rhagoletis pomonella in the Midwestern United States",
"link": "
http://dx.doi.org/10.1038/hdy.1989.98",
"id": "
http://dx.doi.org/10.1038/hdy.1989.98",
"updated": "2009-12-08T10:37:07+00:00",
"content": null,
"dc:identifier": "doi:10.1038/hdy.1989.98",
"dc:title": "Gene frequency clines for host races of
Rhagoletis pomonella in the Midwestern United States",
"dc:creator": [
"Jeffrey L Feder",
"Guy L Bush"
],
"prism:publicationName": "Heredity",
"prism:issn": "0018-067X",
"prism:eIssn": "1365-2540",
"prism:doi": "10.1038/hdy.1989.98",
"dc:publisher": "Nature Publishing Group",
"prism:publicationDate": null,
"prism:volume": "63",
"prism:number": "2",
"prism:startingPage": "245",
"prism:url": "
http://dx.doi.org/10.1038/hdy.1989.98",
"prism:copyright": "© 1989 The Genetical Society of
Great Britain",
"prism:alternateTitle": "hdy",
"sru:recordSchema": "info:srw/schema/11/pam-v2.1",
"sru:recordPacking": "unpacked",
"sru:recordData": {
"pam:message": {
"pam:article": {
"xhtml:head": {
}
}
}
},
"sru:recordPosition": 1
},
2a. Google - Feed
"feed": {
"title": "
nature.com OpenSearch: apple",
"link":
"
http://www.nature.com/opensearch/request?version=1.1&operation=…",
"author": "Nature Publishing Group",
"description": "The
nature.com OpenSearch service provides a
structured resource di…",
"type": "atom10",
"entries": [
...
]
}
2b. Nature - Feed
"feed": {
"title": "
nature.com OpenSearch: apple",
"subtitle": "The
nature.com OpenSearch service provides a
structured resource discovery facility for content hosted on
nature.com.",
"id": "urn:uuid:96a2b87a-bbf7-4a1a-a73b-3ee619ed3951",
"author": {
"name": "Nature Publishing Group",
"uri": "
http://www.nature.com",
"email": "
inter...@nature.com"
},
"updated": "2009-12-08T10:37:07+00:00",
"rights": "© 2009 Nature Publication Group",
"icon": "
http://www.nature.com/opensearch/common/imgs/npg_icon.jpg",
"link": [
{
"rel": "self",
"href":
"
http://www.nature.com/opensearch/request?version=1.1&operation=searchRetrieve&query=apple&httpAccept=application/json&recordPacking=unpacked&sortKeys=&maximumRecords=25&startRecord=1",
"type": "application/json"
},
{
"rel": "first",
"href":
"
http://www.nature.com/opensearch/request?version=1.1&operation=searchRetrieve&query=apple&httpAccept=application/json&recordPacking=unpacked&sortKeys=&maximumRecords=25&startRecord=1",
"type": "application/json"
},
{
"rel": "next",
"href":
"
http://www.nature.com/opensearch/request?version=1.1&operation=searchRetrieve&query=apple&httpAccept=application/json&recordPacking=unpacked&sortKeys=&maximumRecords=25&startRecord=26",
"type": "application/json"
},
{
"rel": "last",
"href":
"
http://www.nature.com/opensearch/request?version=1.1&operation=searchRetrieve&query=apple&httpAccept=application/json&recordPacking=unpacked&sortKeys=&maximumRecords=25&startRecord=4352",
"type": "application/json"
},
{
"rel": "search",
"href": "
http://www.nature.com/opensearch/opensearch.xml",
"type": "application/opensearchdescription+xml"
}
],
"dc:publisher": "Nature Publishing Group",
"dc:language": "en",
"dc:rights": "© 2009 Nature Publication Group",
"prism:copyright": "© 2009 Nature Publication Group",
"prism:rightsAgent": "
permi...@nature.com",
"opensearch:totalResults": 4352,
"opensearch:startIndex": 1,
"opensearch:itemsPerPage": 25,
"opensearch:Query": [
{
"opensearch:role": "request",
"opensearch:searchTerms": "apple"
}
],
"sru:numberOfRecords": 4352,
"sru:resultSetId": "16038157-09d5-43fd-907c-a993fbb2912d",
"sru:nextRecordPosition": "26",
"sru:echoedSearchRetrieveRequest": {
"sru:version": "1.1",
"sru:query": "apple",
"sru:startRecord": null,
"sru:maximumRecords": null,
"sru:recordPacking": "unpacked",
"sru:recordSchema": "default",
"sru:sortKeys": null
},
"sru:extraResponseData": {
"npg:databaseTitle": "
nature.com OpenSearch",
"npg:copyright": "© 2009 Nature Publication Group",
"npg:datetime": "2009-12-08T10:37:07+00:00",
"npg:responseId": "96a2b87a-bbf7-4a1a-a73b-3ee619ed3951",
"npg:httpAccept": "application/json"
},
"entry": [
...
]
}
3a. Google - Root Element
{
"n": "json",
"status": {
"code": 200
},
"feed": {
...
}
}
3b. Nature - Root Element
{
"comment": "
nature.com OpenSearch:
urn:uuid:96a2b87a-bbf7-4a1a-a73b-3ee619ed3951",
"namespaces": {
"_": "
http://www.w3.org/2005/Atom",
"dc": "
http://purl.org/dc/elements/1.1/",
"diag": "
http://www.loc.gov/zing/srw/diagnostic/",
"npg": "
http://www.nature.com/opensearch/ns/sru/",
"opensearch": "
http://a9.com/-/spec/opensearch/1.1/",
"pam": "
http://prismstandard.org/namespaces/pam/2.0/",
"prism": "
http://prismstandard.org/namespaces/basic/2.0/",
"sru": "info:srw/xmlns/1/sru-2-0-v1",
"xhtml": "
http://www.w3.org/1999/xhtml"
},
"feed": {
...
}
}