Skip to content

Commit

Permalink
Use RPB URLs for volumeIn in to-strapi transformation (RPB-239)
Browse files Browse the repository at this point in the history
And re-enable transformation code for Allegro import
  • Loading branch information
fsteeg committed Feb 4, 2025
1 parent 0f6e678 commit 800d925
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 45 deletions.
2 changes: 1 addition & 1 deletion conf/output/test-output-34.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982373",
"id" : "http://rpb.lobid.org/107t982373",
"label" : "SWR-3-Clubmagazin"
} ],
"numbering" : "1998,1(Sept.) -"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-36.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982374",
"id" : "http://rpb.lobid.org/107t982374",
"label" : "On : SWF 3, das Magazin"
} ],
"numbering" : "1992 - 1998,2"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-38.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982375",
"id" : "http://rpb.lobid.org/107t982375",
"label" : "Die Zeitschrift : der Südwestrundfunk und seine Programme. Rheinland-Pfalz"
} ],
"numbering" : "1998,1(Sept.) - 2001,9(Sept.)"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-40.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982376",
"id" : "http://rpb.lobid.org/107t982376",
"label" : "Flieg und flatter : Aktuelles aus der Vogelschutzwarte"
} ],
"numbering" : "Ausg. 1.1997(Dez.) -"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-42.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982377",
"id" : "http://rpb.lobid.org/107t982377",
"label" : "Der Rasenspieler : das Journal zur Saison ..."
} ],
"numbering" : "Nachgewiesen 1998/99(1998) - 2000/01; 2001/02 - 2002/03"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-44.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982378",
"id" : "http://rpb.lobid.org/107t982378",
"label" : "'s Derfsche : Ebertsheim-Rodenbach, das Dorf im Grünen"
} ],
"numbering" : "1998,Apr."
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-46.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/107t982379",
"id" : "http://rpb.lobid.org/107t982379",
"label" : "Wer ist wo"
} ],
"numbering" : "1994/95(1995)"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-51.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/929t112193",
"id" : "http://rpb.lobid.org/929t112193",
"label" : "Aktuell : das Krankenhaus in Ihrer Region"
} ],
"numbering" : "Nachgewiesen 2010 - 2012,1"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-53.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/929t112194",
"id" : "http://rpb.lobid.org/929t112194",
"label" : "Clubzeitung"
} ],
"numbering" : "Nachgewiesen 2006,2 -"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-60.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/929t111801",
"id" : "http://rpb.lobid.org/929t111801",
"label" : "Rhein-Zeitung : unabhängige Tageszeitung"
} ],
"numbering" : "66.2011,77(1.Apr.) -"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-75.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/036t160240",
"id" : "http://rpb.lobid.org/036t160240",
"label" : "Piffche-Bahnfahrt durch Rheinhessen"
} ],
"numbering" : "[1]"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-76.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/036t160240",
"id" : "http://rpb.lobid.org/036t160240",
"label" : "Piffche-Bahnfahrt durch Rheinhessen"
} ],
"numbering" : "2"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-78.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/121t0144215",
"id" : "http://rpb.lobid.org/121t0144215",
"label" : "Bibliographie zu den Jahrbüchern des Kreises Daun"
} ],
"numbering" : "1973/90 (1990) -"
Expand Down
2 changes: 1 addition & 1 deletion conf/output/test-output-87.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/121t0146618"
"id" : "http://rpb.lobid.org/121t0146618"
} ],
"numbering" : "1"
} ],
Expand Down
28 changes: 14 additions & 14 deletions conf/output/test-output-strapi.json

Large diffs are not rendered by default.

33 changes: 17 additions & 16 deletions conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,19 @@ end
if any_equal("type", "Band")
set_field("type[].$append", "Book")
call_macro("move_here", field: "isPartOf[]")
# enable for Allegro import:
# copy_field("isPartOf[].label", "superordinateLabel")
# unless exists("superordinateLabel")
# copy_field("isPartOf[].value", "superordinateLabel")
# end
# set_array("isPartOf[]")
# set_array("isPartOf[].$append.type[]", "IsPartOfRelation")
# set_array("isPartOf[].$last.hasSuperordinate[]")
# # Set up superordinate ID: use the volume ID, remove the numbering part:
# copy_field("volumeIn.value", "isPartOf[].$last.hasSuperordinate[].$append.id")
# copy_field("superordinateLabel", "isPartOf[].$last.hasSuperordinate[].$last.label")
# copy_field("volumeIn.numbering", "isPartOf[].$last.numbering")
# disable after Allegro import:
copy_field("isPartOf[].label", "superordinateLabel")
unless exists("superordinateLabel")
copy_field("isPartOf[].value", "superordinateLabel")
end
set_array("isPartOf[]")
set_array("isPartOf[].$append.type[]", "IsPartOfRelation")
set_array("isPartOf[].$last.hasSuperordinate[]")
# Set up superordinate ID: use the volume ID, remove the numbering part:
copy_field("volumeIn.value", "isPartOf[].$last.hasSuperordinate[].$append.id")
copy_field("superordinateLabel", "isPartOf[].$last.hasSuperordinate[].$last.label")
copy_field("volumeIn.numbering", "isPartOf[].$last.numbering")
# disable after Allegro import until here ^
end

# ------- rpbId -------
Expand Down Expand Up @@ -161,15 +162,15 @@ if exists("inSeries[]")
move_field("inSeries[].*", "isPartOf[].$append")
end
if exists("volumeIn")
#unless any_equal("type", "Band") # enable for Allegro import
unless any_equal("type", "Band") # disable after Allegro import
unless exists("isPartOf[]")
set_array("isPartOf[]")
end
move_field("volumeIn", "isPartOf[].$append")
#end
end
end
if exists("isPartOf[]")
#unless any_equal("type", "Band") # enable for Allegro import
unless any_equal("type", "Band") # disable after Allegro import
set_array("temp")
do list (path:"isPartOf[]", "var": "$i")
set_array("temp.$append.type[]", "IsPartOfRelation")
Expand Down Expand Up @@ -197,7 +198,7 @@ if exists("isPartOf[]")
end
end
move_field("temp", "isPartOf[]")
#end
end
end

# ------- "medium" -------
Expand Down
2 changes: 1 addition & 1 deletion conf/rpb-titel-to-strapi.fix
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ if exists("numbering")
end
copy_field("_id", "volumeIn.value") # Verknüpfung zur MtM (ÜO)
replace_all("volumeIn.value","b\\d+","")
prepend("volumeIn.value","https://lobid.org/resources/")
prepend("volumeIn.value","http://rpb.lobid.org/")
end

# ISBNs (f87_, f871 ff.)
Expand Down

0 comments on commit 800d925

Please sign in to comment.