Fix SPARQL ASK queries to return W3C standard JSON format #42

Open
csajedi wants to merge 1 commits from csajedi/nextgraph-rs:fix/sparql-ask-json-format into master

Description

This PR fixes ASK queries returning raw JavaScript booleans instead of the W3C SPARQL 1.1
standard JSON format.

Problem

  • ASK queries were returning true or false (raw booleans)
  • This violates the W3C SPARQL 1.1 specification
  • Made ASK queries incompatible with standards-compliant SPARQL clients

Solution

  • Use QueryResultsSerializer to format ASK results properly
  • Now returns {"head": {}, "boolean": true/false} as per W3C standard
  • Consistent with SELECT/CONSTRUCT query behavior

Testing

  • Built and tested locally with demonstration script
  • Verified both true and false cases return correct format
  • Confirmed SELECT queries continue to work as expected

References

## Description This PR fixes ASK queries returning raw JavaScript booleans instead of the W3C SPARQL 1.1 standard JSON format. ## Problem - ASK queries were returning `true` or `false` (raw booleans) - This violates the W3C SPARQL 1.1 specification - Made ASK queries incompatible with standards-compliant SPARQL clients ## Solution - Use `QueryResultsSerializer` to format ASK results properly - Now returns `{"head": {}, "boolean": true/false}` as per W3C standard - Consistent with SELECT/CONSTRUCT query behavior ## Testing - Built and tested locally with demonstration script - Verified both `true` and `false` cases return correct format - Confirmed SELECT queries continue to work as expected ## References - W3C SPARQL 1.1 Query Results JSON Format: https://www.w3.org/TR/sparql11-results-json/
csajedi added 1 commit 18 hours ago
8803c63946 fix: return W3C standard JSON format for SPARQL ASK queries
This pull request can be merged automatically.
You are not authorized to merge this pull request.
Sign in to join this conversation.
Loading…
There is no content yet.