Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMIT 0 should be preserved #183

Closed
QuarksToQuasars opened this issue Nov 20, 2024 · 1 comment
Closed

LIMIT 0 should be preserved #183

QuarksToQuasars opened this issue Nov 20, 2024 · 1 comment

Comments

@QuarksToQuasars
Copy link
Contributor

https://www.w3.org/TR/sparql11-query/#modResultLimit

A LIMIT of 0 would cause no results to be returned. A limit may not be negative.

    var parser = new SparqlParser();
    var parsedQuery = parser.parse('SELECT * WHERE { ?s ?p ?o. } LIMIT 0');
    var generator = new SparqlGenerator();
    var generatedQuery = generator.stringify(parsedQuery);
    var expectedQuery =
      'SELECT * WHERE { ?s ?p ?o. }\n' +
      'LIMIT 0';
    expect(generatedQuery).toEqual(expectedQuery);
  });

fails as the generator omits the limit in case of 0 (https://github.com/RubenVerborgh/SPARQL.js/blob/main/lib/SparqlGenerator.js#L79)

@QuarksToQuasars
Copy link
Contributor Author

Was merged with #184 .

Thanks @RubenVerborgh !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant