Skip to content

Commit

Permalink
Merge #1964 from remote-tracking branch 'ssh/1799-SerialUselessPublDate'
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Feb 6, 2024
2 parents a3e819f + 5668b42 commit cea402e
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,15 @@ do list(path:"533 ", "var": "$i")
end

# Cleaning up dates of publicaton []
copy_field("leader","@leaderPos07")
substring("@leaderPos07","7","1")
do list(path: "publication[]", "var": "$i")
replace_all("$i.startDate", ".*?([01]\\d{3}|20\\d{2}).*", "$1")
if any_match("@leaderPos07","s")
if any_contain("$i.startDate","0000")
remove_field("$i.startDate")
end
end
replace_all("$i.endDate", ".*-[ ]?([01]\\d{3}|20\\d{2})$", "$1")
replace_all("$i.location[].*", "^\\[(.*)\\]$", "$1")
replace_all("$i.location[].*", "\\s?[,:;]$", "")
Expand Down
131 changes: 131 additions & 0 deletions src/test/resources/alma-fix/990119186660206441.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"@context" : "http://lobid.org/resources/context.jsonld",
"almaMmsId" : "990119186660206441",
"oclcNumber" : [ "1057478173" ],
"zdbId" : "2102077-2",
"dnbId" : "024334561",
"deprecatedUri" : "http://lobid.org/resources/HT013595767#!",
"hbzId" : "HT013595767",
"title" : "Know your world extra",
"publication" : [ {
"type" : [ "PublicationEvent" ],
"location" : [ "Middletown, CT" ],
"publishedBy" : [ "Xerox Education Publications" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990119186660206441",
"label" : "Webseite der hbz-Ressource 990119186660206441",
"type" : [ "BibliographicDescription" ],
"inDataset" : {
"id" : "http://lobid.org/resources/dataset#!",
"label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data"
},
"resultOf" : {
"type" : [ "CreateAction" ],
"endTime" : "0000-00-00T00:00:00",
"instrument" : {
"id" : "https://github.com/hbz/lobid-resources",
"type" : [ "SoftwareApplication" ],
"label" : "Software lobid-resources"
},
"object" : {
"id" : "https://lobid.org/marcxml/990119186660206441",
"dateCreated" : "2021-04-05",
"dateModified" : "2023-05-25",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990119186660206441 im Exportformat MARC21 XML",
"inDataset" : {
"id" : "https://datahub.io/dataset/hbz_unioncatalog",
"label" : "hbz_unioncatalog"
},
"sourceOrganization" : {
"id" : "http://lobid.org/organisations/DE-600#!",
"label" : "Zeitschriftendatenbank (ZDB)"
},
"provider" : {
"id" : "http://lobid.org/organisations/DE-101#!",
"label" : "Deutsche Nationalbibliothek"
},
"modifiedBy" : [ {
"id" : "http://lobid.org/organisations/DE-600#!",
"label" : "Zeitschriftendatenbank (ZDB)"
} ]
}
},
"license" : [ {
"id" : "http://creativecommons.org/publicdomain/zero/1.0",
"label" : "Creative Commons-Lizenz CC0 1.0 Universal"
} ]
},
"sameAs" : [ {
"id" : "http://worldcat.org/oclc/1057478173",
"label" : "OCLC Ressource"
}, {
"id" : "http://ld.zdb-services.de/resource/2102077-2",
"label" : "ZDB-Ressource"
}, {
"id" : "https://d-nb.info/024334561",
"label" : "DNB-Ressource"
} ],
"fulltextOnline" : [ {
"label" : "EZB",
"id" : "http://www.bibliothek.uni-regensburg.de/ezeit/?2102077"
} ],
"related" : [ {
"note" : [ "Druck-Ausgabe" ],
"label" : "Know your world extra",
"issn" : "0163-4844"
} ],
"inCollection" : [ {
"id" : "http://lobid.org/organisations/DE-655#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen, Netzwerkzone",
"type" : [ "Collection" ]
}, {
"id" : "http://lobid.org/resources/HT014846970#!",
"label" : "Zeitschriftendatenbank (ZDB)",
"type" : [ "Collection" ]
}, {
"id" : "http://lobid.org/resources/HT016356466#!",
"label" : "Elektronische Zeitschriftenbibliothek (EZB)",
"type" : [ "Collection" ]
} ],
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/eng",
"label" : "Englisch"
} ],
"extent" : "Online-Ressource",
"natureOfContent" : [ {
"label" : "Zeitschrift",
"id" : "https://d-nb.info/gnd/4067488-5"
} ],
"subject" : [ {
"notation" : "050",
"type" : [ "Concept" ],
"source" : {
"label" : "DDC-Sachgruppen der ZDB"
},
"label" : "Zeitschriften, fortlaufende Sammelwerke"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Dewey-Dezimalklassifikation",
"id" : "https://d-nb.info/gnd/4149423-4"
},
"label" : "Allgemeine fortlaufende Sammelwerke",
"notation" : "050",
"version" : "sdnb"
} ],
"medium" : [ {
"label" : "Datenträger",
"id" : "http://rdaregistry.info/termList/RDAMediaType/1003"
}, {
"label" : "Online-Ressource",
"id" : "http://rdaregistry.info/termList/RDACarrierType/1018"
} ],
"bibliographicLevel" : {
"label" : "Serial",
"id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Serial"
},
"type" : [ "BibliographicResource", "Periodical" ],
"id" : "http://lobid.org/resources/990119186660206441#!"
}
121 changes: 121 additions & 0 deletions src/test/resources/alma-fix/990119186660206441.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<record>
<leader>00000nas a2200000#c 4500</leader>
<controlfield tag="005">20230525135732.0</controlfield>
<controlfield tag="007">cr||||||||||||</controlfield>
<controlfield tag="008">030218c00009999xxuu||p|o ||| 0||||1eng c</controlfield>
<controlfield tag="003">DE-605</controlfield>
<controlfield tag="001">990119186660206441</controlfield>
<datafield tag="016" ind1="7" ind2=" ">
<subfield code="a">2102077-2</subfield>
<subfield code="2">DE-600</subfield>
</datafield>
<datafield tag="016" ind1="7" ind2=" ">
<subfield code="a">024334561</subfield>
<subfield code="2">DE-101</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(DE-599)ZDB2102077-2</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(OCoLC)1057478173</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(DE-600)2102077-2</subfield>
</datafield>
<datafield tag="035" ind1=" " ind2=" ">
<subfield code="a">(DE-101)024334561</subfield>
</datafield>
<datafield tag="040" ind1=" " ind2=" ">
<subfield code="a">9001</subfield>
<subfield code="b">ger</subfield>
<subfield code="c">DE-101</subfield>
<subfield code="d">9001</subfield>
</datafield>
<datafield tag="041" ind1=" " ind2=" ">
<subfield code="a">eng</subfield>
</datafield>
<datafield tag="044" ind1=" " ind2=" ">
<subfield code="c">XD-US</subfield>
</datafield>
<datafield tag="084" ind1=" " ind2=" ">
<subfield code="a">050</subfield>
<subfield code="q">DE-600</subfield>
<subfield code="2">sdnb</subfield>
</datafield>
<datafield tag="245" ind1="0" ind2="0">
<subfield code="a">Know your world extra</subfield>
</datafield>
<datafield tag="264" ind1="3" ind2="1">
<subfield code="a">Middletown, CT</subfield>
<subfield code="b">Xerox Education Publications</subfield>
<subfield code="c">0000-</subfield>
</datafield>
<datafield tag="300" ind1=" " ind2=" ">
<subfield code="a">Online-Ressource</subfield>
</datafield>
<datafield tag="336" ind1=" " ind2=" ">
<subfield code="b">txt</subfield>
</datafield>
<datafield tag="337" ind1=" " ind2=" ">
<subfield code="b">c</subfield>
</datafield>
<datafield tag="338" ind1=" " ind2=" ">
<subfield code="b">cr</subfield>
</datafield>
<datafield tag="856" ind1="4" ind2=" ">
<subfield code="u">http://www.bibliothek.uni-regensburg.de/ezeit/?2102077</subfield>
<subfield code="x">EZB</subfield>
</datafield>
<datafield tag="776" ind1="0" ind2="8">
<subfield code="i">Erscheint auch als</subfield>
<subfield code="n">Druck-Ausgabe</subfield>
<subfield code="t">Know your world extra</subfield>
<subfield code="x">0163-4844</subfield>
<subfield code="0">http://worldcat.org/issn/0163-4844</subfield>
</datafield>
<datafield tag="655" ind1=" " ind2="7">
<subfield code="a">Zeitschrift</subfield>
<subfield code="0">(DE-588)4067488-5</subfield>
<subfield code="2">gnd-content</subfield>
<subfield code="B">GND-040674886</subfield>
</datafield>
<datafield tag="MBD" ind1=" " ind2=" ">
<subfield code="M">49HBZ_NETWORK</subfield>
<subfield code="i">990119186660206441</subfield>
<subfield code="n">HBZ Network</subfield>
</datafield>
<datafield tag="MNG" ind1=" " ind2=" ">
<subfield code="c">System</subfield>
<subfield code="f">ZDB</subfield>
<subfield code="i">marc21</subfield>
<subfield code="h">20230525135732.0</subfield>
<subfield code="k">01</subfield>
<subfield code="e">false</subfield>
<subfield code="d">2023-05-25 14:20:35 Europe/Berlin</subfield>
<subfield code="g">011918666-HBZ01</subfield>
<subfield code="j">90</subfield>
<subfield code="a">import</subfield>
<subfield code="b">2021-04-05 09:58:24 Europe/Berlin</subfield>
</datafield>
<datafield tag="GST" ind1=" " ind2=" ">
<subfield code="a">Periodikum</subfield>
<subfield code="A">GND-CONTENT</subfield>
<subfield code="B">GND-040674886</subfield>
<subfield code="C">450</subfield>
</datafield>
<datafield tag="GST" ind1=" " ind2=" ">
<subfield code="a">Zeitschriften</subfield>
<subfield code="A">GND-CONTENT</subfield>
<subfield code="B">GND-040674886</subfield>
<subfield code="C">450</subfield>
</datafield>
<datafield tag="GSI" ind1="7" ind2=" ">
<subfield code="a">4067488-5</subfield>
<subfield code="0">http://d-nb.info/gnd/4067488-5</subfield>
<subfield code="2">gnd</subfield>
<subfield code="A">GND-CONTENT</subfield>
<subfield code="B">GND-040674886</subfield>
<subfield code="C">024</subfield>
</datafield>
</record>
2 changes: 1 addition & 1 deletion web/test/tests/IndexIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static Collection<Object[]> data() {
{ "publication.startDate:1993", /*->*/ 3 },
{ "publication.location:Berlin AND publication.startDate:1993", /*->*/ 1 },
{ "publication.location:Berlin AND publication.startDate:[1992 TO 2017]", /*->*/ 4 },
{ "inCollection.id:\"http\\://lobid.org/organisations/DE-655#\\!\"", /*->*/ 129 },
{ "inCollection.id:\"http\\://lobid.org/organisations/DE-655#\\!\"", /*->*/ 130 },
{ "inCollection.id:NWBib", /*->*/ 0 },
{ "publication.publishedBy:Quedenfeldt", /*->*/ 2 },
{ "publication.publishedBy:Quedenfeld", /*->*/ 2 },
Expand Down

0 comments on commit cea402e

Please sign in to comment.