npm.io
1.5.0-alpha.6 • Published 4d ago

@traqula/parser-sparql-1-2

Licence
MIT
Version
1.5.0-alpha.6
Deps
5
Size
93 kB
Vulns
0
Weekly
0
Stars
28

Traqula logo

A query language transpiler framework for JavaScript

Traqula parser engine for SPARQL 1.2

npm version

Traqula Sparql 1.2 is a SPARQL 1.2 query parser for TypeScript. It is a grammar extension of Traqula parser-sparql-1-1

Installation

npm install @traqula/parser-sparql-1-2

or

yarn add @traqula/parser-sparql-1-2

Import

Either through ESM import:

import { Parser } from '@traqula/parser-sparql-1-2';

or CJS require:

const Parser = require('@traqula/parser-sparql-1-2').Parser;

Usage

This package contains a Parser that is able to parse SPARQL 1.2 queries:

const parser = new Parser();
const abstractSyntaxTree = parser.parse('SELECT * { ?s ?p ?o }');

This parser is a simple grammar extension to the parser-sparql-1-1. As such, most, if not all, documentation of that parser holds for this one too.

Modifying the built Parser

Minor versions keep this engine's API and behavior, and the name, signature and behavior of the rules in its builders, but can add rules or change how existing rules are implemented, such as which rules they call. This only affects projects that patch, delete or individually register rules. See versioning.