Skip to content

Commit

Permalink
Use fallback label for related lobid resources in fix instead of etti…
Browse files Browse the repository at this point in the history
…ketmaker #2106
  • Loading branch information
TobiasNx committed Jan 13, 2025
1 parent 063558f commit dd889c9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
13 changes: 13 additions & 0 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -567,3 +567,16 @@ do put_macro("manufacture")
end
end
end


# lobid resources label
do put_macro("lobidResourcesFallbackLabel")
do list(path:"$[field]","var":"$array")
unless exists("$array.label")
if any_contain("$array.id","lobid")
add_field("$array.label","lobid Ressource")
end
end
end
end

13 changes: 12 additions & 1 deletion src/main/resources/alma/fix/relatedRessourcesAndLinks.fix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ end
replace_all("supplement[].*.id","^\\(DE-605\\)(.*)$","http://lobid.org/resources/$1#!")
replace_all("supplement[].*.id","^\\(DE-600\\)(.*)$","http://lobid.org/resources/ZDB-$1#!")
replace_all("supplement[].*.label","<<|>>","")
call_macro("lobidResourcesFallbackLabel",field:"supplement[]")

# isPartOf
# it describes the relation between a published ressource and its superordinate series or collection.
Expand Down Expand Up @@ -201,10 +202,15 @@ replace_all("isPartOf[].*.hasSuperordinate[].*.id", "^\\(DE-605\\)(.*)$", "http:
replace_all("isPartOf[].*.hasSuperordinate[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")

replace_all("isPartOf[].*.numbering", "^[©]|\\s?[,.:;/=]?$", "")
do list(path:"isPartOf[]","var":"$i")
call_macro("lobidResourcesFallbackLabel",field:"$i.hasSuperordinate[]")
end

uniq("isPartOf[]")
replace_all("containedIn[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
replace_all("containedIn[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
replace_all("containedIn[].*.label","<<|>>","")
call_macro("lobidResourcesFallbackLabel",field:"containedIn[]")

uniq("containedIn[]")

Expand All @@ -231,6 +237,7 @@ end

replace_all("primaryForm[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
replace_all("primaryForm[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
call_macro("lobidResourcesFallbackLabel",field:"primaryForm[]")

# secondaryForm

Expand All @@ -250,6 +257,9 @@ do list(path: "77608", "var":"$i")
end
end

call_macro("lobidResourcesFallbackLabel",field:"secondaryForm[]")



# 856 - Electronic Location and Access (R) - Subfield: $u (R) $3 (NR)
# 1. Indicator: 4 = HTTP
Expand Down Expand Up @@ -406,6 +416,7 @@ end
replace_all("related[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
replace_all("related[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")
replace_all("related[].*.label","<<|>>","")
call_macro("lobidResourcesFallbackLabel",field:"related[]")

add_array("inCollection[]")

Expand Down Expand Up @@ -609,7 +620,7 @@ end

replace_all("predecessor[].*.id", "^\\(DE-605\\)(.*)$", "http://lobid.org/resources/$1#!")
replace_all("predecessor[].*.id", "^\\(DE-600\\)(.*)$", "http://lobid.org/resources/ZDB-$1#!")

call_macro("lobidResourcesFallbackLabel",field:"predecessor[]")

replace_all("predecessor[].*.label","Vorg. ---> ","")

Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/labels/labels.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
[
{
"uri": "http://lobid.org/resources",
"label": "lobid Ressource"
},
{
"uri": "http://lobid.org/organisations",
"label": "lobid Organisation"
Expand Down

0 comments on commit dd889c9

Please sign in to comment.