Skip to content

Commit

Permalink
Add volumeIn from Strapi to isPartOf in index (RPB-239)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Jan 21, 2025
1 parent 647a7cb commit 926cee4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions conf/output/test-output-87.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"title" : "2000 Jahre Meilbrück : vom römischen Tempelbezirk zur modernen Raststätte; Von den Anfängen bis zum Ende der Römerherrschaft",
"alternativeTitle" : [ "Zweitausend Jahre Meilbrück" ],
"extent" : "Ill.",
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"id" : "https://lobid.org/resources/121t0146618"
} ],
"numbering" : "1"
} ],
"publication" : [ {
"startDate" : "1990",
"type" : [ "PublicationEvent" ]
Expand Down
20 changes: 18 additions & 2 deletions conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ if exists("inSeries[]")
set_array("isPartOf[]")
move_field("inSeries[].*", "isPartOf[].$append")
end
if exists("volumeIn")
unless any_equal("type", "Band") # not for Allegro
unless exists("isPartOf[]")
set_array("isPartOf[]")
end
move_field("volumeIn", "isPartOf[].$append")
end
end
if exists("isPartOf[]")
unless any_equal("type", "Band") # also sets isPartOf
set_array("temp")
Expand All @@ -173,8 +181,16 @@ if exists("isPartOf[]")
copy_field("$i.numbering", "temp.$last.numbering")
else
split_field("$i.value", " ; ")
copy_field("$i.value.1", "temp.$last.hasSuperordinate[].$append.label")
copy_field("$i.value.2", "temp.$last.numbering")
if all_match("$i.value", "^http.+")
copy_field("$i.value", "temp.$last.hasSuperordinate[].$append.id")
else
copy_field("$i.value.1", "temp.$last.hasSuperordinate[].$append.label")
end
if exists("$i.numbering")
copy_field("$i.numbering", "temp.$last.numbering")
else
copy_field("$i.value.2", "temp.$last.numbering")
end
end
end
move_field("temp", "isPartOf[]")
Expand Down

0 comments on commit 926cee4

Please sign in to comment.