Skip to content

Commit

Permalink
Merge #2120 from remote-tracking branch 'origin/updateMfVersion6.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Jan 10, 2025
2 parents c42d052 + 3dfc0e9 commit f3a5c35
Show file tree
Hide file tree
Showing 15 changed files with 234 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cd ..
git clone https://github.com/metafacture/metafacture-fix.git
cd metafacture-fix
git checkout 1.1.2
git checkout 1.2.0
./gradlew publishToMavenLocal
cd -
- name: Build with Maven
Expand Down
34 changes: 17 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-io</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-files</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-json</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand All @@ -40,72 +40,72 @@
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-biblio</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-formeta</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-monitoring</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-strings</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-formatting</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-elasticsearch</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-csv</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-flowcontrol</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metamorph</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-plumbing</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metamorph-test</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-xml</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafacture-mangling</artifactId>
<version>6.1.2</version>
<version>6.2.0</version>
</dependency>
<dependency>
<groupId>org.metafacture</groupId>
<artifactId>metafix</artifactId>
<version>1.1.2</version>
<version>1.2.0</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/alma/alma.fix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ add_field("@context","http://lobid.org/resources/context.jsonld")

# Set empty elements to manipulate the order winthin the record.
add_field("id","")
set_array("type[]")
set_array("medium[]")
add_array("type[]")
add_array("medium[]")
add_field("title","")

do list(path:"880??","var":"$i")
Expand All @@ -38,7 +38,7 @@ do list(path:"880??","var":"$i")
replace_all("[email protected]","(\\d{3}-\\d{2})/(.*)","$2")
lookup("[email protected]","ISO15924-to-script")
end
set_array("alternateGraphicRepresentation[]")
add_array("alternateGraphicRepresentation[]")

include ("./fix/identifiers.fix")
include ("./fix/titleRelatedFields.fix")
Expand Down
30 changes: 15 additions & 15 deletions src/main/resources/alma/fix/contribution.fix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# 245 - Title Statement (NR) - Subfield: $c (NR)
set_array("responsibilityStatement[]")
add_array("responsibilityStatement[]")
copy_field("245??.c", "responsibilityStatement[].$append")

set_array("contribution[]")
add_array("contribution[]")

# 100 and 700

Expand Down Expand Up @@ -31,7 +31,7 @@ do list(path:"100[01] ", "var":"$i")
end
end
do list(path: "$i.4", "var":"$j")
set_hash("contribution[].$append.agent")
add_hash("contribution[].$append.agent")
do list(path:"$i.0","var":"$k")
if all_match("$k", "^\\(DE-588\\).*$")
# GND identifier
Expand All @@ -58,7 +58,7 @@ do list(path:"100[01] ", "var":"$i")
call_macro("gndPersonCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel","contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","Person")
add_array("contribution[].$last.agent.type[]","Person")
# role
copy_field("$j","contribution[].$last.role.id")
# dateOfBirthAndDeath #will be split on a later stage
Expand All @@ -83,7 +83,7 @@ do list(path:"700[01] ", "var":"$i")
add_field("$i.4","ctb")
end
do list(path: "$i.4", "var":"$j")
set_hash("contribution[].$append.agent")
add_hash("contribution[].$append.agent")
do list(path:"$i.0","var":"$k")
if all_match("$k", "^\\(DE-588\\).*$")
# GND identifier
Expand All @@ -110,7 +110,7 @@ do list(path:"700[01] ", "var":"$i")
call_macro("gndPersonCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel","contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","Person")
add_array("contribution[].$last.agent.type[]","Person")
# role
copy_field("$j","contribution[].$last.role.id")
# dateOfBirthAndDeath #will be split on a later stage
Expand Down Expand Up @@ -145,7 +145,7 @@ do list(path:"110[012] ", "var":"$i")
end
end
do list(path: "$i.4", "var":"$j")
set_hash("contribution[].$append.agent")
add_hash("contribution[].$append.agent")
do list(path:"$i.0","var":"$k")
if all_match("$k", "^\\(DE-588\\).*$")
# GND identifier
Expand All @@ -172,7 +172,7 @@ do list(path:"110[012] ", "var":"$i")
call_macro("gndOtherCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel", "contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","CorporateBody")
add_array("contribution[].$last.agent.type[]","CorporateBody")
# role
copy_field("$j","contribution[].$last.role.id")
call_macro("alternateGraphicRepresationArrayOfObjects",targetArray:"contribution[]",targetField:".agent",variable:"$i")
Expand All @@ -194,7 +194,7 @@ do list(path:"710[012] ", "var":"$i")
add_field("$i.4","ctb")
end
do list(path: "$i.4", "var":"$j")
set_hash("contribution[].$append.agent")
add_hash("contribution[].$append.agent")
do list(path:"$i.0","var":"$k")
if all_match("$k", "^\\(DE-588\\).*$")
# GND identifier
Expand All @@ -221,7 +221,7 @@ do list(path:"710[012] ", "var":"$i")
call_macro("gndOtherCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel", "contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","CorporateBody")
add_array("contribution[].$last.agent.type[]","CorporateBody")
# role
copy_field("$j","contribution[].$last.role.id")
call_macro("alternateGraphicRepresationArrayOfObjects",targetArray:"contribution[]",targetField:".agent",variable:"$i")
Expand All @@ -242,7 +242,7 @@ do list(path:"111[012] |711[012] ", "var":"$i")
add_field("$i.4","oth")
end
do list(path: "$i.4", "var":"$j")
set_hash("contribution[].$append.agent")
add_hash("contribution[].$append.agent")
do list(path:"$i.0","var":"$k")
if all_match("$k", "^\\(DE-588\\).*$")
# GND identifier
Expand All @@ -269,7 +269,7 @@ do list(path:"111[012] |711[012] ", "var":"$i")
call_macro("gndEventCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel", "contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","ConferenceOrEvent")
add_array("contribution[].$last.agent.type[]","ConferenceOrEvent")
# role
copy_field("$j","contribution[].$last.role.id")
call_macro("alternateGraphicRepresationArrayOfObjects",targetArray:"contribution[]",targetField:".agent",variable:"$i")
Expand All @@ -278,7 +278,7 @@ do list(path:"111[012] |711[012] ", "var":"$i")
end


