Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    Primo VE - set Author names in natural order (FirstName LastName) for Alma records

    Created By: Knut Bøckman
    Created on: 3/17/2019



    In Marc21 records, personal names are in inverted order separated by comma (LastName, FirstName). In our Discovery, we want the names to be in natural order (FirstName LastName). 

    To achieve this, we ended up using this rule for the creator field, based on Marc21 100-field:

    rule "Primo VE Display - Creator 100"
    priority 10
        when
            MARC."100" has any "a,b,c"
        then
            set TEMP"1" to MARC."100" sub without sort "a"
            set TEMP"2" to MARC."100" sub without sort "a"
            set TEMP"3" to MARC."100" sub without sort "b,c"
             set TEMP"4" to MARC."100" sub without sort "a"
             remove substring using regex (TEMP"1","^([^,]*)")
             remove substring using regex (TEMP"2",",.*$")
            remove substring using regex (TEMP"4","(/|:|;|=|,)+$")
            add prefix (TEMP"4","$$Q")
            remove substring using regex (TEMP"4","^$$Q$")
            concatenate with delimiter (TEMP"1",TEMP"2"," ")
           concatenate with delimiter (TEMP"1",TEMP"3"," ")
            concatenate with delimiter (TEMP"1",TEMP"4","")
           remove substring using regex (TEMP"1","[,.]")
            set pnx."display"."creator" to TEMP"1"
    end

    I'm sure more regex-savvy colleagues could do this in a more elegant way, but at least this one works. I invite anyone to improve on my clumsy regex and drools. We use a similar path for the 700 field (--> Contributor), of course.

    Worth noting is that if you decide to go for natural order of names, this will only affect your local records. Most, though not all, records from Primo Central give the names in inverted order, so considerable inconsistency can be expected. You should consider this before implementing this rule, and if possible check with your audience.

     




    • Was this article helpful?
    //Feedback