Skip to content

Commit

Permalink
Split inSeries values into label and numbering (RPB-256)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Feb 21, 2025
1 parent 4d2c520 commit e8b75f1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions conf/output/test-output-92.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://rpb.lobid.org/929t163432",
"label" : "Bad Emser Hefte ; 76"
"label" : "Bad Emser Hefte"
} ],
"numbering" : "1 (1989)"
"numbering" : "76"
} ],
"rpbId" : "929t163432b1",
"id" : "https://lobid.org/resources/929t163432b1",
Expand Down
4 changes: 2 additions & 2 deletions conf/output/test-output-93.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://rpb.lobid.org/929t163432",
"label" : "Bad Emser Hefte ; 77"
"label" : "Bad Emser Hefte"
} ],
"numbering" : "2 ([1989])"
"numbering" : "77"
} ],
"rpbId" : "929t163432b2",
"id" : "https://lobid.org/resources/929t163432b2",
Expand Down
4 changes: 2 additions & 2 deletions conf/output/test-output-94.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "http://rpb.lobid.org/929t163432",
"label" : "Bad Emser Hefte ; 78"
"label" : "Bad Emser Hefte"
} ],
"numbering" : "3 ([1989])"
"numbering" : "78"
} ],
"rpbId" : "929t163432b3",
"id" : "https://lobid.org/resources/929t163432b3",
Expand Down
12 changes: 6 additions & 6 deletions conf/output/test-output-strapi.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ if any_equal("type", "Band")
unless exists("superordinateLabel")
copy_field("isPartOf[].value", "superordinateLabel")
end
copy_field("isPartOf[].numbering", "tempNumbering")
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")
copy_field("tempNumbering", "isPartOf[].$last.numbering")
unless exists("isPartOf[].$last.numbering")
copy_field("volumeIn.numbering", "isPartOf[].$last.numbering")
end
# disable after Allegro import until here ^
end

Expand Down
9 changes: 9 additions & 0 deletions conf/rpb-titel-to-strapi.fix
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ move_field("f77_", "extent")
call_macro("move_all", from: "f81?", to: "note")
replace_all("note[].*.value", "/\\. -$", "/")
call_macro("move_all", from: "f85?", to: "isPartOf")
do list_as(partOf: "isPartOf[]")
if all_contain("partOf.value", " ; ")
move_field("partOf.value", "partOfTemp")
split_field("partOfTemp", " ; ")
move_field("partOfTemp.$first", "partOf.value")
move_field("partOfTemp.$last", "partOf.numbering")
remove_field("partOfTemp")
end
end
copy_field("f20u", "superordinate")
move_field("f86_", "otherId")
move_field("f95_", "created")
Expand Down

0 comments on commit e8b75f1

Please sign in to comment.