Skip to content

Commit

Permalink
Always add dissolution date to label
Browse files Browse the repository at this point in the history
See #518
  • Loading branch information
fsteeg committed Jan 13, 2020
1 parent 7d2060e commit 0c21488
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/controllers/nwbib/Classification.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public static JsonNode ids(String q, String t) {
}

/**
* @param uri The NWBib classificationURI
* @param uri The NWBib classification URI
* @param type The ES classification type (see {@link Classification.Type})
* @return The label for the given URI
*/
Expand Down Expand Up @@ -336,6 +336,11 @@ public static Pair<List<JsonNode>, Map<String, List<JsonNode>>> buildHierarchyWi
json.elements().forEachRemaining(item -> {
String id = item.get("item").get("value").textValue();
String label = item.get("itemLabel").get("value").textValue();
String dissolution = item.has("dissolutionDate")
? item.get("dissolutionDate").get("value").textValue().split("-")[0]
: "";
label = !dissolution.isEmpty()
? label + String.format(" (bis %s)", dissolution) : label;
String topLevelLabelPrefix = "Regierungsbezirk";
String nwbibNamespaceId = toNwbibNamespace(id);
String gnd =
Expand All @@ -348,11 +353,6 @@ public static Pair<List<JsonNode>, Map<String, List<JsonNode>>> buildHierarchyWi
} else if (item.has("partOf")) {
String broaderId =
WIKIDATA + item.get("partOf").get("value").textValue();
String dissolution = item.has("dissolutionDate")
? item.get("dissolutionDate").get("value").textValue().split("-")[0]
: "";
label = !dissolution.isEmpty()
? label + String.format(" (bis %s)", dissolution) : label;
if (id.equals(NRW)) {
topClasses.add(Json.toJson(ImmutableMap.of("value", nwbibNamespaceId,
"label", "Sonstige", "notation", notation)));
Expand Down

0 comments on commit 0c21488

Please sign in to comment.