|
43 | 43 | import io.openmanufacturing.sds.aspectmetamodel.KnownVersion;
|
44 | 44 | import io.openmanufacturing.sds.aspectmodel.UnsupportedVersionException;
|
45 | 45 | import io.openmanufacturing.sds.aspectmodel.resolver.ModelResolutionException;
|
| 46 | +import io.openmanufacturing.sds.aspectmodel.resolver.exceptions.InvalidRootElementCountException; |
46 | 47 | import io.openmanufacturing.sds.aspectmodel.resolver.exceptions.InvalidVersionException;
|
47 | 48 | import io.openmanufacturing.sds.aspectmodel.resolver.services.SdsAspectMetaModelResourceResolver;
|
48 | 49 | import io.openmanufacturing.sds.aspectmodel.resolver.services.VersionedModel;
|
@@ -130,14 +131,14 @@ public ValidationReport validate( final Try<VersionedModel> versionedModel ) {
|
130 | 131 | if ( report.getProperty( SH.conforms ).getObject().asLiteral().getBoolean() ) {
|
131 | 132 | // The SHACL validation succeeded. But to catch false positives, also try to load the model
|
132 | 133 | final Try<Aspect> aspects = AspectModelLoader.fromVersionedModel( model );
|
133 |
| - if ( aspects.isFailure() ) { |
| 134 | + if ( aspects.isFailure() && !(aspects.getCause() instanceof InvalidRootElementCountException) ) { |
134 | 135 | return new ValidationReportBuilder()
|
135 | 136 | .withValidationErrors( List.of( new ValidationError.Processing(
|
136 |
| - "Validation succeeded, but an error was found while processing the model. " |
137 |
| - + "This indicates an error in the model validation; please consider reporting this issue including the model " |
138 |
| - + "at https://github.com/OpenManufacturingPlatform/sds-bamm-aspect-meta-model/issues -- " |
139 |
| - + buildCauseMessage( aspects.getCause() ) ) ) ) |
140 |
| - .buildInvalidReport(); |
| 137 | + "Validation succeeded, but an error was found while processing the model. " |
| 138 | + + "This indicates an error in the model validation; please consider reporting this issue including the model " |
| 139 | + + "at https://github.com/OpenManufacturingPlatform/sds-bamm-aspect-meta-model/issues -- " |
| 140 | + + buildCauseMessage( aspects.getCause() ) ) ) ) |
| 141 | + .buildInvalidReport(); |
141 | 142 | }
|
142 | 143 | return new ValidationReportBuilder().buildValidReport();
|
143 | 144 | }
|
|
0 commit comments