egonw opened a new issue, #2816:
URL: https://github.com/apache/jena/issues/2816

   ### Version
   
   5.1.0
   
   ### What happened?
   
   Code that worked well for validation with ShEx now gives a 
`NoClassDefFoundError`. The code used:
   
   ```java
       public ShexReport validateAllOfType(IRDFStore store, String shexFile, 
String shapeURI, String type) {
           if (!(store instanceof IJenaStore))
               throw new RuntimeException("Can only handle IJenaStore's for 
now.");
   
           Graph dataGraph = ((IJenaStore)store).getModel().getGraph();
           ShexSchema shapes = Shex.readSchema(workspaceRoot + shexFile);
           Builder shapeMapBuilder = ShapeMap.newBuilder();
           Triple instance = Triple.create(Shex.FOCUS, RDF.type.asNode(), 
NodeFactory.createURI(type));
           shapeMapBuilder.add(instance, NodeFactory.createURI(shapeURI));
           ShapeMap shapeMap = shapeMapBuilder.build();
   
           return ShexValidator.get().validate(dataGraph, shapes, shapeMap);
       }
   ```
   
   With the Maven `dependency:tree`:
   
   ```
   [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ managers-rdf ---
   [INFO] io.github.egonw.bacting:managers-rdf:jar:1.0.4-SNAPSHOT
   [INFO] +- io.github.egonw.bacting:bioclipse-rdf:jar:2.8.1.2:compile
   [INFO] |  +- org.apache.jena:jena-arq:jar:4.10.0:compile
   [INFO] |  |  +- org.apache.jena:jena-core:jar:4.10.0:compile
   [INFO] |  |  |  +- org.apache.jena:jena-iri:jar:4.10.0:compile
   [INFO] |  |  |  +- commons-cli:commons-cli:jar:1.5.0:compile
   [INFO] |  |  |  \- org.roaringbitmap:RoaringBitmap:jar:1.0.0:compile
   [INFO] |  |  +- com.github.jsonld-java:jsonld-java:jar:0.13.4:compile
   [INFO] |  |  +- com.google.code.gson:gson:jar:2.10.1:compile
   [INFO] |  |  +- org.apache.httpcomponents:httpclient-cache:jar:4.5.14:compile
   [INFO] |  |  +- com.apicatalog:titanium-json-ld:jar:1.3.2:compile
   [INFO] |  |  +- org.glassfish:jakarta.json:jar:2.0.1:compile
   [INFO] |  |  +- com.google.protobuf:protobuf-java:jar:3.24.3:compile
   [INFO] |  |  \- org.apache.thrift:libthrift:jar:0.19.0:compile
   [INFO] |  +- org.apache.jena:jena-tdb:jar:4.10.0:compile
   [INFO] |  \- io.github.egonw.bacting:bioclipse-rdfcore:jar:2.8.1.2:compile
   [INFO] +- org.apache.jena:jena-shex:jar:5.1.0:compile
   [INFO] +- org.apache.jena:jena-base:jar:5.1.0:compile
   [INFO] |  +- org.apache.commons:commons-csv:jar:1.11.0:compile
   [INFO] |  +- commons-io:commons-io:jar:2.16.1:compile
   [INFO] |  +- org.apache.commons:commons-lang3:jar:3.14.0:compile
   [INFO] |  +- commons-codec:commons-codec:jar:1.17.0:compile
   [INFO] |  +- org.apache.commons:commons-compress:jar:1.26.2:compile
   [INFO] |  +- org.apache.commons:commons-collections4:jar:4.4:compile
   [INFO] |  +- com.github.ben-manes.caffeine:caffeine:jar:3.1.8:compile
   [INFO] |  \- com.github.andrewoma.dexx:collection:jar:0.7:compile
   [INFO] +- commons-logging:commons-logging:jar:1.3.4:runtime
   [INFO] +- io.github.egonw.bacting:bioclipse-core:jar:2.8.1.2:compile
   [INFO] |  +- org.eclipse.platform:org.eclipse.core.runtime:jar:3.30.0:compile
   [INFO] |  |  +- org.eclipse.platform:org.eclipse.osgi:jar:3.18.600:compile
   [INFO] |  |  +- 
org.eclipse.platform:org.eclipse.equinox.common:jar:3.18.200:compile
   [INFO] |  |  +- 
org.eclipse.platform:org.eclipse.core.jobs:jar:3.15.100:compile
   [INFO] |  |  +- 
org.eclipse.platform:org.eclipse.equinox.registry:jar:3.11.400:compile
   [INFO] |  |  +- 
org.eclipse.platform:org.eclipse.core.contenttype:jar:3.9.200:compile
   [INFO] |  |  \- 
org.eclipse.platform:org.eclipse.equinox.app:jar:1.6.400:compile
   [INFO] |  +- 
org.eclipse.platform:org.eclipse.core.resources:jar:3.20.0:compile
   [INFO] |  |  +- 
org.eclipse.platform:org.eclipse.core.expressions:jar:3.9.200:compile
   [INFO] |  |  \- 
org.eclipse.platform:org.eclipse.core.filesystem:jar:1.10.200:compile
   [INFO] |  \- 
org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.10.400:compile
   [INFO] |     \- org.osgi:org.osgi.service.prefs:jar:1.1.2:compile
   [INFO] |        \- org.osgi:osgi.annotation:jar:8.0.1:compile
   [INFO] +- org.slf4j:slf4j-simple:jar:2.0.13:compile
   [INFO] |  \- org.slf4j:slf4j-api:jar:2.0.13:compile
   [INFO] +- org.junit.jupiter:junit-jupiter:jar:5.11.0:test
   [INFO] |  +- org.junit.jupiter:junit-jupiter-api:jar:5.11.0:test
   [INFO] |  |  +- org.opentest4j:opentest4j:jar:1.3.0:test
   [INFO] |  |  \- org.junit.platform:junit-platform-commons:jar:1.11.0:test
   [INFO] |  \- org.junit.jupiter:junit-jupiter-params:jar:5.11.0:test
   [INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.11.0:test
   [INFO] |  +- org.junit.platform:junit-platform-engine:jar:1.11.0:test
   [INFO] |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
   [INFO] \- io.github.egonw.bacting:managers-ui:jar:1.0.4-SNAPSHOT:test
   [INFO]    +- io.github.egonw.bacting:bacting-core:jar:1.0.4-SNAPSHOT:test
   [INFO]    +- io.github.egonw.bacting:bioclipse-report:jar:2.8.1.2:test
   [INFO]    +- org.apache.httpcomponents:httpclient:jar:4.5.14:compile
   [INFO]    |  \- org.apache.httpcomponents:httpcore:jar:4.4.16:compile
   [INFO]    \- com.github.egonw:jqudt:jar:1.5.0:test
   [INFO]       +- org.eclipse.rdf4j:rdf4j-model:jar:3.7.7:test
   [INFO]       |  +- org.eclipse.rdf4j:rdf4j-model-api:jar:3.7.7:test
   [INFO]       |  +- org.eclipse.rdf4j:rdf4j-model-vocabulary:jar:3.7.7:test
   [INFO]       |  \- org.eclipse.rdf4j:rdf4j-util:jar:3.7.7:test
   [INFO]       +- org.eclipse.rdf4j:rdf4j-rio-api:jar:3.7.7:test
   [INFO]       |  \- javax.xml.bind:jaxb-api:jar:2.3.1:test
   [INFO]       |     \- javax.activation:javax.activation-api:jar:1.2.0:test
   [INFO]       +- org.eclipse.rdf4j:rdf4j-rio-rdfxml:jar:3.7.7:test
   [INFO]       |  +- org.eclipse.rdf4j:rdf4j-rio-datatypes:jar:3.7.7:test
   [INFO]       |  \- org.eclipse.rdf4j:rdf4j-rio-languages:jar:3.7.7:test
   [INFO]       \- org.eclipse.rdf4j:rdf4j-rio-turtle:jar:3.7.7:test
   ```
   
   ### Relevant output and stacktrace
   
   ```shell
   java.lang.NoClassDefFoundError: org/apache/jena/system/G
           at org.apache.jena.shex.eval.ShapeEval.arcsOut(ShapeEval.java:186)
           at 
org.apache.jena.shex.eval.ShapeEval.matchesTripleExpr(ShapeEval.java:68)
           at 
org.apache.jena.shex.expressions.ShapeExprTripleExpr.satisfies(ShapeExprTripleExpr.java:81)
           at org.apache.jena.shex.ShexShape.satisfies(ShexShape.java:50)
           at 
org.apache.jena.shex.sys.ShexValidatorImpl.validationStepWorker(ShexValidatorImpl.java:172)
           at 
org.apache.jena.shex.sys.ShexValidatorImpl.validationStep(ShexValidatorImpl.java:164)
           at 
org.apache.jena.shex.sys.ShexValidatorImpl.lambda$validate$0(ShexValidatorImpl.java:59)
           at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
           at 
java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1116)
           at 
org.apache.jena.shex.sys.ShexValidatorImpl.validate(ShexValidatorImpl.java:53)
           at 
net.bioclipse.managers.RDFManager.validateAllOfType(RDFManager.java:674)
           at 
net.bioclipse.managers.RDFManagerTest.validateShEx(RDFManagerTest.java:429)
           at java.base/java.lang.reflect.Method.invoke(Method.java:580)
           at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
           at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
   Caused by: java.lang.ClassNotFoundException: org.apache.jena.system.G
           at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
           at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
           at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
           ... 15 more
   ```
   
   
   ### Are you interested in making a pull request?
   
   None


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to