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

    Configuring Normalization Rules for Primo VE

    Return to menu

    Normalization rules define transformations that are applied to external source records (DC or generic XML) to create the Primo VE expanded Dublin Core records for discovery. You can create your own normalization rules and apply them to externally loaded records.

    For information on how to create normalization rules for MARC21 records from external sources, see Working with Normalization Rules.

    Using the Expanded DC Schema

    The Primo VE Dublin Core expanded schema includes additional discovery fields that you can populate as needed using normalization rules. The following fields are supported by the expanded DC schema:

    • discovery.resourceType – These fields hold the resource types that display in Primo, which may be different from the values in the dc:type and dcterms:type fields that are loaded from the external records. For more information, see Mapping Resource Types from External Data Sources.

    • discovery.local1 thru discovery.local50 – These fields hold additional information that you can use to display additional information from the source and also to use as a search index. For more information, see Mapping to Local Discovery Fields.

    Mapping Resource Types from External Data Sources

    Because the values for Dublin Core resource types can be anything and may not match the supported codes used in Primo VE, it may be necessary to map the resource type from the source record's dc:type or dcterms:type field to either a supported resource type code in Primo VE (see Supported Resource Types in Primo VE) or a local resource type defined in Primo VE (see Configuring Local Resource Types for Primo VE).

    You can use any of the following methods to map the resource types to Primo VE:

    • Create normalization rules that replace the value of the relevant dc:type or dcterms:type field.

    • Create normalization rules that map a resource type value to the the discovery:resourceType field and leave the original DC field as it is.

    • Add resource type mappings to the Dublin Core Type to Discovery Type Mapping mapping table. For more information, see Using the Mapping Table to Map Resource Types.

    Primo VE determines a record's resource type based on the existence of the following fields in order:

    1. discovery:resourceType field

    2. dcterms:type field

    3. dc:type field

    If processing continues to items 2 and 3, the system compares the value of the item with the mappings in the Dublin Core Type to Discovery Type Mapping mapping table. If a match is found, the matching value in the mapping table is used and stored in the discovery:resourceType field. If no match is found and the mapping table has a default value, the default value will be used. Otherwise, the system will use the value of the DC field as is.

    Examples

    For more information about creating normalization rules, see Creating Normalization Rules.

    The following example maps the Proceedings resource type in dc:type to a supported code in Primo VE.

    You can map several resource types in the source (such as Poster and Photograph) to the same resource type (such as image) in Primo VE.


    rule "from dc:type A to discovery:type B"

    when

    "dc"."type" equals "Proceedings"

    then

    set "conference_proceedings" in "discovery"."resourceType"

    end


    The following example maps the LibGuides resource type in dcterms:type to a new local resource type that you must define in Primo VE.

    If the local resource type had been defined as LibGuides in Primo VE, the following normalization rule would not be necessary, and the system would just use the resource type that was mapped to dcterms:type in Primo VE.


    rule "from dcterms:type A to discovery:type B"

    when

    "dcterms"."type" equals "LibGuides"

    then

    set "library_guides" in "discovery"."resourceType"

    end


    Supported Resource Types in Primo VE

    The table below lists the resource type codes that are supported by Primo VE. You will need to map your source's values to one of the supported codes or a local resource type (if needed). For more information about creating local resource types, see Configuring Local Resource Types for Primo VE.

    Supported Resource Types in Primo VE

    Resource Type Code

    Display Name

    databases

    Database

    audios

    Audio

    newspapers

    Newspaper

    manuscripts

    Manuscript

    conference_proceedings

    Conference Proceeding

    dissertations

    Dissertation

    kits

    Kit

    other

    Other

    archival_materials

    Archival Material

    realia

    Realia

    books

    Book

    book_chapters

    Book Chapter

    collections

    Collection

    legal_documents

    Legal Document

    patents

    Patent

    reference_entrys

    Reference Entry

    research_datasets

    Research Dataset

    reviews

    Review

    statistical_data_sets

    Statistical Data Set

    technical_reports

    Technical Report

    journals

    Journal

    newspaper_articles

    Newspaper Article

    articles

    Article

    text_resources

    Text Resource

    government_documents

    Government Document

    images

    Image

    maps

    Map

    videos

    Video

    scores

    Score

    websites

    Website

    Mapping to Local Discovery Fields

    The Dublin Core expanded schema for Primo VE allows you to map information to the following fields, which are populated during the loading of records: discovery.local1 - discovery.local50. After the records have been loaded, Primo VE can use the local fields to display additional information in a record's brief and full displays and also to use them as search fields. Local fields are particularly useful to map non-standard DC fields that are not loaded by default during the import to Primo VE.

    When using a local discovery field, you must also configure its similarly named local display field. For example, if you have created a normalization rule for discovery.local2, you must also define the local display field Local_field_02, making sure that you select the Use the parallel Local Field 01/50 from the Dublin Core record check box. For more information, see Configuring Local Display and Search Fields for Primo VE.

    Examples

    For more information about creating normalization rules, see Creating Normalization Rules.

    The following example maps the value in dc:relation to local field 1 in Primo VE.


    rule "move relation to local field 1"

    when

    exist "dc"."relation"

    then

    move "dc"."relation" to "discovery"."local1"

    end


    The following example sets the value of local field 2 to Internal Research for every record processed.


    rule "set local field 2 for internal research"

    when

    True

    then

    set "Internal Research" in "discovery"."local2"

    end


    Creating Normalization Rules

    The MD Editor allows you to create normalization rules, which are used to customize the transformation of external records (either Dublin Core or generic XML) into Primo VE's extended Dublin Core format for discovery. Once the rules are created, you can add them as needed to normalization rule processes, which can then be assigned to import profiles. For more information, see Creating a Normalization Rule Process.

    For information on how to create normalization rules for MARC21 external data sources, see Working with Normalization Rules.

    To add a normalization rule file:
    1. Open the MD Editor (Configuration Menu > Discovery > Loading External Data Sources > Normalization Rules for External Data Sources).

      PVE_ME_RulesSection2.png

      Open Rules Tab
    2. Select one of the following folders the folder under the Rules tab to view the relevant normalization rule files: Normalization Rules (DC) or Normalization Rules (XML). You can use them as the basis for your new rules. It is also a good practice to see whether a rule has already been created.

      PVE_ME_CreateNormRules.png

      Create New DC Rule File
    3. Create a new rule by selecting File > New > Normalization Rules (DC) or Normalization Rules (XML), which depends on the format of the Discovery import files that you are receiving from the external source.

      DC_NormRules_Properties_Add_File.png

      Configure the Normalization Rule File's Properties
    4. Specify the following properties and then click Save:

      • Name - Specify an identifiable name for the rule file, which may contain related types of rules.

      • Description - Enter text to describe the contents of your rule file.

      • Subfolder - Select one of the following subfolder locations: Private (for your use only and cannot be included in a normalization process) or Shared (public rule file).

      • Enabled -Select this check box to allow the rule file to be applied to normalization rule task lists. (By default, the normalization rule file is disabled.)

    5. Add your rules to the editor pane. For more information, see Normalization Rule Syntax.

      PVE_ME_EditRule.png

      Normalization Rule Editor Pane
    6. Click Preview. The rule or rules in the file are applied to the specified records and the outcome is displayed.

    7. Click Save under the editor pane.

    Normalization Rule Syntax

    Rule files contain one or more rules, which contain one or more conditions followed by one or more actions. The following syntax is used for each rule in the file:


    rule "<rule name>"
    when
    <condition 1>
    <condition 2>
    ...
    then
    <action 1>
    <action 2> [if <condition>]
    ...
    end

    Conditions

    A rule can contain one or more conditions that apply to specific fields and values in the source record. If all conditions are met, the rule is applied to the record. Otherwise, the rule is not applied and the record is left unchanged. Each condition must include one of the following keywords:

    • true – Unconditionally applies the rule to all records.

    • exist – Applies the rule when a specific field exists.

    • not exist – Applies the rule when a specific field does not exist.

    • equals – Applies the rule when the entire contents of the specified field matches.

    • not equals – Applies the rule when the entire contents of the specified field does not match.

    The following table provides an example for each type of condition.

    DC and XML Conditions

    Syntax

    Example

    General Conditions:

    true

    true

    DC Conditions:

    exist "{namespace}"."{field}

    exist "dc"."description"

    exist "{namespace}"."{field}"\("{xsiType}"\)

    exist "dc"."identifier"("dcterms:ISBN")

    "{namespace}"."{field}" equals "{value}"

    "dc"."identifier" equals "sport"

    "{namespace}"."{field}"\("{xsiType}"\) equals "{value}"

    "dc"."identifier"("dcterms:ISBN") equals "sport"

    "{namespace}"."{field}" not equals "{value}"

    "dc"."identifier" not equals "sport"

    "{namespace}"."{field}"\("{xsiType}"\) not equals "{value}"

    "dc"."identifier"("dcterms:ISBN") not equals "sport"

    XML Conditions:

    "xpathExpression" equals "value"

    "ino:object/viaRecord/recordId"  equals "test"

    "xpathExpression" not equals "value"

    "ino:object/viaRecord/recordId"  not equals "test"

    exist "xpathExpression"

    exist "ino:object/viaRecord/recordId"

    not exist "xpathExpression"

    not exist "ino:object/viaRecord/recordId"

    Actions

    You can apply actions to single fields in a record based on conditions specified in the rule. If all of the conditions are met, the actions are applied to the record in the order in which they are listed. Each action must include one of the following keywords:

    • copy – Copies the value from a field to another field.

    • move – Moves the value from a field to another field.

    • remove – Removes the value from a field.

    • set – Sets the value of a field directly.

    In addition, you can append the if equals <value> condition to an above action to apply rule changes for specific matching values only.

    The following table provides an example for each type of action.

    DC and XML Actions

    Syntax

    Example

    DC Actions:

    copy "{namespace}"."{field}"({"xsiType"}) to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    copy "dc"."identifier"("dcterms:ISBN") to "dc"."title"("dcterms:ISBN")

    copy "{namespace}"."{field}"({"xsiType"}) to "{newTagNameSpace}"."{newTagField}"

    copy "dc"."identifier"("dcterms:ISBN") to "dc"."title"

    copy "{namespace}"."{field}" to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    copy "dc"."identifier" to "dc"."title"("dcterms:ISBN")

    copy "{namespace}"."{field}" to "{newTagNameSpace}"."{newTagField}"

    copy "dc"."identifier" to "dc"."title"

    copy "{namespace}"."{field}"({"xsiType"}) if equals "{value}" to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    copy "dc"."identifier"("dcterms:ISBN") if equals "sport" to "dc"."title"("dcterms:ISBN")

    copy "{namespace}"."{field}"({"xsiType"}) if equals "{value}" to "{newTagNameSpace}"."{newTagField}"

    copy "dc"."identifier"("dcterms:ISBN") if equals "sport" to "dc"."title"

    copy "{namespace}"."{field}" if equals "{value}" to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    copy "dc"."identifier" if equals "sport" to "dc"."title"("dcterms:ISBN")

    copy "{namespace}"."{field}" if equals "{value}" to "{newTagNameSpace}"."{newTagField}"

    copy "dc"."identifier" ") if equals "sport" to "dc"."title"

    move "{namespace}"."{field}"({"xsiType"}) to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    move "dc"."identifier"("dcterms:ISBN") to "dc"."title"("dcterms:ISBN")

    move "{namespace}"."{field}"({"xsiType"}) to "{newTagNameSpace}"."{newTagField}"

    move "dc"."identifier"("dcterms:ISBN") to "dc"."title"

    move "{namespace}"."{field}"  to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    move "dc"."identifier" to "dc"."title"("dcterms:ISBN")

    move "{namespace}"."{field}"  to "{newTagNameSpace}"."{newTagField}"

    move "dc"."identifier" to "dc"."title"

    move "{namespace}"."{field}"({"xsiType"}) to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    move "dc"."identifier"("dcterms:ISBN") if equals "sport" to "dc"."title"("dcterms:ISBN")

    move "{namespace}"."{field}"({"xsiType"}) if equals "{value}"  to "{newTagNameSpace}"."{newTagField}"

    move "dc"."identifier"("dcterms:ISBN") if equals "sport" to "dc"."title"

    move "{namespace}"."{field}" to "{newTagNameSpace}"."{newTagField}"({"newXsiType"})

    move "dc"."identifier" if equals "sport" to "dc"."title"("dcterms:ISBN")

    move "{namespace}"."{field}" if equals "{value}" to "{newTagNameSpace}"."{newTagField}"

    move "dc"."identifier" if equals "sport" to "dc"."title"

    remove "{namespace}"."{field}" if equals "{value}"

    remove "dc"."identifier" if equals "sport"

    remove "{namespace}"."{field}"({"xsiType"}) if equals "{value}"

    remove "dc"."identifier"("dcterms:ISBN") if equals "sport"

    remove "{namespace}"."{field}"({"xsiType"})

    remove "dc"."identifier"("dcterms:ISBN")

    remove "{namespace}"."{field}"

    remove "dc"."identifier"

    set "{value}" in "{namespace}"."{field}"({"xsiType"})

    set "sport" in "dc"."identifier"("dcterms:ISBN")

    set "{value}" in "{namespace}"."{field}"

    set "sport" in "dc"."identifier"

    XML Actions: (For more information, see W3C XPATH Standards.)

    copy "concat ({xpathExpression},' ',{xpathExpression})" to "{namespace}"."{field}"

    The concat keyword is an XPATH function, which is one of many XPATH functions that can be used within the XML actions.

    copy "concat(//person[@pers_role='pau']/name/first/text(),' ',//person[@pers_role='pau']/name/last/text())" to "dc"."creator"

    copy "xpathExpression" to "newTagNameSpace"."newTagField"({"xsiType"})

    copy "ino:object/viaRecord/isbn" to "dcterms "."title"("dcterms:ISBN")

    copy "xpathExpression" to "newTagNameSpace"."newTagField"

    copy "ino:object/viaRecord/isbn" to "dcterms "."title"

    set "value" in newTagNameSpace"."newTagField"({"xsiType"})

    set "whatever" in "dcterms "."title"("dcterms:ISBN")

    set "value" in newTagNameSpace"."newTagField"

    set " whatever" in "discovery"."local1"

    DC Examples

     

    rule "move description"
    when
    exist "dc"."description"
    then
    move "dc"."description" to "dcterms"."description"
    end

     

    rule "move description"
    when
    exist "dc"."identifier"("dcterms:ISBN")
    then
    move "dc"."identifier"("dcterms:ISBN") to "dcterms"."identifier"("dcterms:ISBN")
    end

     

    rule "move description"
    when
    "dc"."identifier"("dcterms:ISBN") equals "sport1111"
    then
    move "dc"."identifier"("dcterms:ISBN") to "dcterms"."identifier"("dcterms:ISBN")
    end

     

    rule "dc identifier equals sport"
    when
    "dc"."identifier"("dcterms:ISBN") not equals "sport"
    then
    move "dc"."title" to "dcterms"."description"
    end

     

    rule "from dc:type A to discovery:type C"
    when
    "dc"."type" equals "Photograph"
    then
    set "images" in "discovery"."resourceType"
    end

     

    rule "from dc:type A to discovery:type D"
    when
    "dc"."type" equals "Poster"
    then
    set "images" in "discovery"."resourceType"
    end

    XML Examples

     

    rule "Copy identifier"
    when
    exist "ino:object/viaRecord/recordId"
    then
    copy "ino:object/viaRecord/recordId" to "dc"."identifier"
    end

     

    rule "copy first title"
    when
    true
    then
    copy "(//title/textElement)[1]" to "dc"."title"
    end

     

    rule "copy all titles"
    when
    true
    then
    copy "(//title/textElement)" to "dcterms"."title"
    end

     

    rule "creator"
    when
    exist "ino:object/viaRecord/work/creator/nameElement"
    then
    copy "ino:object/viaRecord/work/creator/nameElement" to "dc"."creator"
    end

     

    rule "equals english"
    when
    "ino:object/viaRecord/work/lang/textElement" equals "eng"
    then
    set "English" in "dc"."language"
    end

     

    rule "set Constant"
    when
    true
    then
    set "test subject" in "dc"."subject"
    end

    • Was this article helpful?