rism-digital / muscat

🗂️ A Rails application for the inventory of handwritten and printed music scores
http://muscat-project.org
34 stars 16 forks source link

Validation in MARC tags with multiple subfields #1128

Open jenniferward opened 3 years ago

jenniferward commented 3 years ago

Just noticed that some people are filling out 856 $z and $x even if there is no URL in $u. So we need a validation that looks at the whole field - if 1 subfield is filled out, then all 3 need to be filled out.

jenniferward commented 3 years ago

Editing this to include more fields that have subfields. Catalogers sometimes fill out a function (700$4, 710$4) or a literature reference (690$n, 691$n) but forget the person or book, and they would appreciate a warning here so that they can fix it.

So: 700: If $j or $4 is filled out, then $a required

710: If $j or $4 is filled out, then $a required

690: If $n filled out, then $a required If $a filled out, then $n required

691: If $n filled out, then $a required BUT: 691$a can exist by itself (sometimes $n is not necessary)

510: If $c is filled out, then $a is required If $a is filled out, then $c is required

596: If $a is filled out, then $b is required If $b is filled out, then $a is required

xhero commented 3 years ago

For 700 and 710 I cannot reproduce the bug, as leaving $a empty will always trigger an error for me - is there a special way this is done?

jenniferward commented 3 years ago

I was thinking of the error reports that had the empty $a. Maybe it was only in old records. You're right, I'm getting errors (as expected) too.

jenniferward commented 3 years ago

Was this implemented, or is it yet to come? We had an empty 856$u recently (https://muscat.rism.info/admin/sources/1001171784).

xhero commented 3 years ago

Oh, I realized I implemented all of them except 856$u

xhero commented 2 years ago

I will move this to 8.1, the problem is that a field can be validated only by one rule, and 856 $u already has a begins_with rule.

jenniferward commented 12 months ago

Giving this a boost because there are also some records where just one subfield in 856 is filled out, likely just through misclicking. 856 containing only $x:

The validation should catch such cases and we should add it to the health report. We'd also need a list of 856s missing multiple fields so we can fix them.

jenniferward commented 1 month ago

Also relevant: People: Validation for 024 https://github.com/rism-digital/muscat/issues/1498