We have just written a stand-alone Python SPARQL parser and serialiser that will probably do what you want:
https://github.com/kurrawong/sparql We will contribute this to the RDFlib set of tools shortly. It parses any SPARQL to SPARQL grammar and then implements a serialiser to return back out SPARQL strings. This could be made to produce canonical serialisations which would then standardise all your files. Nick On Tue, Jan 23, 2024 at 6:49 am, Donny Winston <[do...@polyneme.xyz](mailto:On Tue, Jan 23, 2024 at 6:49 am, Donny Winston <<a href=)> wrote: > Ooh, I am interested as well. I use edmcouncil/rdf-toolkit > (https://github.com/edmcouncil/rdf-toolkit) to accomplish this for turtle > (.ttl) files, but I have nothing for sparql files. > > On Mon, Jan 22, 2024, at 12:50 PM, Boris Pelakh wrote: > >> My group has quite a few SPARQL queries in our git repo, and I would like to >> add a pre-commit formatter to standardize appearance and minimize >> format-related diff noise. Any suggestions? (would also love to have one in >> VSCode, but that's a secondary concern). >> >> -- >> http://github.com/RDFLib >> --- >> You received this message because you are subscribed to the Google Groups >> "rdflib-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rdflib-dev+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> [https://groups.google.com/d/msgid/rdflib-dev/4b6283d4-db0a-4d7c-8fa9-347722304ea7n%40googlegroups.com](https://groups.google.com/d/msgid/rdflib-dev/4b6283d4-db0a-4d7c-8fa9-347722304ea7n%40googlegroups.com?utm_medium=email&utm_source=footer). > > -- > Donny Winston, PhD (he/him/his) > Polyneme LLC > New York, NY > https://polyneme.xyz > > -- > http://github.com/RDFLib > --- > You received this message because you are subscribed to the Google Groups > "rdflib-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rdflib-dev+unsubscr...@googlegroups.com. > To view this discussion on the web visit > [https://groups.google.com/d/msgid/rdflib-dev/6aa43f3e-da03-42db-8826-ea060a9d275c%40app.fastmail.com](https://groups.google.com/d/msgid/rdflib-dev/6aa43f3e-da03-42db-8826-ea060a9d275c%40app.fastmail.com?utm_medium=email&utm_source=footer). -- http://github.com/RDFLib --- You received this message because you are subscribed to the Google Groups "rdflib-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/ej853gXqUjIERPfSmtRjAfj_SnmWopDV_-trLEH5sqjWBahgC5SYSvrNms_GfeHmCElBiNbPm4YDrRaeeGdeKYvGKLMRvNLFsM14XzK-tdc%3D%40kurrawong.net.