paulovn / sparql-kernel

A Jupyter kernel to launch queries against SPARQL endpoints
BSD 3-Clause "New" or "Revised" License
98 stars 17 forks source link

Raw JSON result returns invalid JSON output with single quotes. #26

Closed BoPeng closed 6 years ago

BoPeng commented 6 years ago

Is there any reason the raw result in JSON format uses single instead of required double quote? The text output from the cell cannot be processed by for example Python json.loads(), although the output file (use double quote) is correct if I ask sparql to save the JSON output to a file.

image

paulovn commented 6 years ago

No real reason other than overlook on my side. The raw display was actually a hack intended for debugging, and I didn't put much care into it -- it was just a dump of the internal Python data object (which renders strings using single quotes). The output to a file was the real thing, since it got the actual JSON as delivered from the SPARQL endpoint.

I have corrected it in version 1.2.0 of the module, which has just been uploaded to PyPi, so it should now produce real JSON output.