diff --git a/bibliotheca/Taskfile.yml b/bibliotheca/Taskfile.yml index 1ee9460..e0ace67 100644 --- a/bibliotheca/Taskfile.yml +++ b/bibliotheca/Taskfile.yml @@ -125,6 +125,8 @@ tasks: "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/7100a.json > {{.LOG}} - > # spec_B_T_04, spec_B_T_05: ISBN 2000 "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/2000.json > {{.LOG}} + - > # spec_B_T_57: Formal falsche ISBNs in 2009 verschieben + "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/2009.json > {{.LOG}} - > # spec_B_T_04, spec_B_T_05: ISMN 2020 "$CLIENT" -P {{.PORT}} {{.PROJECT}} --apply config/main/2020.json > {{.LOG}} - > # spec_B_T_29: ISSN 2010 diff --git a/bibliotheca/config/main/2009.json b/bibliotheca/config/main/2009.json new file mode 100644 index 0000000..30a5b9d --- /dev/null +++ b/bibliotheca/config/main/2009.json @@ -0,0 +1,25 @@ +[ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [], + "mode": "record-based" + }, + "baseColumnName": "2000", + "expression": "grel:forEach(value.split('␟'), isbn, if(isbn.length() == 10, if(with(round(sum(forRange(1,10,1,i,toNumber(isbn[i-1])*i))%11),x,if(x == 10, 'X', x)).toString() == isbn[9], null, isbn), if(isbn.length() == 13, if(((10-(sum(forRange(0,12,1,i,toNumber(isbn[i])*(1+(i%2*2)) )) %10)) %10).toString()[0] == isbn[12], null, isbn), null))).join('␟')", + "onError": "set-to-blank", + "newColumnName": "2009", + "columnInsertIndex": 4 + { + "op": "core/text-transform", + "engineConfig": { + "facets": [], + "mode": "record-based" + }, + "columnName": "2000", + "expression": "grel:forEach(value.split('␟'), isbn, if(isbn.length() == 10, if(with(round(sum(forRange(1,10,1,i,toNumber(isbn[i-1])*i))%11),x,if(x == 10, 'X', x)).toString() == isbn[9], isbn, null), if(isbn.length() == 13, if(((10-(sum(forRange(0,12,1,i,toNumber(isbn[i])*(1+(i%2*2)) )) %10)) %10).toString()[0] == isbn[12], isbn, null), null))).join('␟')", + "onError": "keep-original", + "repeat": false, + "repeatCount": 10 + } +] diff --git a/bibliotheca/config/main/template.txt b/bibliotheca/config/main/template.txt index 8ea674e..b93be92 100644 --- a/bibliotheca/config/main/template.txt +++ b/bibliotheca/config/main/template.txt @@ -19,6 +19,7 @@ with( '1140', '1500', '2000', + '2009', '2010', '2020', '2201', diff --git a/pica+/config/template.txt b/pica+/config/template.txt index 4a6f8d6..44a0bfd 100644 --- a/pica+/config/template.txt +++ b/pica+/config/template.txt @@ -8,9 +8,10 @@ if(row.index - row.record.fromRowIndex == 0, + forNonBlank(cells['0100'].value, v, '003@ ' + '0' + v + '\n', '') + forNonBlank(cells['0110'].value, v, '003S ' + '0' + v + '\n', '') + forNonBlank(cells['2000'].value, v, forEach(v.split('␟'),x,'004A ' + '0' + x + '\n').join(''), '') -+ forNonBlank(cells['2010'].value, v, '005A ' + '0' + v + '\n', '') ++ forNonBlank(cells['2009'].value, v, forEach(v.split('␟'),x,'004D ' + '0' + x + '\n').join(''), '') + forNonBlank(cells['2020'].value, v, '004F ' + '0' + v + '\n', '') + forNonBlank(cells['2201'].value, v, '004L ' + '0' + v + '\n', '') ++ forNonBlank(cells['2010'].value, v, '005A ' + '0' + v + '\n', '') + forNonBlank(cells['2199'].value, v, forEach(v.split('␟'),x,'006Y ' + '0' + x + '\n').join(''), '') + forNonBlank(cells['2240'].value, v, '007G ' + 'iZDB' + '0' + v + '\n', '') + forNonBlank(cells['1500'].value, v, '010@ ' + forEach(v.split('␟'),x,'a' + x).join('') + '\n', '')