SRU

From swissbib
Revision as of 16:35, 11 September 2017 by Lionel (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Accessing the SRU-Service

The service is openly accessible under the following general URL:

http://sru.swissbib.ch/

  • The service is provided openly as long as the usage is fair.
  • Abuses of the service will result in restriction of usage.
  • Please inform us if you plan to access the SRU interface regularly as part of your search interface.
  • We can configure a logical database for your institution or project.
  • The impementation of the swissbib SRU server is freely available as Open Source.


SRU interface standards

The swissbib SRU service supports the SRU protocol: Version 1.1

Supported retrieval language is CQL: Version 1.1, Level 2


SRU functions

SRU incorporates the basic functions:

  • Explain: Self-description in XML standard format, including information about:
    • Database
    • Indices
    • Data formats
  • Search / Retrieve: Search query
    • Retrieval language: CQL (Common / Contextual Query Language)
    • Boolean operators (and, or, not) are supported


  • swissbib SRU is implemented as a REST service. Therefore the basic functions as described above are accessible as REST resources.
  • Beside the standard SRU functions swissbib provides an additional user interface function which enables users to explore the service and its content interactively.


Mandatory and additional parameters of the SRU functions (resources)


Examples

All books about creativity from the EPFL Library (code E02) which were published after 2010, result in Dublin Core Format :

http://sru.swissbib.ch/sru/search/defaultdb?query=+dc.anywhere+%3D+creativity+AND+dc.date+%3E%3D+2010+AND+dc.possessingInstitution+%3D+E02&operation=searchRetrieve&recordSchema=info%3Asru%2Fschema%2F1%2Fdc-v1.1-light&maximumRecords=10&x-info-10-get-holdings=true&startRecord=0&recordPacking=XML&availableDBs=defaultdb&sortKeys=Submit+query

All maps from libraries of the IDS Basel Bern network which are related to Biel, result in Marc Xml Format :

http://sru.swissbib.ch/sru/search/defaultdb?query=+dc.format+%3D+MP0*+AND+dc.xNetwork+%3D+IDSBB+AND+dc.anywhere+%3D+biel&operation=searchRetrieve&recordSchema=info%3Asrw%2Fschema%2F1%2Fmarcxml-v1.1-light&maximumRecords=10&x-info-10-get-holdings=true&startRecord=0&recordPacking=XML&availableDBs=defaultdb&sortKeys=Submit+query

All documents which match "done allen" in all fields, result in JSON marc :

http://sru.swissbib.ch/sru/search/defaultdb?query=+dc.anywhere+%3D+done+allen&operation=searchRetrieve&recordSchema=info%3Asru%2Fschema%2Fjson&maximumRecords=10&startRecord=0&recordPacking=XML&availableDBs=defaultdb&sortKeys=Submit+query


(Logical) Databases

  • swissbib SRU now provides the possibility to restrict the search on predefined databases
  • At the moment the following databases are supported:
  • Special databases are available using the REST style.
  • If you have special needs for your application let us know. Additional logical databases are easily implemented on the server side. Clients are released to consider such restrictions in the client code.
  • If the database specification is omitted in the request, the defaultdb is used


Available search fields SRU

Access Point Context Set Index Description
Format/Type of Material Dublin Core format swissbib-format code
Language Dublin Core language this means ISO 639-2 codes.
Possessing Institution Bath possessingInstitution Local Library code on a nice page and for download in json:
Possessing library network / union swissbib xNetwork Library codes of Swiss networks (see list)
Filter (for online ressources) swissbib xfilter Filter: Use value 'ONL' to get online resources. Example.
Filter (for CC0 metadata) swissbib xfilter Filter: the metadata of 85% of the records is in the public domain. However, 15% of the records are not in the public domain. To exclude these records, you need to exclude the value MDRR (metadata rights reserved) in the xfilter field (NOT MDRR in field dc.xfilter). Example

Supported CQL relations and how to use them

  • More information is available via the SRU explain operation.
  • Comparison relations such as < or <= or > or >= > are only useful for special indices with numeric values such as dc.date for the published date. If such relations are used in the context of non-numeric indices the default relation = is used
  • How to use the CQL relations
    • For simple term searches use the  =  relation.
    • Multiple terms within a subclause in combination with a  =  relation will be implicitly combined with the boolean AND operator.
    • To express the combination of terms in subclause with the AND operator, the ALL relation should be used.
    • Exact phrase searches will be defined by using the EXACT relation. Double quotes in terms are not necessary and will be filtered out by the parser.
    • To combine the search terms of a subclause with the logical OR operator use the ANY relation for a subclause.
    • Subclauses of a complete query can be combined with the boolean operators AND / OR or NOT.
  • the interactive form is thought as a guide for the use of the supported CQL queries


Record schemas

  • see explain operation for the special databases and the interactive form to play around with them


Additional options

  • Get Holdings: This allows detailed holding information per record to be retrieved (only for the MARC schema).


Further requirements

  • If your requirements need more functionality - please let us know. In general the functionality of Search Servers could be transformed into the SRU standard using the CQL query syntax. If such an effort is justified we could implement it. But as said above: The Search Server interface used by swissbib is also freely available so it could be used by any client for more complex queries and additional features such as facets, more like this, highlighting and much, much more .....
  • You can use directly the github issues list of the repository for notification


Miscellaneous

Recently I stumbled upon an alternative and nice SRU server implementation realized by Jörg Prante It's implemented as an Elasticsearch plugin. It is using JFlex for the parsing process instead of the cql-java library as it is done in our current implementation