Skip to content

Commit

Permalink
Merge branch 'rpb-34' of https://github.com/hbz/rpb into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Oct 24, 2022
2 parents 89c590f + e30e901 commit 2dc92cc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/controllers/nwbib/Classification.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,14 @@ public static Pair<List<JsonNode>, Map<String, List<JsonNode>>> buildHierarchyCs
long hits = Lobid.getTotalHitsNwbibClassification(id);
if (broader == null && !isNullOrEmpty(lk)) {
String broaderNotation = notation.substring(0, 3);
if (isNullOrEmpty(vg)) {
// no wpNr, no vg -> lk is broader
topClasses.add(Json.toJson(ImmutableMap.of("value", RPB_SPATIAL + "n" + broaderNotation, "label", lk + ", Landkreis")));
if (!isNullOrEmpty(lk)) {
// no wpNr, lk is present -> lk is broader
topClasses.add(Json.toJson(ImmutableMap.of(
"value", RPB_SPATIAL + "n" + broaderNotation, "label", lk.toLowerCase().contains("kreis") ? lk : lk + ", Landkreis")));
broader = broaderNotation;
} else {
// no wpNr, both vg & lk present -> vg is broader
}
if(!isNullOrEmpty(vg)) {
// no wpNr, vg is present -> vg is broader
String thisNotation = notation.substring(0, 5);
String broaderId = RPB_SPATIAL + "n" + broaderNotation;
String thisId = RPB_SPATIAL + "n" + thisNotation;
Expand Down

0 comments on commit 2dc92cc

Please sign in to comment.