set_array("contribution[].*.type[]", "Contribution")
add_array("contribution[].*.type[]", "Contribution")
replace_all("contribution[].*.agent.id","^\\(DE-588\\)(.*$)","https://d-nb.info/gnd/$1")
replace_all("contribution[].*.agent.gndIdentifier","^\\(DE-588\\)(.*$)","$1")
replace_all("contribution[].*.agent.label","(?<!\\p{Upper})\\.$|[,]$","")
Expand Down Expand Up @@ -340,7 +340,7 @@ do list (path: "contribution[]", "var": "$i")
end

# compare GND identifier (idn) with ALMA GND enrichment elements:
set_array("$i.agent.altLabel[]")
add_array("$i.agent.altLabel[]")
do list(path:"GPN??", "var": "$z")
if in ("$i.agent.@gndIdn", "$z.B") # Person labels have no character between $a (Name) and $b (Number).
call_macro("gndPersonCombinedLabel",field:"$z")
Expand All @@ -365,7 +365,7 @@ do list (path: "contribution[]", "var": "$i")
end

# orcid
set_array("$i.agent.sameAs[]")
add_array("$i.agent.sameAs[]")
do list(path:"GSI??", "var": "$z")
if in ("$i.agent.@gndIdn", "$z.B")
if any_equal("$z.2","orcid")
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/alma/fix/describedBy.fix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ prepend("describedBy.id", "http://lobid.org/resources/")
copy_field("almaMmsId", "describedBy.label")
prepend("describedBy.label", "Webseite der hbz-Ressource ")

set_array("describedBy.type[]", "BibliographicDescription")
add_array("describedBy.type[]", "BibliographicDescription")


add_field("describedBy.inDataset.id","http://lobid.org/resources/dataset#!")

add_field("describedBy.inDataset.label","lobid-resources – Der hbz-Verbundkatalog als Linked Open Data")

set_array("describedBy.resultOf.type[]", "CreateAction")
add_array("describedBy.resultOf.type[]", "CreateAction")

add_field("@createTime","$[createEndTime]")
if all_match("@createTime","0")
Expand All @@ -24,7 +24,7 @@ end

add_field("describedBy.resultOf.instrument.id","https://github.com/hbz/lobid-resources")

set_array("describedBy.resultOf.instrument.type[]", "SoftwareApplication")
add_array("describedBy.resultOf.instrument.type[]", "SoftwareApplication")

add_field("describedBy.resultOf.instrument.label","Software lobid-resources")

