From 29137002a82c66dd40d8dd4fb6a602e9fea21fae Mon Sep 17 00:00:00 2001 From: klngwll Date: Tue, 7 Dec 2021 09:06:53 +0100 Subject: [PATCH 1/2] Add 264 and 008 tests --- .../src/main/resources/ext/marcframe.json | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/whelk-core/src/main/resources/ext/marcframe.json b/whelk-core/src/main/resources/ext/marcframe.json index 59f18fbe8b..0f144cffe1 100644 --- a/whelk-core/src/main/resources/ext/marcframe.json +++ b/whelk-core/src/main/resources/ext/marcframe.json @@ -1752,6 +1752,24 @@ }, "back": "both" }, + { + "name": "Metatesting postprocess merge", + "source": { + "marc:primaryProvisionActivity": { + "@type": "PrimaryProvisionActivity", + "marc:publicationStatus": "marc:SingleKnownDateProbableDate", + "year": "2021", + "country": [ {"@id": "https://id.kb.se/country/sw"} ] + }, + "publication": [ {"@type": "Publication", "year": "2021" } ] + }, + "result": { + "publication": [ + {"@type": "PrimaryPublication", "country": [ {"@id": "https://id.kb.se/country/sw"} ], "year": "2021"} + ] + }, + "back": "both" + }, { "source": { "publication": [ {"@type": "Publication", "date": ["1977", "1978"]} ] @@ -11511,6 +11529,73 @@ ] }} }, + { + "name": "With publication place ($a) and 008", + "source": [ + {"008": "| s2020 sw |||||||||||000 || | "}, + {"264": {"ind1": " ", "ind2": "1", "subfields": [ + {"a": "Stockholm :"}, + {"b": "Norstedts,"}, + {"c": "2020"} + ] + }} + ], + "result": { + "mainEntity": + { + "marc:primaryProvisionActivity" : { + "@type" : "PrimaryProvisionActivity", + "country" : [ { + "@id" : "https://id.kb.se/country/sw" + } ], + "marc:publicationStatus" : "marc:SingleKnownDateProbableDate", + "year" : "2020" + }, + "publication": + [ + { + "@type": "Publication", + "agent": {"@type": "Agent", "label": "Norstedts"}, + "place" : { + "@type" : "Place", + "label" : "Stockholm" + }, + "year": "2020" + } + ] + }} + }, + { + "name": "No publication place ($a) and 008", + "source": [ + {"008": "| s2021 sw |||||||||||000 || | "}, + {"264": {"ind1": " ", "ind2": "1", "subfields": [ + {"b": "Bonnier,"}, + {"c": "2021"} + ] + }} + ], + "result": { + "mainEntity": + { + "marc:primaryProvisionActivity" : { + "@type" : "PrimaryProvisionActivity", + "country" : [ { + "@id" : "https://id.kb.se/country/sw" + } ], + "marc:publicationStatus" : "marc:SingleKnownDateProbableDate", + "year" : "2021" + }, + "publication": + [ + { + "@type": "Publication", + "agent": {"@type": "Agent", "label": "Bonnier"}, + "year": "2021" + } + ] + }} + }, { "source": [ {"264": {"ind1": " ", "ind2": "1", "subfields": [ @@ -26910,6 +26995,7 @@ "[16]": { "link": "marc:completeness", "uriTemplate": "https://id.kb.se/marc/CompletenessType-{_}", + "matchUriToken": "^[123]$", "fixedDefault": "|" }, "[17:20]": { From 9f190216d3dc6bb1d7cb609e4760e34f4c52dd1e Mon Sep 17 00:00:00 2001 From: klngwll Date: Fri, 17 Dec 2021 11:04:42 +0100 Subject: [PATCH 2/2] More 264 specs --- .../src/main/resources/ext/marcframe.json | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/whelk-core/src/main/resources/ext/marcframe.json b/whelk-core/src/main/resources/ext/marcframe.json index 0f144cffe1..0f56c56720 100644 --- a/whelk-core/src/main/resources/ext/marcframe.json +++ b/whelk-core/src/main/resources/ext/marcframe.json @@ -11530,7 +11530,7 @@ }} }, { - "name": "With publication place ($a) and 008", + "name": "With publication place, agent and date (264 $a $b $c) and 008", "source": [ {"008": "| s2020 sw |||||||||||000 || | "}, {"264": {"ind1": " ", "ind2": "1", "subfields": [ @@ -11566,7 +11566,7 @@ }} }, { - "name": "No publication place ($a) and 008", + "name": "No publication place (264 $a) and 008", "source": [ {"008": "| s2021 sw |||||||||||000 || | "}, {"264": {"ind1": " ", "ind2": "1", "subfields": [ @@ -11596,6 +11596,31 @@ ] }} }, + { + "name": ": No publication place or date (264 $a and $c) and 008", + "NOTE": "False Strings too large to calculate edit distance.", + "NOTE:source": [ + {"008": "| snnnn xx |||||||||||000 || | "}, + {"264": {"ind1": " ", "ind2": "1", "subfields": [ + {"b": "Saga Egmont"} + ] + }} + ], + "NOTE:result": { + "marc:primaryProvisionActivity" : { + "@type" : "PrimaryProvisionActivity", + "country" : [ { "@id" : "https://id.kb.se/country/xx" } ], + "marc:publicationStatus" : "marc:SingleKnownDateProbableDate", + "year" : "nnnn" + }, + "publication" : [ + { + "@type" : "Publication", + "agent" : { "@type" : "Agent", "label" : "Saga Egmont" } + } + ] + } + }, { "source": [ {"264": {"ind1": " ", "ind2": "1", "subfields": [ @@ -26995,7 +27020,6 @@ "[16]": { "link": "marc:completeness", "uriTemplate": "https://id.kb.se/marc/CompletenessType-{_}", - "matchUriToken": "^[123]$", "fixedDefault": "|" }, "[17:20]": {