diff --git a/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/PagingSparqlTraversable.scala b/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/PagingSparqlTraversable.scala index 2fb206f89c..e008330133 100644 --- a/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/PagingSparqlTraversable.scala +++ b/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/PagingSparqlTraversable.scala @@ -65,8 +65,12 @@ object PagingSparqlTraversable { if(Thread.currentThread().isInterrupted) { return } - parsedQuery.setLimit(math.min(params.pageSize, limit - offset)) - parsedQuery.setOffset(offset) + if(params.pageSize != Int.MaxValue && limit > params.pageSize) { + parsedQuery.setOffset(offset) + } + if(limit != Int.MaxValue || params.pageSize != Int.MaxValue) { + parsedQuery.setLimit(math.min(params.pageSize, limit - offset)) + } val inputStream = executeQuery(parsedQuery.serialize(Syntax.syntaxSPARQL_11)) try { val resultCount = outputResults(inputStream, f) diff --git a/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/RemoteSparqlEndpoint.scala b/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/RemoteSparqlEndpoint.scala index e9ce203445..b1495728be 100644 --- a/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/RemoteSparqlEndpoint.scala +++ b/silk-plugins/silk-plugins-rdf/src/main/scala/org/silkframework/plugins/dataset/rdf/endpoint/RemoteSparqlEndpoint.scala @@ -174,4 +174,4 @@ object RemoteSparqlEndpoint { val rt = cfg.getInt("silk.remoteSparqlEndpoint.defaults.read.timeout.ms") (ct, rt) } -} \ No newline at end of file +}