UNPKG

@tpluscode/sparql-builder

Version:

Simple JS library to build SPARQL queries

27 lines (26 loc) 517 B
export default () => ({ limit: null, offset: null, limitOffsetClause() { let clause = ''; if (this.limit != null) { clause += `LIMIT ${this.limit} `; } if (this.offset != null) { clause += `OFFSET ${this.offset}`; } return clause; }, LIMIT(limit) { return { ...this, limit, }; }, OFFSET(offset) { return { ...this, offset, }; }, });