Skip to content
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

Support relative path to rmlmapper.jar? #36

Open
phochste opened this issue Oct 14, 2024 · 0 comments
Open

Support relative path to rmlmapper.jar? #36

phochste opened this issue Oct 14, 2024 · 0 comments

Comments

@phochste
Copy link

On OSX I run the example code from the README

const RMLMapperWrapper = require('@rmlio/rmlmapper-java-wrapper');
const fs = require('fs');

const rmlmapperPath = './rmlmapper.jar';
const tempFolderPath = './tmp';

const wrapper = new RMLMapperWrapper(rmlmapperPath, tempFolderPath, true);
const rml = fs.readFileSync('./test/tc01/mapping.ttl', 'utf-8');
const sources = {
  'student.csv': fs.readFileSync('./test/tc01/student.csv', 'utf-8')
};

const result = await wrapper.execute(rml, {sources, generateMetadata: false, serialization: 'turtle'});

But I get an error message:

Error: Error while executing the rules.
    at ChildProcess.<anonymous> (/Users/hochsten/github.com/MellonScholarlyCommunication/eventlog-server/node_modules/@rmlio/rmlmapper-java-wrapper/lib/wrapper.js:204:23)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:519:28)
    at Pipe.<anonymous> (node:net:339:12) {
  log: 'Error: Unable to access jarfile ./rmlmapper.jar\n'
}

Node.js v20.17.0

The code works when I replace const rmlmapperPath = './rmlmapper.jar'; with the absolute path to the jar file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant