Callidon / sparql-engine

🚂 A framework for building SPARQL query engines in Javascript/Typescript
https://callidon.github.io/sparql-engine
MIT License
99 stars 14 forks source link

JsonFormat not valid when no results #84

Open stuarthendren opened 9 months ago

stuarthendren commented 9 months ago

Describe the bug

The JsonFormat produces {]}} if there are no results.

To Reproduce Steps to reproduce the behavior:

Just use any query (e.g. "SELECT * WHERE { ?s ?p ?o }")) to a dataset with no data and apply the JsonFormat.

Expected behavior

It would ideally produce the expected W3C formatted result, however I realise that you can't produce the bindings with the current set up as the first result is used, but it would be good if it would at least be valid JSON so the JSON.parse doesn't throw.