rdf-dataset-fragmenter
Version:
Fragments an RDF dataset into multiple parts
19 lines • 695 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueModifierRegexReplaceGroup = void 0;
const rdf_data_factory_1 = require("rdf-data-factory");
const DF = new rdf_data_factory_1.DataFactory();
/**
* A value modifier that applies the given regex on the value and replaces it with the first group match.
*/
class ValueModifierRegexReplaceGroup {
regex;
constructor(regex) {
this.regex = new RegExp(regex, 'u');
}
apply(value) {
return DF.literal(value.value.replace(this.regex, '$1'));
}
}
exports.ValueModifierRegexReplaceGroup = ValueModifierRegexReplaceGroup;
//# sourceMappingURL=ValueModifierRegexReplaceGroup.js.map