Skip to content

Commit

Permalink
Add manufacture as property #1806
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 21, 2023
1 parent 1d823fb commit c21ff26
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 39 deletions.
1 change: 1 addition & 0 deletions src/main/resources/alma/alma.fix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ retain(
"language[]",
"langNote[]",
"license[]",
"manufacture[]",
"medium[]",
"natureOfContent[]",
"note[]",
Expand Down
54 changes: 54 additions & 0 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,58 @@ do put_macro("publication")
end
end
end
end

do put_macro("manufacture")
do list(path:"$[field]", "var":"$i")
add_field("manufacture[].$append.test","")
do list(path: "$i.c", "var":"$j")
replace_all("$j", "\\[|\\]|ca. |c ", "")
unless exists("manufacture[].$last.startDate")
if any_match("$j",".*?([01]\\d{3}|20\\d{2}).*")
paste("manufacture[].$last.startDate", "$j")
end
end
unless exists("manufacture[].$last.endDate")
if any_match("$j",".*-[ ]?([01]\\d{3}|20\\d{2})$")
paste("manufacture[].$last.endDate", "$j")
end
end
end
set_array("manufacture[].$last.type[]","Event")
set_array("manufacture[].$last.location[]")
copy_field("$i.a", "manufacture[].$last.location[].$append")
set_array("manufacture[].$last.publishedBy[]")
copy_field("$i.b", "manufacture[].$last.publishedBy[].$append")
if exists("$i.6")
copy_field("$i.6","$i.linkageTest")
do list(path:"880??","var":"$880")
if in ("$i.linkageTest","$880.linkageTest")
if in ("$880.@script.id","alternateGraphicRepresentation[].*.script.id")
do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if in ("$880.@script.id","$AGR.script.id")
unless exists("$AGR.record.manufacture[]")
set_array("$AGR.record.manufacture[]")
end
add_field ("$AGR.record.manufacture[].$append.dummi","")
set_array("$AGR.record.manufacture[].$last.location[]")
copy_field("$880.a", "$AGR.record.manufacture[].$last.location[].$append")
set_array("$AGR.record.manufacture[].$last.publishedBy[]")
copy_field("$880.b", "$AGR.record.manufacture[].$last.publishedBy[].$append")
end
end
else
copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
set_array("alternateGraphicRepresentation[].$last.manufacture[]")
add_field ("alternateGraphicRepresentation[].$last.manufacture[].$append.dummi","")
set_array("alternateGraphicRepresentation[].$last.manufacture[].$last.location[]")
copy_field("$880.a", "alternateGraphicRepresentation[].$last.manufacture[].$last.location[].$append")
set_array("alternateGraphicRepresentation[].$last.manufacture[].$last.publishedBy[]")
copy_field("$880.b", "alternateGraphicRepresentation[].$last.manufacture[].$last.publishedBy[].$append")
end
end
end
end
end
end
7 changes: 7 additions & 0 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ else
call_macro("publication",field:"260 [ 1]") # # - Not applicable/No information provided/Earliest
end

set_array("manufacture[]")
if exists("264[ 23]3")
call_macro("manufacture",field:"26433") # 3 - Current/Latest
call_macro("manufacture",field:"26423") # 2 - Intervening
call_macro("manufacture",field:"264 3") # # - Not applicable/No information provided/Earliest
end

# Only add additional publication info to the first publication-object since it is the latest.

if exists("publication[].$first")
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/alma-fix/990183958380206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"oclcNumber" : [ "706989442" ],
"title" : "Rösenbeck",
"otherTitleInformation" : [ "Orts- und Landesgeschichte am Beispiel eines Bredelarer Klosterdorfes" ],
"manufacture" : [ {
"startDate" : "2010",
"type" : [ "Event" ],
"location" : [ "Marsberg" ],
"publishedBy" : [ "Boxberger" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990183958380206441",
"label" : "Webseite der hbz-Ressource 990183958380206441",
Expand Down
5 changes: 5 additions & 0 deletions src/test/resources/alma-fix/990185619180206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"location" : [ "s.l." ],
"publishedBy" : [ "EMI Records" ]
} ],
"manufacture" : [ {
"startDate" : "1994",
"type" : [ "Event" ],
"location" : [ "EMI Records Ltd, p 1969" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990185619180206441",
"label" : "Webseite der hbz-Ressource 990185619180206441",
Expand Down
78 changes: 39 additions & 39 deletions web/conf/context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"focus" : {
"@id" : "http://xmlns.com/foaf/0.1/focus"
},
"SecondaryPublicationEvent" : {
"@id" : "http://purl.org/lobid/lv#SecondaryPublicationEvent"
},
"altLabel" : {
"@id" : "http://www.w3.org/2004/02/skos/core#altLabel"
},
"SecondaryPublicationEvent" : {
"@id" : "http://purl.org/lobid/lv#SecondaryPublicationEvent"
"Image" : {
"@id" : "http://purl.org/ontology/bibo/Image"
},
"type" : {
"@id" : "@type",
"@container" : "@set"
},
"Image" : {
"@id" : "http://purl.org/ontology/bibo/Image"
},
"ReferenceSource" : {
"@id" : "http://purl.org/ontology/bibo/ReferenceSource"
},
Expand All @@ -35,15 +35,15 @@
"@id" : "http://id.loc.gov/ontologies/bibframe/contribution",
"@container" : "@list"
},
"notation" : {
"@id" : "http://www.w3.org/2004/02/skos/core#notation"
},
"Book" : {
"@id" : "http://purl.org/ontology/bibo/Book"
},
"Combination" : {
"@id" : "http://iflastandards.info/ns/isbd/terms/mediatype/T1008"
},
"notation" : {
"@id" : "http://www.w3.org/2004/02/skos/core#notation"
},
"Work" : {
"@id" : "https://d-nb.info/standards/elementset/gnd#Work"
},
Expand Down Expand Up @@ -100,15 +100,15 @@
"bibliographicCitation" : {
"@id" : "http://purl.org/dc/terms/bibliographicCitation"
},
"dateOfBirthAndDeath" : {
"@id" : "https://d-nb.info/standards/elementset/gnd#dateOfBirthAndDeath"
},
"Map" : {
"@id" : "http://purl.org/ontology/bibo/Map"
},
"Person" : {
"@id" : "https://d-nb.info/standards/elementset/gnd#Person"
},
"dateOfBirthAndDeath" : {
"@id" : "https://d-nb.info/standards/elementset/gnd#dateOfBirthAndDeath"
},
"startDate" : {
"@id" : "http://schema.org/startDate"
},
Expand Down Expand Up @@ -146,13 +146,13 @@
"@id" : "http://id.loc.gov/ontologies/bibframe/hasItem",
"@container" : "@set"
},
"Festschrift" : {
"@id" : "http://purl.org/lobid/lv#Festschrift"
},
"alternativeTitle" : {
"@id" : "http://purl.org/dc/terms/alternative",
"@container" : "@set"
},
"Festschrift" : {
"@id" : "http://purl.org/lobid/lv#Festschrift"
},
"lon" : {
"@id" : "http://schema.org/longitude"
},
Expand Down Expand Up @@ -182,19 +182,19 @@
"modifiedBy" : {
"@id" : "http://open-services.net/ns/core#modifiedBy"
},
"PublishedScore" : {
"@id" : "http://purl.org/ontology/mo/PublishedScore"
},
"gndIdentifier" : {
"@id" : "https://d-nb.info/standards/elementset/gnd#gndIdentifier"
},
"PublishedScore" : {
"@id" : "http://purl.org/ontology/mo/PublishedScore"
"PublicationIssue" : {
"@id" : "http://schema.org/PublicationIssue"
},
"oclcNumber" : {
"@id" : "http://purl.org/ontology/bibo/oclcnum",
"@container" : "@set"
},
"PublicationIssue" : {
"@id" : "http://schema.org/PublicationIssue"
},
"corporateBodyForTitle" : {
"@id" : "http://rdaregistry.info/Elements/u/P60327",
"@container" : "@set"
Expand Down Expand Up @@ -336,25 +336,25 @@
"workNumbering" : {
"@id" : "http://rdaregistry.info/Elements/w/P10079"
},
"exampleOfWork" : {
"@id" : "http://purl.org/lobid/lv#exampleOfWork"
},
"Thesis" : {
"@id" : "http://purl.org/ontology/bibo/Thesis"
},
"exampleOfWork" : {
"@id" : "http://purl.org/lobid/lv#exampleOfWork"
},
"ArchivedWebPage" : {
"@id" : "http://purl.org/lobid/lv#ArchivedWebPage"
},
"BibliographicResource" : {
"@id" : "http://purl.org/dc/terms/BibliographicResource"
},
"license" : {
"@id" : "http://schema.org/license",
"@container" : "@set"
},
"deprecatedUri" : {
"@id" : "https://d-nb.info/standards/elementset/dnb#deprecatedUri"
},
"BibliographicResource" : {
"@id" : "http://purl.org/dc/terms/BibliographicResource"
},
"bibliographicLevel" : {
"@id" : "http://purl.org/lobid/lv#bibliographicLevel"
},
Expand All @@ -374,16 +374,16 @@
"SubjectHeading" : {
"@id" : "https://d-nb.info/standards/elementset/gnd#SubjectHeading"
},
"Sonstige" : {
"@id" : "http://purl.org/lobid/lv#Miscellaneous"
},
"note" : {
"@id" : "http://id.loc.gov/ontologies/bibframe/note",
"@container" : "@set"
},
"langNote" : {
"@id" : "http://purl.org/lobid/lv#langNote"
},
"Sonstige" : {
"@id" : "http://purl.org/lobid/lv#Miscellaneous"
},
"SoftwareApplication" : {
"@id" : "http://schema.org/SoftwareApplication"
},
Expand All @@ -399,6 +399,9 @@
"@id" : "http://www.w3.org/2001/XMLSchema#",
"@container" : "@set"
},
"DataFeedItem" : {
"@id" : "http://schema.org/DataFeedItem"
},
"description" : {
"@id" : "http://purl.org/dc/terms/description",
"@container" : "@set"
Expand All @@ -407,15 +410,12 @@
"@id" : "http://purl.org/ontology/bibo/edition",
"@container" : "@set"
},
"DataFeedItem" : {
"@id" : "http://schema.org/DataFeedItem"
"Standard" : {
"@id" : "http://purl.org/ontology/bibo/Standard"
},
"instrument" : {
"@id" : "http://schema.org/instrument"
},
"Standard" : {
"@id" : "http://purl.org/ontology/bibo/Standard"
},
"medium" : {
"@id" : "http://purl.org/dc/terms/medium",
"@container" : "@set"
Expand Down Expand Up @@ -482,26 +482,26 @@
"currentLocation" : {
"@id" : "http://purl.org/lobid/lv#currentLocation"
},
"Series" : {
"@id" : "http://purl.org/ontology/bibo/Series"
},
"hasSuperordinate" : {
"@id" : "http://purl.org/lobid/lv#hasSuperordinate",
"@container" : "@set"
},
"Series" : {
"@id" : "http://purl.org/ontology/bibo/Series"
},
"subjectAltLabel" : {
"@id" : "http://purl.org/lobid/lv#subjectAltLabel",
"@container" : "@set"
},
"itemOf" : {
"@id" : "http://id.loc.gov/ontologies/bibframe/itemOf"
},
"sourceOrganization" : {
"@id" : "http://schema.org/sourceOrganization"
},
"PublicationEvent" : {
"@id" : "http://schema.org/PublicationEvent"
},
"sourceOrganization" : {
"@id" : "http://schema.org/sourceOrganization"
},
"location" : {
"@id" : "http://schema.org/location"
},
Expand Down

0 comments on commit c21ff26

Please sign in to comment.