Skip to content

Commit

Permalink
Update transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Jan 9, 2025
1 parent bc2e9f5 commit 5759304
Show file tree
Hide file tree
Showing 4 changed files with 1,863 additions and 10,544 deletions.
5 changes: 5 additions & 0 deletions combineHoldingsIntoHasItems.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
paste("id", "~http://lobid.org/resources/", "_id", "~#!", join_char: "")

copy_field("holding","hasItem[].$append")

retain("id", "hasItem[]")
37 changes: 23 additions & 14 deletions mab2De-Sol1Holdings_seq.fix
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,34 @@ do once("maps")
put_filemap("map/identifier.tsv","zdbId2AlmaMmsId", sep_char:"\t",key_column:"2",value_column:"0",expected_columns:"-1")
end

# Lookup MMS Ids for the old HT Numbers or ZDB IDs.

copy_field("012.a","almaMmsId")
if any_match("almaMmsId","^[A-Z]{2}.*")
lookup("almaMmsId","hbzId2AlmaMmsId")
else
lookup("almaMmsId","zdbId2AlmaMmsId")
end

set_array("hasItem[]")
set_hash("hasItem[].$append")
paste("hasItem[].$last.id","~http://lobid.org/items/", "almaMmsId", "~:","~ITEMMMSIDMUSSERSETZTWERDEN","~#!",join_char:"")
copy_field("100.a","hasItem[].$last.callNumber")
set_array("hasItem[].$last.inCollection[]")
add_field("hasItem[].$last.inCollection[].$append.id", "http://lobid.org/organisations/DE-Sol1#!")
add_field("hasItem[].$last.inCollection[].$last.label", "Stadtarchiv Solingen, Bibliothek")
add_field("hasItem[].$last.heldBy.isil", "DE-Sol1")
add_field("hasItem[].$last.heldBy.id", "http://lobid.org/organisations/DE-Sol1#!")
add_field("hasItem[].$last.label", "Stadtarchiv Solingen, Bibliothek")
set_array("hasItem[].$last.type[]")
add_field("hasItem[].$last.type[].$append", "Item")
add_field("hasItem[].$last.type[].$append", "PhysicalObject") # Wie kann man andere Publikationstypen mappen?
# Only create holdings for Records with ME as Format. The other are the local records.
# Each ME Record is one holding. They need to be aggregated.
# Holdings are created not as arrays but as objects,
# so that they can be combined into in hasItem in a later stage of the MF Workflow.do


if any_equal("FMT","ME")
set_hash("holding")
paste("holding.id","~http://lobid.org/items/", "almaMmsId", "~:","~ITEMMMSIDMUSSERSETZTWERDEN","~#!",join_char:"")
copy_field("100.a","holding.callNumber")
set_array("holding.inCollection[]")
add_field("holding.inCollection[].$append.id", "http://lobid.org/organisations/DE-Sol1#!")
add_field("holding.inCollection[].$last.label", "Stadtarchiv Solingen, Bibliothek")
add_field("holding.heldBy.isil", "DE-Sol1")
add_field("holding.heldBy.id", "http://lobid.org/organisations/DE-Sol1#!")
add_field("holding.label", "Stadtarchiv Solingen, Bibliothek")
set_array("holding.type[]")
add_field("holding.type[].$append", "Item")
add_field("holding.type[].$append", "PhysicalObject") # Wie kann man andere Publikationstypen mappen?
end

retain("hasItem[]")
retain("almaMmsId", "holding")
7 changes: 5 additions & 2 deletions mab2De-Sol1Holdings_seq.flux
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ infile
| open-file
| as-lines
| decode-aseq
| merge-same-ids
| fix(FLUX_DIR + "mab2De-Sol1Holdings_seq.fix")
| merge-same-ids // combines the aseq statements in single records.
| fix(FLUX_DIR + "mab2De-Sol1Holdings_seq.fix") // creates holding information for ME records, currently metadata from ML records are not used.
| change-id(idliteral="almaMmsId")
| merge-same-ids // merge records that belong to the same MMS ID.
| fix(FLUX_DIR + "combineHoldingsIntoHasItems.fix") // combine holding information in one hasItem statement.
| encode-json(prettyPrinting="true")
| write(FLUX_DIR + outfile + ".json")
;
Loading

0 comments on commit 5759304

Please # to comment.