eclipse-esmf / esmf-sdk

Load Aspect Models and their artifacts as Java code; share components to realize SAMM as code
https://eclipse-esmf.github.io/esmf-developer-guide/index.html
Mozilla Public License 2.0
25 stars 12 forks source link

[BUG] SAMM-CLI v2.3.1 (also v2.2.2, v2.2.2) BAMM 2.0.0 models referencing other BAMM 2.0.0 models are not properly resolved #410

Closed bs-jokri closed 1 year ago

bs-jokri commented 1 year ago

Describe the bug Exception thrown for

java -jar ~/Downloads/samm-cli-2.3.1.jar  aspect io.catenax.refurbishing_certificate/1.0.0/RefurbishingCertificate.ttl validate

when a BAMM 2.0.0 model references another BAMM 2.0.0 model.

stack trace

org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException: Could not resolve [urn:bamm:io.openmanufacturing:meta-model:2.0.0#Aspect, urn:bamm:io.openmanufacturing:meta-model:2.0.0#properties, urn:bamm:io.openmanufacturing:meta-model:2.0.0#events, urn:bamm:io.openmanufacturing:meta-model:2.0.0#preferredName, urn:bamm:io.openmanufacturing:meta-model:2.0.0#description, urn:bamm:io.openmanufacturing:meta-model:2.0.0#operations, urn:bamm:io.openmanufacturing:meta-model:2.0.0#characteristic, urn:bamm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic, urn:bamm:io.openmanufacturing:meta-model:2.0.0#Property]
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:176)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:146)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$resolveAspectModel$1(AspectModelResolver.java:126)
    at io.vavr.control.Try.flatMapTry(Try.java:490)
    at io.vavr.control.Try.flatMap(Try.java:472)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:126)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModel$8(AspectModelResolver.java:363)
    at io.vavr.control.Try.flatMapTry(Try.java:490)
    at io.vavr.control.Try.flatMap(Try.java:472)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadAndResolveModel(AspectModelResolver.java:361)
    at org.eclipse.esmf.AbstractCommand.loadAndResolveModel(AbstractCommand.java:53)
    at org.eclipse.esmf.aspect.AspectValidateCommand.run(AspectValidateCommand.java:60)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at org.eclipse.esmf.LoggingMixin.executionStrategy(LoggingMixin.java:41)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at org.eclipse.esmf.SammCli.main(SammCli.java:106)
Caused by: java.io.FileNotFoundException: No model file containing urn:samm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic could be found in directory: /Users/johannes/Documents/GitHub/sldt-semantic-models/io.catenax.shared.recycling_strategy_certificate/1.0.0
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy.apply(FileSystemStrategy.java:93)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy.apply(FileSystemStrategy.java:33)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.getModelForUrn(AspectModelResolver.java:311)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolve(AspectModelResolver.java:243)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:171)
    ... 21 more

Where Model resolution in SAMM SDK (as error indicates) it tries to find a urn:samm but should be urn:bam

urn:samm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic could be found in directory: /Users/johannes/Documents/GitHub/sldt-semantic-models/io.catenax.shared.recycling_strategy_certificate/1.0.0

Can be reproduced with model https://github.com/eclipse-tractusx/sldt-semantic-models/blob/main/io.catenax.refurbishing_certificate/1.0.0/RefurbishingCertificate.ttl

