@tpluscode/sparql-builder
Version:
Simple JS library to build SPARQL queries
18 lines (17 loc) • 459 B
JavaScript
import { sparql } from '@tpluscode/rdf-string';
import { concat } from '../TemplateResult.js';
export default () => ({
havings: null,
havingClause() {
if (this.havings) {
return sparql `HAVING ${this.havings}`;
}
return sparql ``;
},
HAVING(strings, ...values) {
return {
...this,
havings: concat(this.havings, strings, values, { wrapTemplate: true }),
};
},
});