sparql-path-parser
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

SPARQL Property Path Parser

Antlr4 grammar-based parser for SPARQL 1.1 property paths.

It returns a clownface-shacl-path JS object representing the parsed path.

Usage

import type { GraphPointer } from 'clownface';
import { parse } from 'sparql-path-parser';
import { findNodes } from 'clownface-shacl-path';

const path = 'schema:image/schema:thumbnail:/schema:url'

// 1. parse the path...
const parsed = parse(path)

// ...use it to find nodes in a graph
let graph: GraphPointer
const nodes = findNodes(parsed, graph)

// 2. or parse to sparqljs algebra
const algebra = parse.toAlgebra(path)

/sparql-path-parser/

    Package Sidebar

    Install

    npm i sparql-path-parser

    Weekly Downloads

    0

    Version

    0.1.0

    License

    none

    Unpacked Size

    152 kB

    Total Files

    5

    Last publish

    Collaborators

    • zazuko-bot