catalog.vubis

Import XML files from the library system

braille-grade-raw-to-braille-grade

(braille-grade-raw-to-braille-grade grade)

Mapping between braille-grade-raw and braille-grade

braille-music-grade-raw-to-braille-grade

Mapping between braille-music-grade-raw and braille-grade

clean-raw-item

(clean-raw-item {:keys [record-id source description source-publisher library-signature title subtitles name-of-part creator price price-on-request? product-number language format producer genre genre-code genre-text general-information produced-commercially? source-date general-note series-title series-volume series-type duration volumes narrators producer-long game-description double-spaced? braille-grade directed-by actors personel-text braille-music-grade ismn], :as raw-item, :or {genre "", genre-code ""}})

Return a proper production based on a raw item, e.g. translate the language tag into proper ISO 639-1 codes

collate-all-duplicate-items

(collate-all-duplicate-items items)

Merge duplicate braille items into one. Typically we have multiple entries for the same braille book for all the different braille grades. In the catalog we want one entry

collate-duplicate-items

(collate-duplicate-items items)

duplicate-print-and-braille-items

(duplicate-print-and-braille-items items)

Given a list of items return the list while duplicating the :braille format items that have the :print-and-braille? attribute. They are duplicated such that the original is kept as is and the second item is like the original but doesn’t have the :print-and-braille? attribute. This will make sure :print-and-braille? items are shown under both Braille and Print&Braille in the catalog

format-raw-to-format

Mapping between format-raw and format

fourth

(fourth coll)

genre-code-to-genre

Mapping between genre-code and genre. Used for movies

genre-raw-to-genre

Mapping between genre-raw and genre

genre-raw-to-ludo-genre

Mapping between genre-raw and ludo genre

genre-raw-to-subgenre

Mapping between genre-raw and subgenre

get-accompanying-material

(get-accompanying-material {:keys [accompanying-material accompanying-material-legacy accompanying-material-legacy-other]})

Get the accompanying material for item. Use accompanying-material and accompanying-material-legacy. If accompanying-material-legacy-other use that instead of accompanying-material-legacy. Return nil if all of the input values are nil.

get-controlfield

(get-controlfield record path)

Same as get-subfield but returns the text unaltered

get-double-spaced

(get-double-spaced field)

Determine whether the item is double-spaced. Return true if the field starts with “Weitzeilig”, false otherwise.

get-multi-subfields

(get-multi-subfields record path)

Get a list of subfield texts for the given path in the given record. Returns an empty list if there is no such subfield

get-personel

(get-personel s)

get-personel-fields

(get-personel-fields record)

Grab all the personel related fields, e.g. directors and actors from a record. Return a map with the keys :directed-by and :actors that contains seqs of strings. If a record has no actors or directors the corresponding key is not in the returned map, so the returned map is potentially empty

get-personel-name

(get-personel-name personel)

Get the name of a personel

get-personel-role

(get-personel-role personel)

Return :director if personel is a director, actor if personel is an actor or nil otherwise

get-producer-brief

(get-producer-brief {:keys [producer producer-long producer-place]})

Get the producer-brief. If producer contains a valid numerical value other than 0 then return the string from the lookup table in producer-raw-to-producer. If producer contains 0 or is nil then generate a brief from producer-long and producer-place.

get-subfield

(get-subfield record path)

Get the subfield text for the given path in the given record. Returns nil if there is no such subfield

get-target-audience

(get-target-audience s)

Extract the target audience from a string s according to the rules of 008 - MARC 21. Return nil if s doesn’t comply with the standard.

get-update-keys-hörfilm

(get-update-keys-hörfilm {fmt :format, genre :genre, :as item})

Return the update keys for a given item (see get-update-keys). For the hörfilm catalog we need to group the :hörfilm items by genre.

get-update-keys-ludo

(get-update-keys-ludo {fmt :format, genre :genre, :as item})

Return the update keys for a given item (see get-update-keys). For the ludo catalog we need to group all other formats under the genre :bücher-über-spiel.

get-update-keys-neu-als-hörbuch

(get-update-keys-neu-als-hörbuch {fmt :format, language :language, :as item})

Return the update keys for a given item (see get-update-keys). For the neu-als-hörbuch all foreign language books need to ge grouped under :bücher-in-fremdsprachen, even kids books, so we need to group not only by format, genre and sub-genre but also by language.

get-update-keys-print-and-braille

(get-update-keys-print-and-braille {fmt :format, target-audience :target-audience, print-and-braille? :print-and-braille?, :as item})

Return the update keys for a given item (see get-update-keys). For the print-and-braille catalog we group the :print-and-braille items by target-audience.

get-update-keys-taktil

(get-update-keys-taktil {fmt :format, genre :genre, :as item})

Return the update keys for a given item (see get-update-keys). For the taktil catalog we group the :taktilesbuch items by genre.

get-year

(get-year s)

Grab the date year out of a string. Return nil if s cannot be parsed.

group

(group items)(group items get-update-keys-fn)

Group the catalog items. Given a sequence of items returns a tree where all items are grouped by format, genre and sometimes even subgenre. The exact details of the grouping are determined by the get-update-keys-fn.

ignore-sine-nomine

(ignore-sine-nomine s)

iso-639-2-to-iso-639-1

Mapping between three letter codes of ISO 639-2 and the two letter codes of ISO 639-1

merge-braille-catalog-items

(merge-braille-catalog-items items)

Merge items into one. All product-numbers and all library-signatures together with their related information such as braille-grade and volumes are collected in a list and merged with the other properties.

normalize-name

(normalize-name name)

Change a name from ‘name, surname’ to ‘surname name’

order

(order items)

Order the catalog items. Items representing the same book, e.g. different Braille versions of the same book are collated.

order-and-group

(order-and-group items)(order-and-group items get-update-keys-fn)

Order and group the catalog items. Given a sequence of items returns a tree where all items are grouped by format, genre and sometimes even subgenre. The exact details of the grouping are determined by the get-update-keys-fn.

parse-int

(parse-int s)

personel-actor?

(personel-actor? personel)

personel-director?

(personel-director? personel)

producer-raw-to-producer

Mapping between producer-raw and producer

read-file

(read-file file)

Read an export file from VUBIS and return a map with all the data

remove-nonprintable-chars

(remove-nonprintable-chars s)

select-vals

(select-vals ks item)

Return a list of the values for the given keys ks from item if the value of the first key is non-nil

target-audience-raw-to-target-audience

Mapping between raw target-audience and target-audience. See also Marc21

text-raw

(text-raw loc)

Similar to clojure.data.zip/text but doesn’t normalize the text

trim-punctuation

(trim-punctuation s)