@rmlio/rmlmapper-java-wrapper
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -10,2 +10,7 @@ # Changelog | ||
## [1.1.0] - 2021-02-25 | ||
### Added | ||
- Possibility to set Java VM option | ||
## [1.0.1] - 2020-05-13 | ||
@@ -59,2 +64,3 @@ | ||
[1.1.0]: https://github.com/RMLio/rmlmapper-java-wrapper-js/compare/v1.0.1...v1.1.0 | ||
[1.0.1]: https://github.com/RMLio/rmlmapper-java-wrapper-js/compare/v1.0.0...v1.0.1 | ||
@@ -61,0 +67,0 @@ [1.0.0]: https://github.com/RMLio/rmlmapper-java-wrapper-js/compare/v0.1.1...v1.0.0 |
@@ -110,3 +110,3 @@ /** | ||
it('Input: array of quads', () => { | ||
it('Input: array of quads', done => { | ||
// GIVEN a wrapper and a simple CSV mapping generating one quad | ||
@@ -132,5 +132,32 @@ const wrapper = new RMLMapperWrapper(rmlmapperPath, tempFolderPath, true); | ||
assert.ok(isomorphic(result.output, expected)); | ||
done(); | ||
} | ||
}); | ||
}); | ||
it('Add Java VM options', done => { | ||
// GIVEN a wrapper and a simple CSV mapping generating one quad | ||
const wrapper = new RMLMapperWrapper(rmlmapperPath, tempFolderPath, true, {'Dfile.encoding': 'UTF-8'}); | ||
const rml = fs.readFileSync('./test/tc04/mapping.ttl', 'utf-8'); | ||
const parser = new N3.Parser(); | ||
const rmlQuads = []; | ||
parser.parse(rml, async (error, quad) => { | ||
if (quad) { | ||
rmlQuads.push(quad); | ||
} else { | ||
const sources = { | ||
'student.csv': fs.readFileSync('./test/tc04/student.csv', 'utf-8') | ||
}; | ||
// WHEN generating the quads without the metadata and expected the results to by an array of quads | ||
const result = await wrapper.execute(rmlQuads, {sources, generateMetadata: false, asQuads: true}); | ||
// THEN the mapping should succeed and the output should match one of the file | ||
const expected = await strToQuads(fs.readFileSync('./test/tc04/output.nq', 'utf-8')); | ||
assert.ok(isomorphic(result.output, expected)); | ||
done(); | ||
} | ||
}); | ||
}); | ||
}); |
@@ -18,6 +18,7 @@ /** | ||
constructor(path, tempFolder, removeTempFolders) { | ||
constructor(path, tempFolder, removeTempFolders, javaVMOptions = {}) { | ||
this.path = path; | ||
this.tempFolder = tempFolder; | ||
this.removeTempFolders = removeTempFolders; | ||
this.javaVMOptions = javaVMOptions | ||
@@ -86,4 +87,11 @@ //check if temp directory exists | ||
let execCommand = `java -jar ${self.path} -m ${mappingFile} -o ${outputFile} -s ${options.serialization}`; | ||
let execCommand = `java `; | ||
Object.keys(self.javaVMOptions).forEach(key => { | ||
const value = self.javaVMOptions[key]; | ||
execCommand += `-${key}=${value} ` | ||
}); | ||
execCommand += `-jar ${self.path} -m ${mappingFile} -o ${outputFile} -s ${options.serialization}`; | ||
if (options.generateMetadata) { | ||
@@ -90,0 +98,0 @@ execCommand += ` -l triple -e ${metadataFile}`; |
{ | ||
"name": "@rmlio/rmlmapper-java-wrapper", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A JavaScript wrapper around the Java RMLMapper.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24188
19
418