(repo https://github.com/eclipse-tractusx/sldt-semantic-models.git) needs to be checked out to allow to find the referenced model.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

bs-jokri commented 1 year ago

other models with similar problem in https://github.com/eclipse-tractusx/sldt-semantic-models/tree/main

generate json into .//io.catenax.remanufacturing_certificate/1.0.0/gen/RemanufacturingCertificate.json

generate html into .//io.catenax.refurbishing_certificate/1.0.0/gen/RefurbishingCertificate.html

generate html into .//io.catenax.certificate_of_dismantler/1.0.1/gen/CertificateOfDismantler.html

Generate artifacts for .//io.catenax.battery.battery_pass/3.0.0/BatteryPass.ttl

Generate artifacts for .//io.catenax.individual_asset_definition/1.0.0/IndividualAssetDefinition.ttl

Generate artifacts for .//io.catenax.transmission.transmission_pass/1.0.0/TransmissionPass.ttl

Generate artifacts for .//io.catenax.sealant.sealant_pass/1.0.0/SealantPass.ttl

bs-jokri commented 1 year ago

@atextor could that be a recursion of #363 or is model resolution handled differently for referenced models?

atextor commented 1 year ago

@bs-jokri Yes, it seems this is a regression. Will have a look.

github-actions[bot] commented 1 year ago

Release v2.3.2 addresses this.

bs-jokri commented 1 year ago

@michelu89 @RaMisess it seems the bug is still present in v2.3.2. At least I get the same error as with 2.3.2

org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException: Could not resolve [urn:bamm:io.openmanufacturing:meta-model:2.0.0#Aspect, urn:bamm:io.openmanufacturing:meta-model:2.0.0#properties, urn:bamm:io.openmanufacturing:meta-model:2.0.0#events, urn:bamm:io.openmanufacturing:meta-model:2.0.0#preferredName, urn:bamm:io.openmanufacturing:meta-model:2.0.0#description, urn:bamm:io.openmanufacturing:meta-model:2.0.0#operations, urn:bamm:io.openmanufacturing:meta-model:2.0.0#characteristic, urn:bamm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic, urn:bamm:io.openmanufacturing:meta-model:2.0.0#Property]
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:188)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:156)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$resolveAspectModel$1(AspectModelResolver.java:133)
    at io.vavr.control.Try.flatMapTry(Try.java:490)
    at io.vavr.control.Try.flatMap(Try.java:472)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:133)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModelFromDir$33570ba8$1(AspectModelResolver.java:414)
    at io.vavr.control.Try$WithResources1.lambda$of$97fea75d$1(Try.java:1392)
    at io.vavr.control.Try.of(Try.java:75)
    at io.vavr.control.Try$WithResources1.of(Try.java:1390)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModelFromDir$53c64c99$1(AspectModelResolver.java:414)
    at io.vavr.control.Try.flatMapTry(Try.java:490)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadAndResolveModelFromDir(AspectModelResolver.java:412)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModel$9(AspectModelResolver.java:385)
    at io.vavr.control.Try.orElse(Try.java:726)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadAndResolveModel(AspectModelResolver.java:385)
    at org.eclipse.esmf.AbstractCommand.loadAndResolveModel(AbstractCommand.java:53)
    at org.eclipse.esmf.aspect.AspectValidateCommand.run(AspectValidateCommand.java:60)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at org.eclipse.esmf.LoggingMixin.executionStrategy(LoggingMixin.java:41)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at org.eclipse.esmf.SammCli.main(SammCli.java:106)
Caused by: java.io.FileNotFoundException: No model file containing urn:samm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic could be found in directory: /Users/johannes/Documents/GitHub/sldt-semantic-models/io.catenax.refurbishing_certificate/1.0.0/io.catenax.shared.recycling_strategy_certificate/1.0.0. AND No model file containing urn:samm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic could be found in directory: /Users/johannes/Documents/GitHub/sldt-semantic-models/io.catenax.refurbishing_certificate/1.0.0/io.catenax.shared.recycling_strategy_certificate/1.0.0
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.lambda$apply$0(FileSystemStrategy.java:137)
    at io.vavr.API$Match$Case0.apply(API.java:5135)
    at io.vavr.API$Match.option(API.java:5105)
    at io.vavr.control.Try.mapFailure(Try.java:602)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.lambda$apply$1(FileSystemStrategy.java:136)
    at io.vavr.control.Try.recoverWith(Try.java:858)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.apply(FileSystemStrategy.java:134)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.apply(FileSystemStrategy.java:116)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.getModelForUrn(AspectModelResolver.java:332)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolve(AspectModelResolver.java:262)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:182)
    ... 27 more
