TobiasNx
TobiasNx
Added my review here: https://github.com/metafacture/metafacture-core/pull/526#issuecomment-2068705357 On scenario is still not working otherwise for me this seems to work. But @maipet has more knowledge about the leader.
[It seems that this is not solved for encode-marcxml. ](https://test.metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7C+as-records%0A%7C+decode-json%0A%7C+fix%28transformationFile%29%0A%7C+encode-marcxml%0A%7C+print%0A%3B&transformation=%23+-----LEADER+-----%0A%0Aset_field%28%22leaderPos0004%22%2C+%2200000%22%29+%23+TODO+record+length%0Aset_field%28%22leaderPos1216%22%2C+%2200000%22%29+%23+TODO+Base+address+of+data+-+Length+of+Leader+and+Directory+%0A%0Aset_field%28%22leader%22%2C%22%22%29%0Aif+exists%28%22isPartof%5B%5D%22%29%0A++set_field%28%22leaderPos07%22%2C+%22a%22%29+%23+Monografischer+unselbstst%C3%A4ndiger+Teil%0Aelsif+any_match%28%22learningResourceType%5B%5D.prefLabel.de%22%2C%22Webseite%22%29%0A++set_field%28%22leaderPos07%22%2C+%22i%22%29+%23+integrierende++Ressource%0Aelse%0A++set_field%28%22leaderPos07%22%2C+%22m%22%29%0Aend%0A%0Aif+any_match%28%22learningResourceType%5B%5D.prefLabel.de%22%2C%22Video%22%29%0A++set_field%28%22leaderPos06%22%2C+%22g%22%29+%23+Projiziertes+Medium%0Aelsif+any_match%28%22learningResourceType%5B%5D.prefLabel.de%22%2C%22Audio%22%29%0A++set_field%28%22leaderPos06%22%2C+%22i%22%29+%23+Nicht-musikalische+Tonaufnahme%0Aelse%0A++set_field%28%22leaderPos06%22%2C+%22a%22%29+%23+text+%0Aend%0A%0Apaste%28%22leader%22%2C+%22leaderPos0004%22%2C+%22~c%22%2C+%22leaderPos06%22%2C+%22leaderPos07%22%2C+%22~+a22%22%2C+%22leaderPos1216%22%2C+%22~+++4500%22%2C+%22join_char%22%3A+%22%22%29%0A%0A%0A%0A%23+-----+001+-----+%0A%0Acopy_field%28%22_id%22%2C%22001%22%29%0Aprepend%28%22001%22%2C%22OERSIMARC%22%29%0A%0A%23+-----+005+-----+%0A%0A%23set_field%28%22005%22%2C%22%22%29%0A%23+add_field%28%22@createTime%22%2C%22%24%5BcreateEndTime%5D%22%29%0Aif+all_match%28%22@createTime%22%2C%220%22%29%0A++add_field%28%22005%22%2C%2200000000000000.0%22%29%0Aelse%0A++timestamp%28%22005%22%2C+format%3A+%22yyyyMMddHHmmss.S%22%2C+timezone%3A+%22CET%22%29+%23+TODO+how+to+get+only+1st+decimal+/++millisecond%3F+%0Aend%0Areplace_all%28%22005%22%2C+%22%5E%28%5B%5E\\.%5D%2B\\.\\d%29\\d\\d%24%22%2C+%22%241%22%29%0A%0A%0A%23+-----+007+-----%0Aset_array%28%22007%22%2C%22cr%22%29%0Aif+exists%28%22hasPart%5B%5D%22%29+%23+hasPart+-%3E+medienkombination%0A++add_field%28%22007.%24append%22%2C%22ou%22%29%0Aend%0A%0A%23+-----+%28first+languageCode%29+008+/+264%24c-----%0A%23+%23+-----+inLanguage+%26+dateCreated/datePublished++-----%0A%23+%23+may+be+advisable+to+create+the+field+008+more+dynamical+%28first+6+pos.+current+date+yymmdd%29%0A%23+%0A%23+copy_field%28%22inLanguage%5B%5D.1%22%2C%22%24firstLang%22%29%0A%23+lookup%28%22%24firstLang%22%2C%22languageCodes%22%29%0A%23+%0A%23+set_array%28%22264+0%22%29%0A%23+set_array%28%22264+1%22%29%0A%23+set_field%28%22008%22%2C%22%22%29%0A%23+if+any_match%28%22datePublished%7CdateCreated%22%2C%22%5E.%2A%24%22%29%0A%23+++if+exists%28%22datePublished%22%29%0A%23+++++copy_field%28%22datePublished%22%2C+%22%24date%22%29%0A%23+++++replace_all%28%22%24date%22%2C+%22%5E%28\\d%7B4%7D%29%28-.%2B%29%24%22%2C%22%241%22%29%0A%23+++++copy_field%28%22%24date%22%2C%22264+1.%24append.c%22%29%0A%23+++++copy_field%28%22publisher%5B%5D.name%22%2C%22264+1.%24last.b%22%29%0A%23+++else%0A%23+++++copy_field%28%22dateCreated%22%2C+%22%24date%22%29%0A%23+++++replace_all%28%22%24date%22%2C+%22%5E%28\\d%7B4%7D%29%28-.%2B%29%24%22%2C%22%241%22%29%0A%23+++++copy_field%28%22%24date%22%2C%22264+0.%24append.c%22%29%0A%23+++++copy_field%28%22publisher%5B%5D.name%22%2C%22264+1.%24append.b%22%29%0A%23+++end%0A%23+++paste%28%22008%22%2C+%22~240228t%22%2C%22%24date%22%2C%22~%7C%7C%7C%7Cxx%23%7C%7C%7C%7C%7Co%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%22%2C%22%24firstLang%22%2C+%22~%7C%7C%22%2C+%22join_char%22%3A+%22%22%29%0A%23+else%0A%23+++paste%28%22008%22%2C+%22~240228t%7C%7C%7C%7C%7C%7C%7C%7Cxx%23%7C%7C%7C%7C%7Co%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%7C%22%2C%22%24firstLang%22%2C+%22~%7C%7C%22%2C+%22join_char%22%3A+%22%22%29%0A%23+end%0A%23+%0A%23+%23+-----+040+-----%0A%23+%23+-----+@language+%28@context%29+%0A%23+%0A%23+do+list%28path%3A%22@context%5B%5D%22%2C%22var%22%3A%22%24i%22%29%0A%23+++unless+is_string%28%22%24i%22%29%0A%23+++++copy_field%28%22%24i.@language%22%2C+%22lang_temp%22%29%0A%23+++++%0A%23+++end%0A%23+end%0A%23+lookup%28%22lang_temp%22%2C+%22languageCodes%22%29%0A%23+copy_field%28%22lang_temp%22%2C+%22040++.b%22%29%0A%23+%0A%23+%0A%23+%23+-----+100+/+700+-----%0A%23+%23+-----+creator+-----%0A%23+%0Aif+all_match%28%22creator%5B%5D.1.type%22%2C%22Person%22%29%0A++copy_field%28%22creator%5B%5D.1.name%22%2C%221001+.a%22%29%0A++remove_field%28%22creator%5B%5D.1.name%22%29%0Aend%0Aset_array%28%227001+%22%29%0Ado+list%28path%3A%22creator%5B%5D%22%2C+%22var%22%3A%22%24i%22%29%0A++if+all_match%28%22%24i.type%22%2C%22Person%22%29%0A++++copy_field%28%22%24i.name%22%2C%227001+.%24append.a%22%29%0A++end%0Aend%0A%0Aif+all_match%28%22creator%5B%5D.1.type%22%2C%22Organization%22%29%0A++copy_field%28%22creator%5B%5D.1.name%22%2C%221101+.a%22%29%0A++remove_field%28%22creator%5B%5D.1.name%22%29%0Aend%0Aset_array%28%227101+%22%29%0Ado+list%28path%3A%22creator%5B%5D%22%2C+%22var%22%3A%22%24i%22%29%0A++if+all_match%28%22%24i.type%22%2C%22Organization%22%29%0A++++copy_field%28%22%24i.name%22%2C%227101+.%24append.a%22%29%0A++end%0Aend%0A%0A%0A%23+-----+245+-----%0A%23+-----+name+-----%0A%0Aif+any_match%28%22creator%5B%5D.%2A.type%22%2C%22Person%7COrganization%22%29%0A++copy_field%28%22name%22%2C+%2224510.a%22%29%0Aelse%0A++copy_field%28%22name%22%2C+%2224500.a%22%29%0Aend%0A%0A%0A%23+----+300+----%0Aset_field%28%22300++.a%22%2C+%221+Online-Ressource%22%29%0A%0A%0A%23+-----+306+-----%0A%23+-----+duration+-----%0Acopy_field%28%22duration%22%2C+%22%24duration%22%29%0Areplace_all%28%22%24duration%22%2C%22%5EPT%28\\d%7B2%7D%29H%28\\d%7B2%7D%29M%28\\d%7B2%7D%29S%24%22%2C+%22%241%242%243%22%29%0Acopy_field%28%22%24duration%22%2C+%22306++.a%22%29%0A%0A%0A%23-----506+-----%0A%23+-----conditionsOfAccess%0Acopy_field%28%22conditionsOfAccess.prefLabel.de%22%2C%22506++.a%22%29%0A%0A%0A%23+-----+520+-----%0A%23+-----+description+-----%0Acopy_field%28%22description%22%2C%225202+.a%22%29%0A%0A%0A%23+-----+521+-----%0A%23+-----+audience+-----%0A%0Aset_array%28%22521++%22%29%0Ado+list%28path%3A%22audience%5B%5D%22%2C%22var%22%3A%22%24audience%22%29%0A++copy_field%28%22%24audience.prefLabel.de%22%2C%22521++.%24append.a%22%29%0Aend%0A%0A%23+-----650+-----%0A%23+-----+about+-----%0A%0Aset_array%28%22650+4%22%29%0Ado+list%28path%3A%22about%5B%5D%22%2C%22var%22%3A%22%24about%22%29%0A++copy_field%28%22%24about.prefLabel.de%22%2C%22650+4.%24append.a%22%29%0Aend%0A%0A%23+-----+653+-----%0A%23+-----+keywords+-----%0A%0Aset_array%28%22653++%22%29%0Ado+list%28path%3A%22keywords%5B%5D%22%2C%22var%22%3A%22%24keyword%22%29%0A++copy_field%28%22%24keyword%22%2C+%22653++.%24append.a%22%29%0Aend%0A%0A%23+-----+655+-----%0A%23+-----+learningResourceType+-----%0A%0Aset_array%28%22655+4%22%29%0Ado+list%28path%3A%22learninResourceType%5B%5D%22%2C%22var%22%3A%22%24lrt%22%29%0A++copy_field%28%22%24lrt.prefLabel.de%22%2C%22655+4.%24append.a%22%29%0Aend%0A%0A%23+-----+856+-----%0A%23+-----+trailer+-----%0A%0Aset_array%28%22856++%22%29%0Aif+exists%28%22trailer%22%29%0A++copy_field%28%22trailer.embedUrl%22%2C%22856++.%24append.u%22%29%0A++set_field%28%22856++.%24last.3%22%2C%22Trailer%22%29%0Aend%0A%0A%23+-----+mainEntityOfPage.id+----%0A%0Aset_array%28%2285640%22%29%0Acopy_field%28%22mainEntityOfPage%5B%5D.id%22%2C%2285640.%24append.u%22%29%0Acopy_field%28%22license.id%22%2C%2285640.%24last.r%22%29%0Aadd_field%28%2285640.%24last.z%22%2C%22kostenfrei%22%29%0A%0Aretain%28%22leader%22%2C%0A++%22%5B1234567890%5D%2A%22%29%0A&data=%7B%0A++++%22image%22%3A+%22https%3A//kicampus-public.s3.openhpicloud.de/courses/6qmhZYChy2ondx1rqzs1vh/7a7kyG8dWqkyHfKSoqL40Z/datengeschichten_unibi_logo_klein_0.jpg%22%2C%0A++++%22creator%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22name%22%3A+%22Katharina+Wei\u00df%22%2C%0A++++++++++++%22type%22%3A+%22Person%22%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%22name%22%3A+%22Marko+Wenzel%22%2C%0A++++++++++++%22type%22%3A+%22Person%22%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%22name%22%3A+%22Marko+Wenzel+%22%2C%0A++++++++++++%22type%22%3A+%22Person%22%0A++++++++%7D%0A++++%5D%2C%0A++++%22about%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22prefLabel%22%3A+%7B%0A++++++++++++++++%22de%22%3A+%22Studienbereich+Informatik%22%2C%0A++++++++++++++++%22fi%22%3A+%22tietojenk\u00e4sittelytiede%22%2C%0A++++++++++++++++%22uk%22%3A+%22\u041a\u043e\u043c\u043f%27\u044e\u0442\u0435\u0440\u043d\u0456+\u043d\u0430\u0443\u043a\u0438%22%2C%0A++++++++++++++++%22en%22%3A+%22Computer+Science%22%2C%0A++++++++++++++++%22fr%22%3A+%22Informatique%22%2C%0A++++++++++++++++%22da%22%3A+%22Datalogi%22%2C%0A++++++++++++++++%22es%22%3A+%22Ciencias+de+la+Computaci\u00f3n%22%2C%0A++++++++++++++++%22nl%22%3A+%22Informatica%22%0A++++++++++++%7D%2C%0A++++++++++++%22id%22%3A+%22https%3A//w3id.org/kim/hochschulfaechersystematik/n71%22%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%22prefLabel%22%3A+%7B%0A++++++++++++++++%22de%22%3A+%22Ingenieurwissenschaften%22%2C%0A++++++++++++++++%22fi%22%3A+%22tekniikka%22%2C%0A++++++++++++++++%22uk%22%3A+%22\u0406\u043d\u0436\u0435\u043d\u0435\u0440\u0456\u044f%22%2C%0A++++++++++++++++%22en%22%3A+%22Engineering+Sciences%22%2C%0A++++++++++++++++%22fr%22%3A+%22Ing\u00e9nierie%22%2C%0A++++++++++++++++%22da%22%3A+%22Ingeni\u00f8rvidenskab%22%2C%0A++++++++++++++++%22es%22%3A+%22Ingenier\u00eda%22%2C%0A++++++++++++++++%22nl%22%3A+%22Engineering%22%0A++++++++++++%7D%2C%0A++++++++++++%22id%22%3A+%22https%3A//w3id.org/kim/hochschulfaechersystematik/n8%22%0A++++++++%7D%0A++++%5D%2C%0A++++%22inLanguage%22%3A+%5B%0A++++++++%22de%22%0A++++%5D%2C%0A++++%22description%22%3A+%22Gesellschaftliche+Debatten+zu+Corona-Pandemie+und+Klimawandel+verdeutlichen%2C+wie+wichtig+die+adressatengerechte+und+zielgruppenspezifische+Kommunikation+von+Datenanalyseergebnissen+f\u00fcr+die+breite+\u00d6ffentlichkeit+und+politische+Entscheidungstr\u00e4ger%2Ainnen+ist.+Ziel+des+Kurses+ist+es%2C+Data+Storytelling+sowohl+auf+theoretischer+als+auch+auf+praktischer+Ebene+zu+vermitteln.\n%22%2C%0A++++%22isAccessibleForFree%22%3A+true%2C%0A++++%22type%22%3A+%5B%0A++++++++%22LearningResource%22%0A++++%5D%2C%0A++++%22mainEntityOfPage%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22provider%22%3A+%7B%0A++++++++++++++++%22name%22%3A+%22KI+Campus%22%2C%0A++++++++++++++++%22id%22%3A+%22https%3A//oerworldmap.org/resource/urn%3Auuid%3Ab092c55e-038c-4634-8063-77f9aa7b7404%22%2C%0A++++++++++++++++%22type%22%3A+%22Service%22%0A++++++++++++%7D%2C%0A++++++++++++%22id%22%3A+%22https%3A//ki-campus.org/courses/Datenanalyse-unibi2021%22%0A++++++++%7D%0A++++%5D%2C%0A++++%22@context%22%3A+%5B%0A++++++++%22https%3A//w3id.org/kim/amb/context.jsonld%22%2C%0A++++++++%7B%0A++++++++++++%22@language%22%3A+%22de%22%0A++++++++%7D%0A++++%5D%2C%0A++++%22trailer%22%3A+%7B%0A++++++++%22embedUrl%22%3A+%22https%3A//player.vimeo.com/progressive_redirect/playback/700837671/rendition/720p/file.mp4%3Floc%3Dexternal%26oauth2_token_id%3D1354883044%26signature%3D045d3c49c0196a8c9444f6d9567a270a8704d54e5a794472e336b769cbc00a4c%22%2C%0A++++++++%22type%22%3A+%22VideoObject%22%0A++++%7D%2C%0A++++%22conditionsOfAccess%22%3A+%7B%0A++++++++%22prefLabel%22%3A+%7B%0A++++++++++++%22de%22%3A+%22Anmeldung+erforderlich%22%2C%0A++++++++++++%22uk%22%3A+%22\u0434\u043b\u044f+\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0456\u0457+\u0432\u043a\u0430\u0436\u0456\u0442\u044c+\u043b\u043e\u0433\u0456\u043d%22%2C%0A++++++++++++%22en%22%3A+%22login+required%22%2C%0A++++++++++++%22nl%22%3A+%22login+vereist%22%0A++++++++%7D%2C%0A++++++++%22id%22%3A+%22http%3A//w3id.org/kim/conditionsOfAccess/login%22%0A++++%7D%2C%0A++++%22license%22%3A+%7B%0A++++++++%22id%22%3A+%22https%3A//creativecommons.org/licenses/by-sa/4.0%22%0A++++%7D%2C%0A++++%22dateCreated%22%3A+%222021-08-21%22%2C%0A++++%22name%22%3A+%22Von+der+Datenanalyse+zur+Datengeschichte+\u2013+Datenanalyseergebnisse+adressatengerecht+kommunizieren%22%2C%0A++++%22id%22%3A+%22https%3A//ki-campus.org/courses/Datenanalyse-unibi2021%22%2C%0A++++%22learningResourceType%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22prefLabel%22%3A+%7B%0A++++++++++++++++%22de%22%3A+%22Kurs%22%2C%0A++++++++++++++++%22fi%22%3A+%22Kurssi%22%2C%0A++++++++++++++++%22uk%22%3A+%22\u041a\u0443\u0440\u0441%22%2C%0A++++++++++++++++%22en%22%3A+%22Course%22%2C%0A++++++++++++++++%22fr%22%3A+%22Cours%22%2C%0A++++++++++++++++%22da%22%3A+%22Kursus%22%2C%0A++++++++++++++++%22nl%22%3A+%22Cursus%22%2C%0A++++++++++++++++%22es%22%3A+%22Curso%22%0A++++++++++++%7D%2C%0A++++++++++++%22id%22%3A+%22https%3A//w3id.org/kim/hcrt/course%22%0A++++++++%7D%0A++++%5D%0A%7D) The leader position at the beginning and in the middle are still 00000
Ahhh I now see what the problem here is, `encode-marcxml` still lacks the ability to generate the counted leader info. I did not review this properly, sorry.
We decided with @maipet and @dr0i that marcXML does not need to count but either use the provided leader info if the leader is provided as whole (even if the...
This is relevant for: https://github.com/hbz/lobid-organisations/issues/486
We could delete them with the help of a match pattern.
This seems to be a dupilcate #318
@acka47 do you know if Verbund knows about it?
The leader is always valid?
I will put this on hold, the failing test hints that it is not as easy: issue336_createRecordWithTopLevelLeader_defaultMarc21Xml