规范化规则处理
使用规范化规则的概述和说明。
- 编目管理员
- 编目经理
- 编目员
规范化规则在多个阶段用于更改或更新书目元数据,例如,当在元数据编辑器中保存记录,使用导入配置文件导入,从外部检索资源导入,或在元数据编辑器中使用“完善记录”菜单编辑时。规范化规则按照特定语法写成,允许您创建对记录做出特定修改的规则。例如,您可以编辑或删除字段,也可以根据在书目记录中发生的条件指定操作。
Normalization rules can be applied to individual records in the MD Editor or to a group of records:
- To apply normalization rules to an individual record, use the Enhance Record option (refer to the section MD Editor Menu and Toolbar Options) or Apply Changes to an individual record when you preview normalization rules (see To preview the outcome of a rule).
- To apply normalization rules to a set of records, you need to create a process using the MarcDroolNormalization, MarcXSLNormalization or DcDroolNormalization tasks (see Working with Normalization Processes) and specify the normalization rule created with the MD Editor (refer to the procedure To create a new normalization rule file).Once you have created the process, you can run a job using that process (see Running Manual Jobs on Defined Sets).In addition, you can create a process that enables application of normalization rules when selecting Save in the MD Editor (see Working with Normalization Processes).
规范化规则是通过遵循特定的编程语法和使用元数据编辑器中规则选项卡下提供的编辑窗口创建的。
In addition to creating your own normalization rules program, you can also copy/paste existing rules into the editing window or use out-of-the-box examples (Rules tab) to develop your normalization rules.See Normalization Rules Syntax for more information regarding the syntax for normalization rules and examples that you can copy to the editing window.
使用元数据编辑器中的预览功能,您可以:
- 并行查看规范化规则和元数据记录
- 在元数据记录运行时预览规则结果
- 在规则和预览更改之间切换
- 编辑规则并立即测试
- For a short overview of Normalization Rules, watch Normalization Rules(6:00).
- For detailed information on Normalization rules with examples, watch Normalization Rules(1 hr).
创建规范化规则
This section describes how to create a normalization rule or copy a rule from the Community Zone, work with previously created rules, and preview the rule's outcome when it is run on a single metadata record.For more information, see the Normalization Rules area on this page.
Note that normalization rules on Institution Zone records that are linked to Network Zone records can be applied only to local fields.To apply normalization rules to such records, run the normalization rules and normalization processes only in the Network institution.
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 navigate to New > Placement Options.请注意,该选项根据用户生效。
- On the MD Editor page (Resources > Cataloging > Open Metadata Editor), open the Rules area.
- To create a normalization rule for a MARC or Dublin Core record, select New > Normalization.The Normalization Rules Properties (New Rule) dialog box opens.
规范化规则属性对话框 - Enter a name and a description for the normalization rule.
- The word rule must not be capitalized if used in the rule name.If capitalized, the rule does not work.
- 不要在规则名称中使用反斜杠(\)!Otherwise, the rule cannot be used for the filter set functionality.
- 规则名称/描述的字符限制为255个字符。
- To create a normalization rule for a MARC record, select Drool.To create a normalization rule for a DC (Dublin Core) record, select XSL.
MARC record normalization rules also support XSL.
- Select an access option,Private or Shared.如果选择专用,只有您可以处理该规则,并且规则不能包含在规范化进程中。如果选择共享,您的规则在编目员之间共享。In this case, more than one user can view the rule at the same time; if two or more people have the rule open for editing, a warning message appears when one of you tries to save changes.(您可以选择保留更改或允许其他用户进行更改并保存更改。)
- Select Save.The Metadata Editor editing pane opens.You can include existing rule syntax (Edit > Add Rule > {type of rule}) or define a rule (for details, see Normalization Rules Syntax).
- Select Save.The rule is added to the list of rule files under the Normalization Rules tab.
- On the Metadata Editor page (Resources > Cataloging > Open Metadata Editor), select the Rules tab and expand the Normalization folder.
- 要复制,请打开社区文件夹,右键单击要复制的规则并选择复制。复制规则对话框打开。输入名称和描述并指示是否保存为专有(仅对您可用)或共享规则(对您的机构中的所有用户可用)。The dialog box indicates the Alma user name and contact email of the user who contributed the rule to the Community Zone.如果您有任何疑问,可以联系此用户。
- 要将您自己的规则提交到共享区,请右键单击规则并选择提交到共享区。The Rule Sharing dialog opens.Provide a descriptive name and description, and select Save to save the rule in the Community Zone.
- 在元数据编辑器页面(资源 > 编目 > 打开元数据编辑器),选择规则选项卡并展开规范化文件夹显示保存的规则。
- 选择要使用的规则,然后选择下列选项:
- Edit – Opens the text box with the rule(s) syntax, enabling you to modify this syntax (for details, see Normalization Rules Syntax).
- Delete – Select Yes to confirm the rule file's deletion.
- Duplicate – Duplicates the selected rule file, enabling you to modify and save it as a new rule without affecting the original file.
- Properties – Opens the Normalization Rules Properties dialog box, enabling you to modify the properties of the rule file.
- To rename the rule, duplicate the rule, give the duplicate the desired name, and then delete the old rule.
- 找到要处理的书目记录(使用仓储检索或元数据编辑器 > 记录选项卡),并在元数据编辑器中打开它。
- PressF6 or select the Split Editor icon.
- Select the Rules tab in the left pane and expand the Normalization folder.
- Right-select the rule that you want to preview or test in the Private or Shared(not the Community) folder and select Edit.
The rule is displayed in the Metadata Editor right pane.
- Select Preview.The rule is applied to the record, and the outcome appears.
To update Network records, the normalization must be run by the Network institution (not by a member).An institution cannot update Network records; therefore, the normalization is only applied to local fields (the local extensions of the member).When previewing a rule for a Network record, the following message is displayed:Note that the rules are applied only to local fields when the normalization process is run.
- Select Apply Changes to save the modifications to the record or select Back to normalization rules to continue editing.
- When you have made your final changes to the normalization rule, select Save and test using external record to save the final version of your normalization rule.For details, see Testing Normalization Rules for External Data Sources.
Normalization Rules for Dublin Core and MODS Records
在元数据编辑器中,有以下类型的规则与都柏林核心和MODS相关:
- XSL指示规则
- XSL normalization rule
XSL Normalization Rule does not support discovery:local.
Dublin Core and MODS normalization rules cannot be written in a regular Normalization Rule format, but only as an XSL.This means that you compose the XSL directly in the Metadata Editor (as explained above), or you can compose it in Notepad (or another external application of your choice) and then copy it to the Metadata Editor.
You can view the below examples of XSL Normalization Rules for Dublin Core in the Community Zone in the Metadata Editor:
- EXL – 更改dc:language的值en为English
- EXL – 替换都柏林核心记录中的字符串的通用规则
- EXL_Add_field_accessRights
- 在外部应用中写好XSL。
- Open the Metadata Editor > Rules section.
- Copy and paste the XSL to the Metadata Editor and save the rule.
Primo VE和Esploro的规范化规则
In addition to Alma normalization rules, you can create normalization rules for Primo VE and Esploro.To create these rules, select New, and then select:
-
Normalization (Discovery) – This option appears only when Primo VE is defined in the system.Select this option if you are creating DC or XML normalization rules for bibliographic records that are loaded into Primo VE and not managed in Alma.For information regarding the syntax of these rules, see Normalization Rule Syntax for DC and XML Formats.
-
Normalization (Research) – This option appears only when Esploro is defined in the system.For details, see Managing Asset Normalization Rules(Esploro).
规范化规则语法
规则可以包含一个或多个其他规则。每个规则含有一个条件,且一个或多个应用于记录的操作。如果记录满足条件,操作将应用于记录。Each action can be performed on a single field within a record.按照规则中出现的顺序执行操作。
定义含有多个规则的规则时,必须使用优先级因素。优先级更高的操作首先执行。例如,规则中优先级为2的操作先于优先级为1的操作。For examples of the way in which priority (or salience) can be used in normalization rules, see Alma Normalization Rule Examples.Note that priority (or salience) is only necessary when the fields in the rules are the same.Otherwise, when each rule deals with different fields, multiple rules are performed from top to bottom.
Learn how to create normalization rules that delete specified fields from records, or change the contents of these fields in the Normalization Routine Syntax for Deletion or Content Change video (9:57 mins).
<conditions on MARC record> contains one or more Boolean clauses that apply to the record.If <conditions on MARC record> returns TRUE, the rule is applied to the record; otherwise, the rule is not applied and the record is not processed.
- “When” must be the only word in the first line.条件必须放在单独的一行上。
- You can use multiple conditions on the whole record in the “When” condition only.
- 尽管在规则中允许使用多个布尔运算符,但当选择大量布尔运算符时会降低运行速度。因此每条规则应包含不超过200个布尔运算符。
- 如果未指定,则条件将在记录级别起作用。如果您希望条件分别作用于每个MARC21字段,则应为每个字段指定条件。例如,当有多个带相同标签的MARC21字段时。
理解规范化规则中的转义字符
编写规范化规则时,您可能需要包含特殊字符,例如引号、制表符或反斜杠。要正确执行此操作,您需要使用转义字符,这些特殊组合可以告诉系统如何解释这些符号。
有效的转义序列
Alma可以识别以下转义字符:
- \b - 退格
- \t - tab
- \n - new line
- \f - 换页
- \r - carriage return
- \" - 双引号
- \' - 单引号
- \\ - 反斜杠
这些序列必须以单个反斜杠开头,后跟一个有效字符。
避免常见错误
使用错误数量的反斜杠会导致错误。例如:
- \z或\\z无效,会触发错误。
- 没有有效转义字符的单独反斜杠(\)也是无效的。
如何修复错误
如果您看到类似这样的错误:
"Invalid escape sequence (valid ones are \b \t \n \f \r "'\)"
您可以通过调整反斜杠来解决此问题。以下是一些示例:
- replacing \\\ with \\
- replacing \. with .
- replacing \( with ( and \) with )
- replacing \\\| with \\|
这些更改既保留规则的预期行为,又避免语法错误。
记录元素
条件和操作适用于记录元素,如MARC记录、字段(一个或多个)、指示符、子字段(一个或多个)和字段/子字段内容。
要测试条件或将操作应用于记录元素,该元素必须符合以下语法:
| 表达 | 意义 |
|---|---|
| "<tag>", "<new tag>" | 表示一个字段标签,例如001、245等。 |
| "<oldCode>", "<newCode>" | 表示子字段代码,例如a,b,c。 |
| "<element>" for a data field | 以下是数据字段的可能值:
|
| "<element>" for a control field | 以下是控制字段的可能值:
|
| 固定位置字段的"<element>" |
The following are the possible values for a fixed position UNIMARC/CNMARC 1XX field:
Relevant only for UNIMARC/CNMARC 1XX fields. |
| CONDITION at record level | 以下是可能的条件选项。See the next section (Conditions) for important information.
The following are the possible condition options relevant only for UNIMARC/CNMARC 1XX fields:
|
条件
Conditions can be defined at the entire rule level (WHEN), or at a specific action level (IF).相同的条件将根据定义的级别而有所不同。
- WHEN clause – A condition that must be met by the entire record in order to determine whether the rule is applied to the record
- IF(within an action) – A condition that applies to a single field in order to determine whether the specific action is taken on that field
条件为:
-
containsScript – Use this condition to detect a specific language.The containsScript condition uses the following fixed list of languages for which you can check: Arabic, Armenian, Bengali, Bopomofo, Braille, Buhid, Canadian_Aboriginal, Cherokee, Cyrillic, Devanagari, Ethiopic, Georgian, Greek, Gujarati, Gurmukhi, Han, Hangul, Hanunoo, Hebrew, Hiragana, Inherited, Kannada, Katakana, Khmer, Lao, Latin, Limbu, Malayalam, Mongolian, Myanmar, Ogham, Oriya, Runic, Sinhala, Syriac, Tagalog, Tagbanwa, TaiLe, Tamil, Telugu, Thaana, Thai, Tibetan, and Yi.见以下语法示例:rule "Is CJK in Authority" when containsScript "Han" "1**" then set indication."true" end
- exists <element> – At least one match is found
- exists <element> – Applies to data fields.在IF子句中使用时,操作元素和由条件测试的元素必须在同一(数据)字段。
- existsControl <element> – Applies to control fields.在IF子句中使用时,操作元素和由条件测试的元素必须在同一(控制)字段。
- existsMoreThanOnce <element> – Multiple matches are found.应用于数据字段。在IF子句中使用时,操作元素和由条件测试的元素必须在同一(数据)字段。
- not exists <element> – No match is found
- not exists <element> – Applies to data fields.在IF子句中使用时,操作元素和由条件测试的元素必须在同一(数据)字段。
- not existsControl <element> – Applies to control fields.在IF子句中使用时,操作元素和由条件测试的元素必须在同一(控制)字段。
-
recordHasDuplicateSubfields(for indication rules; see Working with Indication Rules) – Returns true if duplicate subfields (subfield and its contents) are found for the current record according to the fields, subfields, and the characters to ignore (charsToIgnore) string that were passed as parameters in the following format:recordHasDuplicateSubfields "<tag>" "<code>" "<charsToIgnore>"可以指定由逗号分隔的多个标签(字段)。可指定多个代码(子字段),并不需要空格分隔。One or more characters (alphanumeric or punctuation) with no spaces to separate them can be specified as characters to ignore at the end of the content in the subfields that are being evaluated for duplication.See Example 6 for more information.For the records that meet the recordHasDuplicateSubfields condition (returns true), a set of the records is created.
Each IF clause action can have one of the following formats:
- Applies if a specific condition is not true, for example:addControlField "{element}"if(not exists "{condition}")
- Applies if a specific condition is true, for example:addControlField "{element}"if(exists "{condition}")
- Applies unconditionally, for example:addControlField "{element}"
The Boolean OR operator can be used in a consequence statement by using the pipe (|) symbol, for example:removeField "866" if (not exists "866.8.0 | 99".If the pipe symbol is part of the value, use four backslashes (\\\\) to escape it, for example:removeField "866" if (exists "866.8.0 \\\\| 99")
The if (exists...) condition is met if the value in the condition appears somewhere in the record.无法使用此规则复制/删除具有特定值的子字段。要删除或复制具有特定值的子字段,请使用XSL转换规则。
操作列表
下表提供了可用操作的列表。
| 操作 | 格式/示例 | 评论 |
|---|---|---|
| 将字段和子字段替换为其它字段和子字段。 | changeControlField "<tag>" to "<new tag>"
Example:changeControlField "007" to "008"
|
更改控制字段的标记标识符;不修改内容。 |
| changeField "<tag>" to "<new tag>"
Example:changeField "245" to "246"
|
改变标签标识符;不修改指示符或子字段。 | |
| changeSubField "<tag>.<code>" to "<new code>"
changeSubFieldOnlyFirst "<tag>.<code>" to "<new code>"
changeSubFieldExceptFirst "<tag>.<code>" to "<new code>"
Example:changeSubField "035.b" to "a"
|
Changes the subfields (or only the first subfield, or all except the first subfield) "<code>" to the subfield "<new code>" in field "<tag>". | |
| changeFirstIndicator "<tag>" to "<value>"
changeSecondIndicator "<tag>" to "<value>"
Example:changeFirstIndicator "245" to "3"
|
Sets the value of the specified indicator in tag <tag>. | |
| combineFields "<tag>" excluding "<comma-separated subfield list>"
Example:combineFields "852" excluding "a,b"
|
合并指定数字的所有字段。将所有子字段从第二行和后续行复制到第一行,不包括命名子字段;只有第一次排除的子字段被复制,并且只有在第一行不存在的情况下。 | |
| 添加字段和子字段 | addField "<tag>.<code>.<value>"
addField "<tag>.{<ind1>,<ind2>}.<code>.<value>"
Example:addField "999.a.RESTRICTED"
|
将字段添加到MARC记录。将子字段的值设置为指定值。 |
| addControlField "<tag>.<value>"
Example:addControlField "008.820305s1991####nyu###########001#0#eng##"
|
将控制字段添加到MARC记录。 | |
| addSubField "<tag>.<code>.<value>"
addSubField "<tag>.{<ind1>,<ind2>}.<code>.<value>"
Example:addSubField "245.h.[Journal]"
|
Adds the subfield <code> with value <value> to field <tag>.如果该字段不存在,则不添加。 | |
| addSystemNumber "<element>" from "<tag>" prefixed by "<prefix tag>"
Example:addSystemNumber "035.a" from "001" prefixed by "003"
|
Makes the data field <element> equal to the contents of the second control field <prefix tag> in parentheses followed by the contents of the first control field <tag>.
For example, if 001 has the value 9945110100121 and 003 has the value DAV, the example condition on the left will produce 035 with the value ‡(DAV)9945110100121.
|
|
| 复制字段 | copyField "<tag>" to "<new tag>"
copyField "<tag>.<code>" to "<new tag>.<new code>"
copyField "<tag>" to "<new tag>.{<ind1>,<ind2>}"
Example:copyField "971.a" to "100.u"
|
将字段复制到另一个字段。In the first version, the subfields are not specified (<code> and <new code>), and the new field contains all the same subfields as the old field.In the second version, if just <new code> is not specified, the new subfield is the same as the one specified by <code>.
copyField creates a separate field rather than adding it to any existing field.You may want to combine the new field with any existing fields (see combineFields). |
| 删除字段和子字段 | removeControlField "<tag>"
Example:removeControlField "009"
|
删除所有出现的控制字段。
请注意,如果移除控制字段008,如果您没有重新创建它Alma会立刻重新创建。考虑在移除后重新添加字段,例如: rule "remove 008" when (TRUE) then removeControlField "008" addControlField "008.######s2013####xx######r#####000#0#eng#d" end |
| removeField"<tag>"
Example:removeField "880"
|
Removes all occurrences of the field <tag>. | |
| removeSubField "<tag>.<code>"
Example:removeSubField "245.h"
|
Removes all occurrences of the subfield <code> from the indicated field. | |
| 替换字段或子字段中的文本 | replaceControlContents "<tag>.{<position>,<length>}.<value>" with "<new value>"
Example:replaceControlContents"LDR.{7,1}.s" with "m"
|
Replaces <value> with "<new value>" in starting position <position> to <position>+<length> of control field <tag>.Replaces only the text that matches <value>. |
| replaceContents "<tag>.<code>.<value>" with "<new value>"
replaceContentsOnlyFirst "<tag>.<code>.<value>" with "<new value>"
replaceContentsExceptFirst "<tag>.<code>.<value>" with "<new value>"
Example:replaceContents"245.h.[Journal]" with "[Book]"
|
Replaces the matching strings (or every instance of the matching string in the first matching subfield, or all matching strings in all matching subfields except the first matching subfield) <value> in the subfield <code> of field "<tag>" with "<new value>".The string or part of the string that does not match <value> is not modified. | |
| replaceSubFieldContents "<tag>.<code>" with "<tag>.<code>"
Example:replaceSubFieldContents "245.b" with "100.a"
|
用另一个子字段的内容替换子字段的内容。 | |
|
replaceFixedContents "<tag>.{<1_ind>,<2_ind>}.<code>.{<position>,<length>}.<value>" with "<new value>" Example:replaceFixedContents "100.{1,2}.a.{0,8}.20150226" with "20220724" |
Replaces <value> with <new value> in UNIMARC and CNMARC 1XX fixed position fields. Relevant only for UNIMARC/CNMARC 1XX fields. |
|
| 在子字段中添加文本 | prefix "<tag>.<code>" with "<value>"
Example:prefix "035.b" with "(OCoLC)"
|
Adds a prefix to the value of subfield "<code>" in the field "<tag>".
The new value will be <value> followed by the old value. |
| prefixSubField "<tag>.<code>" with "<source tag>.<source code>"
Example:prefixSubField "910.a" with "906.a"
|
Adds the value of the subfield "<source code>" in the field "<source tag>" as a prefix to the subfield "<code>" in the field "<tag>".
The new value will be the value of the subfield "<source code>" in the field "<source tag>" followed by the old value. |
|
| suffix "<tag>.<code>" with "<value>"
Example:suffix "035.b" with "(OCoLC)"
|
Adds a suffix to the value of subfield "<code>" in the field "<tag>".
The new value will be the old value followed by <value>. |
|
| suffixSubField "<tag>.<code>" with "<source tag>.<source code>"
Example:suffixSubField "910.a" with "907.c"
|
Adds the value of the subfield "<source code>" in the field "<source tag>" as a suffix to the subfield "<code>" in the field "<tag>".
The new value will be the old value followed by the value of the subfield "<source code>" in the field "<source tag>". |
|
| 在书目和规范记录中维护代理信息
例如,该语法可用于在MARC 21书目元数据配置任务列表中选择的规范化规则,以便在保存时规范化网络区书目记录。 此功能正在建设中。要启用此语法,请联系Ex Libris支持。 |
addCreatingAgency "<tag>.<code>"
Example:addCreatingAgency "040.a"
|
Adds the creating agency ISIL code to the subfield in "<code>" in the field "<tag>". |
| addModifyingAgency "<tag>.<code>"
Example:addModifyingAgency "040.d"
|
Adds the modifying agency ISIL code to the subfield in "<code>" in the field "<tag>".If there already is a modifying agency in the "<tag>.<code>", this adds another agency ISIL code. | |
| replaceModifyingAgency "<tag>.<code>"
Example:replaceModifyingAgency "040.d"
|
Adds the modifying agency ISIL code to the subfield in "<code>" in the field "<tag>".If any modifying agencies already exist in the "<tag>.<code>", all of them are replaced. | |
| 拆分子字段 | splitSubField "<tag>.{ind1,ind2}.<code>.<delimiter>" to "<tag>.{<ind1>,<ind2>}.<code>" addSeq "<code>"
Example 1:splitSubField "866.a.;" to "555.{0,0}.a" addSeq "8"
Example 2:splitSubField "555.a.– " to "859.{0,0}.a" addSeq "8"
Example 3:splitSubField "859.a.\\\\."
Example 4:splitSubField "999.a.;" to "555.a" addSeq "8"
|
标签为必备。
指示符可选。 因为拆分在子字段层级,代码为必备。 分隔符可为任意字符串。如果分隔符不存在,完整的子字段复制为第一段,并添加后续。 The to component is optional.If it is specified, multiple occurrences of the to tag.code are created, each with the data until the delimiter.见示例1和2。If the to component is not specified, the subfield is split to the additional same subfields in the same field as shown in example 3. The addSeq component is optional.It is not relevant if the to component is not specified.指定addSeq时,如示例1添加含有序列的子字段;如果子字段已在初始字段中存在,序列添加到字段中如示例2。 |
|
移除重复子字段 |
correctDuplicateSubfields "<tag>" "<code>" 例如: Removes duplicate subfields x, y and z from fields 610 and 630. rule "Remove duplicates" priority 1 when (TRUE) then correctDuplicateSubfields "610,630" "xyz" end |
Corrects duplicate subfields (for instance, subfields with the same code AND the same value) by keeping the first occurrence and removing the others from the current record according to the fields and subfields that were passed as parameters. You may want to use recordHasDuplicateSubfields to create the set that you supply to your normalization rule that uses correctDuplicateSubfields.See Example 6 for more information. For deduplication of subfields with different values, see:How to remove all but one of several similar subfields in the same field in MD Editor. |
|
移动子字段 |
moveSubfieldsToEndOfField "<tag>" "<code>" 例如: Moves subfields 9 and 2 to the end of field 650. rule "Move subfields to end of field" priority 1 when (TRUE) then moveSubfieldsToEndOfField "650" "92" end |
移动每个子字段的第一个内容到字段末尾并移除相同子字段的其他内容。 如果定义了多个子字段,根据规则将其按顺序放置在末尾。该例子中,子字段9放置在末尾,子字段2紧随其后。 Note that the if statement is not supported with the moveSubfieldsToEndOfField action. |
|
更正当前记录的重复字段 |
correctDuplicateFields "{fields}" 例如: correctDuplicateFields "610,630,650" |
该操作使用一个参数,含有按逗号分隔字段值的字段,例如610,630,650。 该操作根据由参数通过的字段更正当前记录的重复字段。 此操作仅可用于识别和纠正在同一字段的多个实例之间发现的重复数据。 |
|
查找重复字段 (Indication Rules; see Working with Indication Rules) |
recordHasDuplicateFields "{fields}" 例如: recordHasDuplicateFields "610,630,650" |
该操作使用一个参数,含有按逗号分隔字段值的字段,例如610,630,650。 该操作可以为true或false。如果根据由参数通过的字段如果在当前记录中找到了重复字段,返回true。 此操作仅可用于识别和纠正在同一字段的多个实例之间发现的重复数据。 |
通配符和特殊字符
While the use of regular expressions in Alma Normalization Rules is not currently fully supported, some regular expressions can be used – for examples of these, see Alma Normalization Rule Examples.
The subfield separator ($$) cannot appear anywhere in the rule, including the rule name.
A hash character (#) at the beginning of a line indicates that the rest of the line is a comment, and is ignored when processing the rule.
The hash character (#) is not treated as a space by the normalization rules function replaceControlContents. The hash (#) is not a wild card and is not supported by this function.
The asterisk (*) is used to match any string, including a string of zero length.For example,"<tag>.<*>.<value>" applies to all the subfields in the tag <tag> that have the value <value>.* is "greedy", so it matches as many characters as possible in the string.例如:如果您有一个字符串“a b c d b e”,模式“b*b”匹配 "b c b d b",而不只是“b c b”。
Empty indicators (but not fields or subfields) are indicated by a hyphen (-).For example,"<tag> {-,<ind2>}" returns all the fields where the MARC tag is <tag>, the first indicator is not defined, and the second indicator is <ind2>.
如果子字段的文本包含句点作为最后的字符,则使用四个反斜杠来匹配句点。例如:
双引号(仅)可用于条件。要使用双引号作为条件的一部分,请使用单引号将规则(')中的文本括起来,而不是双引号(“)。This way you can use double quotation marks inside the text following a double backslash (\\).
希伯来语日期(仅)可用于条件。(希伯来语从右到左读取,因此下例中的双斜杠在双引号之前。)
- 不能在条件或值的第一个字符使用通配符。
- To use a literal backslash (\), escape it with another backslash:\\.
- Use four backslashes (\\\\) to escape a period when it is the last character in the string.When the period is immediately followed by another character, it does not require four backslashes (as in addField "907.a.F.L.T\\\\.").但是,最佳做法是在规范化规则中始终使用四个反斜杠,以确保最一致的预期结果。见下例。
- 如上文所述,如果在用单引号引用的条件中使用双引号或单引号,必须在其后附上双反斜杠。
- If the pipe symbol is part of the condition, use four backslashes to escape it, for example:removeField "866" if (exists "866.8.0\\\\|99").仅当条件中使用(|)符号时需要这样处理。
示例:在使用replaceContents的规范化规则中使用句点。
具有句点的示例记录:
245 00 $$a Feminist literary theory.: $$b a reader / $$c edited by Mary Eagleton.
246 0# $$a F.L.T.
上述示例记录的规范化规则:
前后示例见下图。
示例:在使用addField的规范化规则中使用句点
以下是需要添加句点的记录示例:
906 $$a Architecture.
907 $$a F.L.T.
以下是使用始终包括斜杠的最佳做法的上述示例记录的规范化规则:
前后记录示例见下图。
规范化规则示例
For a list of over 100 normalization rule examples and other normalization rule documents, see Alma Normalization Rule Examples.
For more information on creating normalization rules for bibliographic records in XSL format, see Alma XSL Normalization Rule Examples.
Alma最高支持XSL版本3.0。
Page tags: article:topicproduct:almacontent:Documentationlang:englishactionsRulesyntaxnormalization rule syntaxconditionselements