Expand Down Expand Up @@ -67,7 +67,7 @@ replace_all("describedBy.resultOf.object.dateModified","^(\\d{4})(\\d{2})(\\d{2}
replace_all("describedBy.resultOf.object.dateCreated","^(\\d{4})$","$1-01-01")
replace_all("describedBy.resultOf.object.dateModified","^(\\d{4})$","$1-01-01")

set_array("describedBy.resultOf.object.type[]", "DataFeedItem")
add_array("describedBy.resultOf.object.type[]", "DataFeedItem")

copy_field("almaMmsId","describedBy.resultOf.object.label")
prepend("describedBy.resultOf.object.label","hbz-Ressource ")
Expand All @@ -77,7 +77,7 @@ add_field("describedBy.resultOf.object.inDataset.id", "https://datahub.io/datase

add_field("describedBy.resultOf.object.inDataset.label", "hbz_unioncatalog")

set_array("describedBy.license[]")
add_array("describedBy.license[]")
add_field("describedBy.license[].$append.id","http://creativecommons.org/publicdomain/zero/1.0" )
add_field("describedBy.license[].$last.label","Creative Commons-Lizenz CC0 1.0 Universal" )

Expand All @@ -100,7 +100,7 @@ do list(path: "040 ", "var":"$i")
end
end

set_array("describedBy.resultOf.object.modifiedBy[]")
add_array("describedBy.resultOf.object.modifiedBy[]")
do list(path:"$i.d", "var":"$j")
copy_field("$j", "describedBy.resultOf.object.modifiedBy[].$append.id")
end
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/alma/fix/identifiers.fix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ paste("id", "~http://lobid.org/resources/", "001", "~#!", join_char: "")
# 024 - Other Standard Identifier (R) Subfield: $a (NR) $2 (NR)
# urn

set_array("urn[]")
add_array("urn[]")

do list(path: "0247?", "var": "$i")
if any_equal("$i.2","urn")
Expand All @@ -17,7 +17,7 @@ end
# Sometimes urn are not set in 024 then we could pick up the missing from 856.
# 856 - Electronic Location and Access (R) - Subfield: $u (R) $3 (NR)
# 1. Indicator: 4 = HTTP
set_array("@urnLinks")
add_array("@urnLinks")

do list(path:"856??", "var":"$i")
if all_match("$i.u", "^http.*(urn=|\\.(org|de)/)urn:.+$") # This should ignore repository links like: https://sammlungen.ulb.uni-muenster.de/urn/urn:nbn:de:hbz:6-85659520092
Expand Down Expand Up @@ -50,8 +50,8 @@ end
# 020 - International Standard Book Number (R) - $a (NR)
# source data sometimes provides repeated subfield $a even if this is not valid marc

set_array("@isbn[]")
set_array("isbn[]")
add_array("@isbn[]")
add_array("isbn[]")

do list(path:"020 ", "var": "$i")
do list(path:"$i.a", "var": "$j")
Expand All @@ -74,23 +74,23 @@ uniq("isbn[]")


# 022 - International Standard Serial Number (R) - Subfield $a (NR)
set_array("issn[]")
add_array("issn[]")
do list(path:"022? ", "var":"$i")
copy_field("$i.a", "issn[].$append")
end
replace_all("issn[].*", "-","")
uniq("issn[]")

# 024 - Other Standard Identifier (R) - Subfield a (NR) 1. Indicator 2 = ISMN
set_array("ismn[]")
add_array("ismn[]")
do list(path:"0242?", "var":"$i")
copy_field("$i.a", "ismn[].$append")
end
replace_all("ismn[].*", "-","")


# 024 (R) Subfield a (NR) 1. Indicator 7 = to defined Identifier
set_array("doi[]")
add_array("doi[]")
do list(path:"0247?", "var":"$i")
if all_equal("$i.2","doi")
copy_field("$i.a", "doi[].$append")
Expand All @@ -109,7 +109,7 @@ replace_all("doi[].*", ".*doi.org.*(10\\.(\\d)+/(\\S)+).*", "$1")
uniq("doi[]")

# 035 - System Control Number (R) - Subfield: $a (NR)
set_array("oclcNumber[]")
add_array("oclcNumber[]")

do list(path:"035 ", "var":"$i")
if all_match("$i.a", "\\(OCoLC\\)(.*)")
Expand Down Expand Up @@ -151,7 +151,7 @@ copy_field("almaMmsId","rpbId")
lookup("rpbId","almaMmsId2rpbId",delete:"true")
replace_all("rpbId", "^RPB","")

set_array("stockNumber[]")
add_array("stockNumber[]")
do list(path:"028??", "var":"$i")
copy_field("$i.a", "stockNumber[].$append")
end
Expand Down
Loading

0 comments on commit f3a5c35

Please sign in to comment.