Nicolas Steenlant
and 10 contributors

NAME

Catmandu::Fix::search_sru - use the value as SRU query, and replace it by SRU search result

SYNTAX

 search_sru( <path>, <url> )
  
 search_sru( <path>, <url>, [recordschema:<SCHEMA>], [parser:<PARSER>], [limit:<INTEGER>], [fixes :<STRING|FILE>] )

 # From the command line

 $ echo '{"issn":"1940-5758"}' | catmandu convert JSON to YAML --fix 'search_sru(issn,"http://services.dnb.de/sru/zdb")'

 $ echo '{"issn":"dnb.iss = 1164-5563"}' | catmandu convert JSON to YAML --fix 'search_sru(issn, "http://services.dnb.de/sru/zdb", recordschema:MARC21-xml, parser:marcxml, fixes:"marc_map(245a,dc_title);remove_field(record)")'

PARAMETERS

path

The location in the perl hash where the query is stored.

See "PATHS" in Catmandu::Fix for more information about paths.

url

Base URL of the SRU server.

recordschema

SRU record schema. Use SRU Explain operation to look up available schemas.

Default is 'oai_dc'.

parser

Controls how records are parsed before importing.

Available parsers: 'marcxml', 'meta', 'mods', 'picaxml', 'raw', 'simple', 'struct'.

Default is 'simple'.

limit

Number of records to fetch. This is translated to SRU request parameter maximumRecords.

Default is 10.

fixes

 L<Catmandu::Fix> to transform the parsed records of the SRU response.
   

SEE ALSO

Catmandu::Fix

Catmandu::SRU

AUTHOR

Johann Rolschewski <jorol at cpan.org>