Johanness-MacBook-Pro:sldt-semantic-models johannes$ java -jar ~/Downloads/samm-cli-2.3.2.jar  aspect io.catenax.refurbishing_certificate/1.0.0/RefurbishingCertificate.ttl validate
[To redirect Truffle log output to a file use one of the following options:
* '--log.file=<path>' if the option is passed using a guest language launcher.
* '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
* Configure logging using the polyglot embedding API.]
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException: Could not resolve [urn:bamm:io.openmanufacturing:meta-model:2.0.0#Aspect, urn:bamm:io.openmanufacturing:meta-model:2.0.0#properties, urn:bamm:io.openmanufacturing:meta-model:2.0.0#events, urn:bamm:io.openmanufacturing:meta-model:2.0.0#preferredName, urn:bamm:io.openmanufacturing:meta-model:2.0.0#description, urn:bamm:io.openmanufacturing:meta-model:2.0.0#operations, urn:bamm:io.openmanufacturing:meta-model:2.0.0#characteristic, urn:bamm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic, urn:bamm:io.openmanufacturing:meta-model:2.0.0#Property]
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:188)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:156)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$resolveAspectModel$1(AspectModelResolver.java:133)
    at io.vavr.control.Try.flatMapTry(Try.java:490)
    at io.vavr.control.Try.flatMap(Try.java:472)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:133)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModelFromDir$33570ba8$1(AspectModelResolver.java:414)
    at io.vavr.control.Try$WithResources1.lambda$of$97fea75d$1(Try.java:1392)
    at io.vavr.control.Try.of(Try.java:75)
    at io.vavr.control.Try$WithResources1.of(Try.java:1390)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModelFromDir$53c64c99$1(AspectModelResolver.java:414)
    at io.vavr.control.Try.flatMapTry(Try.java:490)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadAndResolveModelFromDir(AspectModelResolver.java:412)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.lambda$loadAndResolveModel$9(AspectModelResolver.java:385)
    at io.vavr.control.Try.orElse(Try.java:726)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadAndResolveModel(AspectModelResolver.java:385)
    at org.eclipse.esmf.AbstractCommand.loadAndResolveModel(AbstractCommand.java:53)
    at org.eclipse.esmf.aspect.AspectValidateCommand.run(AspectValidateCommand.java:60)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at org.eclipse.esmf.LoggingMixin.executionStrategy(LoggingMixin.java:41)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at org.eclipse.esmf.SammCli.main(SammCli.java:106)
Caused by: java.io.FileNotFoundException: No model file containing urn:samm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic could be found in directory: /Users/johannes/Documents/GitHub/sldt-semantic-models/io.catenax.refurbishing_certificate/1.0.0/io.catenax.shared.recycling_strategy_certificate/1.0.0. AND No model file containing urn:samm:io.catenax.shared.recycling_strategy_certificate:1.0.0#RecyclingStrategyCertificateCharacteristic could be found in directory: /Users/johannes/Documents/GitHub/sldt-semantic-models/io.catenax.refurbishing_certificate/1.0.0/io.catenax.shared.recycling_strategy_certificate/1.0.0
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.lambda$apply$0(FileSystemStrategy.java:137)
    at io.vavr.API$Match$Case0.apply(API.java:5135)
    at io.vavr.API$Match.option(API.java:5105)
    at io.vavr.control.Try.mapFailure(Try.java:602)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.lambda$apply$1(FileSystemStrategy.java:136)
    at io.vavr.control.Try.recoverWith(Try.java:858)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.apply(FileSystemStrategy.java:134)
    at org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy$DefaultNamespace.apply(FileSystemStrategy.java:116)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.getModelForUrn(AspectModelResolver.java:332)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolve(AspectModelResolver.java:262)
    at org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.resolveAspectModel(AspectModelResolver.java:182)
    ... 27 more
github-actions[bot] commented 1 year ago

Release v2.4.0 addresses this.

shijinrajbosch commented 1 year ago

Hi @atextor ,

We are getting the below error with Release v2.4.0


