@swymbase/sparql-ast
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

SPARQL AST

Status: WIP. Everything is subject to change. This is currently a quick & dirty implementation of the minimal subset of SPARQL needed to implement the filter language in sparql-rest. The intent is to eventually support typed, in-memory representation of the full abstract SPARQL abstract algebra (not preserving insignificant syntactical details). See §18 “Definition of SPARQL” and in particular §18.2 “Translation to the SPARQL Algebra”

This is not a parser but would be suitable for use as a parser output format in cases where exact syntax does not need to be preserved.

Motivation

Provide a basis for type safe operations on and serialization of SPARQL expressions. Intended applications include term rewriting systems.

Features

The package provides:

  • types: types for representing abstract SPARQL expressions

  • serialization : safe sparql serialization mapping JSON API documents and resources to record-type objects

  • possible TBD's: equivalency tests, common transforms (e.g. skolemization or other ops on open expressions)

Design

TBD

Roadmap

Should use a reified grammar (i.e. concrete data that can generate TS types, versus using TS as source of truth).

Related work

The SPIN vocabulary is a SPARQL-in-RDF representation, which should be consulted.

Readme

Keywords

none

Package Sidebar

Install

npm i @swymbase/sparql-ast

Weekly Downloads

1

Version

0.0.10

License

BSD-3-Clause

Unpacked Size

165 kB

Total Files

37

Last publish

Collaborators

  • gcannizzaro