Skip to content

Commit

Permalink
Fix publication #1374
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Aug 15, 2022
1 parent 9b0ea05 commit 38800bc
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,18 @@ set_array("publication[]")
do list(path:"260[ 23] |264[ 23][ 1]", "var":"$i")
add_field("publication[].$append.test","")
paste("publication[].$last.publicationHistory", "$i.c")
replace_all("$i.c", "\\[|\\]|ca. |c ", "")
if any_match("$i.c",".*?(\\d{4}).*")
paste("publication[].$last.startDate", "$i.c")
end
if any_match("$i.c",".*-(\\d{4})$")
paste("publication[].$last.endDate", "$i.c")
do list(path: "$i.c", "var":"$j")
replace_all("$j", "\\[|\\]|ca. |c ", "")
unless exists("publication[].$last.startDate")
if any_match("$j",".*?(\\d{4}).*")
paste("publication[].$last.startDate", "$j")
end
end
unless exists("publication[].$last.endDate")
if any_match("$j",".*-(\\d{4})$")
paste("publication[].$last.endDate", "$j")
end
end
end
# TODO is there a way to distinguish PublicationEvent and SecondaryPublicationEvent?
set_array("publication[].$last.type[]","PublicationEvent")
Expand Down
93 changes: 93 additions & 0 deletions src/test/resources/alma-fix/(DE-605)HT012721542.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"almaMmsId" : "990108740950206441",
"@context" : "http://lobid.org/resources/context.jsonld",
"title" : "Tauben- und Hühnerzeitung",
"otherTitleInformation" : [ "Organ der gesammten Haus-Federviehzucht, mit Inbegriff der Sangvögel" ],
"publication" : [ {
"publicationHistory" : "1861-1862",
"startDate" : "1861",
"endDate" : "1862",
"type" : [ "PublicationEvent" ],
"location" : [ "Berlin" ],
"publishedBy" : [ "Schotte" ]
}, {
"publicationHistory" : "anfangs",
"type" : [ "PublicationEvent" ],
"location" : [ "Berlin", "Berlin" ],
"publishedBy" : [ "Janke", "Voss" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990108740950206441",
"label" : "Webseite der hbz-Ressource 990108740950206441",
"type" : [ "BibliographicDescription" ],
"dateCreated" : "20210405",
"dateModified" : "20210408",
"inDataset" : {
"id" : "http://lobid.org/resources/dataset#!",
"label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data"
},
"resultOf" : {
"type" : [ "CreateAction" ],
"endTime" : "0000-00-00T00:00:00",
"instrument" : {
"id" : "https://github.com/hbz/lobid-resources",
"type" : [ "SoftwareApplication" ],
"label" : "Software lobid-resources"
},
"object" : {
"id" : "https://lobid.org/hbz01/990108740950206441",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990108740950206441 im Exportformat MARC21 XML",
"inDataset" : {
"id" : "https://datahub.io/dataset/hbz_unioncatalog",
"label" : "hbz_unioncatalog"
}
}
},
"license" : [ {
"id" : "http://creativecommons.org/publicdomain/zero/1.0",
"label" : "Creative Commons-Lizenz CC0 1.0 Universal"
} ],
"sourceOrganization" : {
"id" : "http://lobid.org/organisations/DE-9001#!",
"label" : "lobid Organisation"
},
"provider" : {
"id" : "http://lobid.org/organisations/DE-DNB#!",
"label" : "lobid Organisation"
}
},
"hbzId" : "HT012721542",
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/ger",
"label" : "Deutsch"
} ],
"zdbId" : "1484300-6",
"sameAs" : [ {
"id" : "http://hub.culturegraph.org/resource/HBZ-HT012721542",
"label" : "Culturegraph Ressource"
}, {
"id" : "http://ld.zdb-services.de/resource/1484300-6",
"label" : "ZDB-Ressource"
} ],
"inCollection" : [ {
"id" : "http://lobid.org/resources/HT014846970#!",
"label" : "Zeitschriftendatenbank (ZDB)",
"type" : [ "Collection" ]
} ],
"hasItem" : [ {
"id" : "https://lobid.org/item/990108740950206441",
"type" : [ "Item", "MBD" ],
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-605#!",
"label" : "lobid Organisation"
},
"label" : "990108740950206441"
} ],
"medium" : [ {
"label" : "Print",
"id" : "http://rdaregistry.info/termList/RDAproductionMethod/1010"
} ],
"type" : [ "BibliographicResource", "Newspaper" ],
"id" : "http://lobid.org/resources/990108740950206441#!"
}

0 comments on commit 38800bc

Please sign in to comment.