diff --git a/doc/examples/constraint-validation/constraint-validation.md b/doc/examples/constraint-validation/constraint-validation.md index a5506de5..3df9ef36 100644 --- a/doc/examples/constraint-validation/constraint-validation.md +++ b/doc/examples/constraint-validation/constraint-validation.md @@ -221,10 +221,10 @@ Validation of constraint failed for the constraint: More than one person matches . } Evidences: -| person | firstName | lastName | -+-------------------------------------------------------------------------------------------+-----------+----------+ -| http://onto.fel.cvut.cz/ontologies/s-pipes/examples/constraint-validation/people/person-2 | Peter | Hnizdo | -| http://onto.fel.cvut.cz/ontologies/s-pipes/examples/constraint-validation/people/person-1 | Pavel | Hnizdo | +| person | firstName | lastName | ++---------------------------------------------------------------------------------------------+-----------+----------+ +| | "Peter" | "Hnizdo" | +| | "Pavel" | "Hnizdo" | ``` If `execution.exitOnError` is set to `true` in `config-core.properties` , the pipeline will not proceed with execution, and an error validation response in JSON-LD will be retrieved: diff --git a/s-pipes-core/src/main/java/cz/cvut/spipes/exception/ValidationConstraintFailedException.java b/s-pipes-core/src/main/java/cz/cvut/spipes/exception/ValidationConstraintFailedException.java index 1f4b1dcd..f5f02947 100644 --- a/s-pipes-core/src/main/java/cz/cvut/spipes/exception/ValidationConstraintFailedException.java +++ b/s-pipes-core/src/main/java/cz/cvut/spipes/exception/ValidationConstraintFailedException.java @@ -1,6 +1,7 @@ package cz.cvut.spipes.exception; import cz.cvut.spipes.modules.Module; +import cz.cvut.spipes.util.RDFNodeUtils; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; import org.jetbrains.annotations.NonNls; @@ -80,7 +81,7 @@ private Map determineColumnWidths() { for (Map row : evidences) { for (Map.Entry entry : row.entrySet()) { int currentWidth = columnWidths.get(entry.getKey()); - int dataWidth = entry.getValue().toString().length(); + int dataWidth = RDFNodeUtils.toString(entry.getValue()).length(); columnWidths.put(entry.getKey(), Math.max(currentWidth, dataWidth)); } } @@ -107,7 +108,7 @@ private void buildRows(StringBuilder tableBuilder, String format) { for (Map row : evidences) { List values = new ArrayList<>(); for (String key : row.keySet()) { - values.add(row.get(key).toString()); + values.add(RDFNodeUtils.toString(row.get(key))); } tableBuilder.append(String.format(format, values.toArray())); }