From 4a47bd17eead67ff79d983d2f4ede1a25c220cd8 Mon Sep 17 00:00:00 2001 From: felix Date: Tue, 10 Sep 2024 15:21:19 +0200 Subject: [PATCH] Update the way `sh:targetClass` of box.getLabel() is rendered. The orginal comment stated `use the sh:targetClass if present, otherwise use the URI of the NodeShape` This commit changes the behaviour of the method that it matches the comment. Or at least the way I could interpret it. We could also consider adding this feature as a CLI option. --- .../main/java/fr/sparna/rdf/shacl/diagram/PlantUmlBox.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shacl-diagram/src/main/java/fr/sparna/rdf/shacl/diagram/PlantUmlBox.java b/shacl-diagram/src/main/java/fr/sparna/rdf/shacl/diagram/PlantUmlBox.java index 64790630..c978c003 100644 --- a/shacl-diagram/src/main/java/fr/sparna/rdf/shacl/diagram/PlantUmlBox.java +++ b/shacl-diagram/src/main/java/fr/sparna/rdf/shacl/diagram/PlantUmlBox.java @@ -92,7 +92,9 @@ public int countShNodeOrShClassReferencesTo(String id, PlantUmlDiagram diagram) public String getLabel() { // use the sh:targetClass if present, otherwise use the URI of the NodeShape - return ModelRenderingUtils.render(this.nodeShape, true)+this.getTargetClass().map(targetClass -> " ("+ModelRenderingUtils.render(targetClass, true)+")").orElse(""); + return this.getTargetClass() + .map(targetClass -> ModelRenderingUtils.render(targetClass, true)) + .orElse(ModelRenderingUtils.render(this.nodeShape, true)); } public String getPlantUmlQuotedBoxName() {