Git Product home page Git Product logo

sru-ruby's Introduction

sru

sru is a Ruby library for talking to servers that support the Search & Retrieve by URL (SRU) protocol. SRU is a lightweight API for performing information retrieval over HTTP. It is lightweight compared to its pre-HTTP ancestory Z39.50. If you are thinking about implementing SRU on the server side you should probably be looking at the much more simple and widely deployed OpenSearch.

Typically SRU clients perform a 'searchRetrieve' operation on a repository and get back different flavored XML metadata for the hits. In addition SRU clients can perform an 'explain' operation which asks the SRU server to describe itself, and its capabilities. The final operation is 'scan' which allows a client to walk an index of terms used in the target.

Usage

require 'sru'

# create the client using a base address for the SRU service
client = SRU::Client.new 'http://sru.example.com'

# fetch a SRU::ExplainResponse object from the server
explain = client.explain

# issue a search and get back a SRU::SearchRetrieveResponse object 
# which serves as an iterator 
records = client.search_retrieve 'rosetta stone', {:maximumRecords => 5}
records.each {|record| puts record}

# issue a scan request and print out each term
client.scan('king tut', {:maximumTerms => 12}).each {|term| puts term}

Installation

You should be able to install the gem:

gem install sru

More information about the project:

http://github.com/edsu/sru-ruby

License

sru-ruby's People

Contributors

edsu avatar rsinger avatar

Watchers

James Cloos avatar Hoylen Sue avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.