rdf-dataset-fragmenter
Version:
Fragments an RDF dataset into multiple parts
23 lines • 738 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuadSourceFile = void 0;
const fs = require("node:fs");
const rdf_parse_1 = require("rdf-parse");
/**
* A quad source that loads quads from a file.
*/
class QuadSourceFile {
constructor(options) {
this.filePath = options.filePath;
this.baseIRI = options.baseIRI;
}
getQuads() {
// The parser from 'rdf-parse' uses Readable from 'readable-stream', hence this cast
return rdf_parse_1.rdfParser.parse(fs.createReadStream(this.filePath), {
path: this.filePath,
baseIRI: this.baseIRI,
});
}
}
exports.QuadSourceFile = QuadSourceFile;
//# sourceMappingURL=QuadSourceFile.js.map