https://github.com/awwright/sparql-spin-js3
Parses SPARQL 1.1 into a js3 structure with SPIN vocabulary using the PEG parser generator
https://github.com/awwright/sparql-spin-js3
Last synced: 3 months ago
JSON representation
Parses SPARQL 1.1 into a js3 structure with SPIN vocabulary using the PEG parser generator
- Host: GitHub
- URL: https://github.com/awwright/sparql-spin-js3
- Owner: awwright
- Created: 2010-12-28T04:09:40.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2012-11-14T17:15:01.000Z (over 13 years ago)
- Last Synced: 2025-10-04T15:29:08.961Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 156 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sparql-spin-js3 - An integration of the SPIN vocabulary/SPARQL parser designed for the js3 RDF library #
## Requirements ##
* Node.js installed (You can set the command for Node.js in Makefile if you like, or like `make NODEJS=/path/to/nodejs`)
* [js3 library](https://github.com/webr3/js3) (This isn't strictly needed, just get rid of the three lines at the top of src/sparql.header.js if you really want to.)
## Building ##
Simply run `make`.
Building the parser is done in two steps: PEG does not come with ready sources, the appropriate files have to be appended together and modified. We don't use the Rakefile because it depends on Ruby and other stuff to be installed. Plus it's simpler.
## Usage ##
The finished peg.node.js can be used as a Node.js module, it's recommended you symlink that to 'peg.js' if you require it from a script.
The finished SPARQL parser is found in sparql.js (and also symlinked by index.js so you can just require() the directory) and accessed with the `parse` call:
var sparqlParser=require('sparql');
var query = sparqlParser.parse(query).ref('_:query');
Some Vows tests can be run, simply run `vows` in the working directory.