C:\project\sldt-semantic-models>java -jar samm-cli-2.4.0.jar  aspect io.catenax.transmission.transmission_pass/1.0.0/TransmissionPass.ttl validate
java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.getBindings(int)" because "this.engine" is null
        at org.eclipse.esmf.aspectmodel.shacl.constraint.JsConstraint.<init>(JsConstraint.java:80)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.lambda$new$31(ShapeLoader.java:179)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.lambda$constraints$35(ShapeLoader.java:352)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at org.apache.jena.util.iterator.Map1Iterator.lambda$forEachRemaining$0(Map1Iterator.java:55)
        at org.apache.jena.util.iterator.FilterIterator.lambda$forEachRemaining$0(FilterIterator.java:99)
        at org.apache.jena.mem.ArrayBunch$2.forEachRemaining(ArrayBunch.java:129)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at org.apache.jena.util.iterator.FilterIterator.forEachRemaining(FilterIterator.java:97)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at org.apache.jena.mem.TrackingTripleIterator.forEachRemaining(TrackingTripleIterator.java:58)
        at org.apache.jena.util.iterator.Map1Iterator.forEachRemaining(Map1Iterator.java:54)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.constraints(ShapeLoader.java:357)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.shapeAttributes(ShapeLoader.java:265)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.propertyShape(ShapeLoader.java:290)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at org.apache.jena.util.iterator.Map1Iterator.lambda$forEachRemaining$0(Map1Iterator.java:55)
        at org.apache.jena.util.iterator.FilterIterator.lambda$forEachRemaining$0(FilterIterator.java:99)
        at org.apache.jena.mem.ArrayBunch$2.forEachRemaining(ArrayBunch.java:129)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at org.apache.jena.util.iterator.FilterIterator.forEachRemaining(FilterIterator.java:97)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at org.apache.jena.mem.TrackingTripleIterator.forEachRemaining(TrackingTripleIterator.java:58)
        at org.apache.jena.util.iterator.Map1Iterator.forEachRemaining(Map1Iterator.java:54)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
        at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
        at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.nodeShape(ShapeLoader.java:282)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
        at org.apache.jena.util.iterator.Map1Iterator.lambda$forEachRemaining$0(Map1Iterator.java:55)
        at org.apache.jena.util.iterator.FilterIterator.lambda$forEachRemaining$0(FilterIterator.java:99)
        at org.apache.jena.mem.HashCommon$BasicKeyIterator.forEachRemaining(HashCommon.java:388)
        at org.apache.jena.util.iterator.NiceIterator$1.forEachRemaining(NiceIterator.java:138)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at org.apache.jena.util.iterator.FilterIterator.forEachRemaining(FilterIterator.java:97)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at org.apache.jena.mem.TrackingTripleIterator.forEachRemaining(TrackingTripleIterator.java:58)
        at org.apache.jena.util.iterator.Map1Iterator.forEachRemaining(Map1Iterator.java:54)
        at org.apache.jena.util.iterator.WrappedIterator.forEachRemaining(WrappedIterator.java:113)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
        at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
        at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
        at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
        at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.apply(ShapeLoader.java:235)
        at org.eclipse.esmf.aspectmodel.shacl.ShaclValidator.<init>(ShaclValidator.java:65)
        at org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator.<init>(AspectModelValidator.java:56)
        at org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator.<init>(AspectModelValidator.java:46)
        at org.eclipse.esmf.aspect.AspectValidateCommand.run(AspectValidateCommand.java:62)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at org.eclipse.esmf.LoggingMixin.executionStrategy(LoggingMixin.java:41)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at org.eclipse.esmf.SammCli.main(SammCli.java:111)`
shijinrajbosch commented 1 year ago

Hi @atextor , It seems to be a generic issue for all the models as it is failing for "java -jar samm-cli-2.4.0.jar aspect io.catenax.individual_asset_definition/1.0.0/IndividualAssetDefinition.ttl validate" and "java -jar samm-cli-2.4.0.jar aspect io.catenax.refurbishing_certificate/1.0.0/RefurbishingCertificate.ttl validate" with the same error.

Please let me know if you can fix the issue as part of this Or need a new issue to be created.

miwamasa commented 1 week ago

we are getting same error for the v2.9.6.jar , it was fine with v.2.9.5.jar

` java -jar samm-cli-2.9.6.jar aspect PerformanceAndDurability.ttl to json -o pa ndd.json java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.getBindings(int)" because "this.engine" is null at org.eclipse.esmf.aspectmodel.shacl.constraint.JsConstraint.(JsConstraint.java:77) at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.lambda$new$31(ShapeLoader.java:179) at org.eclipse.esmf.aspectmodel.shacl.ShapeLoader.lambda$constraints$35(ShapeLoader.java:352) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at org.apache.jena.util.iterator.Map1Iterator.lambda$forEachRemaining$0(Map1Iterator.java:55) ........

`