sparqljson-parse
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -19,2 +19,6 @@ /// <reference types="node" /> | ||
* Convert a SPARQL JSON bindings response stream to a stream of bindings objects. | ||
* | ||
* The bindings stream will emit a 'variables' event that will contain | ||
* the array of variables (as RDF.Variable[]), as defined in the response head. | ||
* | ||
* @param {NodeJS.ReadableStream} sparqlResponseStream A SPARQL JSON response stream. | ||
@@ -21,0 +25,0 @@ * @return {NodeJS.ReadableStream} A stream of bindings. |
@@ -25,2 +25,6 @@ "use strict"; | ||
* Convert a SPARQL JSON bindings response stream to a stream of bindings objects. | ||
* | ||
* The bindings stream will emit a 'variables' event that will contain | ||
* the array of variables (as RDF.Variable[]), as defined in the response head. | ||
* | ||
* @param {NodeJS.ReadableStream} sparqlResponseStream A SPARQL JSON response stream. | ||
@@ -31,2 +35,7 @@ * @return {NodeJS.ReadableStream} A stream of bindings. | ||
sparqlResponseStream.on('error', (error) => resultStream.emit('error', error)); | ||
const variables = []; | ||
sparqlResponseStream | ||
.pipe(require('JSONStream').parse('head.vars.*')) | ||
.on('data', (variable) => variables.push(this.dataFactory.variable(variable))) | ||
.on('end', () => resultStream.emit('variables', variables)); | ||
const resultStream = sparqlResponseStream | ||
@@ -33,0 +42,0 @@ .pipe(require('JSONStream').parse('results.bindings.*')) |
{ | ||
"name": "sparqljson-parse", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Parses SPARQL JSON query results", | ||
@@ -42,2 +42,3 @@ "keywords": [ | ||
"jest": "^23.4.1", | ||
"jest-rdf": "^1.1.0", | ||
"pre-commit": "^1.2.2", | ||
@@ -51,2 +52,3 @@ "streamify-string": "^1.0.1", | ||
"jest": { | ||
"setupTestFrameworkScriptFile": "jest-rdf", | ||
"transform": { | ||
@@ -76,5 +78,5 @@ "^.+\\.ts$": "ts-jest" | ||
"dependencies": { | ||
"JSONStream": "^1.3.3", | ||
"@rdfjs/data-model": "^1.1.0" | ||
"@rdfjs/data-model": "^1.1.0", | ||
"JSONStream": "^1.3.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16205
10
204
13