all files / sparql/ filter.js

100% Statements 27/27
100% Branches 10/10
100% Functions 7/7
100% Lines 4/4
2 statements, 4 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                                         
'use strict';
 
export default class Filter {
    /**
     * The Filter class represents a single FILTER clause to be used within GraphPatterns
     *
     * @class Filter
     * @constructor
     * @param {String} content - SPARQL Filter string (without the FILTER keyword)
     */
    constructor(content) {
        this.content = content;
    }
 
    /**
     * Retrieves the SPARQL string representation of the current instance, adding the FILTER keyword.
     *
     * @method toString
     * @returns {String}
     */
    toString() {
        return `FILTER (${this.content})`;
    }
}