Tech Blog

Alma Indication Rule Examples

See also:

Retrieve all records which contain a 780 and a 785 and a 022 field

rule "Retrieve all records which contain a 780 and a 785 and a 022 field"
when
 ((exists "780") AND (exists "785") AND (exists "022"))
then
set indication."true"
end

 

Retrieve all records which do contain a 336 and a 337 and a 338 field (contain all three)

rule "Retrieve all records which contain a 336 and a 337 and a 338 field"
when
 ((exists "336") AND (exists "337") AND (exists "338"))
then
set indication."true"
end

Retrieve all records which do not contain a 336 and a 337 and a 338 field (does not contain all three)

rule "Retrieve all records which do not contain a 336 and a 337 and a 338 field"
when
 ((not exists "336") OR (not exists "337") OR (not exists "338"))
then
set indication."true"
end

Retrieve all records with at least two 773 fields which have a subfield w

rule "Retrieve all records which have more than one 773 with subfield w"
when
existsMoreThanOnce "773.w"
then
set indication."true"
end

Retrieve all records which contain more than occurrence of 900 field subfield a with text Art and Design”

rule "Retrieve all records which contain more than occurrence of 900 field subfield a with text Art and Design"
when
(existsMoreThanOnce "900.a.Art and Design")
then
set indication."true"
end

Retrieve all records which have neither a 260 or a 264

rule "Retrieve all records which have neither a 260 or a 264"
when
     ((not exists "260") AND (not exists "264"))
then
                set indication."true"
end

Retrieve all records which have a control 001 which starts with “99125”

rule "001 starts with 99125"
when
        existsControl "001.{0,5}.99125"
then
  set indication."true"
end

The rule used here states:  existsControl “001.{0,5}.99125”

That means “start at position 0 and count for 5 positions”.

 

Using wildcards in field codes: Retrieve all records which have a subfield 0 in a field which starts with ‘65’, for example 650 and 659:

rule "Contains a 65X subfield 0"
when
     exists "65*.0.*"
then
     set indication."true"
end

Retrieve all records which have the 202B right to left embedding Unicode character in the 245 subfield a

rule "Contains 245 with subfield a with right to left embedding character"
when
     exists "245.a.*u202B*"
then
  set indication."true"
end

For left to right use U202A instead of the above U202B.

Other Unicode values can also be used.

Here is example:

Retrieve all records which have more than one 300 field and each has a subfield a.  For example one record has both of these:

300   $$a 60 audio discs ; $$c 4 3/4 in.
300   $$a 10 microfiche
rule "Retrieve all records which have more than one 300 field and each has a subfield a"
when
existsMoreThanOnce "300.a"
then
set indication."true"
end

Using wildcards in field codes: Retrieve all records which have a subfield 0 in a field which starts with ‘6’, for example 600, 630, 650 and 659:

rule "Contains a 6XX subfield 0"
when
     exists "6**.0.*"
then
     set indication."true"
end

Retrieve all records which do have a 776 subfield x and do not have a 776 subfield z

rule "776x present 776z not present"
when
(exists "776.x" AND not exists "776.z")
then
set indication."true"
end

Retrieve all records which have Knopf in 260 subfield b or a 264 subfield b

rule "260 264 Palgrave"
when
(exists "260.b.*Knopf*" OR exists "264.b.*Knopf*")
then
set indication."true"
end

Retrieve all records which do not have Knopf in 260 subfield b or a 264 subfield b

rule "260 264 Palgrave"
when
(not exists "260.b.*Knopf*" AND not exists "264.b.*Knopf*")
then
set indication."true"
end

 

Retrieve all records which contain a 050 subfield a which starts with HD

rule "Contains 050 beginning with HD in subfield a"
when
     exists "050.a.HD*"
then
  set indication."true"
end

Retrieve all records which have a 300 subfield a with text loose leaf or loose-leaf

rule "300a loose leaf"
when
exists "300.a.*loose*leaf*"
then
set indication."true"
end

Retrieve all records which contain a 970 with subfield a “minesthesis”

rule "Contains 970 with subfield a minesthesis"
when
     exists "970.a.minesthesis"
then
     set indication."true"
end

Retrieve all records which do not contain a 970 with subfield a “minesthesis”

rule "Does not contain 970 with subfield a minesthesis"
when
     not exists "970.a.minesthesis"
then
     set indication."true"
end

Retrieve all records which contain a 76X – 78X Linking entry field

rule "Retrieve all records which contain a 76X - 78X Linking entry field"
when
     (exists "76*") OR (exists "77*") OR (exists "78*")
then
     set indication."true"
end

Retrieve all records which have an 830 that does not have a 2nd indicator 0

rule "830 without 2nd indicator 0"
when
((exists "830") AND ( not exists "830.{*,0}"))
then
set indication."true"
end

Retrieve all records which have a 084 field with subfield 2 ncsclt

