A query language transpiler framework for JavaScript
WARNING: V2 will come shortly and will have lots of breaking changes.
Traqula Sparql 1.1 Adjust is a SPARQL 1.1 query parser that also parses the builtin function ADJUST for TypeScript. Simple grammar extension of Traqula engine-sparql-1-1
npm install @traqula/parser-sparql-1-1-adjust
or
yarn add @traqula/parser-sparql-1-1-adjust
Either through ESM import:
import { Parser } from '@traqula/parser-sparql-1-1-adjust';
or CJS require:
const Sparql11AdjustParser = require('@traqula/parser-sparql-1-1-adjust').Parser;
This package contains a Sparql11AdjustParser
that is able to parse SPARQL 1.1 queries including the builtin function ADJUST:
const parser = new Parser();
const abstractSyntaxTree = parser.parse(`
SELECT ?s ?p (ADJUST(?o, "-PT10H"^^<http://www.w3.org/2001/XMLSchema#dayTimeDuration>) as ?adjusted) WHERE {
?s ?p ?o
}
`);
This parser is a simple grammar extension to the engine-sparql-1-1. As such, most, if not all, documentation of that parser holds for this one too.