sparqlalgebrajs
Advanced tools
Comparing version 2.5.4 to 2.5.5
@@ -275,3 +275,13 @@ "use strict"; | ||
function recurseGraph(thingy, graph, replacement) { | ||
if (thingy.type === types.BGP) | ||
if (thingy.type === types.GRAPH) { | ||
if (replacement) { | ||
// At this point we would lose track of the replacement which would result in incorrect results | ||
// This would indicate the library is not being used as intended though | ||
throw new Error('Recursing through nested GRAPH statements with a replacement is impossible.'); | ||
} | ||
const graph = thingy; | ||
// In case there were nested GRAPH statements that were not recursed yet for some reason | ||
thingy = recurseGraph(graph.input, graph.name); | ||
} | ||
else if (thingy.type === types.BGP) | ||
thingy.patterns = thingy.patterns.map(quad => { | ||
@@ -286,3 +296,4 @@ if (replacement) { | ||
} | ||
quad.graph = graph; | ||
if (quad.graph.termType === 'DefaultGraph') | ||
quad.graph = graph; | ||
return quad; | ||
@@ -298,3 +309,4 @@ }); | ||
} | ||
thingy.graph = graph; | ||
if (thingy.graph.termType === 'DefaultGraph') | ||
thingy.graph = graph; | ||
} | ||
@@ -301,0 +313,0 @@ // need to replace variables in subqueries should the graph also be a variable of the same name |
{ | ||
"name": "sparqlalgebrajs", | ||
"version": "2.5.4", | ||
"version": "2.5.5", | ||
"description": "Convert SPARQL to SPARQL 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
107064
2543