sparqlalgebrajs
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -9,2 +9,4 @@ import * as Algebra from './algebra'; | ||
* * quads: Boolean indicating whether triples should be converted to Quads (consumes GRAPH statements). Default false. | ||
* * prefixes: Pre-defined prefixes for the given query. Default empty. | ||
* * baseIRI: Base IRI that should be used for the query. Default undefined (throws error if required). | ||
* @returns {Operation} | ||
@@ -15,2 +17,6 @@ */ | ||
quads?: boolean; | ||
prefixes?: { | ||
[prefix: string]: string; | ||
}; | ||
baseIRI?: string; | ||
}): Algebra.Operation; |
@@ -19,2 +19,4 @@ "use strict"; | ||
* * quads: Boolean indicating whether triples should be converted to Quads (consumes GRAPH statements). Default false. | ||
* * prefixes: Pre-defined prefixes for the given query. Default empty. | ||
* * baseIRI: Base IRI that should be used for the query. Default undefined (throws error if required). | ||
* @returns {Operation} | ||
@@ -25,2 +27,9 @@ */ | ||
factory = new Factory_1.default(options.dataFactory || DataFactory); | ||
if (isString(sparql)) { | ||
let parser = new Parser(options.prefixes, options.baseIRI); | ||
// resets the identifier counter used for blank nodes | ||
// provides nicer and more consistent output if there are multiple calls | ||
parser._resetBlanks(); | ||
sparql = parser.parse(sparql); | ||
} | ||
return translateQuery(sparql, options.quads); | ||
@@ -33,9 +42,2 @@ } | ||
useQuads = quads; | ||
if (isString(sparql)) { | ||
let parser = new Parser(); | ||
// resets the identifier counter used for blank nodes | ||
// provides nicer and more consistent output if there are multiple calls | ||
parser._resetBlanks(); | ||
sparql = parser.parse(sparql); | ||
} | ||
if (sparql.type !== 'query') | ||
@@ -42,0 +44,0 @@ throw new Error('Translate only works on complete query objects.'); |
{ | ||
"name": "sparqlalgebrajs", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "Convert SPARQL to SPARL algebra", | ||
@@ -5,0 +5,0 @@ "author": "Joachim Van Herwegen", |
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
50103
1219