-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using rmlmapper as an in-process library, Jena fails to initialize #127
Comments
Hi! Thanks for reaching out! |
I have not tried your sample code yet — I can do that in a few days, if it's important, but I have a large code base written to the Jena API and I don't want to have to refactor it to the be.ugent.rml.store.* API you show in the sample code. The key observation here is that my code uses Jena, and that causes a conflict with the RML Mapper dependencies, which seem to pull in multiple versions of Jena. Further, if the dependencies I suggested eliminating are used only for unit testing, then they should be marked as testing scope so that they are not pulled into my code, but used only when running your tests. |
I marked the Jetty, Jena, Fuseki and Docker dependencies with the
|
I will give this a try as soon as I can. (It may take a couple days, because I have some upcoming customer meetings to prepare for.) |
@IanEmmons Sure! Take your time :) |
Super, thanks! |
My application translates a several kinds of data files into RDF using rmlmapper. Currently, this application forks a separate JVM process to translate each file, using the command-line interface of the "fat" rmlmapper jar. However, I am mapping hundreds of thousands of files, so I would like to avoid the overhead of starting a new JVM process for each file. Thus I am trying to use the non-fat rmlmapper jar as an in-process library. However, before I change a single line of code, if I simply add rmlmapper as a dependency in my Gradle script, I get the following exception in my unit tests:
I've shown the stack trace down to the point where JUnit is calling into my code. You can see that the static constructor of my test case has called the initialization code for Jena, which immediately fails before my code does anything. In the original version of my code, I did not explicitly call Jena's initialization, but rather simply created a default Model in my test case, causing Jena to call its own initialization code. I added the explicit initialization to eliminate several lines from the stack trace, but the top seven lines are the same either way. I have not been able to find the exact cause of this error, but it seems like an issue resolving all the dependencies in a way that does not cause conflicts. When I list the dependencies using Gradle, I note the following:
(I can upload the full dependency listing if you like, but it's very very long, and in the end I suspect not that helpful.)
What I would like to see is for rmlmapper to be refactored into a plain Java library designed to be called in-process, together with one or more other jars that implement some of the "bells and whistles" that are currently bundled in. In other words, the refactored library would not contain any of the following:
Further, this library should not depend on any other software that is not necessary to executing an RML script over an input file to produce RDF.
The text was updated successfully, but these errors were encountered: