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
147 stars 61 forks source link

RML Mapper Java embedded - example not working #119

Closed ghost closed 2 years ago

ghost commented 3 years ago

Hi!

I'd like to use the rml-mapper as part of a Java project. I included the rmlmapper 4.10 in my pom.xml and tried to run the example provided here.

Unfortunately, it does not produce a turtle file, but fails on QuadStore result = executor.executeV5(null).get(new NamedNode("rmlmapper://default.store")); with this error message:

Exception in thread "main" java.lang.NullPointerException at java.base/java.io.File.<init>(File.java:276) at org.apache.commons.io.FileUtils.getFile(FileUtils.java:212) at be.ugent.rml.access.LocalFileAccess.getInputStream(LocalFileAccess.java:40) at be.ugent.rml.records.IteratorFormat.getRecords(IteratorFormat.java:41) at be.ugent.rml.records.RecordsFactory.getRecords(RecordsFactory.java:136) at be.ugent.rml.records.RecordsFactory.createRecords(RecordsFactory.java:70) at be.ugent.rml.Executor.getRecords(Executor.java:409) at be.ugent.rml.Executor.executeWithFunctionV5(Executor.java:153) at be.ugent.rml.Executor.executeV5(Executor.java:140) at be.ugent.rml.Executor.executeV5(Executor.java:230) at start.rmlMapperExample(start.java:116) at start.main(start.java:23)

I also tried to replace to the inputStream with directly reading the file, which results in the same error. It works perfectly fine when I run the jar on the commandline.

Could you please advise on how to get the code running?

Thank you!

DylanVanAssche commented 3 years ago

Hi @airkangoo, Thank you for your interest in RML!

The Java file you linked is an unit test, could you share your example code itself which you try to get running?

ghost commented 3 years ago

@DylanVanAssche

Thanks for your response. In the meantime I got it running!