Page 232 - Building Digital Libraries
P. 232

Thinking about Discovery


                 for blogging to quickly develop tools and services that can serve and con-
                 sume an OpenSearch query and response. Like SRU, OpenSearch utilizes
                 an easy-to-understand query syntax that can be expressed through a URL.
                     Probably OpenSearch’s greatest strength is the ease with which the
                 protocol can be implemented. Utilizing a minimalist approach, OpenSearch
                 uses a minimal number of arguments for query. Couple this with the known
                 RSS/Atom response format, and most systems can be retrofitted to support
                 OpenSearch queries and responses in the course of a couple of hours. For
                 example, at Ohio State University, the local digital collections system has
                 been created using the Samvera technology stack. The URL to create a query
                 into the digital collections system is fairly straightforward:

                         •	 baseURL: https://library.osu.edu/dc/catalog
                         •	 encoding: utf8=%E2%9C%93
                         •	 Query string: q=test
                         •	 Reurn format: format=json

                 Using this structure, any request made to the digital collections system will
                 return back JSON results. Since JSON is a format that is easily parseable by
                 most web-based programming languages, implementing an OpenSearch
                 data feed is relatively easy. What’s more, by providing an OpenSearch feed
                 and creating the necessary autodiscovery link, for example (see figure 9.7),




                   <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>
                    <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en” dir=”ltr”>
                      <head profile=”http://a9.com/-/spec/opensearch/1.1/”>
                        <link rel=”search”
                              type=”application/opensearchdescription+xml”
                              href=”http://linktoyourcontentsearch.xml”
                              title=”Your content search” />
                      </head>
                      <body>
                        <!--- ... --->
                      </body>
                    </html>

                 FIGURE 9.7
                 OpenSearch Autodiscovery Link Syntax



                 a user’s web browser would be able to automatically recognize the search
                 profile and make it accessible directly within the application.
                     Implementing the OpenSearch protocol proved to be simpler than
                 initially expected in part due to the protocol’s minimalist specifications
                 (www.opensearch.org/Specifications/OpenSearch/1.1) and the wide variety
                 of example code that is currently available and shows OpenSearch’s integra-
                 tion within other applications. In all, the process took about ten minutes to
                 produce the following plug-in:


                                                                                                                     217
   227   228   229   230   231   232   233   234   235   236   237