SURF - Wiki

SRU-SRW

Navigatie in deze space
Inhoud van deze pagina

Indended audience

The contents of this document iscontent of this document is intended for those who want to incorporate the LOREnet SRU/SRW interface in a web-portal. This document provides descriptions of the required SRU/SRW calls in order to successfully use the interface and it provides examples.
LOREnet uses the search engine that is part of CSA (CQ2 Search Appliance) which offers a metadata-storage. This metadata-storage has been equipped with SRU/SRW capabilities. Throughout this document the term server will be used to reference to this metadata-storage. Since the address at which the server can be contacted for queries depends on where it is hosted, the term server-address will be used to reference to the URL at which the server is located.
At the time this document was written, the name for the collection in the metadata-storage used by LOREnet was called lorenet. Therefore, in examples, this name will be used to indicate the collection upon which the SRU/SRW requests should be performed.
The purpose of this document is not to describe in detail how SRU/SRW works but to describe how it has been used for LOREnet and the additional functionality is provided.

SRU/SRW

SRU (Search/Retrieve via URL See: http://www.loc.gov/standards/sru/) is a standard search protocol for internet search queries. Its companion protocol, SRW (Search/Retrieve Web Service), is a SOAP variant to SRU. Both protocols use CQL (Contextual Query Language See: http://www.loc.gov/standards/sru/specs/cql.html), to represent queries.

SRU/SRW with LOREnet

The LOREnet portals offers an API that uses makes use of SRU/Idem voorgaande opmerking: zorg dat helder is dat het hier om een functionaliteit van de LOREnet portal gaat.SRW so that it adheres to protocols that are rapidly growing in usage. Another advantage of using these protocols is that it is clearly described how both client and server should communicate with each other.
Currently, within LOREnet, a Level 1 compliant CQL parser is used.

Supported SRU/SRW operations in LOREnet

There are two SRU/SRW operations available for LOREnet:

  • explain
  • searchRetrieve

In this chapter there will be a detailed description of these operations, highlighting any LOREnet specifics.

explain operation

The explain operation provides information about used metadata-storage, including, but not limited to, the location of the server, a description of the metadata-storage. The explain operation can be invoked by performing a HTTP GET query on the server and specifying explain as operation.

Example explain operation
http://server/lorenet/sru?operation=explain&version=1.1

searchRetrieve operation

The searchRetrieve operation is one of the most used SRU/SRW operation as it provides means to query the metadata-storage and retrieve information from it.

Example searchRetrieve operation
http://server/lorenet/sru?operation=searchRetrieve&version=1.1&recordSchema=LOMv1.0&query=lom.general.title.string%3Dschool

For LOREnet, the most interesting data are the validated, cross-walked lom records(IEEE LOM v1.0 See: http://ltsc.ieee.org/wg12/files/LOM_1484_12_1_v1_Final_Draft.pdf) because these records are guaranteed to be valid lom records. In order to retrieve these lom records, the proper record schema needs to be specified with the searchRetrieve operation using the recordSchema parameter: recordSchema=LOMv1.0
In the CQL query fields can be expressed as the path from the lom tag up to the tag that needs to be queried, separated with dots.
For example, if one would like to perform on search on data that is stored in the title of a lom record, the label to search on would be: lom.general.title.string. Valid labels are all those labels that are composed out of tags as specified within the IEEE LOM V1.0 specification.

RecordSchema

The LOREnet SRU/SRW interface supports several recordschema's. Each schema describes a part of the information available of the record. For LOREnet the LOMv1.0 schema contains the LOM record

LOREnet specific recordschema's

For LOREnet, two additional recordschema's have been created to store the data inputted by users.
There recordschema's are:

  • rating
  • tags

The data stored in these schemes can be queried using the SRU/SRW by specifying them in the query using the x-recordSchema parameter.

Example request with x-recordSchema
http://_server_/_lorenet_/sru?operation=searchRetrieve&version=1.1&recordSchema=LOMv1.0&query=lom.general.title.string%3Dschool&x-recordSchema=tags

In the result of this query, every record will be accompanied with a extraRecordData-tag containing a list of recordData tags for each recordSchema specified using the x-recordSchema parameter.

Rating

The rating of a document is stored by recording three values:

  • numberOfVotes: The number of times a user has rated the record
  • totalScore: the sum of all ratings for the record
  • averageScore: the average rating of the record, multiplied with a factor 1000. The rating is multiplied to create natural number instead of a floating point number.
Example output of rating recordSchema
<recordData recordSchema="rating">
  <rating>
    <numberOfVotes>1</numberOfVotes>
    <totalScore>5</totalScore>
    <averageScore>5000</averageScore>
  </rating>
</recordData> |

Tags

The tags users add to records are stored under the tags recordschema. Per tag the timestamp the tag was submitted is stored as well. The tags are grouped under a tags tag as there can be more then one tag per record.

Example output of tag recordSchema
<recordData recordSchema="tags">
  <tags>
    <tag>
      <timestamp xmlns:teddy="http://www.cq2.nl/teddy" teddy:tokenize="false">2007-05-01T06:39:12Z</timestamp>
      <value xmlns:teddy="http://www.cq2.nl/teddy" teddy:tokenize="false">TagValue</value>
    </tag>
    ...
  </tags>
</recordData>

Labels

lorenet lorenet Delete
standaarden standaarden Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.