SRU is Simple!
This page tries to illustrate how simple SRU really is. Click
on the links for a demonstration. Each link is an SRU URL.
In each case the text for the URL is identical to the URL, and clicking
on the link will result in the SRU response corresponding to that SRU
request represented by the URL.
These examples are all version 1.1. Version 1.2 examples to come
soon.
- Start with an Explain request.
http://z3950.loc.gov:7090/voyager
The Explain record for an SRU server is an XML document that
explains features, defaults, etc. It may be used by a client to self-configure
and allow it to fully interoperate with the server. As an example,
for the above server (z3950.loc.gov:7090) you can see that "title" is
a supported index. Advanced clients may make use Explain information
in more sophisticated ways, but this is not strictly necessary. Most
clients don't rely on Explain.
- Next, a simple search for the term "dinosaur".
http://z3950.loc.gov:7090/voyager?
version=1.1& operation=searchRetrieve&query=dinosaur
For this SRU request, no records are requested in the response. The
response shows that there are 1634 records containing the term "dinosaur".
(This is subject to change since this is a production database, but
there were 1634 such records when this page was created.)
- Now the user wants to see the first of the 1634 records.
http://z3950.loc.gov:7090/voyager?
version=1.1&operation=searchRetrieve&query=dinosaur&maximumRecords=1
The response includes a single record -- a marcxml record. Note
that the request does not specify a particular schema for the record-to-be-retrieved,
and so the default, marcxml, is used.
- Retrieve the same record, different schema -- DC.
http://z3950.loc.gov:7090/voyager?
version=1.1&operation=searchRetrieve&
query=dinosaur&maximumRecords=1&recordSchema=dc
Again the response includes a single record -- this time a DC record. Note
that DC is one of the supported-schemas listed in the Explain record.
- Retrieve the next five records:
http://z3950.loc.gov:7090/voyager?
version=1.1&operation=searchRetrieve&
query=dinosaur&startRecord=2&maximumRecords=5&recordSchema=dc
The response includes five records, each wrapped with a <recordPostition>,
two through six.
- Search for "dinosaur" in the title.
http://z3950.loc.gov:7090/voyager?
version=1.1&operation=searchRetrieve&
query=title=dinosaur
This query turned up 1238 records. (Similarly, as in step 2, this is
subject to change since this is a production database, but there were
1238 such records when this page was created.)
|