rule "084 2 ncsclt"
when
(exists "084.2.ncsclt")
then
set indication."true"
end

Retrieve all records which have a 6XX field with subfield 2 bisacsh

rule "650 2 bisacsh"
when
(exists "6**.2.bisacsh")
then
set indication."true"
end

Retrieve all records which have a 6XX field with subfield v “Drama.” (with a period at the end)

The period must be preceded by two slashes.

rule "Retrieve all records which contain 6xx subfield v Drama" 
when
(exists "6**.v.Drama.")
then
set indication."true"
end

Retrieve all records which have a 245 field with no second indicator or second indicator 0 and subfield a with an initial article

rule "Retrieve all records which have a 245 field with no second indicator or second indicator 0 and subfield a with an initial article"
when
   (  ( (exists "245.{*,-}.a.*") OR (exists "245.{*,0}.a.*") ) AND ( (exists "245.a.A *") OR (exists "245.a.An *") OR (exists "245.a.The *") ) )
then
     set indication."true"
end

Retrieve all records which have eng (English) in position 35-37 of the 008

rule "have eng for 008 pos. 35-37 (language)"
when
       existsControl "008.{35,3}.eng"
then
     set indication."true"
end

Retrieve all records which have blank (no language) in position 35-37 of the 008

rule "have blank for 008 pos. 35-37 (language)"
when
       existsControl "008.{35,3}.   "
then
     set indication."true"
end

Retrieve all records which have a 949 field with a subfield a with any contents

rule "Contains 949 with subfield a"
when
     exists "949.a.*"
then
     set indication."true"
end

Retrieve all records which have either a 1XX with a subfield 0 or 6XX with subfield 0 or a 7XX with subfield 0

rule "Contains a 1XX or 6XX or 7XX subfield 0"
when
     ((exists "1**.0.*") OR (exists "6**.0.*") OR (exists "7**.0.*"))
then
     set indication."true"
end

Retrieve all records which have a 700 without 2nd indicator 2 and also have either a 77X or 78X

rule "Retrieve all records which have a 700 field without 2nd indicator 2 and also have 77X or 78X"
when
     ( (exists "700.a.*") AND (not exists "700.{*,2}") ) AND ( (exists "77*") OR (exists "78*") )
then
     set indication."true"
end

Retrieve all records which have multiple 300 fields each having a subfield a

rule "Retrieve all records which contain two subfield a occurrences in 300"
    when
        existsMoreThanOnce "300.a"
    then
        set indication."true"
end

Retrieve all records which have a 773 field with 2nd indicator 8

rule "Retrieve all records which have a 773 field with 2nd indicator 8"
when
     (exists "773.{*,8}")
then
                set indication."true"
end

Retrieve all records which have a 773 field without 2nd indicator 8

rule "Retrieve all records which have a 773 field without 2nd indicator 8"
when
     ((exists "773") AND (not exists "773.{*,8}"))
then
                set indication."true"
end

Retrieve all records which have any fields 009, 09X, 490, 59X, 69X, and 9XX:

rule "Contains any fields 009 09X 490 5XX 69X 9XX"
when
((existsControl "009") OR (exists "09*") OR (exists "490") OR (exists "59*") OR (exists "69*") OR (exists "9**"))
then
set indication."true"
end

Retrieve all records which have any fields 009, 09X, 490, 59X, 69X, and 9XX except 906 (if it has 906 do not say “true”):

rule "Contains any fields 009 09X 490 5XX 69X 9XX except 906"
when
((existsControl "009") OR (exists "09*") OR (exists "490") OR (exists "59*") OR (exists "69*") OR (exists "91*") OR (exists "92*") OR (exists "93*") OR (exists "94*") OR (exists "95*") OR (exists "96*") OR (exists "97*") OR (exists "98*") OR (exists "99*") OR (exists "900") OR (exists "901") OR (exists "902") OR (exists "903") OR (exists "904") OR (exists "905") OR (exists "907") OR (exists "908") OR (exists "909"))
then
set indication."true"
end

Retrieve all records which contain one of the following in 100d d., b., ca., or fl.

rule "A list of catalog records containing abbreviations d., b., ca., or fl. in subfield d of a MARC 100"
when
     ((exists "100.d.*d.*") OR (exists "100.d.*b.*") OR (exists "100.d.*ac.*") OR (exists "100.d.*fl.*"))
then
                set indication."true"
end

Retrieve all records which are Govt. Publications based on the 008 position 28. May be used for Hathi Trust.

rule "Check 008 position 28 and if it is a Govt. Publication then return value true"
when
(existsControl "008.{28,1}.a") OR (existsControl "008.{28,1}.c") OR (existsControl "008.{28,1}.f") OR (existsControl "008.{28,1}.i") OR (existsControl "008.{28,1}.l") OR (existsControl "008.{28,1}.m") OR (existsControl "008.{28,1}.o") OR (existsControl "008.{28,1}.s") OR (existsControl "008.{28,1}.z") 
then
set indication."true"
end

