Skip to content

Commit 6573c60

Browse files
committed
Incorporate PR suggestions
1 parent 1b4344b commit 6573c60

33 files changed

+170
-132
lines changed

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/constraint/OrConstraint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public List<Violation> apply( final RDFNode rdfNode, final EvaluationContext con
3030
final List<Violation> result = new ArrayList<>();
3131
for ( final Constraint constraint : constraints ) {
3232
final List<Violation> violations = constraint.apply( rdfNode, context );
33-
if ( violations.isEmpty() && result.isEmpty() ) {
33+
if ( violations.isEmpty() ) {
3434
return List.of();
3535
}
3636
result.addAll( violations );

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/ClassTypeViolation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public String errorCode() {
2525

2626
@Override
2727
public String message() {
28-
return String.format( "Property %s on %s has type %s, but only %s is allowed",
28+
return String.format( "Property %s on %s has type %s, but only %s is allowed.",
2929
propertyName(), elementName(), shortUri( actualClass().getURI() ), shortUri( allowedClass().getURI() ) );
3030
}
3131

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/ClosedViolation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public String message() {
3434
.map( Property::getURI )
3535
.map( this::shortUri )
3636
.collect( Collectors.toSet() );
37-
return String.format( "%s is used on %s. It is not allowed there; allowed are only %s",
37+
return String.format( "%s is used on %s. It is not allowed there; allowed are only %s.",
3838
shortUri( actual.getURI() ), elementName(), allowed );
3939
}
4040

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/DatatypeViolation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public String errorCode() {
3939
public String message() {
4040
if ( context.property().isPresent() ) {
4141
return allowedTypeUri.equals( RDF.langString.getURI() ) && actualTypeUri.equals( XSD.xstring.getURI() ) ?
42-
String.format( "Property %s on %s is missing a language tag",
42+
String.format( "Property %s on %s is missing a language tag.",
4343
propertyName(), elementName() ) :
44-
String.format( "Property %s on %s uses data type %s, but only %s is allowed",
44+
String.format( "Property %s on %s uses data type %s, but only %s is allowed.",
4545
propertyName(), elementName(), shortUri( actualTypeUri ), shortUri( allowedTypeUri ) );
4646
}
47-
return String.format( "%s uses data type %s, but only %s is allowed",
47+
return String.format( "%s uses data type %s, but only %s is allowed.",
4848
elementName(), shortUri( actualTypeUri ), shortUri( allowedTypeUri ) );
4949
}
5050

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/DisjointViolation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public String errorCode() {
2626

2727
@Override
2828
public String message() {
29-
return String.format( "Property %s on %s may not have the same value as property %s (%s)",
29+
return String.format( "Property %s on %s may not have the same value as property %s (%s).",
3030
propertyName(), elementName(), shortUri( otherProperty.getURI() ), otherValue );
3131
}
3232

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/EqualsViolation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public String errorCode() {
2626

2727
@Override
2828
public String message() {
29-
return String.format( "Property %s on %s must have the same value as property %s (%s), but has value %s",
29+
return String.format( "Property %s on %s must have the same value as property %s (%s), but has value %s.",
3030
propertyName(), elementName(), shortUri( otherProperty.getURI() ), allowedValue, actualValue );
3131
}
3232

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/InvalidValueViolation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public String errorCode() {
2525

2626
@Override
2727
public String message() {
28-
return String.format( "Property %s on %s has value %s, but only %s is allowed",
29-
propertyName(), elementName(), actual, allowed );
28+
return String.format( "Property %s on %s has value %s, but only %s is allowed.",
29+
propertyName(), elementName(), value( actual ), value( allowed ) );
3030
}
3131

3232
@Override

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/JsConstraintViolation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public String errorCode() {
4141
public String message() {
4242
if ( constraintMessage().isEmpty() ) {
4343
return context.property().isPresent() ?
44-
String.format( "Property %s on %s is invalid", propertyName(), elementName() ) :
45-
String.format( "%s is invalid", elementName() );
44+
String.format( "Property %s on %s is invalid.", propertyName(), elementName() ) :
45+
String.format( "%s is invalid.", elementName() );
4646
}
4747
String interpolatedMessage = bindings.getOrDefault( "message", constraintMessage() ).toString();
4848
for ( final Map.Entry<String, Object> entry : bindings.entrySet() ) {

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/LanguageFromListViolation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public String errorCode() {
2525

2626
@Override
2727
public String message() {
28-
return String.format( "Property %s on %s has language tag %s, which is not in the list of allowed languages: %s",
28+
return String.format( "Property %s on %s has language tag %s, which is not in the list of allowed languages: %s.",
2929
propertyName(), elementName(), actual, allowed );
3030
}
3131

core/sds-aspect-model-validator/src/main/java/io/openmanufacturing/sds/aspectmodel/shacl/violation/LessThanOrEqualsViolation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public String errorCode() {
2626

2727
@Override
2828
public String message() {
29-
return String.format( "Property %s on %s must have a value that is less than or equal to that of %s: %s must less than %s",
30-
propertyName(), elementName(), shortUri( otherProperty.getURI() ), actualValue, otherValue );
29+
return String.format( "Property %s on %s must have a value that is less than or equal to that of %s: %s must be less than %s.",
30+
propertyName(), elementName(), shortUri( otherProperty.getURI() ), value( actualValue ), value( otherValue ) );
3131
}
3232

3333
@Override

0 commit comments

Comments
 (0)