SRU is Simple!
This page illustrates how simple SRU is. Click
on the links below for a demonstration; each link is an SRU URL representing an SRU request.
Clicking
on the link will result in the corresponding SRU response.
- Start with an Explain request.
http://lx2.loc.gov:210/LCDB
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/database (http://lx2.loc.gov:210/LCDB) you can see that "title" is
a supported index, within context set "dc". That means that the query "dc.title=<search term>" is supported. This is used in step 6 below.
Advanced clients may 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://lx2.loc.gov:210/lcdb?
version=1.1& operation=searchRetrieve&query=dinosaur
For this SRU request, no records are requested in the response. The
response shows that there are 2492 records containing the term "dinosaur".
(This is subject to change.)
- Now the user wants to see the first of the 2492 records.
http://lx2.loc.gov:210/lcdb?
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://lx2.loc.gov:210/lcdb?
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, this time, MODS records:
http://lx2.loc.gov:210/lcdb?
version=1.1&operation=searchRetrieve&
query=dinosaur&startRecord=2&maximumRecords=5&recordSchema=mods
This request says start with record 2 and return five records. The response includes five MODS records, each wrapped with a <recordPostition>,
two through six.
- Search for "dinosaur" in the title.
http://lx2.loc.gov:210/lcdb?
version=1.1&operation=searchRetrieve&
query=dc.title=dinosaur
This query turned up 1928 records (as in step 2, the number is
subject to change).
|