diff --git a/lib/graphs.js b/lib/graphs.js index 777e729d..dc8d87eb 100644 --- a/lib/graphs.js +++ b/lib/graphs.js @@ -607,6 +607,7 @@ Graphs.prototype.sparql = function queryGraphSPARQL() { // TODO: collection, directory? + // Single configuration object if (argLen === 1) { var params = args[0]; acceptType = params.contentType; @@ -626,9 +627,11 @@ Graphs.prototype.sparql = function queryGraphSPARQL() { if ((acceptType == null) || (query == null)) { throw new Error('named parameters must specify content type and query for SPARQL query on graphs'); } - } else { + } + // Multiple params + else { acceptType = args[0]; - if (argLen > 3) { + if (argLen >= 3) { defaultGraphs = Array.prototype.slice.call(arguments, 1, argLen - 1); } query = args[argLen - 1];