Retrieve all records which are not Govt. Publications based on the 008 position 28. May be used for Hathi Trust.

rule "Check 008 position 28 and if it is not a Govt. Publication then return value true"
when
(not existsControl "008.{28,1}.a") AND (not existsControl "008.{28,1}.c") AND (not existsControl "008.{28,1}.f") AND (not existsControl "008.{28,1}.i") AND (not existsControl "008.{28,1}.l") AND (not existsControl "008.{28,1}.m") AND (not existsControl "008.{28,1}.o") AND (not existsControl "008.{28,1}.s") AND (not existsControl "008.{28,1}.z") 
then
set indication."true"
end

13 Replies to “Alma Indication Rule Examples”

  1. Hi Yoel,

    I am trying to filter subfied data from a local 9xx (962 field) that is mapped as a local param 02. Because the subfields in this local field aren’t indexed, I am using an indication rule to get the records with particular subfield values. The purpose of this is to get information on cataloger statistics–for example the level of cataloging effort and national contributions–that each subfield value represents. I am wondering if an indication rule is the best way to generate this data in Alma or does Analytics provide a better option in terms of such report generation?

    Thanks,
    Paromita

  2. Hello Paromita:
    If the goal here is to make a set of records which have a certain value in a certain subfield of a certain field then the most efficient way would be to use an indication rule.
    Thanks.

  3. Hi Yoel,

    I created an Indication rule to Retrieve all records which contain LDR 7 = i and 008 21 = ”

    I tested the Indication Rule on a record in the Metadata Editor and got this error, “Failed During compilation of Drools files” I can’t find any reference to this error message in the Exlibris Knowledge Center. Can you point me in the right direction to solving this Drools files error message?

    rule “Retrieve all records which contain LDR 7 = i and 008 21 = ”
    when
    ((exists “LDR.{7,i}.”) and (exists “008.{21,1}. “))
    then
    set indication.”true”
    end

    Regards,
    Sandra

    1. Hi Sandra:
      This part of your rule
      (exists “LDR.{7,i}.”)

      Should be
      (existsControl “LDR.{7,1}.i”)

      Please try this:

      rule “Retrieve all records which contain LDR 7 = i and 008 21 = ”
      when
      existsControl “LDR.{7,1}.i” AND existsControl “008.{21,1}. ”
      then
      set indication.”true”
      end

  4. Hi, Yoel:
    Is it possible to write an indication rule that looks for specific values in two or more subfields, both of which reside in the same MARC field? (The MARC field appears more than once in the bib record, so I get some false hits.) I need to create a filter that finds each MARC field that contains ALL of the defined values. e.g.:
    962.a.law AND 962.b.mmb AND 962.c.202105*
    Thanks!

  5. Hello Melissa.
    The clause between the “when” and the “then” in an indication rule works on the entire record and not on a specific field.
    Therefore it is not possible to say “check the subfield a and b of field 900 (for example) only when both a and b are in the same field and not repeated fields of the same record. For example both records below will be treated the same when looking for subfield a “apples” and subfield b “oranges” in the 900 field:
    rule “mashehu”
    when
    (exists “900.a.apples” AND exists “900.b.oranges”)
    then
    set indication.”true”
    end

    Record one
    24514 $$a The first example
    900__ $$a apples $$b oranges

    Record two
    24514 $$a The second example
    900__ $$a apples $$b kiwi
    900__ $$a avocado $$b oranges

  6. Hi, Yoel:
    Is it possible to write an indication rule that looks for blank specific subfields in a MARC field? The purpose is to get records with errors like this where there is $ blank position instead of $b:
    245 10$aTelecomunicaciones y Audiovisual :$ Informe Económico Sectorial /$cComisión Nacional de los Mercados y la Competencia
    Thanks a lot!

  7. Is it possible to write an indication rule for 001 appearing more than once? I can use existsMoreThanOnce on other fields and I can use existsControl “001” but I can’t figure out how to use them together.

  8. Hello Kristen.
    The parameter “existsMoreThanOnce” is relevant only for DataFields, and not for Control Fields.
    There is not a parameter to get records with more than one 001 per record.
    Thank you.

  9. Hi Yoel,

    Is there any way to create an indication rule that will search for duplicate fields with the same value? There is a NR that uses the operator “correctDuplicateFields” to fix such issues, but we would like first to identify / filter the records that have duplicate fields.

    Thanks,
    Marina

  10. I have this same question. I have some records that incorrectly imported and took the number from the 037 and merged it to a record that had that number as the 035 number. Now I want to find records where the 037 and 035 match but the numbers obviously aren’t consistent to look for, just the match of the two fields.

Leave a Reply