I like the idea of utilizing the SPARQL parser/serializer, but have a
couple of questions re:features

1. would it be able to preserve inline comments? The current Lark grammar
discards comments, but keeping them is a requirement.
2. would it be able to remove unused prefix declarations? Obviously that's
a nice-to-have

On Mon, Jan 22, 2024 at 4:46 PM Nicholas Car <n...@kurrawong.net> wrote:

> 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
> <On+Tue,+Jan+23,+2024+at+6:49+am,+Donny+Winston+%3C%3Ca+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
> <https://groups.google.com/d/msgid/rdflib-dev/ej853gXqUjIERPfSmtRjAfj_SnmWopDV_-trLEH5sqjWBahgC5SYSvrNms_GfeHmCElBiNbPm4YDrRaeeGdeKYvGKLMRvNLFsM14XzK-tdc%3D%40kurrawong.net?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/CAMNphsoqCxtmX5Y3cKx6ynhjF%3D9pnRtOLiv3evXzgjRaJ81%3DFQ%40mail.gmail.com.

Reply via email to