RMLio / rmlmapper-java

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources
http://rml.io
MIT License
146 stars 61 forks source link

RMLMapper + Jena 4.4 #148

Closed ghost closed 11 months ago

ghost commented 2 years ago

Hi!

I wanted to upgrade my code to the newest Jena version 4.4, which causes the entire program fail with the following error message:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jena/base/module/SubsystemRegistry
    at org.apache.jena.sparql.core.DatasetGraphFactory.<clinit>(DatasetGraphFactory.java:34)
    at org.apache.jena.query.DatasetFactory.create(DatasetFactory.java:54)
    ...
Caused by: java.lang.ClassNotFoundException: org.apache.jena.base.module.SubsystemRegistry
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 4 more

It points to this line:

Dataset ds = DatasetFactory.create();

I tested that with Jena 4.4 without the rml mapper and it works, when I add the rml mapper it breaks again. The dependencies I use:

<dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>apache-jena-libs</artifactId>
            <version>4.4.0</version>
            <type>pom</type>
        </dependency>
        <!-- https://mvnrepository.com/artifact/be.ugent.rml/rmlmapper -->
        <dependency>
            <groupId>be.ugent.rml</groupId>
            <artifactId>rmlmapper</artifactId>
            <version>4.15.0</version>
        </dependency>

My workaround is to stick with Jena 3.8 for the moment, but I'd like to know what causes this problem and how it can be solved (conflicting dependencies?).

Thank you!

DylanVanAssche commented 2 years ago

Hi @airkangoo !

We're currently a bit stuck with some dependencies because of changed APIs. Upgrading would be preferred, but it depends on the time we have available on our team to work on the RMLMapper. However, we welcome PRs to upgrade these dependencies :)

rppala3 commented 2 years ago

I just updated rmlmapper from 5.0.0 to 6.0.0 and I'm facing a similar issue related to jena

java.lang.NoClassDefFoundError: org/apache/jena/sparql/lib/Metadata

    at org.apache.jena.tdb2.TDB2.<clinit>(TDB2.java:163)
    at org.apache.jena.tdb2.sys.InitTDB2.start(InitTDB2.java:28)
    at org.apache.jena.sys.JenaSystem.lambda$init$2(JenaSystem.java:117)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:192)
    at org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:169)
    at org.apache.jena.sys.JenaSystem.init(JenaSystem.java:115)
    at org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
    at be.ugent.idlab.knows.functions.agent.functionModelProvider.fno.FnOFunctionModelProvider.<init>(FnOFunctionModelProvider.java:31)
    at be.ugent.idlab.knows.functions.agent.AgentFactory.createFromFnO(AgentFactory.java:47)
    at be.ugent.idlab.knows.functions.agent.AgentFactory.createFromFnO(AgentFactory.java:30)
    at be.ugent.rml.Initializer.<init>(Initializer.java:28)
    at be.ugent.rml.Executor.<init>(Executor.java:54)
    at be.ugent.rml.Executor.<init>(Executor.java:50)

Sticking apache-jena-libs version to 3.8.0 it seems to work again but, now I'm catching the Exception below

be.ugent.idlab.knows.functions.agent.functionIntantiation.exception.ClassNotFoundException: No class found for be.ugent.rml.functions.lib.UtilFunctions
    at be.ugent.idlab.knows.functions.agent.functionIntantiation.Instantiator.getClass(Instantiator.java:138)
    at be.ugent.idlab.knows.functions.agent.functionIntantiation.Instantiator.getMethod(Instantiator.java:78)
    at be.ugent.idlab.knows.functions.agent.AgentImpl.execute(AgentImpl.java:38)
    at be.ugent.rml.functions.StaticMultipleRecordsFunctionExecutor.execute(StaticMultipleRecordsFunctionExecutor.java:36)
    at be.ugent.rml.Executor.getIRIsWithTrueCondition(Executor.java:351)
    at be.ugent.rml.Executor.getIRIsWithConditions(Executor.java:315)
    at be.ugent.rml.Executor.generatePredicateObjectGraphs(Executor.java:269)
    at be.ugent.rml.Executor.executeWithFunction(Executor.java:207)
    at be.ugent.rml.Executor.execute(Executor.java:126)
    at be.ugent.rml.Executor.execute(Executor.java:224)
DylanVanAssche commented 1 year ago

We're upgrading all the libraries, try the latest RMLMapper.

DylanVanAssche commented 11 months ago

Already done for some time, closing.