Catman...rch_sru(3pm)

πŸ“¦
version 0.43.0 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay bestie, so Catmandu::Fix::search_sru is the moment πŸ’… β€” it takes a value, treats it as an SRU query, and swaps it out for the SRU search result. literally a glow-up for your field, no cap.


πŸ¦‹ SYNTAX πŸ¦‹

here's the base vibe:

search_sru( <path>, <url> )

and with all the optional garnish on top:

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

now the part where we do it from the command line, because that's the main character energy πŸŽ€

# 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)")'

look at her go πŸ˜­πŸ’–


🌸 PARAMETERS 🌸

path

this is where in the perl hash your query is chillin'. like, the exact address of it.

peep "PATHS" in Catmandu::Fix if you wanna know more about how paths work 🫢

url

the base URL of the SRU server. that's it, that's the whole thing ✨

recordschema

the SRU record schema, bestie. if you don't know what's on the menu, hit up the SRU Explain operation to look up which schemas are actually available.

default? 'oai_dc' πŸ’«

parser

this one controls how the records get parsed before they're imported. very "let me handle this" of it.

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

default is 'simple' 🧚

limit

maximum number of records to fetch per request. don't be greedy πŸ’…

default is 10.

total

maximum number of records to fetch from a result set. also a cap, but a bigger-picture cap πŸ‘‘

fixes

a Catmandu::Fix to transform the parsed records of the SRU response. basically you get to restyle the fit after it arrives 😌


πŸ‘‘ SEE ALSO πŸ‘‘

  • Catmandu::Fix
  • Catmandu::SRU

πŸ’œ AUTHOR πŸ’œ

Johann Rolschewski "<jorol at cpan.org>" β€” icon, legend, the blueprint fr fr πŸ™Œ


and that's the whole page, bestie!! this was perl v5.38.2, dated 2021-09-02, served up as User Contributed Perl Documentation πŸŽ€ go forth and slay your SRU queries πŸ’–βœ¨

πŸ“¦ where this page comes from