Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rmlio/rmlmapper-java-wrapper

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rmlio/rmlmapper-java-wrapper - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

test/tc04/mapping.ttl

6

CHANGELOG.md

@@ -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

29

index.test.js

@@ -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}`;

2

package.json
{
"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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc