Working with Merge Rules
To work with merge rules, you must have the following role:
- Catalog Administrator
Merge rules provide instructions on how two records are to be merged. When merging two records, the primary record is the record that will contain all of the merged information. The secondary record is the record whose information will be merged into the primary record. Merge rules either remove information in the primary record or copy information from the secondary record to the primary record. Merge rules do not affect the secondary record, which may remain after the merge; although it is typically deleted.
The MD Editor enables catalogers to create merge rules and apply them to MARC 21 records, or apply merge rules that have already been created. The syntax to be used for the rules is described in Merge Rules Syntax and Examples. Also, see Merge Rules in the Training section for more information.
Primary Records
There are several possible scenarios for merging records. The primary record in each of these scenarios is as follows:
Scenario | Primary Record |
---|---|
Importing records using a profile | The existing record in Alma |
Importing records from OCLC Connexion | The existing record in Alma |
Merging two already existing records | The record in the left pane of the MDE (opened first) |
Copy cataloging using an external resource | The external resource |
Since the primary records for importing profiles and copy cataloging (as in Searching External Resources) are essentially the opposite, a merge rule written for an import profile cannot work for copy cataloging (and vice versa). You require two sets of merge rules, one for import profiles and another for copy cataloging. An example of each type of rule can be found in Examples of Rules for Import Profiles and Copy Cataloging.
Basic Merge Rules
The following are the basic merge rules. Each basic rule can be applied unconditionally or may be subject to a condition on the primary record. The order in which the rules are applied is important.
Merge Rule | Example | Description |
---|---|---|
remove | remove MARC."035" | Remove all lines with this field from the primary record. |
add | add MARC."035" | Add all lines with this field from the secondary record to the primary record. |
replace MARC."505" |
Remove all lines with this field from the primary record and then add all lines with this field from the secondary record to the primary record.
A Replace produces exactly the same result as a Remove followed by an Add, except that when using the "if exists" clause, if the secondary record does not have the indicated field, the field is not removed in the primary record. So, for example:
replace MARC."505"
always removes 505 from the primary record. If 505 exists in the secondary record, then the primary record now contains this 505. If 505 does not exist in the secondary record, the primary record contains no 505.
replace MARC."505" if exists
removes 505 from the primary record, only if 505 exists in the secondary record. If 505 exists in the secondary record, then the primary record now contains this 505. If 505 does not exist in the secondary record, the primary record retains its original 505.
This logic is only true when you specify a field such as MARC."505" in the Replace action. If you use the Replace action formats below, Alma treats the Replace rule as if "if exists" is written. So, for example, if you have a 260 field in the Alma primary record, a 264 field in the incoming secondary record, and you are using replace MARC.XXX, Alma keeps the 260 field and adds the 264 during merge processing (as if the "if exists" is written).
For more information see the Merge Rule Syntax table.
|
Creating a Merge Rule
Use the procedure described in this section to create a merge rule.
For Network Zone consortia members, users can control whether to save new rules locally or in a network institution. To make this selection, open the Records or Templates area, and go to New > Placement Options. Note that this selection is per user.
To create a merge rule:
- On the MD Editor page (Resources > Cataloging > Open Metadata Editor), select the Rules tab. The Merge Rules folder opens.
- Select New > Merge and enter your merge rule properties in the Merge Rule Properties dialog box.
- Indicate whether to create the rule as Private or Shared. This determines in which folder the indication rule is saved. You may want to save the rule to the Private folder and test it first, before moving it to the Shared folder (by changing the Properties). Private merge rules do not appear in the Merge Method dropdown, when you want to subsequently use a merge rule in Alma.
Note that the Community folder has merge rules that you can copy to create your own rules. - Select Save in the dialog. The MD Editor editing pane opens.
- Enter your rule details.
- Enter the specific information for your merge rule. For information on the syntax to be used, see Merge Rules Syntax and Examples.
- Select Save. The saved merge rules appear under the Rules tab. The saved merge rules can be edited, deleted, duplicated (to create new merge rules), and contributed to the Community Zone for sharing (see Contributing to the Community Zone - Normalization, Merge, and Indication Rules for more information). You also have the option to change the properties for saved merge rules.
- Unlike normalization rules, merge rules cannot be previewed.
Merge Rules Syntax and Examples
The merge rules follow a specific syntax. For a list of merge rule examples, see the examples below or Alma Merge Rule Examples.
While it is permissible to include multiple Boolean Operators in the rules, when a large number of Boolean operators are selected, slower performance is likely to result. Thus, each rule should include no more than 200 Boolean operators.
Examples of Rules for Import Profiles and Copy Cataloging
Below are examples of merge rules that can be used in a scenario such as the following: You have a primary record in Alma containing basic metadata, most of which you want to replace with metadata from the secondary record. However, for the following fields, you want to keep the primary record metadata: 001, 019, 035, 59X, 9XX.
Use a merge rule such as the following for import profiles:
rule "Replace all fields except local data and match keys"
when
merge
then
replace MARC.XXX excluding "001,019,035,59X,9XX"
end
when
merge
then
replace MARC.XXX excluding "001,019,035,59X,9XX"
end
Use a merge rule such as the following for copy cataloging (see Configuring External Search Resources):
rule "Replace all fields except local data and match keys"
when
merge
then
replace MARC."001"
replace MARC."035"
replace MARC."019"
replace MARC."59"X
replace MARC."9"XX
end
when
merge
then
replace MARC."001"
replace MARC."035"
replace MARC."019"
replace MARC."59"X
replace MARC."9"XX
end
Note that in both of the above examples, when a field does not exist in the secondary record, the primary record's field is not removed. If you prefer that the primary record's fields are always removed, use remove and add rules instead of replace rules. For details, see Replace in Basic Merge Rules table.
Rule Syntax
Conditions and actions apply to record elements, such as the MARC record, fields (one or more), indicators, subfields (one or more), and field/subfield contents.
Conditions apply to the primary record elements. To apply an action to a record element, the element must match the syntax in the table below.